@mizyoel/mercury-mesh 0.9.4 → 1.0.0

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.
Files changed (129) hide show
  1. package/.copilot/mcp-config.json +3 -6
  2. package/.copilot/skills/agent-collaboration/SKILL.md +42 -42
  3. package/.copilot/skills/agent-conduct/SKILL.md +24 -24
  4. package/.copilot/skills/architectural-proposals/SKILL.md +151 -151
  5. package/.copilot/skills/ci-validation-gates/SKILL.md +85 -84
  6. package/.copilot/skills/cli-wiring/SKILL.md +47 -47
  7. package/.copilot/skills/client-compatibility/SKILL.md +89 -89
  8. package/.copilot/skills/cross-mesh/SKILL.md +114 -114
  9. package/.copilot/skills/distributed-mesh/SKILL.md +287 -287
  10. package/.copilot/skills/distributed-mesh/mesh.json.example +30 -30
  11. package/.copilot/skills/distributed-mesh/sync-mesh.ps1 +111 -111
  12. package/.copilot/skills/distributed-mesh/sync-mesh.sh +104 -104
  13. package/.copilot/skills/docs-standards/SKILL.md +71 -71
  14. package/.copilot/skills/economy-mode/SKILL.md +101 -101
  15. package/.copilot/skills/external-comms/SKILL.md +331 -331
  16. package/.copilot/skills/gh-auth-isolation/SKILL.md +183 -183
  17. package/.copilot/skills/git-workflow/SKILL.md +206 -206
  18. package/.copilot/skills/github-multi-account/SKILL.md +95 -95
  19. package/.copilot/skills/history-hygiene/SKILL.md +36 -36
  20. package/.copilot/skills/humanizer/SKILL.md +107 -107
  21. package/.copilot/skills/init-mode/SKILL.md +101 -101
  22. package/.copilot/skills/mesh-conventions/SKILL.md +69 -69
  23. package/.copilot/skills/model-selection/SKILL.md +139 -139
  24. package/.copilot/skills/nap/SKILL.md +24 -24
  25. package/.copilot/skills/personal-mesh/SKILL.md +57 -57
  26. package/.copilot/skills/project-conventions/SKILL.md +56 -56
  27. package/.copilot/skills/release-process/SKILL.md +432 -435
  28. package/.copilot/skills/reskill/SKILL.md +92 -92
  29. package/.copilot/skills/reviewer-protocol/SKILL.md +79 -79
  30. package/.copilot/skills/secret-handling/SKILL.md +200 -200
  31. package/.copilot/skills/session-recovery/SKILL.md +155 -155
  32. package/.copilot/skills/test-discipline/SKILL.md +37 -37
  33. package/.copilot/skills/windows-compatibility/SKILL.md +74 -74
  34. package/.github/agents/mercury-mesh.agent.md +1732 -1732
  35. package/.mesh/manifesto.md +66 -66
  36. package/.mesh/templates/casting/Futurama.json +9 -9
  37. package/.mesh/templates/casting-history.json +4 -4
  38. package/.mesh/templates/casting-policy.json +37 -37
  39. package/.mesh/templates/casting-reference.md +104 -104
  40. package/.mesh/templates/casting-registry.json +3 -3
  41. package/.mesh/templates/ceremonies.md +41 -41
  42. package/.mesh/templates/charter.md +56 -56
  43. package/.mesh/templates/constraint-tracking.md +38 -38
  44. package/.mesh/templates/cooperative-rate-limiting.md +229 -229
  45. package/.mesh/templates/copilot-instructions.md +50 -50
  46. package/.mesh/templates/department-backlog.md +15 -15
  47. package/.mesh/templates/department-charter.md +27 -27
  48. package/.mesh/templates/department-state.json +19 -19
  49. package/.mesh/templates/history.md +10 -10
  50. package/.mesh/templates/identity/now.md +9 -9
  51. package/.mesh/templates/identity/wisdom.md +15 -15
  52. package/.mesh/templates/interface-contract.md +26 -26
  53. package/.mesh/templates/issue-lifecycle.md +421 -421
  54. package/.mesh/templates/keda-scaler.md +166 -166
  55. package/.mesh/templates/local.json +5 -0
  56. package/.mesh/templates/machine-capabilities.md +76 -76
  57. package/.mesh/templates/mcp-config.md +87 -90
  58. package/.mesh/templates/mercury-mesh.agent.md +1732 -1732
  59. package/.mesh/templates/multi-agent-format.md +28 -28
  60. package/.mesh/templates/orchestration-log.md +27 -27
  61. package/.mesh/templates/org-autonomy-spec.md +152 -152
  62. package/.mesh/templates/org-backlog-from-triage.js +199 -199
  63. package/.mesh/templates/org-runtime-reconcile.js +364 -364
  64. package/.mesh/templates/org-seed-runtime.js +237 -237
  65. package/.mesh/templates/org-status.js +193 -193
  66. package/.mesh/templates/org-structure.json +38 -38
  67. package/.mesh/templates/package.json +3 -3
  68. package/.mesh/templates/plugin-marketplace.md +49 -49
  69. package/.mesh/templates/ralph-circuit-breaker.md +313 -313
  70. package/.mesh/templates/ralph-triage.js +849 -844
  71. package/.mesh/templates/raw-agent-output.md +37 -37
  72. package/.mesh/templates/roster.md +60 -60
  73. package/.mesh/templates/routing.md +78 -78
  74. package/.mesh/templates/run-output.md +50 -50
  75. package/.mesh/templates/schedule.json +64 -64
  76. package/.mesh/templates/scribe-charter.md +119 -119
  77. package/.mesh/templates/skill.md +24 -24
  78. package/.mesh/templates/skills/agent-collaboration/SKILL.md +42 -42
  79. package/.mesh/templates/skills/agent-conduct/SKILL.md +24 -24
  80. package/.mesh/templates/skills/architectural-proposals/SKILL.md +151 -151
  81. package/.mesh/templates/skills/ci-validation-gates/SKILL.md +85 -84
  82. package/.mesh/templates/skills/cli-wiring/SKILL.md +47 -47
  83. package/.mesh/templates/skills/client-compatibility/SKILL.md +89 -89
  84. package/.mesh/templates/skills/cross-mesh/SKILL.md +114 -114
  85. package/.mesh/templates/skills/distributed-mesh/SKILL.md +287 -287
  86. package/.mesh/templates/skills/distributed-mesh/mesh.json.example +30 -30
  87. package/.mesh/templates/skills/distributed-mesh/sync-mesh.ps1 +111 -111
  88. package/.mesh/templates/skills/distributed-mesh/sync-mesh.sh +104 -104
  89. package/.mesh/templates/skills/docs-standards/SKILL.md +71 -71
  90. package/.mesh/templates/skills/economy-mode/SKILL.md +101 -101
  91. package/.mesh/templates/skills/external-comms/SKILL.md +331 -331
  92. package/.mesh/templates/skills/gh-auth-isolation/SKILL.md +183 -183
  93. package/.mesh/templates/skills/git-workflow/SKILL.md +204 -204
  94. package/.mesh/templates/skills/github-multi-account/SKILL.md +95 -95
  95. package/.mesh/templates/skills/history-hygiene/SKILL.md +36 -36
  96. package/.mesh/templates/skills/humanizer/SKILL.md +107 -107
  97. package/.mesh/templates/skills/init-mode/SKILL.md +101 -101
  98. package/.mesh/templates/skills/mesh-conventions/SKILL.md +69 -69
  99. package/.mesh/templates/skills/model-selection/SKILL.md +139 -139
  100. package/.mesh/templates/skills/nap/SKILL.md +24 -24
  101. package/.mesh/templates/skills/personal-mesh/SKILL.md +57 -57
  102. package/.mesh/templates/skills/project-conventions/SKILL.md +56 -56
  103. package/.mesh/templates/skills/release-process/SKILL.md +432 -435
  104. package/.mesh/templates/skills/reskill/SKILL.md +92 -92
  105. package/.mesh/templates/skills/reviewer-protocol/SKILL.md +79 -79
  106. package/.mesh/templates/skills/secret-handling/SKILL.md +200 -200
  107. package/.mesh/templates/skills/session-recovery/SKILL.md +155 -155
  108. package/.mesh/templates/skills/test-discipline/SKILL.md +37 -37
  109. package/.mesh/templates/skills/windows-compatibility/SKILL.md +74 -74
  110. package/.mesh/templates/workflows/mesh-ci.yml +24 -24
  111. package/.mesh/templates/workflows/mesh-docs.yml +54 -54
  112. package/.mesh/templates/workflows/mesh-heartbeat.yml +237 -237
  113. package/.mesh/templates/workflows/mesh-insider-release.yml +61 -61
  114. package/.mesh/templates/workflows/mesh-issue-assign.yml +243 -243
  115. package/.mesh/templates/workflows/mesh-label-enforce.yml +181 -181
  116. package/.mesh/templates/workflows/mesh-preview.yml +55 -55
  117. package/.mesh/templates/workflows/mesh-promote.yml +120 -120
  118. package/.mesh/templates/workflows/mesh-release.yml +77 -77
  119. package/.mesh/templates/workflows/mesh-triage.yml +383 -383
  120. package/.mesh/templates/workflows/sync-mesh-labels.yml +204 -204
  121. package/README.md +753 -640
  122. package/bin/mercury-mesh.cjs +1804 -317
  123. package/docs/brand-language.md +287 -287
  124. package/docs/commander-onboarding.md +462 -462
  125. package/docs/mercury-mesh-runtime-rename-impact.md +147 -147
  126. package/docs/persona-manifesto.md +114 -114
  127. package/docs/scenarios/client-compatibility.md +59 -59
  128. package/index.cjs +40 -40
  129. package/package.json +68 -43
