@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,204 @@
1
+ ---
2
+ name: "git-workflow"
3
+ description: "Mercury Mesh branching model: dev-first workflow with insiders preview channel"
4
+ domain: "version-control"
5
+ confidence: "high"
6
+ source: "team-decision"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ Mercury Mesh uses a three-branch model. **All feature work starts from `dev`, not `main`.**
12
+
13
+ | Branch | Purpose | Publishes |
14
+ |--------|---------|-----------|
15
+ | `main` | Released, tagged, in-npm code only | `npm publish` on tag |
16
+ | `dev` | Integration branch โ€” all feature work lands here | `npm publish --tag preview` on merge |
17
+ | `insiders` | Early-access channel โ€” synced from dev | `npm publish --tag insiders` on sync |
18
+
19
+ ## Branch Naming Convention
20
+
21
+ Issue branches MUST use: `mesh/{issue-number}-{kebab-case-slug}`
22
+
23
+ Examples:
24
+ - `Mercury Mesh/195-fix-version-stamp-bug`
25
+ - `mesh/42-add-profile-api`
26
+
27
+ ## Workflow for Issue Work
28
+
29
+ 1. **Branch from dev:**
30
+ ```bash
31
+ git checkout dev
32
+ git pull origin dev
33
+ git checkout -b mesh/{issue-number}-{slug}
34
+ ```
35
+
36
+ 2. **Mark issue in-progress:**
37
+ ```bash
38
+ gh issue edit {number} --add-label "status:in-progress"
39
+ ```
40
+
41
+ 3. **Create draft PR targeting dev:**
42
+ ```bash
43
+ gh pr create --base dev --title "{description}" --body "Closes #{issue-number}" --draft
44
+ ```
45
+
46
+ 4. **Do the work.** Make changes, write tests, commit with issue reference.
47
+
48
+ 5. **Push and mark ready:**
49
+ ```bash
50
+ git push -u origin mesh/{issue-number}-{slug}
51
+ gh pr ready
52
+ ```
53
+
54
+ 6. **After merge to dev:**
55
+ ```bash
56
+ git checkout dev
57
+ git pull origin dev
58
+ git branch -d mesh/{issue-number}-{slug}
59
+ git push origin --delete mesh/{issue-number}-{slug}
60
+ ```
61
+
62
+ ## Parallel Multi-Issue Work (Worktrees)
63
+
64
+ When the coordinator routes multiple issues simultaneously (e.g., "fix bugs X, Y, and Z"), use `git worktree` to give each agent an isolated working directory. No filesystem collisions, no branch-switching overhead.
65
+
66
+ ### When to Use Worktrees vs Sequential
67
+
68
+ | Scenario | Strategy |
69
+ |----------|----------|
70
+ | Single issue | Standard workflow above โ€” no worktree needed |
71
+ | 2+ simultaneous issues in same repo | Worktrees โ€” one per issue |
72
+ | Work spanning multiple repos | Separate clones as siblings (see Multi-Repo below) |
73
+
74
+ ### Setup
75
+
76
+ From the main clone (must be on dev or any branch):
77
+
78
+ ```bash
79
+ # Ensure dev is current
80
+ git fetch origin dev
81
+
82
+ # Create a worktree per issue โ€” siblings to the main clone
83
+ git worktree add ../Mercury Mesh-195 -b Mercury Mesh/195-fix-stamp-bug origin/dev
84
+ git worktree add ../Mercury Mesh-193 -b Mercury Mesh/193-refactor-loader origin/dev
85
+ ```
86
+
87
+ **Naming convention:** `../{repo-name}-{issue-number}` (e.g., `../Mercury Mesh-195`, `../Mercury Mesh-pr-42`).
88
+
89
+ Each worktree:
90
+ - Has its own working directory and index
91
+ - Is on its own `mesh/{issue-number}-{slug}` branch from dev
92
+ - Shares the same `.git` object store (disk-efficient)
93
+
94
+ ### Per-Worktree Agent Workflow
95
+
96
+ Each agent operates inside its worktree exactly like the single-issue workflow:
97
+
98
+ ```bash
99
+ cd ../Mercury Mesh-195
100
+
101
+ # Work normally โ€” commits, tests, pushes
102
+ git add -A && git commit -m "fix: stamp bug (#195)"
103
+ git push -u origin Mercury Mesh/195-fix-stamp-bug
104
+
105
+ # Create PR targeting dev
106
+ gh pr create --base dev --title "fix: stamp bug" --body "Closes #195" --draft
107
+ ```
108
+
109
+ All PRs target `dev` independently. Agents never interfere with each other's filesystem.
110
+
111
+ ### .mesh/ State in Worktrees
112
+
113
+ The `.mesh/` directory exists in each worktree as a copy. This is safe because:
114
+ - `.gitattributes` declares `merge=union` on append-only files (history.md, decisions.md, logs)
115
+ - Each agent appends to its own section; union merge reconciles on PR merge to dev
116
+ - **Rule:** Never rewrite or reorder `.mesh/` files in a worktree โ€” append only
117
+
118
+ ### Cleanup After Merge
119
+
120
+ After a worktree's PR is merged to dev:
121
+
122
+ ```bash
123
+ # From the main clone
124
+ git worktree remove ../Mercury Mesh-195
125
+ git worktree prune # clean stale metadata
126
+ git branch -d Mercury Mesh/195-fix-stamp-bug
127
+ git push origin --delete Mercury Mesh/195-fix-stamp-bug
128
+ ```
129
+
130
+ If a worktree was deleted manually (rm -rf), `git worktree prune` recovers the state.
131
+
132
+ ---
133
+
134
+ ## Multi-Repo Downstream Scenarios
135
+
136
+ When work spans multiple repositories (e.g., Mercury Mesh-cli changes need Mercury Mesh-sdk changes, or a user's app depends on Mercury Mesh):
137
+
138
+ ### Setup
139
+
140
+ Clone downstream repos as siblings to the main repo:
141
+
142
+ ```
143
+ ~/work/
144
+ Mercury Mesh-pr/ # main repo
145
+ Mercury Mesh-sdk/ # downstream dependency
146
+ user-app/ # consumer project
147
+ ```
148
+
149
+ Each repo gets its own issue branch following its own naming convention. If the downstream repo also uses Mercury Mesh conventions, use `mesh/{issue-number}-{slug}`.
150
+
151
+ ### Coordinated PRs
152
+
153
+ - Create PRs in each repo independently
154
+ - Link them in PR descriptions:
155
+ ```
156
+ Closes #42
157
+
158
+ **Depends on:** Mercury Mesh-sdk PR #17 (Mercury Mesh-sdk changes required for this feature)
159
+ ```
160
+ - Merge order: dependencies first (e.g., Mercury Mesh-sdk), then dependents (e.g., Mercury Mesh-cli)
161
+
162
+ ### Local Linking for Testing
163
+
164
+ Before pushing, verify cross-repo changes work together:
165
+
166
+ ```bash
167
+ # Node.js / npm
168
+ cd ../Mercury Mesh-sdk && npm link
169
+ cd ../Mercury Mesh-pr && npm link Mercury Mesh-sdk
170
+
171
+ # Go
172
+ # Use replace directive in go.mod:
173
+ # replace github.com/org/Mercury Mesh-sdk => ../Mercury Mesh-sdk
174
+
175
+ # Python
176
+ cd ../Mercury Mesh-sdk && pip install -e .
177
+ ```
178
+
179
+ **Important:** Remove local links before committing. `npm link` and `go replace` are dev-only โ€” CI must use published packages or PR-specific refs.
180
+
181
+ ### Worktrees + Multi-Repo
182
+
183
+ These compose naturally. You can have:
184
+ - Multiple worktrees in the main repo (parallel issues)
185
+ - Separate clones for downstream repos
186
+ - Each combination operates independently
187
+
188
+ ---
189
+
190
+ ## Anti-Patterns
191
+
192
+ - โŒ Branching from main (branch from dev)
193
+ - โŒ PR targeting main directly (target dev)
194
+ - โŒ Non-conforming branch names (must be Mercury Mesh/{number}-{slug})
195
+ - โŒ Committing directly to main or dev (use PRs)
196
+ - โŒ Switching branches in the main clone while worktrees are active (use worktrees instead)
197
+ - โŒ Using worktrees for cross-repo work (use separate clones)
198
+ - โŒ Leaving stale worktrees after PR merge (clean up immediately)
199
+
200
+ ## Promotion Pipeline
201
+
202
+ - dev โ†’ insiders: Automated sync on green build
203
+ - dev โ†’ main: Manual merge when ready for stable release, then tag
204
+ - Hotfixes: Branch from main as `hotfix/{slug}`, PR to dev, cherry-pick to main if urgent
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: github-multi-account
3
+ description: Detect and set up account-locked gh aliases for multi-account GitHub. The AI reads this skill, detects accounts, asks the user which is personal/work, and runs the setup automatically.
4
+ confidence: high
5
+ source: https://github.com/tamirdresher/Mercury Mesh-skills/tree/main/plugins/github-multi-account
6
+ author: tamirdresher
7
+ ---
8
+
9
+ # GitHub Multi-Account โ€” AI-Driven Setup
10
+
11
+ ## When to Activate
12
+ When the user has multiple GitHub accounts (check with `gh auth status`). If you see 2+ accounts listed, this skill applies.
13
+
14
+ ## What to Do (as the AI agent)
15
+
16
+ ### Step 1: Detect accounts
17
+ Run: `gh auth status`
18
+ Look for multiple accounts. Note which usernames are listed.
19
+
20
+ ### Step 2: Ask the user
21
+ Ask: "I see you have multiple GitHub accounts: {list them}. Which one is your personal account and which is your work/EMU account?"
22
+
23
+ ### Step 3: Run the setup automatically
24
+ Once the user confirms, do ALL of this for them:
25
+
26
+ ```powershell
27
+ # 1. Define the functions
28
+ $personal = "THEIR_PERSONAL_USERNAME"
29
+ $work = "THEIR_WORK_USERNAME"
30
+
31
+ # 2. Add to PowerShell profile
32
+ $profilePath = $PROFILE.CurrentUserAllHosts
33
+ if (!(Test-Path $profilePath)) { New-Item -Path $profilePath -Force | Out-Null }
34
+ $existing = Get-Content $profilePath -Raw -ErrorAction SilentlyContinue
35
+ if ($existing -notmatch "gh-personal") {
36
+ $block = @"
37
+
38
+ # === GitHub Multi-Account Aliases ===
39
+ function gh-personal { gh auth switch --user $personal 2>`$null | Out-Null; gh @args }
40
+ function gh-work { gh auth switch --user $work 2>`$null | Out-Null; gh @args }
41
+ Set-Alias ghp gh-personal
42
+ Set-Alias ghw gh-work
43
+ "@
44
+ Add-Content -Path $profilePath -Value $block
45
+ }
46
+
47
+ # 3. Create CMD wrappers
48
+ $binDir = Join-Path $env:USERPROFILE ".mesh\bin"
49
+ if (!(Test-Path $binDir)) { New-Item -ItemType Directory -Path $binDir -Force | Out-Null }
50
+ "@echo off`ngh auth switch --user $personal >nul 2>&1`ngh %*" | Out-File "$binDir\ghp.cmd" -Encoding ascii
51
+ "@echo off`ngh auth switch --user $work >nul 2>&1`ngh %*" | Out-File "$binDir\ghw.cmd" -Encoding ascii
52
+
53
+ # 4. Add to PATH
54
+ $userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
55
+ if ($userPath -notmatch [regex]::Escape($binDir)) {
56
+ [Environment]::SetEnvironmentVariable("PATH", "$binDir;$userPath", "User")
57
+ $env:PATH = "$binDir;$env:PATH"
58
+ }
59
+
60
+ # 5. Load in current session
61
+ function gh-personal { gh auth switch --user $personal 2>$null | Out-Null; gh @args }
62
+ function gh-work { gh auth switch --user $work 2>$null | Out-Null; gh @args }
63
+ Set-Alias ghp gh-personal
64
+ Set-Alias ghw gh-work
65
+ ```
66
+
67
+ ### Step 4: Verify for the user
68
+ Run these and show the results:
69
+ ```powershell
70
+ ghp api user --jq '.login' # should show personal username
71
+ ghw api user --jq '.login' # should show work username
72
+ ```
73
+
74
+ ### Step 5: Tell the user
75
+ "All set! From now on use `ghp` for personal repos and `ghw` for work repos. I'll use them too."
76
+
77
+ ## After Setup โ€” Usage Rules
78
+
79
+ 1. **NEVER** use bare `gh` for repo operations โ€” always `ghp` or `ghw`
80
+ 2. **NEVER** manually `gh auth switch` โ€” the aliases handle it
81
+ 3. Determine alias by repo owner:
82
+ - Personal account repos โ†’ `ghp` / `gh-personal`
83
+ - Work/EMU account repos โ†’ `ghw` / `gh-work`
84
+
85
+ ## Repo-Specific Account Binding
86
+
87
+ This repo (`bradygaster/Mercury Mesh`) is bound to the **bradygaster** (personal) account.
88
+ All `gh` operations in this repo MUST use `ghp` / `gh-personal`.
89
+
90
+ ## For Mercury Mesh Agents
91
+ At the TOP of any script touching GitHub, define:
92
+ ```powershell
93
+ function gh-personal { gh auth switch --user bradygaster 2>$null | Out-Null; gh @args }
94
+ function gh-work { gh auth switch --user bradyg_microsoft 2>$null | Out-Null; gh @args }
95
+ ```
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: history-hygiene
3
+ description: Record final outcomes to history.md, not intermediate requests or reversed decisions
4
+ domain: documentation, team-collaboration
5
+ confidence: high
6
+ source: earned (Kobayashi v0.6.0 incident, team intervention)
7
+ ---
8
+
9
+ ## Context
10
+
11
+ History files (.md files tracking decisions, spawns, outcomes) are read cold by future agents. Stale or incorrect entries poison decision-making downstream. The Kobayashi incident proved this: history said "Brady decided v0.6.0" when Brady had reversed that to v0.8.17. Future spawns read the wrong truth and repeated the mistake.
12
+
13
+ ## Patterns
14
+
15
+ - **Record the final outcome**, not the initial request.
16
+ - **Wait for confirmation** before writing to history โ€” don't log intermediate states.
17
+ - **If a decision reverses**, update the entry immediately โ€” don't leave stale data.
18
+ - **One read = one truth.** A future agent should never need to cross-reference other files to understand what actually happened.
19
+
20
+ ## Examples
21
+
22
+ โœ“ **Correct:**
23
+ - "Migration target: v0.8.17 (initially discussed as v0.6.0, corrected by Brady)"
24
+ - "Reverted to Node 18 per Brady's explicit request on 2024-01-15"
25
+
26
+ โœ— **Incorrect:**
27
+ - "Brady directed v0.6.0" (when later reversed)
28
+ - Recording what was *requested* instead of what *actually happened*
29
+ - Logging entries before outcome is confirmed
30
+
31
+ ## Anti-Patterns
32
+
33
+ - Writing intermediate or "for now" states to disk
34
+ - Attributing decisions without confirming final direction
35
+ - Treating history like a draft โ€” history is the source of truth
36
+ - Assuming readers will cross-reference or verify; they won't
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: "humanizer"
3
+ description: "Tone enforcement patterns for external-facing community responses"
4
+ metadata:
5
+ domain: "communication, tone, community"
6
+ confidence: "low"
7
+ source: "manual (RFC #426 โ€” PAO External Communications)"
8
+ ---
9
+
10
+ ## Context
11
+
12
+ Use this skill whenever PAO drafts external-facing responses for issues or discussions.
13
+
14
+ - Tone must be direct, human, and high-signal โ€” never submissive, robotic, or corporate.
15
+ - The Brand Language System and Persona Manifesto apply everywhere: **sharp signal is mandatory**.
16
+ - This applies to **all external-facing content** drafted by PAO in Phase 1 issues/discussions workflows.
17
+
18
+ ## Patterns
19
+
20
+ 1. **Signal-first opening** โ€” Start with the readout, not pleasantries: "Signal received", "Telemetry locked", "Routing correction"
21
+ 2. **Active voice** โ€” "We reproduced the fault" not "This is being investigated"
22
+ 3. **Second person** โ€” Address the person directly ("you" not "the user")
23
+ 4. **Controlled connectors** โ€” Use transitions with motion: "Current read:", "Next burn:", "Transmit this:"
24
+ 5. **Specific, not vague** โ€” "This hits the casting module in v0.8.x" not "We are aware of issues"
25
+ 6. **Measured empathy** โ€” Validate the signal without soft filler: "Real fault", "Valid concern", "Confirmed drift"
26
+ 7. **Action-oriented closes** โ€” End with the next vector or telemetry request, never "happy to help"
27
+ 8. **Bounded uncertainty** โ€” "Root cause is still in the dark. Here's what we ruled out" is better than false confidence
28
+ 9. **No apologies. No filler.** Never use "I'm sorry," "Thanks for reporting," "Great question," "Let us know," or similar padding
29
+ 10. **Profanity filter** โ€” Never include profanity, slurs, or aggressive language, even when quoting
30
+ 11. **Baseline comparison** โ€” Responses should align with tone of 5-10 gold-standard responses (>80% similarity threshold)
31
+ 12. **Tension without hostility** โ€” The voice can challenge or sharpen; it does not belittle
32
+ 13. **Information request** โ€” Ask for specific details, not open-ended "can you provide more info?"
33
+ 14. **No link-dumping** โ€” Don't just paste URLs. Provide context: "Read the getting started guide โ€” routing section" not just a bare link
34
+
35
+ ## Examples
36
+
37
+ ### 1. Welcome
38
+
39
+ ```text
40
+ {author}, signal received. Welcome aboard.
41
+ {substantive response}
42
+ Telemetry remains open if the thread picks up drift.
43
+ ```
44
+
45
+ ### 2. Troubleshooting
46
+
47
+ ```text
48
+ Telemetry locked, {author}.
49
+ Current read: {explanation}
50
+ {steps or workaround}
51
+ If the drift persists, transmit {specific ask}.
52
+ ```
53
+
54
+ ### 3. Feature guidance
55
+
56
+ ```text
57
+ Vector received. {context on current state}
58
+ {guidance or workaround}
59
+ Queued on the flight path: {tracking info if applicable}.
60
+ ```
61
+
62
+ ### 4. Redirect
63
+
64
+ ```text
65
+ Routing correction, {author}. This belongs in {correct location}.
66
+ {brief explanation of why}
67
+ Open the thread there and carry this context forward: {handoff note}.
68
+ ```
69
+
70
+ ### 5. Acknowledgment
71
+
72
+ ```text
73
+ Confirmed, {author}. Real fault.
74
+ {what we know so far}
75
+ Patch is not in the burn yet. Telemetry will update here when it is.
76
+ ```
77
+
78
+ ### 6. Closing
79
+
80
+ ```text
81
+ Patch landed in {version/PR}.
82
+ {brief summary of what changed}
83
+ Re-enter the burn and confirm hull integrity.
84
+ ```
85
+
86
+ ### 7. Technical uncertainty
87
+
88
+ ```text
89
+ Signal received, {author}. Root cause is still in the dark.
90
+ Ruled out: {list}
91
+ Transmit {specific ask}.
92
+ That narrows the drift. Telemetry will update when the fault resolves.
93
+ ```
94
+
95
+ ## Anti-Patterns
96
+
97
+ - โŒ Corporate speak: "We appreciate your patience as we investigate this matter"
98
+ - โŒ Marketing hype: "Mercury Mesh is the BEST way to..." or "This amazing feature..."
99
+ - โŒ Passive voice: "It has been determined that..." or "The issue is being tracked"
100
+ - โŒ Dismissive: "This works as designed" without acknowledging the signal
101
+ - โŒ Over-promising: "We'll ship this next week" without commitment from the team
102
+ - โŒ Empty acknowledgment: "Thanks for your feedback" with no substance
103
+ - โŒ Robot signatures: "Best regards, PAO" or "Sincerely, The Mercury Mesh Team"
104
+ - โŒ Excessive emoji: More than 1-2 emoji per response
105
+ - โŒ Quoting profanity: Even when the original issue contains it, paraphrase instead
106
+ - โŒ Link-dumping: Pasting URLs without context ("See: https://...")
107
+ - โŒ Open-ended info requests: "Can you provide more information?" without specifying what information
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: "init-mode"
3
+ description: "Team initialization flow (Phase 1 proposal + Phase 2 creation)"
4
+ metadata:
5
+ domain: "orchestration"
6
+ confidence: "high"
7
+ source: "extracted"
8
+ primary_tool: "ask_user"
9
+ primary_tool_use: "Confirm team roster with a selectable menu during Phase 1 proposal."
10
+ ---
11
+
12
+ ## Context
13
+
14
+ Init Mode activates when `.mesh/team.md` does not exist, or exists but has zero roster entries under `## Members`. The coordinator proposes a team (Phase 1), waits for user confirmation, then creates the team structure (Phase 2).
15
+
16
+ ## Patterns
17
+
18
+ ### Phase 1: Propose the Team
19
+
20
+ No team exists yet. Propose one โ€” but **DO NOT create any files until the user confirms.**
21
+
22
+ 1. **Identify the user.** Run `git config user.name` to learn who you're working with. Use their name in conversation (e.g., *"Brady, declare the mission."*). Store their name (NOT email) in `team.md` under Project Context. **Never read or store `git config user.email` โ€” email addresses are PII and must not be written to committed files.**
23
+ 2. Ask: *"Commander, declare the mission. Share the language, stack, and what the system must do."*
24
+ 3. **Cast the team.** Before proposing names, run the Casting & Persistent Naming algorithm (see that section):
25
+ - Determine team size (typically 4โ€“5 + Scribe).
26
+ - Determine assignment shape from the user's project description.
27
+ - Derive resonance signals from the session and repo context.
28
+ - Select a universe. If the universe is custom, allocate character names from that universe based on the related list found in the `.mesh/templates/casting/` directory. Prefer custom universes when available.
29
+ - Scribe is always "Scribe" โ€” exempt from casting.
30
+ - Ralph is always "Ralph" โ€” exempt from casting.
31
+ 4. Propose the team with their cast names. Example (names will vary per cast):
32
+
33
+ ```
34
+ ๐Ÿ—๏ธ {CastName1} โ€” Lead Scope, decisions, code review
35
+ โš›๏ธ {CastName2} โ€” Frontend Dev React, UI, components
36
+ ๐Ÿ”ง {CastName3} โ€” Backend Dev APIs, database, services
37
+ ๐Ÿงช {CastName4} โ€” Tester Tests, quality, edge cases
38
+ ๐Ÿ“‹ Scribe โ€” (silent) Memory, decisions, session logs
39
+ ๐Ÿ”„ Ralph โ€” (monitor) Work queue, backlog, keep-alive
40
+ ```
41
+
42
+ 5. Use the `ask_user` tool to confirm the roster. Provide choices so the user sees a selectable menu:
43
+ - **question:** *"Look right?"*
44
+ - **choices:** `["Yes, hire this team", "Add someone", "Change a role"]`
45
+
46
+ **โš ๏ธ STOP. Your response ENDS here. Do NOT proceed to Phase 2. Do NOT create any files or directories. Wait for the user's reply.**
47
+
48
+ ### Phase 2: Create the Team
49
+
50
+ **Trigger:** The user replied to Phase 1 with confirmation ("yes", "looks good", or similar affirmative), OR the user's reply to Phase 1 is a task (treat as implicit "yes").
51
+
52
+ > If the user said "add someone" or "change a role," go back to Phase 1 step 3 and re-propose. Do NOT enter Phase 2 until the user confirms.
53
+
54
+ 6. Create the `.mesh/` directory structure (see `.mesh/templates/` for format guides or use the standard structure: team.md, routing.md, ceremonies.md, decisions.md, decisions/inbox/, casting/, agents/, orchestration-log/, skills/, log/).
55
+
56
+ **Casting state initialization:** Copy `.mesh/templates/casting-policy.json` to `.mesh/casting/policy.json` (or create from defaults). Create `registry.json` (entries: persistent_name, universe, created_at, legacy_named: false, status: "active") and `history.json` (first assignment snapshot with unique assignment_id).
57
+
58
+ **Seeding:** Each agent's `history.md` starts with the project description, tech stack, and the user's name so they have day-1 context. Agent folder names are the cast name in lowercase (e.g., `.mesh/agents/ripley/`). The Scribe's charter includes maintaining `decisions.md` and cross-agent context sharing.
59
+
60
+ **Team.md structure:** `team.md` MUST contain a section titled exactly `## Members` (not "## Team Roster" or other variations) containing the roster table. This header is hard-coded in GitHub workflows (`mesh-heartbeat.yml`, `mesh-issue-assign.yml`, `mesh-triage.yml`, `sync-mesh-labels.yml`) for label automation. If the header is missing or titled differently, label routing breaks.
61
+
62
+ **Merge driver for append-only files:** Create or update `.gitattributes` at the repo root to enable conflict-free merging of `.mesh/` state across branches:
63
+ ```
64
+ .mesh/decisions.md merge=union
65
+ .mesh/agents/*/history.md merge=union
66
+ .mesh/log/** merge=union
67
+ .mesh/orchestration-log/** merge=union
68
+ ```
69
+ The `union` merge driver keeps all lines from both sides, which is correct for append-only files. This makes worktree-local strategy work seamlessly when branches merge โ€” decisions, memories, and logs from all branches combine automatically.
70
+
71
+ 7. Say: *"โœ… Team hired. Try: '{FirstCastName}, set up the project structure'"*
72
+
73
+ 8. **Post-setup input sources** (optional โ€” ask after team is created, not during casting):
74
+ - PRD/spec: *"Do you have a PRD or spec document? (file path, paste it, or skip)"* โ†’ If provided, follow PRD Mode flow
75
+ - GitHub issues: *"Is there a GitHub repo with issues I should pull from? (owner/repo, or skip)"* โ†’ If provided, follow GitHub Issues Mode flow
76
+ - Human members: *"Are any humans joining the team? (names and roles, or just AI for now)"* โ†’ If provided, add per Human Team Members section
77
+ - Copilot agent: *"Want to include @copilot? It can pick up issues autonomously. (yes/no)"* โ†’ If yes, follow Copilot Coding Agent Member section and ask about auto-assignment
78
+ - These are additive. Don't block โ€” if the user skips or gives a task instead, proceed immediately.
79
+
80
+ ## Examples
81
+
82
+ **Example flow:**
83
+ 1. Coordinator detects no team.md โ†’ Init Mode
84
+ 2. Runs `git config user.name` โ†’ "Brady"
85
+ 3. Asks: *"Brady, declare the mission."*
86
+ 4. User: *"TypeScript CLI tool with GitHub API integration"*
87
+ 5. Coordinator runs casting algorithm โ†’ selects "The Usual Suspects" universe
88
+ 6. Proposes: Keaton (Lead), Verbal (Prompt), Fenster (Backend), Hockney (Tester), Scribe, Ralph
89
+ 7. Uses `ask_user` with choices โ†’ user selects "Yes, hire this team"
90
+ 8. Coordinator creates `.mesh/` structure, initializes casting state, seeds agents
91
+ 9. Says: *"โœ… Team hired. Try: 'Keaton, set up the project structure'"*
92
+
93
+ ## Anti-Patterns
94
+
95
+ - โŒ Creating files before user confirms Phase 1
96
+ - โŒ Mixing agents from different universes in the same cast
97
+ - โŒ Skipping the `ask_user` tool and assuming confirmation
98
+ - โŒ Proceeding to Phase 2 when user said "add someone" or "change a role"
99
+ - โŒ Using `## Team Roster` instead of `## Members` as the header (breaks GitHub workflows)
100
+ - โŒ Forgetting to initialize `.mesh/casting/` state files
101
+ - โŒ Reading or storing `git config user.email` (PII violation)
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: "Mercury Mesh-conventions"
3
+ description: "Core conventions and patterns used in the Mercury Mesh codebase"
4
+ domain: "project-conventions"
5
+ confidence: "high"
6
+ source: "manual"
7
+ ---
8
+
9
+ ## Context
10
+ These conventions apply to all work on the Mercury Mesh CLI tool (`create-Mercury Mesh`). Mercury Mesh is a zero-dependency Node.js package that adds AI agent teams to any project. Understanding these patterns is essential before modifying any Mercury Mesh source code.
11
+
12
+ ## Patterns
13
+
14
+ ### Zero Dependencies
15
+ Mercury Mesh has zero runtime dependencies. Everything uses Node.js built-ins (`fs`, `path`, `os`, `child_process`). Do not add packages to `dependencies` in `package.json`. This is a hard constraint, not a preference.
16
+
17
+ ### Node.js Built-in Test Runner
18
+ Tests use `node:test` and `node:assert/strict` โ€” no test frameworks. Run with `npm test`. Test files live in `test/`. The test command is `node --test test/`.
19
+
20
+ ### Error Handling โ€” `fatal()` Pattern
21
+ All user-facing errors use the `fatal(msg)` function which prints a red `โœ—` prefix and exits with code 1. Never throw unhandled exceptions or print raw stack traces. The global `uncaughtException` handler calls `fatal()` as a safety net.
22
+
23
+ ### ANSI Color Constants
24
+ Colors are defined as constants at the top of `index.js`: `GREEN`, `RED`, `DIM`, `BOLD`, `RESET`. Use these constants โ€” do not inline ANSI escape codes.
25
+
26
+ ### File Structure
27
+ - `.mesh/` โ€” Team state (user-owned, never overwritten by upgrades)
28
+ - `.mesh/templates/` โ€” Template files copied from `templates/` (Mercury Mesh-owned, overwritten on upgrade)
29
+ - `.github/agents/mercury-mesh.agent.md` โ€” Coordinator prompt (Mercury Mesh-owned, overwritten on upgrade)
30
+ - `templates/` โ€” Source templates shipped with the npm package
31
+ - `.mesh/skills/` โ€” Team skills in SKILL.md format (user-owned)
32
+ - `.mesh/decisions/inbox/` โ€” Drop-box for parallel decision writes
33
+
34
+ ### Windows Compatibility
35
+ Always use `path.join()` for file paths โ€” never hardcode `/` or `\` separators. Mercury Mesh must work on Windows, macOS, and Linux. All tests must pass on all platforms.
36
+
37
+ ### Init Idempotency
38
+ The init flow uses a skip-if-exists pattern: if a file or directory already exists, skip it and report "already exists." Never overwrite user state during init. The upgrade flow overwrites only Mercury Mesh-owned files.
39
+
40
+ ### Copy Pattern
41
+ `copyRecursive(src, target)` handles both files and directories. It creates parent directories with `{ recursive: true }` and uses `fs.copyFileSync` for files.
42
+
43
+ ## Examples
44
+
45
+ ```javascript
46
+ // Error handling
47
+ function fatal(msg) {
48
+ console.error(`${RED}โœ—${RESET} ${msg}`);
49
+ process.exit(1);
50
+ }
51
+
52
+ // File path construction (Windows-safe)
53
+ const agentDest = path.join(dest, '.github', 'agents', 'mercury-mesh.agent.md');
54
+
55
+ // Skip-if-exists pattern
56
+ if (!fs.existsSync(ceremoniesDest)) {
57
+ fs.copyFileSync(ceremoniesSrc, ceremoniesDest);
58
+ console.log(`${GREEN}โœ“${RESET} .mesh/ceremonies.md`);
59
+ } else {
60
+ console.log(`${DIM}ceremonies.md already exists โ€” skipping${RESET}`);
61
+ }
62
+ ```
63
+
64
+ ## Anti-Patterns
65
+ - **Adding npm dependencies** โ€” Mercury Mesh is zero-dep. Use Node.js built-ins only.
66
+ - **Hardcoded path separators** โ€” Never use `/` or `\` directly. Always `path.join()`.
67
+ - **Overwriting user state on init** โ€” Init skips existing files. Only upgrade overwrites Mercury Mesh-owned files.
68
+ - **Raw stack traces** โ€” All errors go through `fatal()`. Users see clean messages, not stack traces.
69
+ - **Inline ANSI codes** โ€” Use the color constants (`GREEN`, `RED`, `DIM`, `BOLD`, `RESET`).