Skip to content

Commit 488494f

Browse files
QilongTangCopilot
andauthored
Dynamo Repo Agent Instructions Updates (#17025)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ed026f7 commit 488494f

8 files changed

Lines changed: 271 additions & 36 deletions

File tree

.agents/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Each skill lives in its own folder with a `SKILL.md` and optionally a `template.
6969
| [dynamo-onboarding](skills/dynamo-onboarding/SKILL.md) | Learning the Dynamo codebase, architecture briefings, finding where to start on a Jira ticket. | Repo-specific variant |
7070
| [dynamo-pr-description](skills/dynamo-pr-description/SKILL.md) | Writing PR descriptions matching the Dynamo template. | Repo-specific variant |
7171
| [dynamo-jira-ticket](skills/dynamo-jira-ticket/SKILL.md) | Creating or refining Jira tickets from bugs, test failures, or feature requests. | Repo-specific variant |
72-
| [dynamo-skill-writer](skills/dynamo-skill-writer/SKILL.md) | Authoring/updating skills and enforcing sync across Copilot, Cursor, and Claude surfaces. | Repo-specific variant |
72+
| [dynamo-skill-writer](skills/dynamo-skill-writer/SKILL.md) | Authoring and updating skills; writing high-quality skill instructions; managing sync across Copilot, Cursor, and Claude surfaces. | Repo-specific variant |
7373
| [dynamo-unit-testing](skills/dynamo-unit-testing/SKILL.md) | Writing NUnit tests following Dynamo patterns. Test classes, setup/teardown, .dyn file testing. | Repo-specific variant |
7474
| [dynamo-ux-designer](skills/dynamo-ux-designer/SKILL.md) | Planning UX flows and producing Weave-aligned interface designs and mockups. | Repo-specific variant |
7575
| [dynamo-webview-component-scaffold](skills/dynamo-webview-component-scaffold/SKILL.md) | Scaffolding new Dynamo WebView2 view-extension package repositories. | Repo-specific variant |
Lines changed: 157 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: dynamo-skill-writer
3-
description: Author and maintain Dynamo agent skills while enforcing cross-tool sync between canonical .agents skills and generated wrappers for GitHub Copilot, Cursor, and Claude Code.
3+
description: Author and maintain Dynamo agent skills. Use this skill whenever creating a new skill in .agents/skills/, updating an existing skill, fixing drift between canonical skills and Copilot/Cursor/Claude wrappers, or asking how to write effective skill instructions for the Dynamo repo.
44
---
55

66
# Dynamo Skill Writer
@@ -9,7 +9,7 @@ description: Author and maintain Dynamo agent skills while enforcing cross-tool
99

1010
- Creating a new skill in `.agents/skills/`.
1111
- Updating an existing skill and ensuring tool mirrors remain aligned.
12-
- Adding or updating Copilot agent wrappers that should be generated from canonical skills.
12+
- Adding or updating Copilot agent wrappers generated from canonical skills.
1313
- Fixing drift between canonical skill content and generated wrappers.
1414

1515
## When not to use
@@ -27,43 +27,47 @@ A concrete set of file edits and validation steps that:
2727
- updates canonical skill content in `.agents/skills/`
2828
- updates sync metadata in `.github/scripts/sync_agent_wrappers.ps1` when Copilot exposure is needed
2929
- regenerates and validates wrappers in `.github/agents/`
30-
- updates index/docs references in `.agents/README.md`, `.github/copilot-instructions.md`, and `CLAUDE.md` when applicable
30+
- updates index/docs references in `.agents/README.md`, `.github/copilot-instructions.md`, and `AGENTS.md` when applicable
3131

3232
---
3333

3434
## Workflow
3535

3636
1. Determine whether this is a **new skill** or an **update to an existing skill**.
3737
2. Author or update canonical content in `.agents/skills/<skill-name>/SKILL.md`.
38-
3. If the skill should be available as a Copilot agent, add an entry to the `canonicalSkills` array in `.github/scripts/sync_agent_wrappers.ps1`.
39-
4. Regenerate wrappers:
40-
- `./.github/scripts/sync_agent_wrappers.ps1`
41-
5. Validate sync:
42-
- `./.github/scripts/sync_agent_wrappers.ps1 -Check -VerboseReport`
43-
6. Update discovery docs when skill inventory changed:
38+
3. **Ask the user** whether the skill should be surfaced as a Copilot agent before touching any wrapper files. The sync steps below are optional — skip them unless the user confirms.
39+
4. *(If confirmed)* Add an entry to the `canonicalSkills` array in `.github/scripts/sync_agent_wrappers.ps1`.
40+
5. *(If confirmed)* Regenerate wrappers: `./.github/scripts/sync_agent_wrappers.ps1`
41+
6. *(If confirmed)* Validate sync: `./.github/scripts/sync_agent_wrappers.ps1 -Check -VerboseReport`
42+
7. Update discovery docs when skill inventory changed:
4443
- `.agents/README.md`
4544
- `.github/copilot-instructions.md`
46-
- `CLAUDE.md`
47-
7. Ensure no contradictions between canonical and mirrored surfaces.
45+
- `AGENTS.md`
46+
8. Ensure no contradictions between canonical and mirrored surfaces.
47+
48+
## Boundaries
49+
50+
-**Always**: edit `.agents/skills/<skill>/SKILL.md` and its `assets/`/`references/` files; update `.agents/README.md` and `AGENTS.md`
51+
- ⚠️ **Ask first**: touch `.github/scripts/sync_agent_wrappers.ps1` or trigger wrapper regeneration — confirm Copilot surfacing intent before running the sync script
52+
- 🚫 **Never**: hand-edit generated wrappers in `.github/agents/` — they are always overwritten by the sync script, so manual edits are lost and create drift
4853

4954
## Rules
5055

51-
- `.agents/` is the canonical source of truth for skill logic.
52-
- Generated wrappers in `.github/agents/` must not be hand-edited.
53-
- Skill metadata (name/description) should be concise and stable.
54-
- If mirrors conflict with canonical files, canonical files win.
56+
- `.agents/` is the canonical source of truth for skill logic. When mirrors conflict with canonical files, canonical wins.
57+
- Generated wrappers in `.github/agents/` must never be hand-edited — they exist only as outputs of the sync script.
58+
- Skill metadata (`name`/`description`) should be concise and stable; churn in these fields breaks triggering accuracy.
5559
- Keep changes deterministic so `-Check` mode stays reliable in CI.
5660

5761
## New Skill Checklist
5862

5963
- [ ] Created `.agents/skills/<skill-name>/SKILL.md` with frontmatter (`name`, `description`)
6064
- [ ] Added skill to `.agents/README.md` Quick Reference table
6165
- [ ] Added skill to `.agents/README.md` parity matrix (if cross-tool surfaced)
62-
- [ ] Added skill to `.github/scripts/sync_agent_wrappers.ps1` wrapper map (if Copilot surfaced)
63-
- [ ] Regenerated `.github/agents/*` wrappers
64-
- [ ] Ran `./.github/scripts/sync_agent_wrappers.ps1 -Check -VerboseReport`
66+
- [ ] *(If Copilot-surfaced)* Added skill to `.github/scripts/sync_agent_wrappers.ps1` wrapper map
67+
- [ ] *(If Copilot-surfaced)* Regenerated `.github/agents/*` wrappers
68+
- [ ] *(If Copilot-surfaced)* Ran `./.github/scripts/sync_agent_wrappers.ps1 -Check -VerboseReport`
6569
- [ ] Updated `.github/copilot-instructions.md` skill list
66-
- [ ] Updated `CLAUDE.md` skill list
70+
- [ ] Updated `AGENTS.md` skill list
6771

6872
## Naming guidance
6973

@@ -72,10 +76,140 @@ A concrete set of file edits and validation steps that:
7276

7377
## Example intent
7478

75-
"Create a skill that enforces consistent skill-sync behavior across Copilot, Cursor, and Claude."
79+
> "Create a skill that enforces consistent skill-sync behavior across Copilot, Cursor, and Claude."
7680
7781
Expected result:
7882
- New canonical skill in `.agents/skills/`
79-
- New generated wrapper in `.github/agents/`
80-
- Sync script updated and passing in check mode
81-
- README/Copilot/Claude skill indexes updated
83+
- User asked whether Copilot wrapper is needed before any sync steps run
84+
- *(If yes)* New generated wrapper in `.github/agents/`, sync script updated and passing in check mode
85+
- `AGENTS.md`, `.agents/README.md`, and `.github/copilot-instructions.md` skill indexes updated
86+
87+
---
88+
89+
## Writing a High-Quality Skill
90+
91+
### Start minimal, then iterate
92+
93+
Write a skill to handle one focused task well. Anticipating all requirements upfront produces bloated prompts that are harder to maintain and easier to overfit. Expand based on observed gaps instead.
94+
95+
### The description is the trigger — make it specific and slightly pushy
96+
97+
The description field is what the agent reads when deciding whether to consult this skill. Vague descriptions cause undertriggering; overly broad ones cause false matches. Include the concrete contexts that should activate the skill, not just a general summary.
98+
99+
❌ Vague:
100+
```
101+
description: Helps with code tasks in Dynamo.
102+
```
103+
104+
✅ Specific and triggering:
105+
```
106+
description: Write and review NUnit tests for DynamoCore following Dynamo testing
107+
patterns, base class selection, and AAA structure. Use when writing test methods,
108+
setting up test infrastructure, or reviewing tests for quality.
109+
```
110+
111+
Include the framework and key constraints when they matter (`.NET 10`, `NUnit`, `WPF Windows-only`). Per skill-creator guidance: all "when to use" information belongs in the description, not just the body.
112+
113+
### Commands belong early and must be executable
114+
115+
List commands in an early section with exact flags — not just tool names. An agent that doesn't know the flags will guess, and guesses are wrong.
116+
117+
❌ Missing flags:
118+
```
119+
Run dotnet test to execute tests.
120+
```
121+
122+
✅ Executable:
123+
```bash
124+
dotnet test src/DynamoCoreTests/DynamoCoreTests.csproj --filter "Name~MyTest"
125+
```
126+
127+
### Code examples over prose
128+
129+
One real snippet showing the expected pattern beats three paragraphs describing it. Explain the *why* behind rules rather than issuing mandates — an agent that understands reasoning generalizes better than one following a checklist.
130+
131+
Show both ✅ correct and ❌ anti-pattern forms for non-obvious rules:
132+
133+
❌ Prose only:
134+
```
135+
Override BuildOutputAst and return a list of AssociativeNodes.
136+
```
137+
138+
✅ Code example:
139+
```csharp
140+
public override IEnumerable<AssociativeNode> BuildOutputAst(
141+
List<AssociativeNode> inputAstNodes)
142+
{
143+
return new[] { AstFactory.BuildAssignment(
144+
GetAstIdentifierForOutputIndex(0),
145+
AstFactory.BuildFunctionCall("MyLib.MyFunc", inputAstNodes)) };
146+
}
147+
```
148+
149+
### Define explicit boundaries
150+
151+
Use a three-tier system so the agent knows what requires human approval before acting:
152+
153+
-**Always do** — safe, reversible, local actions (read files, run tests, edit `.cs` files)
154+
- ⚠️ **Ask first** — affects shared state or is hard to reverse (add entries to `PublicAPI.Unshipped.txt`, edit `.resx` files, rename public types)
155+
- 🚫 **Never do** — destructive or policy-violating (hand-edit generated wrappers in `.github/agents/`, remove entries from `PublicAPI.Shipped.txt`, suppress CA2327/CA2328/CA2329/CA2330)
156+
157+
### Map file-level responsibilities
158+
159+
When a skill touches multiple directories, state which it reads vs. writes. This prevents unintended side effects and makes it obvious what "done" looks like:
160+
161+
| Path | Access |
162+
|---|---|
163+
| `.agents/skills/<skill>/SKILL.md` | Read + Write (canonical) |
164+
| `.github/agents/*.md` | Read only (generated — never hand-edit) |
165+
| `.github/scripts/sync_agent_wrappers.ps1` | Read + Write (sync map) |
166+
| `.agents/README.md` | Read + Write (index) |
167+
168+
### Reference assets, don't inline everything
169+
170+
Put detailed reference material in `assets/` or `references/` sub-files and link from the skill. This keeps `SKILL.md` under ~500 lines and scannable.
171+
172+
```
173+
## Assets & References
174+
- **[quality-checklist.md](./references/quality-checklist.md)** — anti-patterns and PR checklist
175+
- **[template.md](./assets/template.md)** — copy-paste skill template
176+
```
177+
178+
---
179+
180+
## Skill Template
181+
182+
```markdown
183+
---
184+
name: dynamo-<skill-name>
185+
description: One sentence covering what this skill does AND the specific contexts
186+
that should trigger it. Be concrete. Be slightly pushy.
187+
---
188+
189+
# Dynamo <Skill Name>
190+
191+
## When to use
192+
- Bullet list of triggering scenarios.
193+
194+
## When not to use
195+
- Redirect to the correct skill where applicable.
196+
197+
## Inputs expected
198+
What the caller must provide.
199+
200+
## Output format
201+
What the skill produces.
202+
203+
---
204+
205+
## Workflow
206+
Numbered steps. Reference asset files for detail rather than inlining.
207+
208+
## Boundaries
209+
- ✅ Always: ...
210+
- ⚠️ Ask first: ...
211+
- 🚫 Never: ...
212+
213+
## Assets & References
214+
- **[asset.md](./assets/asset.md)** — description
215+
```

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<!--
22
Please Note:
33
1. Before submitting the PR, please review [How to Contribute to Dynamo](https://github.com/DynamoDS/Dynamo/blob/master/CONTRIBUTING.md)
4-
2. Dynamo Team will meet 1x a month to review PRs found on Github (Issues will be handled separately)
5-
3. PRs will be reviewed from oldest to newest
6-
4. If a reviewed PR requires changes by the owner, the owner of the PR has 30 days to respond. If the PR has seen no activity by the next session, it will be either closed by the team or depending on its utility will be taken over by someone on the team
7-
5. PRs should use either Dynamo's default PR template or [one of these other template options](https://github.com/DynamoDS/Dynamo/wiki/Choosing-a-Pull-Request-Template) in order to be considered for review.
8-
6. PRs that do not have one of the Dynamo PR templates completely filled out with all declarations satisfied will not be reviewed by the Dynamo team.
9-
7. PRs made to the `DynamoRevit` repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after a `LGTM` label is added to the PR.
4+
2. PRs will be reviewed from oldest to newest
5+
3. If a reviewed PR requires changes by the owner, the owner of the PR has 30 days to respond. If the PR has seen no activity by the next session, it will be either closed by the team or depending on its utility will be taken over by someone on the team
6+
4. PRs should use either Dynamo's default PR template or [one of these other template options](https://github.com/DynamoDS/Dynamo/wiki/Choosing-a-Pull-Request-Template) in order to be considered for review.
7+
5. PRs that do not have one of the Dynamo PR templates completely filled out with all declarations satisfied will not be reviewed by the Dynamo team.
8+
6. PRs made to the `DynamoRevit` repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after a `LGTM` label is added to the PR.
109
-->
1110

1211
### Purpose

.github/agents/dynamo-skill-writer.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Dynamo Skill Writer
3-
description: Author and maintain Dynamo agent skills while enforcing cross-tool sync between canonical .agents skills and generated wrappers for GitHub Copilot, Cursor, and Claude Code.
3+
description: Author and maintain Dynamo agent skills. Use this skill whenever creating a new skill in .agents/skills/, updating an existing skill, fixing drift between canonical skills and Copilot/Cursor/Claude wrappers, or asking how to write effective skill instructions for the Dynamo repo.
44
---
55

66
# Dynamo Skill Writer

.github/copilot-instructions.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ dotnet build src/DynamoCore.sln -c Release /p:Platform=NET_Linux
4242

4343
Tests are located in the `test/` directory. Use Visual Studio Test Explorer or dotnet test CLI to run tests.
4444

45+
**Running a single test:**
46+
```bash
47+
# Filter by test name (substring match)
48+
dotnet test src/DynamoCoreTests/DynamoCoreTests.csproj --filter "Name~MyTestClass"
49+
50+
# Filter by NUnit category
51+
dotnet test src/DynamoCoreTests/DynamoCoreTests.csproj --filter "Category=UnitTests"
52+
53+
# Combine with & (AND) or | (OR)
54+
dotnet test src/DynamoCoreTests/DynamoCoreTests.csproj --filter "Name~WhenCondition&Category=UnitTests"
55+
```
56+
57+
UI tests are split across `DynamoCoreWpfTests`, `DynamoCoreWpfTests2`, and `DynamoCoreWpfTests3`.
58+
4559
## Code Style and Formatting
4660

4761
### Follow Existing Standards
@@ -100,12 +114,11 @@ Dynamo/
100114

101115
### Pull Requests
102116

117+
- PR title must include the Jira ticket: `DYN-1234 concise summary`
103118
- Use one of the [Dynamo PR templates](https://github.com/DynamoDS/Dynamo/wiki/Choosing-a-Pull-Request-Template)
104-
- All template declarations must be satisfied
119+
- All template declarations must be satisfied; Release Notes section is mandatory (use `N/A` if not user-facing)
105120
- Include unit tests when adding new features
106121
- Start with a test that highlights broken behavior when fixing bugs
107-
- PRs are reviewed monthly, oldest to newest
108-
- PR owners have 30 days to respond to feedback
109122

110123
### API Compatibility
111124

@@ -116,6 +129,37 @@ Dynamo/
116129

117130
## Node Development
118131

132+
### Node Registration Patterns
133+
134+
**Zero-touch** (static methods) — preferred for pure computation. Place static methods in a class under `src/Libraries/`. Namespace becomes the library category. Use XML `<search>` tags for keywords:
135+
136+
```csharp
137+
/// <summary>Brief description.</summary>
138+
/// <returns name="result">Output description.</returns>
139+
/// <search>keyword1,keyword2</search>
140+
public static double MyFunction(double x) { ... }
141+
```
142+
143+
**Explicit NodeModel** — required for custom UI, dynamic ports, or multi-output nodes. Inherit from `NodeModel` in `src/Libraries/CoreNodeModels/`. Requires two constructors — a `[JsonConstructor]` private one and a public parameterless one:
144+
145+
```csharp
146+
[NodeName("Display Name"), NodeCategory("Category.Sub")]
147+
[IsDesignScriptCompatible]
148+
public class MyNode : NodeModel
149+
{
150+
[JsonConstructor]
151+
private MyNode(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPorts)
152+
: base(inPorts, outPorts) { }
153+
154+
public MyNode() { /* AddPorts(); RegisterAllPorts(); */ }
155+
156+
public override IEnumerable<AssociativeNode> BuildOutputAst(
157+
List<AssociativeNode> inputAstNodes) { ... }
158+
}
159+
```
160+
161+
Use `[AlsoKnownAs("OldName")]` when renaming nodes to preserve backward compatibility.
162+
119163
### Detecting New Node Additions
120164

121165
A new node addition is identified by:

0 commit comments

Comments
 (0)