@@ -3,12 +3,9 @@
3
3
  "EXAMPLE-github": {
4
4
  "command": "npx",
5
5
  "args": [
6
- "-y",
7
- "@anthropic/github-mcp-server"
8
- ],
9
- "env": {
10
- "GITHUB_TOKEN": "${GITHUB_TOKEN}"
11
- }
6
+ "mercury-mesh",
7
+ "github-mcp"
8
+ ]
12
9
  }
13
10
  }
14
11
  }
@@ -1,42 +1,42 @@
1
- ---
2
- name: "agent-collaboration"
3
- description: "Standard collaboration patterns for all Mercury Mesh agents — worktree awareness, decisions, cross-agent communication"
4
- domain: "team-workflow"
5
- confidence: "high"
6
- source: "extracted from charter boilerplate — identical content in 18+ agent charters"
7
- ---
8
-
9
- ## Context
10
-
11
- Every agent on the team follows identical collaboration patterns for worktree awareness, decision recording, and cross-agent communication. These were previously duplicated in every charter's Collaboration section (~300 bytes × 18 agents = ~5.4KB of redundant context). Now centralized here.
12
-
13
- The coordinator's spawn prompt already instructs agents to read decisions.md and their history.md. This skill adds the patterns for WRITING decisions and requesting help.
14
-
15
- ## Patterns
16
-
17
- ### Worktree Awareness
18
- Use the `TEAM ROOT` path provided in your spawn prompt. All `.mesh/` paths are relative to this root. If TEAM ROOT is not provided (rare), run `git rev-parse --show-toplevel` as fallback. Never assume CWD is the repo root.
19
-
20
- ### Decision Recording
21
- After making a decision that affects other team members, write it to:
22
- `.mesh/decisions/inbox/{your-name}-{brief-slug}.md`
23
-
24
- Format:
25
- ```
26
- ### {date}: {decision title}
27
- **By:** {Your Name}
28
- **What:** {the decision}
29
- **Why:** {rationale}
30
- ```
31
-
32
- ### Cross-Agent Communication
33
- If you need another team member's input, say so in your response. The coordinator will establish an Airbridge. Don't try to do work outside your domain.
34
-
35
- ### Reviewer Protocol
36
- If you have reviewer authority and reject work: the original author is locked out from revising that artifact. A different agent must own the revision. State who should revise in your rejection response.
37
-
38
- ## Anti-Patterns
39
- - Don't read all agent charters — you only need your own context + decisions.md
40
- - Don't write directly to `.mesh/decisions.md` — always use the inbox drop-box
41
- - Don't modify other agents' history.md files — that's Scribe's job
42
- - Don't assume CWD is the repo root — always use TEAM ROOT
1
+ ---
2
+ name: "agent-collaboration"
3
+ description: "Standard collaboration patterns for all Mercury Mesh agents — worktree awareness, decisions, cross-agent communication"
4
+ domain: "team-workflow"
5
+ confidence: "high"
6
+ source: "extracted from charter boilerplate — identical content in 18+ agent charters"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Every agent on the team follows identical collaboration patterns for worktree awareness, decision recording, and cross-agent communication. These were previously duplicated in every charter's Collaboration section (~300 bytes × 18 agents = ~5.4KB of redundant context). Now centralized here.
12
+
13
+ The coordinator's spawn prompt already instructs agents to read decisions.md and their history.md. This skill adds the patterns for WRITING decisions and requesting help.
14
+
15
+ ## Patterns
16
+
17
+ ### Worktree Awareness
18
+ Use the `TEAM ROOT` path provided in your spawn prompt. All `.mesh/` paths are relative to this root. If TEAM ROOT is not provided (rare), run `git rev-parse --show-toplevel` as fallback. Never assume CWD is the repo root.
19
+
20
+ ### Decision Recording
21
+ After making a decision that affects other team members, write it to:
22
+ `.mesh/decisions/inbox/{your-name}-{brief-slug}.md`
23
+
24
+ Format:
25
+ ```
26
+ ### {date}: {decision title}
27
+ **By:** {Your Name}
28
+ **What:** {the decision}
29
+ **Why:** {rationale}
30
+ ```
31
+
32
+ ### Cross-Agent Communication
33
+ If you need another team member's input, say so in your response. The coordinator will establish an Airbridge. Don't try to do work outside your domain.
34
+
35
+ ### Reviewer Protocol
36
+ If you have reviewer authority and reject work: the original author is locked out from revising that artifact. A different agent must own the revision. State who should revise in your rejection response.
37
+
38
+ ## Anti-Patterns
39
+ - Don't read all agent charters — you only need your own context + decisions.md
40
+ - Don't write directly to `.mesh/decisions.md` — always use the inbox drop-box
41
+ - Don't modify other agents' history.md files — that's Scribe's job
42
+ - Don't assume CWD is the repo root — always use TEAM ROOT
@@ -1,24 +1,24 @@
1
- ---
2
- name: "agent-conduct"
3
- description: "Shared hard rules enforced across all Mercury Mesh agents"
4
- domain: "team-governance"
5
- confidence: "high"
6
- source: "reskill extraction — Product Isolation Rule and Peer Quality Check appeared in all 20 agent charters"
7
- ---
8
-
9
- ## Context
10
-
11
- Every Mercury Mesh agent must follow these two hard rules. They were previously duplicated in every charter. Now they live here as a shared skill, loaded once.
12
-
13
- ## Patterns
14
-
15
- ### Product Isolation Rule (hard rule)
16
- Tests, CI workflows, and product code must NEVER depend on specific agent names from any particular Mercury Mesh. "Our Mercury Mesh" must not impact "the Mercury Mesh." No hardcoded references to agent names (Flight, EECOM, FIDO, etc.) in test assertions, CI configs, or product logic. Use generic/parameterized values. If a test needs agent names, use obviously-fake test fixtures (e.g., "test-agent-1", "TestBot").
17
-
18
- ### Peer Quality Check (hard rule)
19
- Before finishing work, verify your changes don't break existing tests. Run the test suite for files you touched. If CI has been failing, check your changes aren't contributing to the problem. When you learn from mistakes, update your history.md.
20
-
21
- ## Anti-Patterns
22
- - Don't hardcode dev team agent names in product code or tests
23
- - Don't skip test verification before declaring work done
24
- - Don't ignore pre-existing CI failures that your changes may worsen
1
+ ---
2
+ name: "agent-conduct"
3
+ description: "Shared hard rules enforced across all Mercury Mesh agents"
4
+ domain: "team-governance"
5
+ confidence: "high"
6
+ source: "reskill extraction — Product Isolation Rule and Peer Quality Check appeared in all 20 agent charters"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Every Mercury Mesh agent must follow these two hard rules. They were previously duplicated in every charter. Now they live here as a shared skill, loaded once.
12
+
13
+ ## Patterns
14
+
15
+ ### Product Isolation Rule (hard rule)
16
+ Tests, CI workflows, and product code must NEVER depend on specific agent names from any particular Mercury Mesh. "Our Mercury Mesh" must not impact "the Mercury Mesh." No hardcoded references to agent names (Flight, EECOM, FIDO, etc.) in test assertions, CI configs, or product logic. Use generic/parameterized values. If a test needs agent names, use obviously-fake test fixtures (e.g., "test-agent-1", "TestBot").
17
+
18
+ ### Peer Quality Check (hard rule)
19
+ Before finishing work, verify your changes don't break existing tests. Run the test suite for files you touched. If CI has been failing, check your changes aren't contributing to the problem. When you learn from mistakes, update your history.md.
20
+
21
+ ## Anti-Patterns
22
+ - Don't hardcode dev team agent names in product code or tests
23
+ - Don't skip test verification before declaring work done
24
+ - Don't ignore pre-existing CI failures that your changes may worsen
@@ -1,151 +1,151 @@
1
- ---
2
- name: "architectural-proposals"
3
- description: "How to write comprehensive architectural proposals that drive alignment before code is written"
4
- domain: "architecture, product-direction"
5
- confidence: "high"
6
- source: "earned (2026-02-21 interactive shell proposal)"
7
- tools:
8
- - name: "view"
9
- description: "Read existing codebase, prior decisions, and team context before proposing changes"
10
- when: "Always read .mesh/decisions.md, relevant PRDs, and current architecture docs before writing proposal"
11
- - name: "create"
12
- description: "Create proposal in docs/proposals/ with structured format"
13
- when: "After gathering context, before any implementation work begins"
14
- ---
15
-
16
- ## Context
17
-
18
- Proposals create alignment before code is written. Cheaper to change a doc than refactor code. Use this pattern when:
19
- - Architecture shifts invalidate existing assumptions
20
- - Product direction changes require new foundation
21
- - Multiple waves/milestones will be affected by a decision
22
- - External dependencies (Copilot CLI, SDK APIs) change
23
-
24
- ## Patterns
25
-
26
- ### Proposal Structure (docs/proposals/)
27
-
28
- **Required sections:**
29
- 1. **Problem Statement** — Why current state is broken (specific, measurable evidence)
30
- 2. **Proposed Architecture** — Solution with technical specifics (not hand-waving)
31
- 3. **What Changes** — Impact on existing work (waves, milestones, modules)
32
- 4. **What Stays the Same** — Preserve existing functionality (no regression)
33
- 5. **Key Decisions Needed** — Explicit choices with recommendations
34
- 6. **Risks and Mitigations** — Likelihood + impact + mitigation strategy
35
- 7. **Scope** — What's in v1, what's deferred (timeline clarity)
36
-
37
- **Optional sections:**
38
- - Implementation Plan (high-level milestones)
39
- - Success Criteria (measurable outcomes)
40
- - Open Questions (unresolved items)
41
- - Appendix (prior art, alternatives considered)
42
-
43
- ### Tone Ceiling Enforcement
44
-
45
- **Always:**
46
- - Cite specific evidence (user reports, performance data, failure modes)
47
- - Justify recommendations with technical rationale
48
- - Acknowledge trade-offs (no perfect solutions)
49
- - Be specific about APIs, libraries, file paths
50
-
51
- **Never:**
52
- - Hype ("revolutionary", "game-changing")
53
- - Hand-waving ("we'll figure it out later")
54
- - Unsubstantiated claims ("users will love this")
55
- - Vague timelines ("soon", "eventually")
56
-
57
- ### Wave Restructuring Pattern
58
-
59
- When a proposal invalidates existing wave structure:
60
- 1. **Acknowledge the shift:** "This becomes Wave 0 (Foundation)"
61
- 2. **Cascade impacts:** Adjust downstream waves (Wave 1, Wave 2, Wave 3)
62
- 3. **Preserve non-blocking work:** Identify what can proceed in parallel
63
- 4. **Update dependencies:** Document new blocking relationships
64
-
65
- **Example (Interactive Shell):**
66
- - Wave 0 (NEW): Interactive Shell — blocks all other waves
67
- - Wave 1 (ADJUSTED): npm Distribution — shell bundled in cli.js
68
- - Wave 2 (DEFERRED): MeshUI — waits for shell foundation
69
- - Wave 3 (ADJUSTED): Public Docs — now documents shell as primary interface
70
-
71
- ### Decision Framing
72
-
73
- **Format:** "Recommendation: X (recommended) or alternatives?"
74
-
75
- **Components:**
76
- - Recommendation (pick one, justify)
77
- - Alternatives (what else was considered)
78
- - Decision rationale (why recommended option wins)
79
- - Needs sign-off from (which agents/roles must approve)
80
-
81
- **Example:**
82
- ```
83
- ### 1. Terminal UI Library: `ink` (recommended) or alternatives?
84
-
85
- **Recommendation:** `ink`
86
- **Alternatives:** `blessed`, raw readline
87
- **Decision rationale:** Component model enables testable UI. Battle-tested ecosystem.
88
-
89
- **Needs sign-off from:** Brady (product direction), Fortier (runtime performance)
90
- ```
91
-
92
- ### Risk Documentation
93
-
94
- **Format per risk:**
95
- - **Risk:** Specific failure mode
96
- - **Likelihood:** Low / Medium / High (not percentages)
97
- - **Impact:** Low / Medium / High
98
- - **Mitigation:** Concrete actions (measurable)
99
-
100
- **Example:**
101
- ```
102
- ### Risk 2: SDK Streaming Reliability
103
-
104
- **Risk:** SDK streaming events might drop messages or arrive out of order.
105
- **Likelihood:** Low (SDK is production-grade).
106
- **Impact:** High — broken streaming makes shell unusable.
107
-
108
- **Mitigation:**
109
- - Add integration test: Send 1000-message stream, verify all deltas arrive in order
110
- - Implement fallback: If streaming fails, fall back to polling session state
111
- - Log all SDK events to `.mesh/orchestration-log/sdk-events.jsonl` for debugging
112
- ```
113
-
114
- ## Examples
115
-
116
- **File references from interactive shell proposal:**
117
- - Full proposal: `docs/proposals/Mercury Mesh-interactive-shell.md`
118
- - User directive: `.mesh/decisions/inbox/copilot-directive-2026-02-21T202535Z.md`
119
- - Team decisions: `.mesh/decisions.md`
120
- - Current architecture: `docs/architecture/module-map.md`, `docs/prd-23-release-readiness.md`
121
-
122
- **Key patterns demonstrated:**
123
- 1. Read user directive first (understand the "why")
124
- 2. Survey current architecture (module map, existing waves)
125
- 3. Research SDK APIs (exploration task to validate feasibility)
126
- 4. Document problem with specific evidence (unreliable handoffs, zero visibility, UX mismatch)
127
- 5. Propose solution with technical specifics (ink components, SDK session management, spawn.ts module)
128
- 6. Restructure waves when foundation shifts (Wave 0 becomes blocker)
129
- 7. Preserve backward compatibility (mercury-mesh.agent.md still works, VS Code mode unchanged)
130
- 8. Frame decisions explicitly (5 key decisions with recommendations)
131
- 9. Document risks with mitigations (5 risks, each with concrete actions)
132
- 10. Define scope (what's in v1 vs. deferred)
133
-
134
- ## Anti-Patterns
135
-
136
- **Avoid:**
137
- - ❌ Proposals without problem statements (solution-first thinking)
138
- - ❌ Vague architecture ("we'll use a shell") — be specific (ink components, session registry, spawn.ts)
139
- - ❌ Ignoring existing work — always document impact on waves/milestones
140
- - ❌ No risk analysis — every architecture has risks, document them
141
- - ❌ Unbounded scope — draw the v1 line explicitly
142
- - ❌ Missing decision ownership — always say "needs sign-off from X"
143
- - ❌ No backward compatibility plan — users don't care about your replatform
144
- - ❌ Hand-waving timelines ("a few weeks") — be specific (2-3 weeks, 1 engineer full-time)
145
-
146
- **Red flags in proposal reviews:**
147
- - "Users will love this" (citation needed)
148
- - "We'll figure out X later" (scope creep incoming)
149
- - "This is revolutionary" (tone ceiling violation)
150
- - No section on "What Stays the Same" (regression risk)
151
- - No risks documented (wishful thinking)
1
+ ---
2
+ name: "architectural-proposals"
3
+ description: "How to write comprehensive architectural proposals that drive alignment before code is written"
4
+ domain: "architecture, product-direction"
5
+ confidence: "high"
6
+ source: "earned (2026-02-21 interactive shell proposal)"
7
+ tools:
8
+ - name: "view"
9
+ description: "Read existing codebase, prior decisions, and team context before proposing changes"
10
+ when: "Always read .mesh/decisions.md, relevant PRDs, and current architecture docs before writing proposal"
11
+ - name: "create"
12
+ description: "Create proposal in docs/proposals/ with structured format"
13
+ when: "After gathering context, before any implementation work begins"
14
+ ---
15
+
16
+ ## Context
17
+
18
+ Proposals create alignment before code is written. Cheaper to change a doc than refactor code. Use this pattern when:
19
+ - Architecture shifts invalidate existing assumptions
20
+ - Product direction changes require new foundation
21
+ - Multiple waves/milestones will be affected by a decision
22
+ - External dependencies (Copilot CLI, SDK APIs) change
23
+
24
+ ## Patterns
25
+
26
+ ### Proposal Structure (docs/proposals/)
27
+
28
+ **Required sections:**
29
+ 1. **Problem Statement** — Why current state is broken (specific, measurable evidence)
30
+ 2. **Proposed Architecture** — Solution with technical specifics (not hand-waving)
31
+ 3. **What Changes** — Impact on existing work (waves, milestones, modules)
32
+ 4. **What Stays the Same** — Preserve existing functionality (no regression)
33
+ 5. **Key Decisions Needed** — Explicit choices with recommendations
34
+ 6. **Risks and Mitigations** — Likelihood + impact + mitigation strategy
35
+ 7. **Scope** — What's in v1, what's deferred (timeline clarity)
36
+
37
+ **Optional sections:**
38
+ - Implementation Plan (high-level milestones)
39
+ - Success Criteria (measurable outcomes)
40
+ - Open Questions (unresolved items)
41
+ - Appendix (prior art, alternatives considered)
42
+
43
+ ### Tone Ceiling Enforcement
44
+
45
+ **Always:**
46
+ - Cite specific evidence (user reports, performance data, failure modes)
47
+ - Justify recommendations with technical rationale
48
+ - Acknowledge trade-offs (no perfect solutions)
49
+ - Be specific about APIs, libraries, file paths
50
+
51
+ **Never:**
52
+ - Hype ("revolutionary", "game-changing")
53
+ - Hand-waving ("we'll figure it out later")
54
+ - Unsubstantiated claims ("users will love this")
55
+ - Vague timelines ("soon", "eventually")
56
+
57
+ ### Wave Restructuring Pattern
58
+
59
+ When a proposal invalidates existing wave structure:
60
+ 1. **Acknowledge the shift:** "This becomes Wave 0 (Foundation)"
61
+ 2. **Cascade impacts:** Adjust downstream waves (Wave 1, Wave 2, Wave 3)
62
+ 3. **Preserve non-blocking work:** Identify what can proceed in parallel
63
+ 4. **Update dependencies:** Document new blocking relationships
64
+
65
+ **Example (Interactive Shell):**
66
+ - Wave 0 (NEW): Interactive Shell — blocks all other waves
67
+ - Wave 1 (ADJUSTED): npm Distribution — shell bundled in cli.js
68
+ - Wave 2 (DEFERRED): MeshUI — waits for shell foundation
69
+ - Wave 3 (ADJUSTED): Public Docs — now documents shell as primary interface
70
+
71
+ ### Decision Framing
72
+
73
+ **Format:** "Recommendation: X (recommended) or alternatives?"
74
+
75
+ **Components:**
76
+ - Recommendation (pick one, justify)
77
+ - Alternatives (what else was considered)
78
+ - Decision rationale (why recommended option wins)
79
+ - Needs sign-off from (which agents/roles must approve)
80
+
81
+ **Example:**
82
+ ```
83
+ ### 1. Terminal UI Library: `ink` (recommended) or alternatives?
84
+
85
+ **Recommendation:** `ink`
86
+ **Alternatives:** `blessed`, raw readline
87
+ **Decision rationale:** Component model enables testable UI. Battle-tested ecosystem.
88
+
89
+ **Needs sign-off from:** Brady (product direction), Fortier (runtime performance)
90
+ ```
91
+
92
+ ### Risk Documentation
93
+
94
+ **Format per risk:**
95
+ - **Risk:** Specific failure mode
96
+ - **Likelihood:** Low / Medium / High (not percentages)
97
+ - **Impact:** Low / Medium / High
98
+ - **Mitigation:** Concrete actions (measurable)
99
+
100
+ **Example:**
101
+ ```
102
+ ### Risk 2: SDK Streaming Reliability
103
+
104
+ **Risk:** SDK streaming events might drop messages or arrive out of order.
105
+ **Likelihood:** Low (SDK is production-grade).
106
+ **Impact:** High — broken streaming makes shell unusable.
107
+
108
+ **Mitigation:**
109
+ - Add integration test: Send 1000-message stream, verify all deltas arrive in order
110
+ - Implement fallback: If streaming fails, fall back to polling session state
111
+ - Log all SDK events to `.mesh/orchestration-log/sdk-events.jsonl` for debugging
112
+ ```
113
+
114
+ ## Examples
115
+
116
+ **File references from interactive shell proposal:**
117
+ - Full proposal: `docs/proposals/Mercury Mesh-interactive-shell.md`
118
+ - User directive: `.mesh/decisions/inbox/copilot-directive-2026-02-21T202535Z.md`
119
+ - Team decisions: `.mesh/decisions.md`
120
+ - Current architecture: `docs/architecture/module-map.md`, `docs/prd-23-release-readiness.md`
121
+
122
+ **Key patterns demonstrated:**
123
+ 1. Read user directive first (understand the "why")
124
+ 2. Survey current architecture (module map, existing waves)
125
+ 3. Research SDK APIs (exploration task to validate feasibility)
126
+ 4. Document problem with specific evidence (unreliable handoffs, zero visibility, UX mismatch)
127
+ 5. Propose solution with technical specifics (ink components, SDK session management, spawn.ts module)
128
+ 6. Restructure waves when foundation shifts (Wave 0 becomes blocker)
129
+ 7. Preserve backward compatibility (mercury-mesh.agent.md still works, VS Code mode unchanged)
130
+ 8. Frame decisions explicitly (5 key decisions with recommendations)
131
+ 9. Document risks with mitigations (5 risks, each with concrete actions)
132
+ 10. Define scope (what's in v1 vs. deferred)
133
+
134
+ ## Anti-Patterns
135
+
136
+ **Avoid:**
137
+ - ❌ Proposals without problem statements (solution-first thinking)
138
+ - ❌ Vague architecture ("we'll use a shell") — be specific (ink components, session registry, spawn.ts)
139
+ - ❌ Ignoring existing work — always document impact on waves/milestones
140
+ - ❌ No risk analysis — every architecture has risks, document them
141
+ - ❌ Unbounded scope — draw the v1 line explicitly
142
+ - ❌ Missing decision ownership — always say "needs sign-off from X"
143
+ - ❌ No backward compatibility plan — users don't care about your replatform
144
+ - ❌ Hand-waving timelines ("a few weeks") — be specific (2-3 weeks, 1 engineer full-time)
145
+
146
+ **Red flags in proposal reviews:**
147
+ - "Users will love this" (citation needed)
148
+ - "We'll figure out X later" (scope creep incoming)
149
+ - "This is revolutionary" (tone ceiling violation)
150
+ - No section on "What Stays the Same" (regression risk)
151
+ - No risks documented (wishful thinking)
@@ -1,84 +1,85 @@
1
- ---
2
- name: "ci-validation-gates"
3
- description: "Defensive CI/CD patterns: semver validation, token checks, retry logic, draft detection — earned from v0.8.22"
4
- domain: "ci-cd"
5
- confidence: "high"
6
- source: "extracted from Drucker and Trejo charters — earned knowledge from v0.8.22 release incident"
7
- ---
8
-
9
- ## Context
10
-
11
- CI workflows must be defensive. These patterns were learned from the v0.8.22 release disaster where invalid semver, wrong token types, missing retry logic, and draft releases caused a multi-hour outage. Both Drucker (CI/CD) and Trejo (Release Manager) carried this knowledge in their charters — now centralized here.
12
-
13
- ## Patterns
14
-
15
- ### Semver Validation Gate
16
- Every publish workflow MUST validate version format before `npm publish`. 4-part versions (e.g., 0.8.21.4) are NOT valid semver — npm mangles them.
17
-
18
- ```yaml
19
- - name: Validate semver
20
- run: |
21
- VERSION="${{ github.event.release.tag_name }}"
22
- VERSION="${VERSION#v}"
23
- if ! npx semver "$VERSION" > /dev/null 2>&1; then
24
- echo "❌ Invalid semver: $VERSION"
25
- echo "Only 3-part versions (X.Y.Z) or prerelease (X.Y.Z-tag.N) are valid."
26
- exit 1
27
- fi
28
- echo "✅ Valid semver: $VERSION"
29
- ```
30
-
31
- ### NPM Token Type Verification
32
- NPM_TOKEN MUST be an Automation token, not a User token with 2FA:
33
- - User tokens require OTP CI can't provide it → EOTP error
34
- - Create Automation tokens at npmjs.com Settings Access Tokens Automation
35
- - Verify before first publish in any workflow
36
-
37
- ### Retry Logic for npm Registry Propagation
38
- npm registry uses eventual consistency. After `npm publish` succeeds, the package may not be immediately queryable.
39
- - Propagation: typically 5-30s, up to 2min in rare cases
40
- - All verify steps: 5 attempts, 15-second intervals
41
- - Log each attempt: "Attempt 1/5: Checking package..."
42
- - Exit loop on success, fail after max attempts
43
-
44
- ```yaml
45
- - name: Verify package (with retry)
46
- run: |
47
- MAX_ATTEMPTS=5
48
- WAIT_SECONDS=15
49
- for attempt in $(seq 1 $MAX_ATTEMPTS); do
50
- echo "Attempt $attempt/$MAX_ATTEMPTS: Checking $PACKAGE@$VERSION..."
51
- if npm view "$PACKAGE@$VERSION" version > /dev/null 2>&1; then
52
- echo " Package verified"
53
- exit 0
54
- fi
55
- [ $attempt -lt $MAX_ATTEMPTS ] && sleep $WAIT_SECONDS
56
- done
57
- echo "❌ Failed to verify after $MAX_ATTEMPTS attempts"
58
- exit 1
59
- ```
60
-
61
- ### Draft Release Detection
62
- Draft releases don't emit `release: published` event. Workflows MUST:
63
- - Trigger on `release: published` (NOT `created`)
64
- - If using workflow_dispatch: verify release is published via GitHub API before proceeding
65
-
66
- ### Build Script Protection
67
- Set `SKIP_BUILD_BUMP=1` (or `$env:SKIP_BUILD_BUMP = "1"` on Windows) before ANY release build. bump-build.mjs is for dev builds ONLY — it silently mutates versions.
68
-
69
- ## Known Failure Modes (v0.8.22 Incident)
70
-
71
- | # | What Happened | Root Cause | Prevention |
72
- |---|---------------|-----------|------------|
73
- | 1 | 4-part version published, npm mangled it | No semver validation gate | `npx semver` check before every publish |
74
- | 2 | CI failed 5+ times with EOTP | User token with 2FA | Automation token only |
75
- | 3 | Verify returned false 404 | No retry logic for propagation | 5 attempts, 15s intervals |
76
- | 4 | Workflow never triggered | Draft release doesn't emit event | Never create draft releases |
77
- | 5 | Version mutated during release | bump-build.mjs ran in release | SKIP_BUILD_BUMP=1 |
78
-
79
- ## Anti-Patterns
80
- - ❌ Publishing without semver validation gate
81
- - ❌ Single-shot verification without retry
82
- - ❌ Hard-coded secrets in workflows
83
- - ❌ Silent CI failures — every error needs actionable output with remediation
84
- - ❌ Assuming npm publish is instantly queryable
1
+ ---
2
+ name: "ci-validation-gates"
3
+ description: "Defensive CI/CD patterns: semver validation, token checks, retry logic, draft detection — earned from v0.8.22"
4
+ domain: "ci-cd"
5
+ confidence: "high"
6
+ source: "extracted from Drucker and Trejo charters — earned knowledge from v0.8.22 release incident"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ CI workflows must be defensive. These patterns were learned from the v0.8.22 release disaster where invalid semver, wrong token types, missing retry logic, and draft releases caused a multi-hour outage. Both Drucker (CI/CD) and Trejo (Release Manager) carried this knowledge in their charters — now centralized here.
12
+
13
+ ## Patterns
14
+
15
+ ### Semver Validation Gate
16
+ Every publish workflow MUST validate version format before `npm publish`. 4-part versions (e.g., 0.8.21.4) are NOT valid semver — npm mangles them.
17
+
18
+ ```yaml
19
+ - name: Validate semver
20
+ run: |
21
+ VERSION="${{ github.event.release.tag_name }}"
22
+ VERSION="${VERSION#v}"
23
+ if ! npx semver "$VERSION" > /dev/null 2>&1; then
24
+ echo "❌ Invalid semver: $VERSION"
25
+ echo "Only 3-part versions (X.Y.Z) or prerelease (X.Y.Z-tag.N) are valid."
26
+ exit 1
27
+ fi
28
+ echo "✅ Valid semver: $VERSION"
29
+ ```
30
+
31
+ ### Publish Authentication Verification
32
+ Prefer npm trusted publishing via OIDC for GitHub Actions:
33
+ - Trusted publishing removes long-lived write tokens from CI entirely
34
+ - Configure npm package settings to trust GitHub repo `mizyoel/mercury-mesh` and workflow `publish.yml`
35
+ - If token fallback is required, `NPM_TOKEN` must be a granular write token with bypass 2FA enabled
36
+ - User tokens that still require OTP will fail in CI with `EOTP`
37
+
38
+ ### Retry Logic for npm Registry Propagation
39
+ npm registry uses eventual consistency. After `npm publish` succeeds, the package may not be immediately queryable.
40
+ - Propagation: typically 5-30s, up to 2min in rare cases
41
+ - All verify steps: 5 attempts, 15-second intervals
42
+ - Log each attempt: "Attempt 1/5: Checking package..."
43
+ - Exit loop on success, fail after max attempts
44
+
45
+ ```yaml
46
+ - name: Verify package (with retry)
47
+ run: |
48
+ MAX_ATTEMPTS=5
49
+ WAIT_SECONDS=15
50
+ for attempt in $(seq 1 $MAX_ATTEMPTS); do
51
+ echo "Attempt $attempt/$MAX_ATTEMPTS: Checking $PACKAGE@$VERSION..."
52
+ if npm view "$PACKAGE@$VERSION" version > /dev/null 2>&1; then
53
+ echo "✅ Package verified"
54
+ exit 0
55
+ fi
56
+ [ $attempt -lt $MAX_ATTEMPTS ] && sleep $WAIT_SECONDS
57
+ done
58
+ echo "❌ Failed to verify after $MAX_ATTEMPTS attempts"
59
+ exit 1
60
+ ```
61
+
62
+ ### Draft Release Detection
63
+ Draft releases don't emit `release: published` event. Workflows MUST:
64
+ - Trigger on `release: published` (NOT `created`)
65
+ - If using workflow_dispatch: verify release is published via GitHub API before proceeding
66
+
67
+ ### Build Script Protection
68
+ Set `SKIP_BUILD_BUMP=1` (or `$env:SKIP_BUILD_BUMP = "1"` on Windows) before ANY release build. bump-build.mjs is for dev builds ONLY — it silently mutates versions.
69
+
70
+ ## Known Failure Modes (v0.8.22 Incident)
71
+
72
+ | # | What Happened | Root Cause | Prevention |
73
+ |---|---------------|-----------|------------|
74
+ | 1 | 4-part version published, npm mangled it | No semver validation gate | `npx semver` check before every publish |
75
+ | 2 | CI failed 5+ times with EOTP | Token required OTP in CI | Trusted publishing or granular token with bypass 2FA |
76
+ | 3 | Verify returned false 404 | No retry logic for propagation | 5 attempts, 15s intervals |
77
+ | 4 | Workflow never triggered | Draft release doesn't emit event | Never create draft releases |
78
+ | 5 | Version mutated during release | bump-build.mjs ran in release | SKIP_BUILD_BUMP=1 |
79
+
80
+ ## Anti-Patterns
81
+ - ❌ Publishing without semver validation gate
82
+ - ❌ Single-shot verification without retry
83
+ - ❌ Hard-coded secrets in workflows
84
+ - ❌ Silent CI failures every error needs actionable output with remediation
85
+ - ❌ Assuming npm publish is instantly queryable