@mizyoel/mercury-mesh 0.9.4

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 (128) hide show
  1. package/.copilot/mcp-config.json +14 -0
  2. package/.copilot/skills/agent-collaboration/SKILL.md +42 -0
  3. package/.copilot/skills/agent-conduct/SKILL.md +24 -0
  4. package/.copilot/skills/architectural-proposals/SKILL.md +151 -0
  5. package/.copilot/skills/ci-validation-gates/SKILL.md +84 -0
  6. package/.copilot/skills/cli-wiring/SKILL.md +47 -0
  7. package/.copilot/skills/client-compatibility/SKILL.md +89 -0
  8. package/.copilot/skills/cross-mesh/SKILL.md +114 -0
  9. package/.copilot/skills/distributed-mesh/SKILL.md +287 -0
  10. package/.copilot/skills/distributed-mesh/mesh.json.example +30 -0
  11. package/.copilot/skills/distributed-mesh/sync-mesh.ps1 +111 -0
  12. package/.copilot/skills/distributed-mesh/sync-mesh.sh +104 -0
  13. package/.copilot/skills/docs-standards/SKILL.md +71 -0
  14. package/.copilot/skills/economy-mode/SKILL.md +101 -0
  15. package/.copilot/skills/external-comms/SKILL.md +331 -0
  16. package/.copilot/skills/gh-auth-isolation/SKILL.md +183 -0
  17. package/.copilot/skills/git-workflow/SKILL.md +206 -0
  18. package/.copilot/skills/github-multi-account/SKILL.md +95 -0
  19. package/.copilot/skills/history-hygiene/SKILL.md +36 -0
  20. package/.copilot/skills/humanizer/SKILL.md +107 -0
  21. package/.copilot/skills/init-mode/SKILL.md +101 -0
  22. package/.copilot/skills/mesh-conventions/SKILL.md +69 -0
  23. package/.copilot/skills/model-selection/SKILL.md +139 -0
  24. package/.copilot/skills/nap/SKILL.md +24 -0
  25. package/.copilot/skills/personal-mesh/SKILL.md +57 -0
  26. package/.copilot/skills/project-conventions/SKILL.md +56 -0
  27. package/.copilot/skills/release-process/SKILL.md +435 -0
  28. package/.copilot/skills/reskill/SKILL.md +92 -0
  29. package/.copilot/skills/reviewer-protocol/SKILL.md +79 -0
  30. package/.copilot/skills/secret-handling/SKILL.md +200 -0
  31. package/.copilot/skills/session-recovery/SKILL.md +155 -0
  32. package/.copilot/skills/test-discipline/SKILL.md +37 -0
  33. package/.copilot/skills/windows-compatibility/SKILL.md +74 -0
  34. package/.github/agents/mercury-mesh.agent.md +1732 -0
  35. package/.mesh/manifesto.md +66 -0
  36. package/.mesh/templates/casting/Futurama.json +10 -0
  37. package/.mesh/templates/casting-history.json +4 -0
  38. package/.mesh/templates/casting-policy.json +37 -0
  39. package/.mesh/templates/casting-reference.md +104 -0
  40. package/.mesh/templates/casting-registry.json +3 -0
  41. package/.mesh/templates/ceremonies.md +41 -0
  42. package/.mesh/templates/charter.md +56 -0
  43. package/.mesh/templates/constraint-tracking.md +38 -0
  44. package/.mesh/templates/cooperative-rate-limiting.md +229 -0
  45. package/.mesh/templates/copilot-instructions.md +50 -0
  46. package/.mesh/templates/department-backlog.md +15 -0
  47. package/.mesh/templates/department-charter.md +27 -0
  48. package/.mesh/templates/department-state.json +19 -0
  49. package/.mesh/templates/history.md +10 -0
  50. package/.mesh/templates/identity/now.md +9 -0
  51. package/.mesh/templates/identity/wisdom.md +15 -0
  52. package/.mesh/templates/interface-contract.md +26 -0
  53. package/.mesh/templates/issue-lifecycle.md +421 -0
  54. package/.mesh/templates/keda-scaler.md +166 -0
  55. package/.mesh/templates/machine-capabilities.md +77 -0
  56. package/.mesh/templates/mcp-config.md +90 -0
  57. package/.mesh/templates/mercury-mesh.agent.md +1732 -0
  58. package/.mesh/templates/multi-agent-format.md +28 -0
  59. package/.mesh/templates/orchestration-log.md +27 -0
  60. package/.mesh/templates/org-autonomy-spec.md +152 -0
  61. package/.mesh/templates/org-backlog-from-triage.js +199 -0
  62. package/.mesh/templates/org-runtime-reconcile.js +364 -0
  63. package/.mesh/templates/org-seed-runtime.js +238 -0
  64. package/.mesh/templates/org-status.js +193 -0
  65. package/.mesh/templates/org-structure.json +38 -0
  66. package/.mesh/templates/package.json +3 -0
  67. package/.mesh/templates/plugin-marketplace.md +49 -0
  68. package/.mesh/templates/ralph-circuit-breaker.md +313 -0
  69. package/.mesh/templates/ralph-triage.js +844 -0
  70. package/.mesh/templates/raw-agent-output.md +37 -0
  71. package/.mesh/templates/roster.md +60 -0
  72. package/.mesh/templates/routing.md +78 -0
  73. package/.mesh/templates/run-output.md +50 -0
  74. package/.mesh/templates/schedule.json +64 -0
  75. package/.mesh/templates/scribe-charter.md +119 -0
  76. package/.mesh/templates/skill.md +24 -0
  77. package/.mesh/templates/skills/agent-collaboration/SKILL.md +42 -0
  78. package/.mesh/templates/skills/agent-conduct/SKILL.md +24 -0
  79. package/.mesh/templates/skills/architectural-proposals/SKILL.md +151 -0
  80. package/.mesh/templates/skills/ci-validation-gates/SKILL.md +84 -0
  81. package/.mesh/templates/skills/cli-wiring/SKILL.md +47 -0
  82. package/.mesh/templates/skills/client-compatibility/SKILL.md +89 -0
  83. package/.mesh/templates/skills/cross-mesh/SKILL.md +114 -0
  84. package/.mesh/templates/skills/distributed-mesh/SKILL.md +287 -0
  85. package/.mesh/templates/skills/distributed-mesh/mesh.json.example +30 -0
  86. package/.mesh/templates/skills/distributed-mesh/sync-mesh.ps1 +111 -0
  87. package/.mesh/templates/skills/distributed-mesh/sync-mesh.sh +104 -0
  88. package/.mesh/templates/skills/docs-standards/SKILL.md +71 -0
  89. package/.mesh/templates/skills/economy-mode/SKILL.md +101 -0
  90. package/.mesh/templates/skills/external-comms/SKILL.md +331 -0
  91. package/.mesh/templates/skills/gh-auth-isolation/SKILL.md +183 -0
  92. package/.mesh/templates/skills/git-workflow/SKILL.md +204 -0
  93. package/.mesh/templates/skills/github-multi-account/SKILL.md +95 -0
  94. package/.mesh/templates/skills/history-hygiene/SKILL.md +36 -0
  95. package/.mesh/templates/skills/humanizer/SKILL.md +107 -0
  96. package/.mesh/templates/skills/init-mode/SKILL.md +101 -0
  97. package/.mesh/templates/skills/mesh-conventions/SKILL.md +69 -0
  98. package/.mesh/templates/skills/model-selection/SKILL.md +139 -0
  99. package/.mesh/templates/skills/nap/SKILL.md +24 -0
  100. package/.mesh/templates/skills/personal-mesh/SKILL.md +57 -0
  101. package/.mesh/templates/skills/project-conventions/SKILL.md +56 -0
  102. package/.mesh/templates/skills/release-process/SKILL.md +435 -0
  103. package/.mesh/templates/skills/reskill/SKILL.md +92 -0
  104. package/.mesh/templates/skills/reviewer-protocol/SKILL.md +79 -0
  105. package/.mesh/templates/skills/secret-handling/SKILL.md +200 -0
  106. package/.mesh/templates/skills/session-recovery/SKILL.md +155 -0
  107. package/.mesh/templates/skills/test-discipline/SKILL.md +37 -0
  108. package/.mesh/templates/skills/windows-compatibility/SKILL.md +74 -0
  109. package/.mesh/templates/workflows/mesh-ci.yml +24 -0
  110. package/.mesh/templates/workflows/mesh-docs.yml +54 -0
  111. package/.mesh/templates/workflows/mesh-heartbeat.yml +237 -0
  112. package/.mesh/templates/workflows/mesh-insider-release.yml +61 -0
  113. package/.mesh/templates/workflows/mesh-issue-assign.yml +243 -0
  114. package/.mesh/templates/workflows/mesh-label-enforce.yml +181 -0
  115. package/.mesh/templates/workflows/mesh-preview.yml +55 -0
  116. package/.mesh/templates/workflows/mesh-promote.yml +120 -0
  117. package/.mesh/templates/workflows/mesh-release.yml +77 -0
  118. package/.mesh/templates/workflows/mesh-triage.yml +383 -0
  119. package/.mesh/templates/workflows/sync-mesh-labels.yml +204 -0
  120. package/README.md +640 -0
  121. package/bin/mercury-mesh.cjs +317 -0
  122. package/docs/brand-language.md +287 -0
  123. package/docs/commander-onboarding.md +462 -0
  124. package/docs/mercury-mesh-runtime-rename-impact.md +148 -0
  125. package/docs/persona-manifesto.md +114 -0
  126. package/docs/scenarios/client-compatibility.md +59 -0
  127. package/index.cjs +41 -0
  128. package/package.json +43 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "mcpServers": {
3
+ "EXAMPLE-github": {
4
+ "command": "npx",
5
+ "args": [
6
+ "-y",
7
+ "@anthropic/github-mcp-server"
8
+ ],
9
+ "env": {
10
+ "GITHUB_TOKEN": "${GITHUB_TOKEN}"
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +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
@@ -0,0 +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
@@ -0,0 +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)
@@ -0,0 +1,84 @@
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
@@ -0,0 +1,47 @@
1
+ # Skill: CLI Command Wiring
2
+
3
+ **Bug class:** Commands implemented in `packages/Mercury Mesh-cli/src/cli/commands/` but never routed in `cli-entry.ts`.
4
+
5
+ ## Checklist — Adding a New CLI Command
6
+
7
+ 1. **Create command file** in `packages/Mercury Mesh-cli/src/cli/commands/<name>.ts`
8
+ - Export a `run<Name>(cwd, options)` async function (or class with static methods for utility modules)
9
+
10
+ 2. **Add routing block** in `packages/Mercury Mesh-cli/src/cli-entry.ts` inside `main()`:
11
+ ```ts
12
+ if (cmd === '<name>') {
13
+ const { run<Name> } = await import('./cli/commands/<name>.js');
14
+ // parse args, call function
15
+ await run<Name>(process.cwd(), options);
16
+ return;
17
+ }
18
+ ```
19
+
20
+ 3. **Add help text** in the help section of `cli-entry.ts` (search for `Commands:`):
21
+ ```ts
22
+ console.log(` ${BOLD}<name>${RESET} <description>`);
23
+ console.log(` Usage: <name> [flags]`);
24
+ ```
25
+
26
+ 4. **Verify both exist** — the recurring bug is doing step 1 but missing steps 2-3.
27
+
28
+ ## Wiring Patterns by Command Type
29
+
30
+ | Type | Example | How to wire |
31
+ |------|---------|-------------|
32
+ | Standard command | `export.ts`, `build.ts` | `run*()` function, parse flags from `args` |
33
+ | Placeholder command | `loop`, `hire` | Inline in cli-entry.ts, prints pending message |
34
+ | Utility/check module | `rc-tunnel.ts`, `copilot-bridge.ts` | Wire as diagnostic check (e.g., `isDevtunnelAvailable()`) |
35
+ | Subcommand of another | `init-remote.ts` | Already used inside parent + standalone alias |
36
+
37
+ ## Common Import Pattern
38
+
39
+ ```ts
40
+ import { BOLD, RESET, DIM, RED, GREEN, YELLOW } from './cli/core/output.js';
41
+ ```
42
+
43
+ Use dynamic `await import()` for command modules to keep startup fast (lazy loading).
44
+
45
+ ## History
46
+
47
+ - **#237 / PR #244:** 4 commands wired (rc, copilot-bridge, init-remote, rc-tunnel). aspire, link, loop, hire were already present.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: "client-compatibility"
3
+ description: "Platform detection and adaptive spawning for CLI vs VS Code vs other surfaces"
4
+ domain: "orchestration"
5
+ confidence: "high"
6
+ source: "extracted"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Mercury Mesh runs on multiple Copilot surfaces (CLI, VS Code, JetBrains, GitHub.com). The coordinator must detect its platform and adapt spawning behavior accordingly. Different tools are available on different platforms, requiring conditional logic for agent spawning, SQL usage, and response timing.
12
+
13
+ ## Patterns
14
+
15
+ ### Platform Detection
16
+
17
+ Before spawning agents, determine the platform by checking available tools:
18
+
19
+ 1. **CLI mode** — `task` tool is available → full spawning control. Use `task` with `agent_type`, `mode`, `model`, `description`, `prompt` parameters. Collect results via `read_agent`.
20
+
21
+ 2. **VS Code mode** — `runSubagent` or `agent` tool is available → conditional behavior. Use `runSubagent` with the task prompt. Drop `agent_type`, `mode`, and `model` parameters. Multiple subagents in one turn run concurrently (equivalent to background mode). Results return automatically — no `read_agent` needed.
22
+
23
+ 3. **Fallback mode** — neither `task` nor `runSubagent`/`agent` available → work inline. Do not apologize or explain the limitation. Execute the task directly.
24
+
25
+ If both `task` and `runSubagent` are available, prefer `task` (richer parameter surface).
26
+
27
+ ### VS Code Spawn Adaptations
28
+
29
+ When in VS Code mode, the coordinator changes behavior in these ways:
30
+
31
+ - **Spawning tool:** Use `runSubagent` instead of `task`. The prompt is the only required parameter — pass the full agent prompt (charter, identity, task, hygiene, response order) exactly as you would on CLI.
32
+ - **Parallelism:** Spawn ALL concurrent agents in a SINGLE turn. They run in parallel automatically. This replaces `mode: "background"` + `read_agent` polling.
33
+ - **Model selection:** Accept the session model. Do NOT attempt per-spawn model selection or fallback chains — they only work on CLI. In Phase 1, all subagents use whatever model the user selected in VS Code's model picker.
34
+ - **Scribe:** Cannot fire-and-forget. Batch Scribe as the LAST subagent in any parallel group. Scribe is light work (file ops only), so the blocking is tolerable.
35
+ - **Launch table:** Skip it. Results arrive with the response, not separately. By the time the coordinator speaks, the work is already done.
36
+ - **`read_agent`:** Skip entirely. Results return automatically when subagents complete.
37
+ - **`agent_type`:** Drop it. All VS Code subagents have full tool access by default. Subagents inherit the parent's tools.
38
+ - **`description`:** Drop it. The agent name is already in the prompt.
39
+ - **Prompt content:** Keep ALL prompt structure — charter, identity, task, hygiene, response order blocks are surface-independent.
40
+
41
+ ### Feature Degradation Table
42
+
43
+ | Feature | CLI | VS Code | Degradation |
44
+ |---------|-----|---------|-------------|
45
+ | Parallel fan-out | `mode: "background"` + `read_agent` | Multiple subagents in one turn | None — equivalent concurrency |
46
+ | Model selection | Per-spawn `model` param (4-layer hierarchy) | Session model only (Phase 1) | Accept session model, log intent |
47
+ | Scribe fire-and-forget | Background, never read | Sync, must wait | Batch with last parallel group |
48
+ | Launch table UX | Show table → results later | Skip table → results with response | UX only — results are correct |
49
+ | SQL tool | Available | Not available | Avoid SQL in cross-platform code paths |
50
+ | Response order bug | Critical workaround | Possibly necessary (unverified) | Keep the block — harmless if unnecessary |
51
+
52
+ ### SQL Tool Caveat
53
+
54
+ The `sql` tool is **CLI-only**. It does not exist on VS Code, JetBrains, or GitHub.com. Any coordinator logic or agent workflow that depends on SQL (todo tracking, batch processing, session state) will silently fail on non-CLI surfaces. Cross-platform code paths must not depend on SQL. Use filesystem-based state (`.mesh/` files) for anything that must work everywhere.
55
+
56
+ ## Examples
57
+
58
+ **Example 1: CLI parallel spawn**
59
+ ```typescript
60
+ // Coordinator detects task tool available → CLI mode
61
+ task({ agent_type: "general-purpose", mode: "background", model: "claude-sonnet-4.5", ... })
62
+ task({ agent_type: "general-purpose", mode: "background", model: "claude-haiku-4.5", ... })
63
+ // Later: read_agent for both
64
+ ```
65
+
66
+ **Example 2: VS Code parallel spawn**
67
+ ```typescript
68
+ // Coordinator detects runSubagent available → VS Code mode
69
+ runSubagent({ prompt: "...Fenster charter + task..." })
70
+ runSubagent({ prompt: "...Hockney charter + task..." })
71
+ runSubagent({ prompt: "...Scribe charter + task..." }) // Last in group
72
+ // Results return automatically, no read_agent
73
+ ```
74
+
75
+ **Example 3: Fallback mode**
76
+ ```typescript
77
+ // Neither task nor runSubagent available → work inline
78
+ // Coordinator executes the task directly without spawning
79
+ ```
80
+
81
+ ## Anti-Patterns
82
+
83
+ - ❌ Using SQL tool in cross-platform workflows (breaks on VS Code/JetBrains/GitHub.com)
84
+ - ❌ Attempting per-spawn model selection on VS Code (Phase 1 — only session model works)
85
+ - ❌ Fire-and-forget Scribe on VS Code (must batch as last subagent)
86
+ - ❌ Showing launch table on VS Code (results already inline)
87
+ - ❌ Apologizing or explaining platform limitations to the user
88
+ - ❌ Using `task` when only `runSubagent` is available
89
+ - ❌ Dropping prompt structure (charter/identity/task) on non-CLI platforms
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: "cross-Mercury Mesh"
3
+ description: "Coordinating work across multiple Mercury Mesh instances"
4
+ domain: "orchestration"
5
+ confidence: "medium"
6
+ source: "manual"
7
+ tools:
8
+ - name: "Mercury Mesh-discover"
9
+ description: "List known meshes and their capabilities"
10
+ when: "When you need to find which Mercury Mesh can handle a task"
11
+ - name: "Mercury Mesh-delegate"
12
+ description: "Create work in another Mercury Mesh's repository"
13
+ when: "When a task belongs to another Mercury Mesh's domain"
14
+ ---
15
+
16
+ ## Context
17
+ When an organization runs multiple Mercury Mesh instances (e.g., platform-Mercury Mesh, frontend-Mercury Mesh, data-Mercury Mesh), those meshes need to discover each other, share context, and hand off work across repository boundaries. This skill teaches agents how to coordinate across meshes without creating tight coupling.
18
+
19
+ Cross-Mercury Mesh orchestration applies when:
20
+ - A task requires capabilities owned by another Mercury Mesh
21
+ - An architectural decision affects multiple meshes
22
+ - A feature spans multiple repositories with different meshes
23
+ - A Mercury Mesh needs to request infrastructure, tooling, or support from another Mercury Mesh
24
+
25
+ ## Patterns
26
+
27
+ ### Discovery via Manifest
28
+ Each Mercury Mesh publishes a `.mesh/manifest.json` declaring its name, capabilities, and contact information. meshes discover each other through:
29
+ 1. **Well-known paths**: Check `.mesh/manifest.json` in known org repos
30
+ 2. **Upstream config**: meshes already listed in `.mesh/upstream.json` are checked for manifests
31
+ 3. **Explicit registry**: A central `mesh-registry.json` can list all meshes in an org
32
+
33
+ ```json
34
+ {
35
+ "name": "platform-Mercury Mesh",
36
+ "version": "1.0.0",
37
+ "description": "Platform infrastructure team",
38
+ "capabilities": ["kubernetes", "helm", "monitoring", "ci-cd"],
39
+ "contact": {
40
+ "repo": "org/platform",
41
+ "labels": ["Mercury Mesh:platform"]
42
+ },
43
+ "accepts": ["issues", "prs"],
44
+ "skills": ["helm-developer", "operator-developer", "pipeline-engineer"]
45
+ }
46
+ ```
47
+
48
+ ### Context Sharing
49
+ When delegating work, share only what the target Mercury Mesh needs:
50
+ - **Capability list**: What this Mercury Mesh can do (from manifest)
51
+ - **Relevant decisions**: Only decisions that affect the target Mercury Mesh
52
+ - **Handoff context**: A concise description of why this work is being delegated
53
+
54
+ Do NOT share:
55
+ - Internal team state (casting history, session logs)
56
+ - Full decision archives (send only relevant excerpts)
57
+ - Authentication credentials or secrets
58
+
59
+ ### Work Handoff Protocol
60
+ 1. **Check manifest**: Verify the target Mercury Mesh accepts the work type (issues, PRs)
61
+ 2. **Create issue**: Use `gh issue create` in the target repo with:
62
+ - Title: `[cross-Mercury Mesh] <description>`
63
+ - Label: `Mercury Mesh:cross-Mercury Mesh` (or the Mercury Mesh's configured label)
64
+ - Body: Context, acceptance criteria, and link back to originating issue
65
+ 3. **Track**: Record the cross-Mercury Mesh issue URL in the originating Mercury Mesh's orchestration log
66
+ 4. **Poll**: Periodically check if the delegated issue is closed/completed
67
+
68
+ ### Feedback Loop
69
+ Track delegated work completion:
70
+ - Poll target issue status via `gh issue view`
71
+ - Update originating issue with status changes
72
+ - Close the feedback loop when delegated work merges
73
+
74
+ ## Examples
75
+
76
+ ### Discovering meshes
77
+ ```bash
78
+ # List all meshes discoverable from upstreams and known repos
79
+ Mercury Mesh discover
80
+
81
+ # Output:
82
+ # platform-Mercury Mesh → org/platform (kubernetes, helm, monitoring)
83
+ # frontend-Mercury Mesh → org/frontend (react, nextjs, storybook)
84
+ # data-Mercury Mesh → org/data (spark, airflow, dbt)
85
+ ```
86
+
87
+ ### Delegating work
88
+ ```bash
89
+ # Delegate a task to the platform Mercury Mesh
90
+ Mercury Mesh delegate platform-Mercury Mesh "Add Prometheus metrics endpoint for the auth service"
91
+
92
+ # Creates issue in org/platform with cross-Mercury Mesh label and context
93
+ ```
94
+
95
+ ### Manifest in Mercury Mesh.config.ts
96
+ ```typescript
97
+ export default defineMercury Mesh({
98
+ manifest: {
99
+ name: 'platform-Mercury Mesh',
100
+ capabilities: ['kubernetes', 'helm'],
101
+ contact: { repo: 'org/platform', labels: ['Mercury Mesh:platform'] },
102
+ accepts: ['issues', 'prs'],
103
+ skills: ['helm-developer', 'operator-developer'],
104
+ },
105
+ });
106
+ ```
107
+
108
+ ## Anti-Patterns
109
+ - **Direct file writes across repos** — Never modify another Mercury Mesh's `.mesh/` directory. Use issues and PRs as the communication protocol.
110
+ - **Tight coupling** — Don't depend on another Mercury Mesh's internal structure. Use the manifest as the public API contract.
111
+ - **Unbounded delegation** — Always include acceptance criteria and a timeout. Don't create open-ended requests.
112
+ - **Skipping discovery** — Don't hardcode Mercury Mesh locations. Use manifests and the discovery protocol.
113
+ - **Sharing secrets** — Never include credentials, tokens, or internal URLs in cross-Mercury Mesh issues.
114
+ - **Circular delegation** — Track delegation chains. If Mercury Mesh A delegates to B which delegates back to A, something is wrong.