@cyanheads/mcp-ts-core 0.9.10 → 0.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +2 -1
- package/README.md +1 -1
- package/biome.json +1 -1
- package/changelog/0.9.x/0.9.11.md +38 -0
- package/dist/cli/init.js +16 -3
- package/dist/cli/init.js.map +1 -1
- package/dist/logs/combined.log +4 -4
- package/dist/logs/error.log +2 -2
- package/package.json +3 -3
- package/skills/code-simplifier/SKILL.md +130 -0
- package/skills/git-wrapup/SKILL.md +1 -3
- package/skills/orchestrations/SKILL.md +217 -0
- package/skills/orchestrations/workflows/field-test-fix.md +206 -0
- package/skills/orchestrations/workflows/fix-wrapup-release.md +175 -0
- package/skills/orchestrations/workflows/greenfield-build.md +143 -0
- package/skills/orchestrations/workflows/maintenance-release.md +171 -0
- package/skills/polish-docs-meta/SKILL.md +2 -1
- package/skills/report-issue-framework/SKILL.md +4 -1
- package/templates/AGENTS.md +6 -0
- package/templates/CLAUDE.md +6 -0
- package/skills/multi-server-orchestration/SKILL.md +0 -137
- package/skills/multi-server-orchestration/references/greenfield-buildout.md +0 -246
- package/skills/multi-server-orchestration/references/maintenance-pass.md +0 -148
- package/skills/multi-server-orchestration/references/release-and-publish-pass.md +0 -184
- package/skills/multi-server-orchestration/references/wrapup-pass.md +0 -150
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: greenfield-build
|
|
3
|
+
description: >
|
|
4
|
+
Workflow: scaffold one or more new MCP server projects from `bunx @cyanheads/mcp-ts-core init` through design → build → polish → first public release. Each phase invokes a foundational skill end-to-end; this file is the sequencing and gates, not the procedural detail. Read `../SKILL.md` first for the universal rules and sub-agent strategy.
|
|
5
|
+
metadata:
|
|
6
|
+
author: cyanheads
|
|
7
|
+
version: "1.0"
|
|
8
|
+
audience: internal
|
|
9
|
+
type: workflow
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Greenfield Build Workflow
|
|
13
|
+
|
|
14
|
+
Use after reading `../SKILL.md`. Drives one or more freshly-scaffolded MCP servers from idea to first public release by sequencing foundational skills with gates and verification.
|
|
15
|
+
|
|
16
|
+
## When applicable
|
|
17
|
+
|
|
18
|
+
- One or more new servers from `bunx @cyanheads/mcp-ts-core init <name>` need to be driven through design → build → ship
|
|
19
|
+
- Each target is a freshly-scaffolded project with no implementation yet (echo definitions still present)
|
|
20
|
+
- N = 1 and N > 1 both apply — parallelism is the optimization; the phase structure is the value
|
|
21
|
+
|
|
22
|
+
## Pre-flight
|
|
23
|
+
|
|
24
|
+
1. **Target list** — absolute paths and intended GitHub owner/org per target
|
|
25
|
+
2. **`gh auth status`** — Phase 1 creates GH repos
|
|
26
|
+
3. **`npm whoami`** — required if Phase 18 publishes publicly
|
|
27
|
+
4. **API key inventory** per target — Phase 11 (field-test loop) skips targets without keys
|
|
28
|
+
5. **Gold-standard reference(s)** — repo(s) the `polish-docs-meta` phase anchors on for README/metadata style. Skip the phase if no anchor exists in the ecosystem.
|
|
29
|
+
|
|
30
|
+
## Versioning strategy
|
|
31
|
+
|
|
32
|
+
Everything stays at **v0.1.0** through the build. Intermediate commits don't bump versions. The launch version (typically v0.1.1) is set in Phase 17.
|
|
33
|
+
|
|
34
|
+
## Tier 1 skills referenced
|
|
35
|
+
|
|
36
|
+
| Phase | Tier 1 skill(s) |
|
|
37
|
+
|:---|:---|
|
|
38
|
+
| Scaffold (1) | `skills/setup/SKILL.md` |
|
|
39
|
+
| Initial commit, design commit, build commit, pre-launch commit (2, 5, 10, 16) | `skills/git-wrapup/SKILL.md` (commit + tag, no push) |
|
|
40
|
+
| Design + validation (3, 4) | `skills/design-mcp-server/SKILL.md` |
|
|
41
|
+
| Build (6) | `skills/add-tool/SKILL.md`, `skills/add-app-tool/SKILL.md`, `skills/add-resource/SKILL.md`, `skills/add-prompt/SKILL.md`, `skills/add-service/SKILL.md` |
|
|
42
|
+
| Tool-def audit (7) | `skills/tool-defs-analysis/SKILL.md` |
|
|
43
|
+
| Test coverage (8) | `skills/add-test/SKILL.md` |
|
|
44
|
+
| Field-test loop (11) | → `workflows/field-test-fix.md` as a sub-loop (see Phase 11 note) |
|
|
45
|
+
| Simplify (12) | `skills/code-simplifier/SKILL.md` |
|
|
46
|
+
| Polish docs/meta (13) | `skills/polish-docs-meta/SKILL.md` |
|
|
47
|
+
| Security pass (14) | `skills/security-pass/SKILL.md` |
|
|
48
|
+
| Final wrap-up (17) | `skills/git-wrapup/SKILL.md` |
|
|
49
|
+
| Release (18) | `skills/release-and-publish/SKILL.md` |
|
|
50
|
+
|
|
51
|
+
## Phases
|
|
52
|
+
|
|
53
|
+
Each phase's Objective column is the goal state per target — the verifiable end state the phase must produce. Phase notes only appear for orchestration overrides; phases without notes run the foundational skill end-to-end.
|
|
54
|
+
|
|
55
|
+
| # | Phase | Objective | Sub-agent mode |
|
|
56
|
+
|:--|:---|:---|:---|
|
|
57
|
+
| 1 | Scaffold + repo | `bunx init` scaffold complete; `--private` GH repo created; LICENSE in place; working tree dirty (no commit) | parallel fanout |
|
|
58
|
+
| 2 | Initial commit | v0.1.0 commit + annotated tag + push to private GH repo | parallel fanout |
|
|
59
|
+
| 3 | Design | `docs/design.md` authored with Decisions Log | parallel fanout |
|
|
60
|
+
| 4 | Design validation | `docs/design.md` hardened by review pass; gate sub-agent returned PASS | two sub-agents per target |
|
|
61
|
+
| 5 | Design commit | Design changes committed and pushed | parallel fanout |
|
|
62
|
+
| 6 | Build | All designed tools/resources/prompts implemented; no echo definitions; `devcheck` + `test` green | parallel fanout |
|
|
63
|
+
| 7 | Tool-def audit | `tool-defs-analysis` findings reviewed and applied | parallel fanout |
|
|
64
|
+
| 8 | Test coverage | Tests extended beyond happy path; `devcheck` + `test` green | parallel fanout |
|
|
65
|
+
| 9 | Design ↔ implementation check | Every surface element in `docs/design.md` has a definition (or `docs/design.md` updated to reflect what shipped) | parallel fanout or orchestrator-direct |
|
|
66
|
+
| 10 | Build commit | Build work committed and pushed | parallel fanout |
|
|
67
|
+
| 11 | Field-test loop (optional) | Live API surface exercised; valid findings filed and fixed (or skipped with note) | conditional |
|
|
68
|
+
| 12 | Simplify | `code-simplifier` applied; `devcheck` + `test` green — last source-code modification | parallel fanout |
|
|
69
|
+
| 13 | Polish docs/meta | README, metadata, and agent protocol aligned to gold-standard reference | parallel fanout |
|
|
70
|
+
| 14 | Security pass | `security-pass` findings addressed; no open security gaps | parallel fanout |
|
|
71
|
+
| 15 | Final-state check | `rebuild` + `devcheck` + `test:all` + `lint:packaging` green; LICENSE present; no unfinished TODO/FIXME | orchestrator-direct |
|
|
72
|
+
| 16 | Pre-launch commit | Final polish + security work committed and pushed | parallel fanout |
|
|
73
|
+
| 17 | Final wrap-up | Launch version (typically v0.1.1) commit + annotated tag in place; **not pushed** | parallel fanout (Bash git only) |
|
|
74
|
+
| 18 | Release | Pushed and published per scope; tag annotation renders as structured markdown on GitHub Release; artifacts reachable | parallel fanout or serial (per npm 2FA mode) |
|
|
75
|
+
|
|
76
|
+
Phase 11 is optional. Phase 12 is the last phase that modifies source code — everything after is docs/metadata/verification.
|
|
77
|
+
|
|
78
|
+
## Phase notes
|
|
79
|
+
|
|
80
|
+
Only phases with orchestration overrides or non-obvious instructions appear below. Other phases run their foundational skill end-to-end.
|
|
81
|
+
|
|
82
|
+
### Phase 1: Scaffold + repo
|
|
83
|
+
Sub-agent runs `bunx @cyanheads/mcp-ts-core init <name>`, follows the `setup` skill, then creates a **private** GitHub repo (`gh repo create --private`). Override the `setup` skill's commit step — **do NOT commit**; Phase 2 is the commit. Copy `LICENSE` from `node_modules/@cyanheads/mcp-ts-core/LICENSE` if not already present.
|
|
84
|
+
|
|
85
|
+
### Phase 2: Initial commit
|
|
86
|
+
Sub-agent verifies `gh repo view --json visibility` returns `PRIVATE` (or has explicit user authorization for public) before push. Tag is `v0.1.0`.
|
|
87
|
+
|
|
88
|
+
### Phase 4: Design validation
|
|
89
|
+
Two sub-agents per target, sequential:
|
|
90
|
+
|
|
91
|
+
1. **Review** — fresh sub-agent re-runs `design-mcp-server` against the existing `docs/design.md` cold (no `docs/idea.md`, no prior context). Goal: spot what the original author justified away. Output: hardened `docs/design.md`.
|
|
92
|
+
2. **Gate** — sub-agent reads ONLY the hardened design and returns **PASS** or **FAIL**. PASS means "ready to build as-is." FAIL flags structural issues that would cause wasted build effort: missing tool the API clearly supports and users would expect; wrong endpoint or data model that would fail at runtime; contradictory constraints; missing error handling strategy for common failures. **Filter style preferences and marginal scope suggestions** — those are not gate failures.
|
|
93
|
+
|
|
94
|
+
If gate fails, spawn a focused fix sub-agent for that target, then re-gate.
|
|
95
|
+
|
|
96
|
+
### Phase 6: Build
|
|
97
|
+
Sub-agents will exhaust context on targets with 4+ tools — work persists to disk but the sub-agent can't continue. Plan a follow-up "finish" iteration as a normal backstop, not a fallback for failure. After Phase 6 lands, the orchestrator inspects each target (`bun run devcheck`, `bun run test`, `ls src/mcp-server/tools/definitions/`) and spawns a narrow-scope finish sub-agent per incomplete target with a concrete punch list: "X TS errors here, tools A/B/C missing tests, echo definitions still present in `<file>`." Narrow scope is the antidote to context exhaustion.
|
|
98
|
+
|
|
99
|
+
### Phase 9: Design ↔ implementation check
|
|
100
|
+
For each tool / resource / prompt named in `docs/design.md`, verify a definition file exists in `src/mcp-server/{tools,resources,prompts}/definitions/`. For missing surface, decide: implement it (spawn a narrow-scope sub-agent), drop it from the design (update `docs/design.md`), or defer to a follow-up (record in the Decisions Log). This is orchestration glue — small enough that the orchestrator can run it directly for N ≤ 3, fan out for larger N.
|
|
101
|
+
|
|
102
|
+
### Phase 11: Field-test loop (optional)
|
|
103
|
+
When the upstream API supports live testing and an API key is available, run the phases of `field-test-fix.md` as a sub-loop here, ending at its field-test commit. Skip with a note if blocked.
|
|
104
|
+
|
|
105
|
+
### Phase 12: Simplify
|
|
106
|
+
Last phase that modifies source code. Everything after is docs/metadata/verification.
|
|
107
|
+
|
|
108
|
+
### Phase 15: Final-state check
|
|
109
|
+
Orchestrator-direct mechanical verification per target: `bun run rebuild`, `bun run devcheck`, `bun run test:all` (or `test`), `bun run lint:packaging`. `LICENSE` present. No `TODO`/`FIXME` indicating unfinished work. `CHANGELOG.md` current. `docs/tree.md` reflects current structure. Fix anything red before Phase 16; this is verification, not a sub-agent task.
|
|
110
|
+
|
|
111
|
+
### Phase 17: Final wrap-up
|
|
112
|
+
Version bump intent is typically **patch** — v0.1.0 was the scaffold tag; the launch is the first real release at v0.1.1. Bash git only; **do not push** — Phase 18 owns the push.
|
|
113
|
+
|
|
114
|
+
## Workflow-specific gotchas
|
|
115
|
+
|
|
116
|
+
| # | Gotcha | Mitigation |
|
|
117
|
+
|:--|:-------|:-----------|
|
|
118
|
+
| 1 | `gh repo create` defaults to public if `--private` is omitted | Phase 1 prompt restates the rule; Phase 2 sub-agent re-verifies `gh repo view --json visibility` before push |
|
|
119
|
+
| 2 | Build sub-agents exhaust context on targets with 4+ tools | Expected — plan a finish iteration with a concrete punch list, narrow scope |
|
|
120
|
+
| 3 | Design gate sub-agents flag style preferences as failures | Gate prompt: "Do NOT flag style preferences or marginal scope suggestions — only structural issues that would cause wasted build effort" |
|
|
121
|
+
| 4 | Sub-agent commits during Phase 1 despite the orchestration override | Phase 1 prompt restates: "Do NOT commit — leave working tree dirty for Phase 2" verbatim |
|
|
122
|
+
|
|
123
|
+
## Checklist
|
|
124
|
+
|
|
125
|
+
- [ ] Pre-flight: targets confirmed, `gh` + `npm` auth verified, gold-standard reference(s) named, API key inventory complete
|
|
126
|
+
- [ ] Phase 1: scaffold + setup run, private repo created, LICENSE present, working tree dirty (no commits)
|
|
127
|
+
- [ ] Phase 2: v0.1.0 commit + annotated tag + push verified per target
|
|
128
|
+
- [ ] Phase 3: `docs/design.md` authored per target with Decisions Log
|
|
129
|
+
- [ ] Phase 4: design hardened by review pass; gate returns PASS per target
|
|
130
|
+
- [ ] Phase 5: design committed per target
|
|
131
|
+
- [ ] Phase 6: build complete — all designed surface implemented, green devcheck + test
|
|
132
|
+
- [ ] Phase 7: `tool-defs-analysis` audit + fixes applied
|
|
133
|
+
- [ ] Phase 8: dedicated test coverage pass — beyond happy path
|
|
134
|
+
- [ ] Phase 9: every designed surface element has a definition (or `docs/design.md` updated to reflect what shipped)
|
|
135
|
+
- [ ] Phase 10: build committed per target
|
|
136
|
+
- [ ] Phase 11 (optional): field-test loop completed or skipped with note
|
|
137
|
+
- [ ] Phase 12: code-simplifier — final source-code cleanup, green devcheck + test
|
|
138
|
+
- [ ] Phase 13: polish-docs-meta against named gold-standard
|
|
139
|
+
- [ ] Phase 14: security-pass complete, findings addressed
|
|
140
|
+
- [ ] Phase 15: final-state check — rebuild + devcheck + test:all + lint:packaging green; LICENSE; no TODO/FIXME
|
|
141
|
+
- [ ] Phase 16: pre-launch commit per target
|
|
142
|
+
- [ ] Phase 17: final wrap-up — version bumped, changelog authored, commit + annotated tag per target
|
|
143
|
+
- [ ] Phase 18: release — published per scope, artifacts verified reachable
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maintenance-release
|
|
3
|
+
description: >
|
|
4
|
+
Workflow: run the `maintenance` skill against one or more existing MCP server projects (dependency updates, framework adoption, skill sync), verify adoption gaps in a double-check pass, then wrap up and release via `git-wrapup` and `release-and-publish`. Read `../SKILL.md` first for the universal rules and sub-agent strategy.
|
|
5
|
+
metadata:
|
|
6
|
+
author: cyanheads
|
|
7
|
+
version: "1.0"
|
|
8
|
+
audience: internal
|
|
9
|
+
type: workflow
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Maintenance + Release Workflow
|
|
13
|
+
|
|
14
|
+
Use after reading `../SKILL.md`. Drives maintenance, adoption verification, wrap-up, and release across N existing MCP server projects.
|
|
15
|
+
|
|
16
|
+
## When applicable
|
|
17
|
+
|
|
18
|
+
- One or more existing servers built on `@cyanheads/mcp-ts-core` need updates from `bun outdated` landed and shipped
|
|
19
|
+
- N = 1 still benefits — fresh-context sub-agents per phase keep each focused and within context budget
|
|
20
|
+
- Each target should have a clean working tree before the workflow starts — uncommitted work blocks the `maintenance` skill's verification gate
|
|
21
|
+
|
|
22
|
+
## Tier 1 skills referenced
|
|
23
|
+
|
|
24
|
+
| Phase | Tier 1 skill(s) |
|
|
25
|
+
|:---|:---|
|
|
26
|
+
| Maintenance | `skills/maintenance/SKILL.md` |
|
|
27
|
+
| Double-check | `skills/polish-docs-meta/SKILL.md` (the cross-file consistency reference is the most commonly missed surface) |
|
|
28
|
+
| Wrap-up | `skills/git-wrapup/SKILL.md` |
|
|
29
|
+
| Release | `skills/release-and-publish/SKILL.md` |
|
|
30
|
+
|
|
31
|
+
## Pre-flight
|
|
32
|
+
|
|
33
|
+
Per target:
|
|
34
|
+
|
|
35
|
+
1. **Clean working tree** — `git status --short` must be empty. Halt if dirty; user fixes locally before re-invoking.
|
|
36
|
+
2. **Latest tag and version** — `git describe --tags --abbrev=0`, `grep '"version"' package.json`
|
|
37
|
+
3. **`list-skills` script presence** — `test -f scripts/list-skills.ts && grep -q '"list-skills"' package.json`. If missing, note it — the `maintenance` skill's Phase C will install it.
|
|
38
|
+
4. **`publish-mcp` script** — when `server.json` exists, check `grep -q '"publish-mcp"' package.json`. If missing, flag it — the maintenance sub-agent adds it.
|
|
39
|
+
5. **Publish destinations** — note which exist: `server.json` (MCP Registry), `manifest.json` (MCPB / GH Release), `Dockerfile` (GHCR). If `server.json` exists but `manifest.json` doesn't, flag — maintenance scaffolds it.
|
|
40
|
+
6. **`npm whoami`** — required if releasing publicly.
|
|
41
|
+
7. **Framework version delta** — `grep '"version"' node_modules/@cyanheads/mcp-ts-core/package.json` vs `npm view @cyanheads/mcp-ts-core version` to preview adoption scope.
|
|
42
|
+
|
|
43
|
+
## Phases
|
|
44
|
+
|
|
45
|
+
Each phase's Objective column is the goal state per target — the verifiable end state the phase must produce.
|
|
46
|
+
|
|
47
|
+
| # | Phase | Objective | Sub-agent mode |
|
|
48
|
+
|:--|:---|:---|:---|
|
|
49
|
+
| 1 | Maintenance | Per target: deps updated, framework adoption applied, project skills synced, `rebuild` + `devcheck` + `test` green, Step 8 numbered summary returned | parallel fanout |
|
|
50
|
+
| 2 | Double-check | Adoption gaps from Phase 1 fixed; `manifest.json`/`server.json` content validated; audience compliance verified; `rebuild` + `devcheck` + `test` green | parallel fanout |
|
|
51
|
+
| 3 | Roll-up | Per-target headlines + cross-target patterns surfaced to user; version-bump intent confirmed (patch/minor/major) | orchestrator (serial) |
|
|
52
|
+
| 4 | Wrap-up + release | Per target: version-bumped commit + annotated tag + push + publish per scope; tag annotation renders as structured markdown on GitHub Release | parallel fanout (Bash git only) |
|
|
53
|
+
|
|
54
|
+
Phase 4 combines wrap-up and release in one sub-agent because the work is sequential and shares context (version, changelog, tag annotation). The sub-agent reads both Tier 1 skills.
|
|
55
|
+
|
|
56
|
+
## Phase notes
|
|
57
|
+
|
|
58
|
+
### Phase 1: Maintenance
|
|
59
|
+
Each sub-agent runs `skills/maintenance/SKILL.md` Mode A — the full flow from `bun outdated` through verification.
|
|
60
|
+
|
|
61
|
+
**Prompt phrasing matters.** Generic "run the maintenance skill" prompts cause sub-agents to stop at changelog analysis without executing. Include explicit steps in the prompt body:
|
|
62
|
+
1. `bun outdated` — capture the list
|
|
63
|
+
2. `bun update --latest` — apply, capturing the `↑ package old → new` lines for Step 3
|
|
64
|
+
3. Invoke the `changelog` skill for each updated package (or read `node_modules/<pkg>/CHANGELOG.md` directly if the skill isn't synced yet)
|
|
65
|
+
4. If `@cyanheads/mcp-ts-core` updated, do the deeper framework review per the maintenance skill's Step 4
|
|
66
|
+
5. Run Step 5 skill/script sync — Phase A (package → project `skills/`), Phase B (project `skills/` → agent dirs), Phase C (package scripts + pristine references → project)
|
|
67
|
+
6. Adopt changes per Step 6 — framework changes are auto-adopt at every applicable site in this pass; third-party libs are cost/benefit
|
|
68
|
+
7. `bun run rebuild` → `bun run devcheck` → `bun run test`
|
|
69
|
+
8. Produce the Step 8 numbered summary
|
|
70
|
+
|
|
71
|
+
**Skill-version paradox.** If `node_modules/@cyanheads/mcp-ts-core/skills/maintenance/SKILL.md` version is newer than the synced project copy, feature-adoption rows added in the new version don't surface. Sub-agent prompt instructs: after Phase A sync completes, re-read the synced `maintenance` SKILL.md and continue from Step 5 with the new version.
|
|
72
|
+
|
|
73
|
+
**Skill audience compliance.** Only sync skills with `metadata.audience: external` into project `skills/`. Sub-agents miss this under context pressure — restate explicitly.
|
|
74
|
+
|
|
75
|
+
**Constraints to restate verbatim:**
|
|
76
|
+
- No commits, tags, pushes — leave working tree dirty for orchestrator review
|
|
77
|
+
- Read-only git allowed and expected — `git diff skills/` after Phase A surfaces adoption signal
|
|
78
|
+
- Halt and report verbatim if `bun run devcheck` can't be made green; `bun audit` failures from a transitive dep with no patch are note-not-halt
|
|
79
|
+
- Output the Step 8 numbered summary at the end — the orchestrator parses it
|
|
80
|
+
|
|
81
|
+
### Phase 2: Double-check
|
|
82
|
+
Independent maintenance sub-agents diverge on incidental choices and miss adoption sites under context pressure. The double-check pass catches gaps before wrap-up.
|
|
83
|
+
|
|
84
|
+
**Critical: these sub-agents audit AND fix, then re-verify.** Not analysis-only.
|
|
85
|
+
|
|
86
|
+
Audit categories (sub-agent prompt enumerates):
|
|
87
|
+
|
|
88
|
+
- **Adoption gaps** — features the updated skills say to do that weren't applied (error code semantic audit, missing scaffolding files like `manifest.json`/`.mcpbignore`, `publish-mcp` script)
|
|
89
|
+
- **Audience compliance** — only skills with `metadata.audience: external` belong in project `skills/`; agents sometimes sync `internal`-audience skills
|
|
90
|
+
- **Content accuracy** — `isRequired` flags in `server.json` match the upstream API's reality (does the API work without the key?); `manifest.json` `name` doesn't include the npm scope prefix; `user_config` entries have required `title` and `type` fields
|
|
91
|
+
- **Cross-target consistency** — if a feature shows up in 3 of 5 Phase 1 summaries, the other 2 likely missed it
|
|
92
|
+
- **Error code semantics** — `InvalidParams` only for malformed JSON-RPC params shape; `ValidationError` for domain validation; `NotFound` for missing entities
|
|
93
|
+
- **Description alignment** — `package.json`, `manifest.json`, `server.json` (≤100 char), README header, GH repo description should be consistent
|
|
94
|
+
- **README install badges** — Claude Desktop `.mcpb`, Cursor deeplink, VS Code deeplink — present when `manifest.json` exists
|
|
95
|
+
|
|
96
|
+
Exit gate: `bun run rebuild && bun run devcheck && bun run test` after fixes.
|
|
97
|
+
|
|
98
|
+
A lighter model (e.g. Sonnet-class) is appropriate here — verification + targeted fixes, not deep adoption work.
|
|
99
|
+
|
|
100
|
+
### Phase 3: Roll-up
|
|
101
|
+
The orchestrator collects Phase 1 + Phase 2 reports and produces:
|
|
102
|
+
1. **Per-target headlines** — short table: target → packages updated → mcp-ts-core delta → devcheck/test status → gaps fixed
|
|
103
|
+
2. **Cross-target patterns** — features adopted across multiple targets, breaking changes that hit a subset
|
|
104
|
+
3. **Open decisions** — per-target ambiguities; group by decision so the user can rule once across multiple targets when the choice is the same
|
|
105
|
+
4. **Outliers** — targets with unusually large diffs or where adoption couldn't complete cleanly
|
|
106
|
+
|
|
107
|
+
**Version bump intent.** Default is **patch** unless the change shape indicates otherwise:
|
|
108
|
+
|
|
109
|
+
| Bump | When |
|
|
110
|
+
|:---|:---|
|
|
111
|
+
| **patch** (default) | Dependency updates, framework adoption, doc polish, bug fixes — ~95% of maintenance runs |
|
|
112
|
+
| **minor** | New tools/resources/prompts added, new user-facing features, new env vars that change behavior |
|
|
113
|
+
| **major** | Breaking changes to the server's MCP surface (removed tools, renamed fields, changed semantics) |
|
|
114
|
+
|
|
115
|
+
If a target's diff suggests minor-or-above, **pause that target and surface to the user during roll-up** — unaffected targets proceed to Phase 4 at patch.
|
|
116
|
+
|
|
117
|
+
### Phase 4: Wrap-up + release
|
|
118
|
+
Each sub-agent reads BOTH `skills/git-wrapup/SKILL.md` AND `skills/release-and-publish/SKILL.md`. Runs wrap-up (version bump, changelog authoring, commit, annotated tag), then release (push, npm publish, MCP Registry, GH release, Docker).
|
|
119
|
+
|
|
120
|
+
**Framework changelog reading.** When `mcp-ts-core` was updated, the sub-agent must read the framework's changelog files for the version delta (e.g. `node_modules/@cyanheads/mcp-ts-core/changelog/0.9.x/0.9.2.md` through `0.9.6.md`) and distill user-facing changes relevant to this server into the changelog entry and tag annotation. "Picks up upstream fixes" is not acceptable — name what changed.
|
|
121
|
+
|
|
122
|
+
**Wrap-up scope.** Determined by repo visibility (`gh repo view --json visibility`):
|
|
123
|
+
|
|
124
|
+
| Status | Scope |
|
|
125
|
+
|:---|:---|
|
|
126
|
+
| Private / in-development | Version bump → changelog → commit → tag → mcpb bundle → push → `gh release create`. Skip `bun publish`, Docker, MCP Registry. |
|
|
127
|
+
| Public / launched | Full `release-and-publish`: push + `bun publish` + `publish-mcp` + bundle + GH release + Docker (if Dockerfile). |
|
|
128
|
+
|
|
129
|
+
**npm 2FA mode.** Parallel `bun publish` doesn't play nicely with interactive 2FA — OTP prompts from multiple sub-agents interleave. Either:
|
|
130
|
+
- Bypass token configured (granular access token with "Bypass 2FA for publish") → Phase 4 runs as parallel fanout
|
|
131
|
+
- No bypass → Phase 4 runs serially, orchestrator-driven, one target at a time
|
|
132
|
+
- No npm publish involved (private only) → non-issue
|
|
133
|
+
|
|
134
|
+
**Commit structure.** Version bump rides with the change that warrants it. For a maintenance pass with a single cohesive change shape (e.g. just dep updates, or just one framework adoption), that's **one commit** — subject can lead with the version (e.g. `feat: 0.5.2 — adopt new error factories, framework ^0.9.6`). For a maintenance pass containing multiple distinct concerns, split into per-concern commits with the version bump folded into the headline-change commit, not a separate ceremonial release commit.
|
|
135
|
+
|
|
136
|
+
**Tag annotations are for end users.** Internal dev cleanup (lockfile refreshes, linter fixes, build config) belongs in the commit body, not the tag annotation.
|
|
137
|
+
|
|
138
|
+
**Tag-moving protocol.** If post-version doc changes land after the version commit, move the tag to HEAD: delete remote release, delete remote + local tag, recreate tag at new HEAD with same annotation, re-push, recreate release with `.mcpb`. Authorized within the workflow — same-day forward move.
|
|
139
|
+
|
|
140
|
+
### Watchtower-style container refresh (if applicable)
|
|
141
|
+
For targets with hosted instances behind an auto-pull tool, trigger the refresh after GHCR images are verified reachable. This is operational, not part of the release-and-publish skill — handle in the orchestrator's post-Phase-4 step if the deployment infrastructure has it.
|
|
142
|
+
|
|
143
|
+
## Workflow-specific gotchas
|
|
144
|
+
|
|
145
|
+
| # | Gotcha | Mitigation |
|
|
146
|
+
|:--|:-------|:-----------|
|
|
147
|
+
| 1 | Generic "run the maintenance skill" prompts cause ~50% of sub-agents to halt at changelog analysis without executing | Include explicit execution steps in Phase 1 prompt body; respawn with directive if Step 8 summary missing |
|
|
148
|
+
| 2 | Skill-version paradox — feature rows added in newer maintenance skill don't surface in the synced older copy | Sub-agent prompt: after Phase A sync, re-read synced `maintenance` SKILL.md and continue from Step 5 |
|
|
149
|
+
| 3 | Per-target adoption divergence is expected — projects on different starting framework versions adopt different things | Don't try to normalize. Surface divergence as informational in Phase 3 roll-up. |
|
|
150
|
+
| 4 | The `changelog` skill may not exist in a target's skill directory yet | Sub-agent falls back to direct `node_modules/<pkg>/CHANGELOG.md` reading |
|
|
151
|
+
| 5 | Sub-agent runs write git commands despite instruction | Restate the no-write-git list + no-`stash` rule in prompt body; verify via `git log --oneline -1` per target after Phase 1 — should show no new commits |
|
|
152
|
+
| 6 | Sub-agent syncs `internal`-audience skills into project `skills/` | Restate "Only sync skills with `metadata.audience: external`" — sub-agents miss this under context pressure |
|
|
153
|
+
| 7 | `manifest.json` scaffolded with scoped name from `package.json` (e.g. `@scope/server-name`) — renders in mcpb install dialog | Phase 2 verifies `manifest.json` `name` doesn't contain `/` |
|
|
154
|
+
| 8 | `manifest.json` `user_config` entries missing required `title`/`type` — `mcpb pack` fails at release time | Phase 2 verifies required fields |
|
|
155
|
+
| 9 | `server.json` `isRequired` doesn't match upstream API reality | Phase 2 verifies against actual API behavior |
|
|
156
|
+
| 10 | Framework version arrow in tag/changelog says nothing useful ("picks up upstream fixes") | Phase 4 prompt requires reading mcp-ts-core changelog files and distilling relevant changes |
|
|
157
|
+
| 11 | Tag annotations render as flat comma-separated strings or balloon into full CHANGELOG copies | Phase 4 prompt: structured markdown with sections (Fixed, Dependencies, etc.), dep arrows (`pkg ^old → ^new`), test footer; length is earned |
|
|
158
|
+
| 12 | Post-version doc changes land after the tag — release points at stale content | Tag-moving protocol; authorized within the workflow as a same-day forward move |
|
|
159
|
+
| 13 | Background sub-agent bails early on context | Orchestrator checks for Step 8 summary; respawns continuation sub-agent if missing |
|
|
160
|
+
| 14 | Big monorepo or many adoptions cause context exhaustion in a sub-agent | Narrow the prompt: if a target has many breaking framework changes, split the work into "update deps + verify" and "adopt features" against that target |
|
|
161
|
+
|
|
162
|
+
## Checklist
|
|
163
|
+
|
|
164
|
+
- [ ] Pre-flight: target list confirmed, clean working trees, `list-skills`/`publish-mcp`/`manifest.json` presence noted, framework version delta noted, npm 2FA mode confirmed if releasing publicly
|
|
165
|
+
- [ ] Phase 1: maintenance sub-agents complete — Step 8 summary present per target, devcheck + test green
|
|
166
|
+
- [ ] Phase 1 integrity: `git log --oneline -1` per target confirms no new commits written by sub-agents
|
|
167
|
+
- [ ] Phase 2: double-check sub-agents complete — adoption gaps fixed, audience compliance verified, `manifest.json` and `server.json` validated; devcheck + test green after fixes
|
|
168
|
+
- [ ] Phase 3: roll-up surfaced to user; version bump intent confirmed (patch default; minor/major surfaces if applicable)
|
|
169
|
+
- [ ] Phase 4: wrap-up + release sub-agents complete — commit + annotated tag + push + publish per target, scope matches private/public status
|
|
170
|
+
- [ ] Post-Phase-4 verification: `git ls-remote --tags origin` shows new tag; `npm view <pkg>@<version>` resolves (public); GH release artifacts attached; Docker image exists (if Dockerfile)
|
|
171
|
+
- [ ] Tag/release quality review: tag subject omits version number, structured markdown, no marketing adjectives, dep arrows present, issue backlinks where applicable
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Finalize documentation and project metadata for a ship-ready MCP server. Use after implementation is complete, tests pass, and devcheck is clean. Safe to run at any stage — each step checks current state and only acts on what still needs work.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "2.
|
|
7
|
+
version: "2.3"
|
|
8
8
|
audience: external
|
|
9
9
|
type: workflow
|
|
10
10
|
---
|
|
@@ -202,6 +202,7 @@ If the project ships as an `.mcpb` bundle for Claude Desktop (check for `manifes
|
|
|
202
202
|
- Env var names in `manifest.json` (`mcp_config.env` + `user_config`) match `server.json` `environmentVariables` — `lint:packaging` enforces this, but verify the set is complete
|
|
203
203
|
- `manifest.json` `name` matches `package.json` name **without the npm scope prefix** (e.g. `bls-mcp-server`, not `@cyanheads/bls-mcp-server`); `description` matches `package.json`
|
|
204
204
|
- `manifest.json` `user_config` entries must include `title` and `type` fields — `mcpb pack` validates these
|
|
205
|
+
- For each `user_config` entry referenced as `${user_config.X}` in `mcp_config.env`: if it's not `required: true`, set `"default": ""`. MCPB hosts (Claude Desktop included) pass the literal placeholder string through to the process when an optional field is left blank without a default — strict consumer validators (`z.email()`, `z.url()`, `.regex()`) then crash at lazy config load, exiting silently after `initialize`. Server-side: pair every optional env-backed strict-validator field with a `z.preprocess` that strips `${...}` placeholders to `undefined`.
|
|
205
206
|
- `server.json` env var `isRequired` must match the upstream API's actual requirement — if the API works without the value (rate-limited, DEMO_KEY fallback, polite pool), mark `isRequired: false` and describe the tradeoff in the description
|
|
206
207
|
- Server description aligned across all surfaces: `package.json`, `manifest.json`, `server.json` (condensed, hard 100-char limit), README header `<p><b>`, and GitHub repo description (`gh repo edit --description`)
|
|
207
208
|
- `package.json` `keywords` include baseline terms: `mcp`, `mcp-server`, `model-context-protocol`, `typescript`, `bun`, `stdio`, `streamable-http`, plus data-domain terms. GitHub repo topics (`gh repo edit --add-topic`) should match.
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
File a bug or feature request against @cyanheads/mcp-ts-core when you hit a framework issue. Use when a builder, utility, context method, or config behaves contrary to the documented API — not for server-specific application bugs.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.7"
|
|
8
8
|
audience: external
|
|
9
9
|
type: workflow
|
|
10
10
|
---
|
|
@@ -33,6 +33,8 @@ For general `gh` CLI workflows outside issue filing (PRs, workflows, API access)
|
|
|
33
33
|
gh issue list -R cyanheads/mcp-ts-core --search "your error message or keyword"
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
5. **For documentation- or contract-shaped requests, audit all three doc layers first** — proposals to add reference docs, public-API conventions, attribute/event catalogs, or stability commitments often duplicate surface that already exists. Check `src/` for behavior, `docs/` for human-facing reference, and `skills/` for agent-facing reference. Skill files marked `audience: external` are the framework's public contract — treat them as authoritative when evaluating whether a documentation gap exists. Also verify the constants or types you'd reference aren't already exported from `@cyanheads/mcp-ts-core` or one of its subpaths.
|
|
37
|
+
|
|
36
38
|
## Writing Well-Structured Issues
|
|
37
39
|
|
|
38
40
|
Good issues are scannable, concrete, and self-contained — terse and fact-dense. Default to one or two sentences per bullet; if a bullet runs long, split it or cut it. These patterns apply to both bugs and features — the guidance targets any prose block (Description, Additional context, feature proposals).
|
|
@@ -286,6 +288,7 @@ gh issue list -R cyanheads/mcp-ts-core --author @me
|
|
|
286
288
|
- [ ] Confirmed bug is in `@cyanheads/mcp-ts-core`, not server code
|
|
287
289
|
- [ ] Running latest (or documented) framework version
|
|
288
290
|
- [ ] Searched existing issues — no duplicate found
|
|
291
|
+
- [ ] If documentation or contract enhancement: confirmed `src/`, `docs/`, `skills/`, and public exports don't already cover the surface
|
|
289
292
|
- [ ] All secrets, credentials, and tokens redacted
|
|
290
293
|
- [ ] Primary label assigned (`bug` / `enhancement` / `documentation`)
|
|
291
294
|
- [ ] If bug: version, runtime, repro code, actual vs expected behavior included
|
package/templates/AGENTS.md
CHANGED
|
@@ -264,9 +264,14 @@ Available skills:
|
|
|
264
264
|
| `add-service` | Scaffold a new service integration |
|
|
265
265
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
266
266
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
267
|
+
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
267
268
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
269
|
+
| `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
|
|
268
270
|
| `devcheck` | Lint, format, typecheck, audit |
|
|
269
271
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
272
|
+
| `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
|
|
273
|
+
| `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
274
|
+
| `migrate-mcp-ts-template` | One-time migration of an existing project to the current framework template |
|
|
270
275
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
271
276
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
272
277
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
@@ -275,6 +280,7 @@ Available skills:
|
|
|
275
280
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
276
281
|
| `api-context` | Context interface, logger, state, progress |
|
|
277
282
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
283
|
+
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
278
284
|
| `api-services` | LLM, Speech, Graph services |
|
|
279
285
|
| `api-testing` | createMockContext, test patterns |
|
|
280
286
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
|
package/templates/CLAUDE.md
CHANGED
|
@@ -265,9 +265,14 @@ Available skills:
|
|
|
265
265
|
| `add-service` | Scaffold a new service integration |
|
|
266
266
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
267
267
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
268
|
+
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
268
269
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
270
|
+
| `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
|
|
269
271
|
| `devcheck` | Lint, format, typecheck, audit |
|
|
270
272
|
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
273
|
+
| `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
|
|
274
|
+
| `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
275
|
+
| `migrate-mcp-ts-template` | One-time migration of an existing project to the current framework template |
|
|
271
276
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
272
277
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
273
278
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
@@ -276,6 +281,7 @@ Available skills:
|
|
|
276
281
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
277
282
|
| `api-context` | Context interface, logger, state, progress |
|
|
278
283
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
284
|
+
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
279
285
|
| `api-services` | LLM, Speech, Graph services |
|
|
280
286
|
| `api-testing` | createMockContext, test patterns |
|
|
281
287
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: multi-server-orchestration
|
|
3
|
-
description: >
|
|
4
|
-
Orchestrate parallel sub-agent fanouts across one or more MCP server projects — the same workflow run independently per target. Use for greenfield builds across N new servers, maintenance passes across N existing ones, or any repeatable workflow that benefits from fresh-context per-target sub-agents. Encodes the orient template every sub-agent needs (CLAUDE.md chain + list-skills + spec artifacts), the universal hard rules around git tooling and authorization, common gotchas that bite across runs, and a router into per-scenario references for the phase pattern.
|
|
5
|
-
metadata:
|
|
6
|
-
author: cyanheads
|
|
7
|
-
version: "1.2"
|
|
8
|
-
audience: internal
|
|
9
|
-
type: workflow
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## When to Use
|
|
13
|
-
|
|
14
|
-
- Same workflow driven across multiple MCP server projects in parallel — greenfield builds, maintenance updates, security audits, design extensions
|
|
15
|
-
- Single server, but the work is large enough to want fresh-context sub-agents per phase rather than one continuous session
|
|
16
|
-
- Any case where the per-target work is independent and benefits from devcheck-gated handoffs between phases
|
|
17
|
-
|
|
18
|
-
Skip this skill for in-session tweaks to a single server — use `add-tool`, `maintenance`, `polish-docs-meta`, etc. directly.
|
|
19
|
-
|
|
20
|
-
## First Pass
|
|
21
|
-
|
|
22
|
-
Read this SKILL.md end-to-end first — the concepts, orient block, and hard rules below are universal across scenarios. Then:
|
|
23
|
-
|
|
24
|
-
1. **Capture the target list.** N projects with absolute paths. Per-target metadata as relevant (framework version, gold-standard reference, GH owner/org). If the user named a single target, that's still N = 1.
|
|
25
|
-
2. **Identify the scenario** from user intent first, then sanity-check against project state. If user intent is ambiguous, use the state heuristics below to surface a recommendation and confirm with the user — don't pick silently.
|
|
26
|
-
|
|
27
|
-
| Likely scenario | State signals (per target) |
|
|
28
|
-
|:----------------|:---------------------------|
|
|
29
|
-
| **Greenfield build-out** | Echo definitions still present in `src/mcp-server/{tools,resources,prompts}/definitions/`, no real services in `src/services/`, no released changelog files under `changelog/<minor>.x/`, `package.json` version is `0.0.0` or unset |
|
|
30
|
-
| **Maintenance pass** | Real tool/resource definitions present, framework deps installed, `bun outdated` reports updates available, at least one prior release tagged |
|
|
31
|
-
| **Wrap-up / release pass** | Working tree has uncommitted/staged work, OR `git log v<latest-tag>..HEAD` shows commits since the last release that warrant a new version, OR the user explicitly asks to "ship", "release", or do a version bump. If the user explicitly wants to publish to npm/registries → release-and-publish pass; if local-only → wrap-up pass |
|
|
32
|
-
| **Neither** | None of the above match cleanly — surface the state to the user, ask what they want |
|
|
33
|
-
|
|
34
|
-
3. **Pick the reference** from the References table below. Each reference contains its scenario's phase pattern, per-sub-agent prompt bodies, scenario-specific gotchas, and checklist.
|
|
35
|
-
4. **Surface the plan to the user** before kicking off the first fanout: scenario, target list, phase summary, gotchas in play. Get explicit authorization before any phase that commits, tags, pushes, or creates remote resources. Non-destructive phases (read, analyze, write files, devcheck) proceed without additional check-ins after the initial plan approval.
|
|
36
|
-
|
|
37
|
-
## References
|
|
38
|
-
|
|
39
|
-
| Scenario | Reference | When |
|
|
40
|
-
|:---------|:----------|:-----|
|
|
41
|
-
| **Greenfield build-out** | `references/greenfield-buildout.md` | New server(s) from `bunx @cyanheads/mcp-ts-core init` driven through design → build → first release |
|
|
42
|
-
| **Maintenance pass** | `references/maintenance-pass.md` | Existing server(s) need `bun update --latest`, changelog investigation, framework adoption, and verification — optionally followed by a commit/push |
|
|
43
|
-
| **Wrap-up pass** | `references/wrapup-pass.md` | Existing server(s) with committed/staged work to land locally as a new commit + annotated tag — verification → optional doc review → wrap-up (version + changelog + commit + tag) — **local only, no push**. Sub-agents execute the standalone `git-wrapup` skill per target |
|
|
44
|
-
| **Release-and-publish pass** | `references/release-and-publish-pass.md` | Existing server(s) have committed/staged work that needs to ship as a new version end-to-end — verification → README polish → wrap-up → publish → optional GH issue closure. Sub-agents execute the standalone `git-wrapup` then `release-and-publish` skills per target |
|
|
45
|
-
|
|
46
|
-
**Mental model — scenarios are related but never auto-chain.** A maintenance pass often produces work worth wrapping up; a wrap-up commonly precedes a release; a greenfield build-out ends with what's effectively a release. Useful for orienting around what comes next conceptually — but **each scenario requires its own explicit user authorization to invoke**. The orchestrator never advances from one to the next on its own. Pick the reference for the current scope; if more work follows, wait for the user to direct it.
|
|
47
|
-
|
|
48
|
-
For scenarios not listed (security audits, design-only extensions, framework-wide migrations), the concepts/orient/rules/gotchas below are universal. Author a new reference describing the phase pattern when the workflow becomes repeatable.
|
|
49
|
-
|
|
50
|
-
## Concepts
|
|
51
|
-
|
|
52
|
-
**Parallel fanout.** One phase = one parallel batch of sub-agents, one per target. All N agents run independently in the same orchestrator message. The orchestrator (you) collects their results, normalizes inconsistencies, then triggers the next phase.
|
|
53
|
-
|
|
54
|
-
**Sub-agent isolation.** Sub-agents do **not** inherit the parent session's `CLAUDE.md` chain or skills registry. They start with a blank slate plus the prompt you give them. Every sub-agent prompt must begin with an explicit orient sequence (see below) or it will work from defaults and pattern-matching instead of project conventions.
|
|
55
|
-
|
|
56
|
-
**Narrow scope per fanout.** A single agent doing "implement everything, write tests, run devcheck, polish, commit, tag" will exhaust its context window before finishing — the work lands on disk but the agent can't continue. Split phases narrowly so each agent finishes well under the context limit. Plan for a follow-up "finish" pass after a big work phase.
|
|
57
|
-
|
|
58
|
-
**Normalize after divergent fanouts.** Independent agents will diverge on incidental choices (scoped vs. unscoped names, script invocation form, README hero structure). When the choices should be uniform across targets, plan an explicit normalization pass after the fanout — don't expect alignment for free.
|
|
59
|
-
|
|
60
|
-
## The Orient Block
|
|
61
|
-
|
|
62
|
-
Every parallel sub-agent prompt opens with this block. The block is **mandatory, not advisory** — the sub-agent's first six tool calls should be the orient sequence, in order. Substitute the bracketed values per target.
|
|
63
|
-
|
|
64
|
-
```text
|
|
65
|
-
You are working on `[project name]` at `[project absolute path]`.
|
|
66
|
-
|
|
67
|
-
Orient first. These six steps are required before any task work — do them in
|
|
68
|
-
order. If any file does not exist, note it and continue.
|
|
69
|
-
|
|
70
|
-
1. Read the global agent protocol at `~/.claude/CLAUDE.md` (or your agent's equivalent).
|
|
71
|
-
2. Read the workspace-level protocol if one exists at `[workspace CLAUDE.md path]`
|
|
72
|
-
— skip this step if no workspace-tier protocol applies.
|
|
73
|
-
3. Read the project protocol at `[project absolute path]/CLAUDE.md`.
|
|
74
|
-
4. Run `cd [project absolute path] && bun run list-skills` to see the project's
|
|
75
|
-
available skills with descriptions and locations.
|
|
76
|
-
5. Read the skill file(s) for this task: `[skill paths]`.
|
|
77
|
-
6. Read the spec artifact(s) you'll work from: `[doc paths, e.g., docs/design.md]`.
|
|
78
|
-
|
|
79
|
-
Only after that, begin the task below.
|
|
80
|
-
|
|
81
|
-
**Task:** [concrete description with constraints, no-go list, expected outputs]
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
The orient block compensates for the two pieces of context sub-agents don't inherit: the CLAUDE.md chain (global → workspace → project) and the project skill registry. Both must be reconstructed manually inside the sub-agent prompt or the agent works from defaults.
|
|
85
|
-
|
|
86
|
-
### Prerequisite: `list-skills.ts` in each project
|
|
87
|
-
|
|
88
|
-
`list-skills.ts` is the script the orient block runs in step 4. It parses YAML frontmatter from each project-local `.claude/skills/*/SKILL.md` (falling back to `skills/`) and prints a summary an agent can read. It ships with `@cyanheads/mcp-ts-core` and is scaffolded by `init` into `scripts/list-skills.ts` with a corresponding `list-skills` package script. Projects scaffolded before the script existed pick it up via `maintenance` Phase C on the next sync.
|
|
89
|
-
|
|
90
|
-
Verify presence in each target before kicking off any fanout:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
test -f scripts/list-skills.ts && grep -q '"list-skills"' package.json
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Hard Rules
|
|
97
|
-
|
|
98
|
-
These apply to every scenario. Scenario-specific rules live in their reference.
|
|
99
|
-
|
|
100
|
-
1. **Bash `git` only in parallel sub-agents.** Do not let parallel sub-agents call `mcp__git-mcp-server__*` tools (or any git MCP tool that holds session state across calls). The MCP server's session state (`set_working_dir`) leaks across parallel agents in the same orchestrator session, causing silent no-ops, wrong-directory operations, and false "tag already exists" errors. Bash `git` in the agent's CWD is reliable. The orchestrator may still use git-mcp-server itself in serial.
|
|
101
|
-
2. **No git commits, pushes, tags, branch creation, or destructive ops without an explicit user request.** Setup-phase and build-phase work is left unstaged for review. Wrap-up phases run only after the user authorizes a commit. Honor every `~/.claude/CLAUDE.md` rule: no `git stash`, no `reset --hard`, no `restore .`, no `clean -f`, no `--no-verify`, plain `-m` commit messages, no `Co-authored-by` or `Generated with` trailers.
|
|
102
|
-
3. **`bun run devcheck` is the handoff gate.** Work phases must hand back a green devcheck. If a sub-agent can't reach green, it reports the failing step verbatim and stops rather than carrying broken state forward to the next phase.
|
|
103
|
-
4. **Verify sub-agent claims with a read-only check.** Agent summaries describe intent, not always reality. After any fanout that touched the filesystem, the orchestrator confirms with `git log`, `git status`, `ls`, or its own `bun run devcheck` before declaring the phase done.
|
|
104
|
-
5. **Skip marketing adjectives.** In commits, tags, READMEs, and CHANGELOG entries — no "comprehensive", "robust", "enhanced", "seamless", "improved". State the change. Restate this rule in every sub-agent prompt that produces text artifacts; the global protocol's restated rules aren't visible to sub-agents at prompt time.
|
|
105
|
-
6. **One scenario per orchestration run.** Don't interleave greenfield and maintenance phases against the same target in one session. If a target needs both (e.g., a build run that needs a `bun update` first), sequence them as two scenarios with a clean handoff in between.
|
|
106
|
-
|
|
107
|
-
## Gotchas
|
|
108
|
-
|
|
109
|
-
These commonly bite across all scenarios. Scenario-specific gotchas live in their reference.
|
|
110
|
-
|
|
111
|
-
| # | Gotcha | Mitigation |
|
|
112
|
-
|:--|:-------|:-----------|
|
|
113
|
-
| 1 | Sub-agents don't inherit the CLAUDE.md chain | Orient block — global, workspace (if applicable), and project CLAUDE.md read before work |
|
|
114
|
-
| 2 | Sub-agents don't inherit the project skill registry | Orient block step 4 — `bun run list-skills` surfaces available skills, agent then reads task-specific ones by path |
|
|
115
|
-
| 3 | `git-mcp-server`'s `set_working_dir` state leaks across parallel sub-agents in the same orchestrator session | Bash `git` only in parallel sub-agents; reserve `git-mcp-server` for serial orchestrator use |
|
|
116
|
-
| 4 | Big work agents exhaust context before finishing — work lands on disk but the agent can't continue | Narrow scope per fanout; plan a finish-pass as the backstop in the scenario reference |
|
|
117
|
-
| 5 | Parallel agent self-reports describe intent, not always reality (claimed "pushed" but no remote ref exists) | Verify with read-only `git log --oneline -5`, `git ls-remote --tags origin`, `gh repo view` after every fanout that touched git |
|
|
118
|
-
| 6 | Independent agents diverge on incidental conventions (scoping, scripts, README hero) | Plan an explicit normalization pass; don't expect alignment for free |
|
|
119
|
-
| 7 | Sub-agent skips the orient block and proceeds with pattern-matched defaults | Put orient as a numbered prerequisite in the prompt with "Only after that, begin the task"; spot-check the first tool calls in the agent's response |
|
|
120
|
-
| 8 | Sub-agent runs `git stash` to "test something safely" | Restate the global rule verbatim in every sub-agent prompt that may touch git: "NEVER `git stash` for any reason." |
|
|
121
|
-
| 9 | `gh release create --notes-from-tag` fails when combined with `--repo` flag | `gh` CLI limitation. Always `cd` into the target repo dir for `gh release` commands; don't use `--repo` with `--notes-from-tag` |
|
|
122
|
-
|
|
123
|
-
## Extending the pattern
|
|
124
|
-
|
|
125
|
-
When a new scenario emerges that's worth codifying (security-pass fanout across N servers, framework-wide migration, etc.), author a new reference at `references/<scenario>.md` and add a row to the table above. The reference should follow the shape of the existing references (e.g., `greenfield-buildout.md`): scope, pre-flight, phase table, phase details, scenario-specific gotchas, checklist. The concepts/orient/rules/gotchas in this SKILL.md don't need to be restated — the reference assumes the reader started here.
|
|
126
|
-
|
|
127
|
-
## Pre-flight Checklist
|
|
128
|
-
|
|
129
|
-
Applies to all scenarios — verify before picking a reference and kicking off the first fanout.
|
|
130
|
-
|
|
131
|
-
- [ ] Target list captured with absolute paths and per-target metadata
|
|
132
|
-
- [ ] Scenario identified from intent + state; confirmed with user if ambiguous
|
|
133
|
-
- [ ] Reference selected from the table above
|
|
134
|
-
- [ ] `scripts/list-skills.ts` + `list-skills` package script present in each target
|
|
135
|
-
- [ ] Plan surfaced to user: scenario, targets, phase summary, active gotchas
|
|
136
|
-
- [ ] User authorization captured for any phase that commits, tags, pushes, or creates remote resources
|
|
137
|
-
- [ ] Scenario reference read in full before first fanout
|