Skip to content

Commit b56e470

Browse files
release: MCP packages minor versions
1 parent 8a926d0 commit b56e470

66 files changed

Lines changed: 1771 additions & 77 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Use `hex-line` first for repo file reads/search/edits on code, config, scripts,
7070
| Architecture patterns (L0-L3) | `cat docs/architecture/SKILL_ARCHITECTURE_GUIDE.md` |
7171
| Agent delegation runtime | `cat docs/architecture/AGENT_DELEGATION_PLATFORM_GUIDE.md` |
7272
| Tool configuration | `cat skills-catalog/shared/references/environment_state_contract.md` |
73+
| Loop health model | `cat skills-catalog/shared/references/loop_health_contract.md` |
74+
| Procedural SOP/TWI guide | `cat skills-catalog/shared/references/procedural_skill_sop_guide.md` |
7375
| Key workflow | `ln-700 -> ln-100 -> ln-200 -> ln-1000` |
7476
| Skill metadata | `head -20 {ln-NNN}/SKILL.md` |
7577
| Reference files for a skill | `ls {ln-NNN}/references/` |
@@ -86,6 +88,8 @@ Use `hex-line` first for repo file reads/search/edits on code, config, scripts,
8688
| Agent instructions writing guide | `skills-catalog/shared/references/agent_instructions_writing_guide.md` |
8789
| Writing guidelines | `docs/architecture/SKILL_ARCHITECTURE_GUIDE.md` |
8890
| Environment State | `skills-catalog/shared/references/environment_state_contract.md` |
91+
| Loop Health | `skills-catalog/shared/references/loop_health_contract.md` |
92+
| Procedural SOP/TWI | `skills-catalog/shared/references/procedural_skill_sop_guide.md` |
8993
| Risk-Based Testing | `skills-catalog/shared/references/risk_based_testing_guide.md` |
9094
| Frontmatter fields | `skills-catalog/shared/references/frontmatter_reference.md` |
9195
| Questions format | `skills-catalog/shared/references/questions_format.md` |

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ ln-200-scope-decomposer # 2. Scope -> Epics -> Stories
112112
ln-1000-pipeline-orchestrator # 3. Full artifact-driven pipeline: 300 → 310 → 400 → 500 → Done
113113
```
114114

115+
Coordinators keep lifecycle status separate from Loop Health: `status` says where the run is, artifacts/checkpoints prove completion, and `loop_health` decides whether another retry is useful. Procedural skills use SOP/TWI-style point-of-use checklists so risky steps carry action, key point, why, evidence, exception, and guard close to the moment of use.
116+
115117
---
116118

117119
## MCP Servers (Optional)
118120

119-
Bundled MCP servers extend agent capabilities — hash-verified editing, code intelligence, and remote access. All skills work without MCP (fallback to built-in tools), but MCP servers improve accuracy and save tokens.
121+
Bundled MCP servers extend agent capabilities — hash-verified editing, code intelligence, and remote access. All skills work without MCP (fallback to built-in tools), but MCP servers improve accuracy and save tokens. MCP errors stay as `status: "ERROR"` and include `failure_class`, `next_action`, and recovery fields so skills can feed transport/tool/auth/rate-limit signals into Loop Health without inventing a second retry loop.
120122

121123
### Bundled servers
122124

@@ -129,7 +131,7 @@ Bundled MCP servers extend agent capabilities — hash-verified editing, code in
129131
Deterministic scope rule: `hex-line` and `hex-graph` keep `path` as the project anchor. In normal use the agent fills it automatically from the active file or project root, so users usually do not need to type it manually. `hex-ssh` runs on Windows/macOS/Linux hosts; remote shell tools stay POSIX-oriented, while SFTP transfers support platform-aware remote paths.
130132

131133
<!-- GENERATED:HEX_GRAPH_MCP_STATUS:START -->
132-
`hex-graph-mcp` quality snapshot: `103/103` tests passing, `1` curated corpus, `1` pinned external corpora, parser-first `green`.
134+
`hex-graph-mcp` quality snapshot: `106/106` tests passing, `1` curated corpus, `1` pinned external corpora, parser-first `green`.
133135
<!-- GENERATED:HEX_GRAPH_MCP_STATUS:END -->
134136

135137
### External servers

docs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ docs/
1111
| `-- AGENT_DELEGATION_PLATFORM_GUIDE.md # Skill vs subagent runtime, recovery, Windows
1212
|-- best-practice/ # Claude Code usage guidance
1313
| |-- COMPONENT_SELECTION.md
14+
| |-- MCP_TOOL_DESIGN_GUIDE.md # MCP naming, bounded output, clean-cut migration, error classes
1415
| |-- MCP_OUTPUT_CONTRACT_GUIDE.md # Canonical MCP status/reason/next_action vocabulary
1516
| `-- WORKFLOW_TIPS.md
1617
|-- plugins/ # Per-plugin landing pages
@@ -55,3 +56,5 @@ docs/
5556
|-------|------|
5657
| MCP tool design | [best-practice/MCP_TOOL_DESIGN_GUIDE.md](best-practice/MCP_TOOL_DESIGN_GUIDE.md) |
5758
| MCP output contract | [best-practice/MCP_OUTPUT_CONTRACT_GUIDE.md](best-practice/MCP_OUTPUT_CONTRACT_GUIDE.md) |
59+
| Loop Health contract | [../skills-catalog/shared/references/loop_health_contract.md](../skills-catalog/shared/references/loop_health_contract.md) |
60+
| Procedural SOP/TWI guide | [../skills-catalog/shared/references/procedural_skill_sop_guide.md](../skills-catalog/shared/references/procedural_skill_sop_guide.md) |

docs/architecture/SKILL_ARCHITECTURE_GUIDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Rule of thumb:
4444
| **Single source of truth** | Put enforceable rules in shared refs, not scattered prose |
4545
| **Top-down ownership** | Coordinators know workers; workers do not encode ownership hierarchy back upward |
4646
| **Token efficiency** | Remove duplicated prose and keep only action-relevant detail |
47+
| **Loop-aware retries** | Keep lifecycle status separate from `loop_health`; repeated attempts need new evidence |
48+
| **SOP/TWI execution** | Procedural steps carry action, key point, why, evidence, exception, and guard at point of use |
4749

4850
### Skill Layers
4951

@@ -157,6 +159,8 @@ These are repo heuristics, not universal laws.
157159
|---------|--------------|
158160
| table-oriented metadata | cheaper to scan than long prose |
159161
| imperative workflow steps | easier for agents to execute |
162+
| point-of-use risk checklists | prevents skipped critical steps when progressive disclosure hides later sections |
163+
| step -> key point -> why | makes risky instructions harder to bypass or reinterpret |
160164
| short direct sentences | lowers context cost and ambiguity |
161165
| `MANDATORY READ` only for execution-critical files | keeps context minimal and intentional |
162166
| detail in `references/` | prevents giant monolithic skills |
@@ -188,6 +192,8 @@ Use `skills-catalog/shared/concise_terms.md` for wording cleanup.
188192
| worker defines parent or coordinator | reverse coupling | remove ownership wording |
189193
| caller describes workers but never invokes them explicitly | agents tend to inline logic | add `Skill()` blocks and Worker Invocation section |
190194
| same threshold or rule repeated in many skills | drift risk | move to shared ref |
195+
| retries are driven only by lifecycle status | retry storms and same-error loops | use `shared/references/loop_health_contract.md` |
196+
| final DoD carries all safety checks | agents may miss point-of-use risks | colocate SOP/TWI checklist at the risky step |
191197
| giant inline instructions that are rarely needed | context waste | move to conditional shared ref |
192198
| stale platform/runtime references | agent confusion | update or delete immediately |
193199
| giant root map or giant skill manual | crowds out task context | keep map-first and route outward |
@@ -210,6 +216,7 @@ Use `skills-catalog/shared/concise_terms.md` for wording cleanup.
210216
- [ ] The chosen layer is appropriate
211217
- [ ] `Skill` vs `Agent` choice is justified
212218
- [ ] Shared refs reduce duplication instead of adding indirection
219+
- [ ] Retry loops use `loop_health` evidence instead of lifecycle status alone
213220
- [ ] File size and workflow shape still fit the responsibility
214221

215222
### Writing Check
@@ -218,6 +225,7 @@ Use `skills-catalog/shared/concise_terms.md` for wording cleanup.
218225
- [ ] Tables replace verbose prose where useful
219226
- [ ] Sentences are short and direct
220227
- [ ] Repeated instructions have been merged or removed
228+
- [ ] Procedural risky steps include point-of-use action/key point/why/evidence/exception/guard
221229

222230
---
223231

docs/best-practice/MCP_OUTPUT_CONTRACT_GUIDE.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ When a tool returns structured content, prefer this order:
3434

3535
1. `status`
3636
2. `reason`
37-
3. `revision` / `file` / `path` / `query` identity
38-
4. `next_action` or `next_actions`
39-
5. `summary`
40-
6. recovery helpers such as `retry_edit`, `retry_edits`, `suggested_read_call`, `retry_plan`
41-
7. detailed sections such as `result`, `warnings`, `snippet`, `risk_summary`
37+
3. `failure_class` for classified errors
38+
4. `revision` / `file` / `path` / `query` identity
39+
5. `next_action` or `next_actions`
40+
6. `summary`
41+
7. recovery helpers such as `retry_edit`, `retry_edits`, `suggested_read_call`, `retry_plan`
42+
8. detailed sections such as `result`, `warnings`, `snippet`, `risk_summary`
4243

4344
Reason: agents should see decision fields before supporting detail.
4445

@@ -130,6 +131,11 @@ Rules:
130131
| `inspect_raw_diff` | Fall back to raw diff because semantic mode is unavailable |
131132
| `review_risks` | Inspect risk details before acting |
132133
| `no_action` | Nothing to do |
134+
| `fix_permissions` | Correct file, SSH, graph DB, or OS permissions |
135+
| `install_tool` | Install or expose a missing executable/provider |
136+
| `authenticate` | Configure credentials, token, OAuth, or SSH key |
137+
| `defer_retry` | Wait for rate-limit or quota recovery before retrying |
138+
| `retry_after_wait` | Retry after an idle timeout or transient busy resource clears |
133139

134140
### Canonical graph labels
135141

@@ -202,15 +208,16 @@ Structured-output MCP errors should use this public shape in `structuredContent`
202208
- `summary`
203209
- `next_action`
204210
- `recovery`
211+
- `failure_class`
205212
- `error: { code, message, recovery }` (canonical sub-object)
206213

207-
`summary` explains what failed. `next_action` names the immediate category of recovery. `recovery` gives the human-readable instruction.
214+
`summary` explains what failed. `next_action` names the immediate category of recovery. `recovery` gives the human-readable instruction. `failure_class` is the machine-readable transport/tool/auth/rate-limit/timeout signal consumed by Loop Health.
208215

209216
On the MCP envelope level, ALSO set `isError: true` (see section 8).
210217

211218
Do not return raw stack traces in public tool outputs.
212219

213-
Text-grammar servers express errors inside their grammar. For `hex-graph`, the first line is `error <next_action> ...` and body lines carry details such as `!code=<CODE>` and `!message=<text>`.
220+
Text-grammar servers express errors inside their grammar. For `hex-graph`, the first line is `error <next_action> ...` and body lines carry details such as `!code=<CODE>`, `!failure_class=<CLASS>`, and `!message=<text>`.
214221

215222
## 8. MCP Envelope
216223

@@ -281,6 +288,7 @@ Before merging MCP output changes, check:
281288
- `next_action` / `next_actions` use labels, not prose
282289
- `summary` is compact and non-redundant
283290
- structured error outputs set BOTH `isError: true` and `structuredContent.status: "ERROR"`
291+
- structured and text-grammar errors include `failure_class` when a failure can affect retry usefulness
284292
- structured tools declare `outputSchema` that matches actual `structuredContent` shape (schema-contract tests)
285293
- text-grammar tools do not declare `outputSchema` and have grammar contract tests
286294
- large results set `_meta["anthropic/maxResultSizeChars"]`

docs/best-practice/MCP_TOOL_DESIGN_GUIDE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ Rule: if a tool can return >100 lines, it MUST support truncation or a compact m
3939
| `NOOP_EDIT` | Edit produced identical content | Inform file already has desired content |
4040
| `OUT_OF_RANGE` | Line number exceeds file length | Show boundary snippet with hashes |
4141

42-
Anti-pattern: raw stack traces. Agents cannot act on `Error: ENOENT` -- they need recovery actions.
42+
Every public error also carries `failure_class`: `permission_denial`, `tool_missing`, `auth_missing`, `rate_limited`, `timeout_idle`, `timeout_productive`, or `unknown`. This lets skills feed MCP failures into Loop Health without making the MCP server own retry policy.
43+
44+
Anti-pattern: raw stack traces. Agents cannot act on `Error: ENOENT` or `Cannot read properties of undefined` -- they need `code`, `summary`, `next_action`, `recovery`, `failure_class`, and `error`.
4345

4446
## 4. Tool Descriptions — WHEN to use, not WHAT it does
4547

@@ -91,14 +93,15 @@ When truncating, prefer structured metadata that tells the agent how to narrow n
9193

9294
Build a tool when: it saves tokens, adds verification, or prevents errors shell cannot catch.
9395

94-
## 9. Evolution -- periodically review constraints
96+
## 9. Evolution -- clean-cut migrations for repo-owned MCP
9597

9698
| Practice | Example |
9799
|----------|--------|
98100
| Review constraints | `TodoWrite` removed from Claude Code -- tools wrapping it become dead weight |
99101
| Track usage patterns | If agents never use `plain`, remove it or make it default |
100-
| Version schemas | Breaking input changes break cached agent behavior |
101-
| Deprecate before removing | "DEPRECATED: use X instead" in description, remove after one cycle |
102+
| Make clean cuts | Remove repo-owned obsolete names and update docs/tests in the same change |
103+
| Keep lifecycle stable | Preserve public `status` meanings; add evidence fields instead of a second status path |
104+
| Migrate by tests | Contract tests prove docs, schemas, and examples no longer mention the old path |
102105

103106
## 10. Tool Annotations
104107

@@ -124,6 +127,7 @@ Canonical fields (match [MCP_OUTPUT_CONTRACT_GUIDE.md](./MCP_OUTPUT_CONTRACT_GUI
124127
- `status` -- required, from canonical vocabulary (OK, ERROR, CONFLICT, STALE, etc.)
125128
- `reason` -- machine-readable classifier
126129
- `next_action` -- canonical label from output contract
130+
- `failure_class` -- classified transport/tool/auth/rate-limit/timeout signal for Loop Health
127131
- `error: {code, message, recovery}` -- only when status is ERROR
128132
- domain-specific payload -- tool-owned fields (matches, outline, etc.)
129133

docs/plugins/agile-workflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## What it does
1616

17-
Automates the full Agile delivery cycle. Coordinators advance only from machine-readable artifacts, while task-plan, execution, quality, and test-planning workers keep their own runtime state and stay standalone-capable. Integrates with Linear or works standalone with markdown files.
17+
Automates the full Agile delivery cycle. Coordinators advance only from machine-readable artifacts, while task-plan, execution, quality, and test-planning workers keep their own runtime state and stay standalone-capable. Loop Health prevents same-error and no-progress retry storms without changing lifecycle statuses. Integrates with Linear or works standalone with markdown files.
1818

1919
## Skills
2020

@@ -56,7 +56,7 @@ ln-200 (scope) -> ln-300 (tasks) -> ln-310 (validate)
5656
-> ln-500 (quality gate)
5757
```
5858

59-
`ln-220`, `ln-300`, `ln-400`, `ln-510`, and `ln-520` keep coordinator runtime state and checkpoint child worker runs for resume. `ln-221/222`, `ln-301/302`, `ln-401..404`, `ln-511..514`, and `ln-521..523` remain standalone-capable workers with their own run-scoped state and summaries. `ln-1000` advances only from coordinator stage artifacts, while `ln-310` runs registry-configured external-agent review before execution begins.
59+
`ln-220`, `ln-300`, `ln-400`, `ln-510`, and `ln-520` keep coordinator runtime state and checkpoint child worker runs for resume. `ln-400` and `ln-1000` also record `loop_health` when an attempt repeats a task, worker, stage, error, or validation segment. `ln-221/222`, `ln-301/302`, `ln-401..404`, `ln-511..514`, and `ln-521..523` remain standalone-capable workers with their own run-scoped state and summaries. `ln-1000` advances only from coordinator stage artifacts, while `ln-310` runs registry-configured external-agent review before execution begins.
6060

6161
## Quick start
6262

0 commit comments

Comments
 (0)