Nemotron add pattern

From NVIDIA-NeMo/Nemotron · View interactive version

Nemotron add pattern is an AI agent skill from the GitHub repository NVIDIA-NeMo/Nemotron. Add a cross-cutting decision pattern under src/nemotron/steps/patterns/. Use when a recurring ML decision (tokenizer lock, eval bookends, LoRA-on-small-data, etc.) must be encoded so other skills can fire it during planning.

How to use this skill

Skill file

nemotron-add-pattern

Invocation: /nemotron-add-pattern.

You help contributors add a new cross-cutting pattern to src/nemotron/steps/patterns/ without getting the frontmatter, scope, catalog regeneration, or tests wrong.

Tone

Concise. Checklist-first. Ask for missing facts before writing files.


Workflow

Four phases. Always in this order.

1. Orient

Read these first:

Then ask the contributor:

  1. What is the pattern about? (one sentence)
  2. When should it apply? (natural-language triggers)
  3. Which steps does it touch? (step ids, or [] for global)
  4. What is the confidence level? (high, medium, or experimental)
  5. Does it introduce a new concept or just encode existing tribal knowledge?

Use these repo conventions:

2. Generate

Create:

The pattern file must contain:

Generation rules:

  1. Keep the pattern id kebab-case and make it match the filename exactly.
  2. Turn vague triggers into 2–4 concrete, observable conditions.
  3. Scope the pattern honestly: use explicit step ids if it only applies to a subset of steps; use [] only when it is truly global.
  4. Put the recommendation itself in What to do; keep background explanation shorter than the action guidance.
  5. If the pattern introduces a new concept, define it in the first paragraph of When to apply.
  6. Do not modify existing patterns.
  7. Regenerate the catalog with:
  1. Run validations with:

3. Validate

Check all of these before finishing:

If validation fails:

  1. Fix the real frontmatter, scope, or catalog issue
  2. Re-run the failing command
  3. Do not present the result until tests pass

4. Summarize

Show:


Boundaries

Do

Don’t


When Stuck


Calibration Examples

Example 1 — simple high-confidence pattern

User:

Add a pattern saying we should use a consistent random seed across stages.

Assistant:

I’ll confirm whether this is global or limited to a few steps, then I’ll create src/nemotron/steps/patterns/consistent-random-seed.md with the required frontmatter and the four body sections.

I’ll mark it high confidence only if the guidance is already established team practice, regenerate PATTERNS.md with uv run python src/nemotron/steps/index.py, and run uv run pytest tests/steps -q before I finish.

Example 2 — experimental step-scoped pattern

User:

Add a pattern for code-generation SFT that uses a higher learning rate.

Assistant:

I’ll confirm the exact step ids and keep the scope narrow, for example sft/automodel and sft/megatron_bridge if that is what you intend.

Because this is a newer idea rather than settled guidance, I’ll label it experimental, encode the trigger conditions in frontmatter, create the new pattern markdown file, regenerate PATTERNS.md, and run uv run pytest tests/steps -q.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.