@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,101 @@
1
+ ---
2
+ name: "economy-mode"
3
+ description: "Shifts Layer 3 model selection to cost-optimized alternatives when economy mode is active."
4
+ ---
5
+
6
+ ## SCOPE
7
+
8
+ ✅ THIS SKILL PRODUCES:
9
+ - A modified Layer 3 model selection table applied when economy mode is active
10
+ - `economyMode: true` written to `.mesh/config.json` when activated persistently
11
+ - Spawn acknowledgments with `💰` indicator when economy mode is active
12
+
13
+ ❌ THIS SKILL DOES NOT PRODUCE:
14
+ - Code, tests, or documentation
15
+ - Cost reports or billing artifacts
16
+ - Changes to Layer 0, Layer 1, or Layer 2 resolution (user intent always wins)
17
+
18
+ ## Context
19
+
20
+ Economy mode shifts Layer 3 (Task-Aware Auto-Selection) to lower-cost alternatives. It does NOT override persistent config (`defaultModels`, `defaultModel`, `agentModelOverrides`) or per-agent charter preferences — those represent explicit user intent and always take priority. Economy routes must come from config rather than hardcoded model IDs.
21
+
22
+ Use this skill when the user wants to reduce costs across an entire session or permanently, without manually specifying models for each agent.
23
+
24
+ ## Activation Methods
25
+
26
+ | Method | How |
27
+ |--------|-----|
28
+ | Session phrase | "use economy mode", "save costs", "go cheap", "reduce costs" |
29
+ | Persistent config | `"economyMode": true` in `.mesh/config.json` |
30
+ | CLI flag | `Mercury Mesh --economy` |
31
+
32
+ **Deactivation:** "turn off economy mode", "disable economy mode", or remove `economyMode` from `config.json`.
33
+
34
+ ## Economy Model Selection Table
35
+
36
+ When economy mode is **active**, Layer 3 auto-selection uses `modelRouting.economy.taskTypes` and `modelRouting.economy.fallbacks` from config. If those keys are absent, reuse the normal `modelRouting` block rather than falling back to hardcoded model IDs.
37
+
38
+ ## AGENT WORKFLOW
39
+
40
+ ### On Session Start
41
+
42
+ 1. READ the active runtime config (`.mesh/config.json` or `.mesh/config.json`)
43
+ 2. CHECK for `economyMode: true` — if present, activate economy mode for the session
44
+ 3. STORE economy mode state in session context
45
+
46
+ ### On User Phrase Trigger
47
+
48
+ **Session-only (no config change):** "use economy mode", "save costs", "go cheap"
49
+
50
+ 1. SET economy mode active for this session
51
+ 2. ACKNOWLEDGE: `✅ Economy mode active — using cost-optimized models this session. (Layer 0 and Layer 2 preferences still apply)`
52
+
53
+ **Persistent:** "always use economy mode", "save economy mode"
54
+
55
+ 1. WRITE `economyMode: true` to the active `config.json` (merge, don't overwrite other fields)
56
+ 2. ACKNOWLEDGE: `✅ Economy mode saved — cost-optimized models will be used until disabled.`
57
+
58
+ ### On Every Agent Spawn (Economy Mode Active)
59
+
60
+ 1. CHECK Layer 0 first (`agentModelOverrides`, `defaultModels`, `defaultModel`) — if set, use that. Economy mode does NOT override Layer 0.
61
+ 2. CHECK Layer 1 (session directive for a specific model) — if set, use that. Economy mode does NOT override explicit session directives.
62
+ 3. CHECK Layer 2 (charter preference) — if set, use that. Economy mode does NOT override charter preferences.
63
+ 4. APPLY `modelRouting.economy` at Layer 3 instead of normal `modelRouting` when present.
64
+ 5. INCLUDE `💰` in spawn acknowledgment: `🔧 {Name} ({model} · 💰 economy) — {task}`
65
+
66
+ ### On Deactivation
67
+
68
+ **Trigger phrases:** "turn off economy mode", "disable economy mode", "use normal models"
69
+
70
+ 1. REMOVE `economyMode` from the active `config.json` (if it was persisted)
71
+ 2. CLEAR session economy mode state
72
+ 3. ACKNOWLEDGE: `✅ Economy mode disabled — returning to standard model selection.`
73
+
74
+ ### STOP
75
+
76
+ After updating economy mode state and including the `💰` indicator in spawn acknowledgments, this skill is done. Do NOT:
77
+ - Change Layer 0, Layer 1, or Layer 2 model choices
78
+ - Override charter-specified models
79
+ - Generate cost reports or comparisons
80
+ - Fall back to premium models via economy mode (economy mode never bumps UP)
81
+
82
+ ## Config Schema
83
+
84
+ `.mesh/config.json` economy-related fields:
85
+
86
+ ```json
87
+ {
88
+ "version": 1,
89
+ "economyMode": true
90
+ }
91
+ ```
92
+
93
+ - `economyMode` — when `true`, Layer 3 uses the economy table. Optional; absent = economy mode off.
94
+ - Combines with `defaultModels`, `defaultModel`, and `agentModelOverrides` — Layer 0 always wins.
95
+
96
+ ## Anti-Patterns
97
+
98
+ - **Don't override Layer 0 in economy mode.** If the user set `defaultModels: ["gpt-5.4", "claude-opus-4.6"]`, they want that chain honored. Economy mode only affects Layer 3 auto-selection.
99
+ - **Don't silently apply economy mode.** Always acknowledge when activated or deactivated.
100
+ - **Don't treat economy mode as permanent by default.** Session phrases activate session-only; only "always" or `config.json` persist it.
101
+ - **Don't bump premium tasks down too far.** Architecture and security reviews shift from opus to sonnet in economy mode — they do NOT go to fast/cheap models.
@@ -0,0 +1,331 @@
1
+ ---
2
+ name: "external-comms"
3
+ description: "PAO workflow for scanning, drafting, and presenting community responses in Mercury Mesh voice with a human command gate"
4
+ metadata:
5
+ domain: "community, communication, workflow"
6
+ confidence: "low"
7
+ source: "manual (RFC #426 — PAO External Communications)"
8
+ tools:
9
+ - name: "github-mcp-server-list_issues"
10
+ description: "List open issues for scan candidates and lightweight triage"
11
+ when: "Use for recent open issue scans before thread-level review"
12
+ - name: "github-mcp-server-issue_read"
13
+ description: "Read the full issue, comments, and labels before drafting"
14
+ when: "Use after selecting a candidate so PAO has complete thread context"
15
+ - name: "github-mcp-server-search_issues"
16
+ description: "Search for candidate issues or prior Mercury Mesh responses"
17
+ when: "Use when filtering by keywords, labels, or duplicate response checks"
18
+ - name: "gh CLI"
19
+ description: "Fallback for GitHub issue comments and discussions workflows"
20
+ when: "Use gh issue list/comment and gh api or gh api graphql when MCP coverage is incomplete"
21
+ ---
22
+
23
+ ## Context
24
+
25
+ Phase 1 is **draft-only mode**.
26
+
27
+ - PAO scans issues and discussions, drafts responses with the humanizer skill, and presents a review table for human approval.
28
+ - **Human review gate is mandatory** — PAO never posts autonomously.
29
+ - Every action is logged to `.mesh/comms/audit/`.
30
+ - This workflow is triggered manually only ("PAO, check community") — no automated or Ralph-triggered activation in Phase 1.
31
+ - The draft voice must obey `docs/brand-language.md` and `docs/persona-manifesto.md`: no apologies, no filler, direct telemetry, command-bridge cadence.
32
+
33
+ ## Patterns
34
+
35
+ ### 1. Scan
36
+
37
+ Find unanswered community items with GitHub MCP tools first, or `gh issue list` / `gh api` as fallback for issues and discussions.
38
+
39
+ - Include **open** issues and discussions only.
40
+ - Filter for items with **no Mercury Mesh team response**.
41
+ - Limit to items created in the last 7 days.
42
+ - Exclude items labeled `Mercury Mesh:internal` or `wontfix`.
43
+ - Include discussions **and** issues in the same sweep.
44
+ - Phase 1 scope is **issues and discussions only** — do not draft PR replies.
45
+
46
+ ### Discussion Handling (Phase 1)
47
+
48
+ Discussions use the GitHub Discussions API, which differs from issues:
49
+
50
+ - **Scan:** `gh api /repos/{owner}/{repo}/discussions --jq '.[] | select(.answer_chosen_at == null)'` to find unanswered discussions
51
+ - **Categories:** Filter by Q&A and General categories only (skip Announcements, Show and Tell)
52
+ - **Answers vs comments:** In Q&A discussions, PAO drafts an "answer" (not a comment). The human marks it as accepted answer after posting.
53
+ - **Phase 1 scope:** Issues and Discussions ONLY. No PR comments.
54
+
55
+ ### 2. Classify
56
+
57
+ Determine the response type before drafting.
58
+
59
+ - Welcome (new contributor)
60
+ - Troubleshooting (bug/help)
61
+ - Feature guidance (feature request/how-to)
62
+ - Redirect (wrong repo/scope)
63
+ - Acknowledgment (confirmed, no fix)
64
+ - Closing (resolved)
65
+ - Technical uncertainty (unknown cause)
66
+ - Empathetic disagreement (pushback on a decision or design)
67
+ - Information request (need more reproduction details or context)
68
+
69
+ ### Template Selection Guide
70
+
71
+ | Signal in Issue/Discussion | → Response Type | Template |
72
+ |---------------------------|-----------------|----------|
73
+ | New contributor (0 prior issues) | Welcome | T1 |
74
+ | Error message, stack trace, "doesn't work" | Troubleshooting | T2 |
75
+ | "How do I...?", "Can Mercury Mesh...?", "Is there a way to...?" | Feature Guidance | T3 |
76
+ | Wrong repo, out of scope for Mercury Mesh | Redirect | T4 |
77
+ | Confirmed bug, no fix available yet | Acknowledgment | T5 |
78
+ | Fix shipped, PR merged that resolves issue | Closing | T6 |
79
+ | Unclear cause, needs investigation | Technical Uncertainty | T7 |
80
+ | Author disagrees with a decision or design | Empathetic Disagreement | T8 |
81
+ | Need more reproduction info or context | Information Request | T9 |
82
+
83
+ Use exactly one template as the base draft. Replace placeholders with issue-specific details, then apply the humanizer patterns. If the thread spans multiple signals, choose the highest-risk template and capture the nuance in the thread summary.
84
+
85
+ ### Confidence Classification
86
+
87
+ | Confidence | Criteria | Example |
88
+ |-----------|----------|---------|
89
+ | 🟢 High | Answer exists in Mercury Mesh docs or FAQ, similar question answered before, no technical ambiguity | "How do I install Mercury Mesh?" |
90
+ | 🟡 Medium | Technical answer is sound but involves judgment calls, OR docs exist but don't perfectly match the question, OR tone is tricky | "Can Mercury Mesh work with Azure DevOps?" (yes, but setup is nuanced) |
91
+ | 🔴 Needs Review | Technical uncertainty, policy/roadmap question, potential reputational risk, author is frustrated/angry, question about unreleased features | "When will Mercury Mesh support Claude?" |
92
+
93
+ **Auto-escalation rules:**
94
+ - Any mention of competitors → 🔴
95
+ - Any mention of pricing/licensing → 🔴
96
+ - Author has >3 follow-up comments without resolution → 🔴
97
+ - Question references a closed-wontfix issue → 🔴
98
+
99
+ ### 3. Draft
100
+
101
+ Use the humanizer skill for every draft.
102
+
103
+ - Complete **Thread-Read Verification** before writing.
104
+ - Read the **full thread**, including all comments, before writing.
105
+ - Select the matching template from the **Template Selection Guide** and record the template ID in the review notes.
106
+ - Treat templates as reusable drafting assets: keep the structure, replace placeholders, and only improvise when the thread truly requires it.
107
+ - Validate the draft against the humanizer anti-patterns.
108
+ - Flag long threads (`>10` comments) with `⚠️`.
109
+
110
+ ### Thread-Read Verification
111
+
112
+ Before drafting, PAO MUST verify complete thread coverage:
113
+
114
+ 1. **Count verification:** Compare API comment count with actually-read comments. If mismatch, abort draft.
115
+ 2. **Deleted comment check:** Use `gh api` timeline to detect deleted comments. If found, flag as ⚠️ in review table.
116
+ 3. **Thread summary:** Include in every draft: "Thread: {N} comments, last activity {date}, {summary of key points}"
117
+ 4. **Long thread flag:** If >10 comments, add ⚠️ to review table and include condensed thread summary
118
+ 5. **Evidence line in review table:** Each draft row includes "Read: {N}/{total} comments" column
119
+
120
+ ### 4. Present
121
+
122
+ Show drafts for review in this exact format:
123
+
124
+ ```text
125
+ 📝 PAO — Community Response Drafts
126
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
127
+
128
+ | # | Item | Author | Type | Confidence | Read | Preview |
129
+ |---|------|--------|------|------------|------|---------|
130
+ | 1 | Issue #N | @user | Type | 🟢/🟡/🔴 | N/N | "First words..." |
131
+
132
+ Confidence: 🟢 High | 🟡 Medium | 🔴 Needs review
133
+
134
+ Full drafts below ▼
135
+ ```
136
+
137
+ Each full draft must begin with the thread summary line:
138
+ `Thread: {N} comments, last activity {date}, {summary of key points}`
139
+
140
+ ### 5. Human Action
141
+
142
+ Wait for explicit human direction before anything is posted.
143
+
144
+ - `pao approve 1 3` — approve drafts 1 and 3
145
+ - `pao edit 2` — edit draft 2
146
+ - `pao skip` — skip all
147
+ - `banana` — freeze all pending (safe word)
148
+
149
+ ### Rollback — Bad Post Recovery
150
+
151
+ If a posted response turns out to be wrong, inappropriate, or needs correction:
152
+
153
+ 1. **Delete the comment:**
154
+ - Issues: `gh api -X DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}`
155
+ - Discussions: `gh api graphql -f query='mutation { deleteDiscussionComment(input: {id: "{node_id}"}) { comment { id } } }'`
156
+ 2. **Log the deletion:** Write audit entry with action `delete`, include reason and original content
157
+ 3. **Draft replacement** (if needed): PAO drafts a corrected response, goes through normal review cycle
158
+ 4. **Postmortem:** If the error reveals a pattern gap, update humanizer anti-patterns or add a new test case
159
+
160
+ **Safe word — `banana`:**
161
+ - Immediately freezes all pending drafts in the review queue
162
+ - No new scans or drafts until `pao resume` is issued
163
+ - Audit entry logged with halter identity and reason
164
+
165
+ ### 6. Post
166
+
167
+ After approval:
168
+
169
+ - Human posts via `gh issue comment` for issues or `gh api` for discussion answers/comments.
170
+ - PAO helps by preparing the CLI command.
171
+ - Write the audit entry after the posting action.
172
+
173
+ ### 7. Audit
174
+
175
+ Log every action.
176
+
177
+ - Location: `.mesh/comms/audit/{timestamp}.md`
178
+ - Required fields vary by action — see `.mesh/comms/templates/audit-entry.md` Conditional Fields table
179
+ - Universal required fields: `timestamp`, `action`
180
+ - All other fields are conditional on the action type
181
+
182
+ ## Examples
183
+
184
+ These are reusable templates. Keep the structure, replace placeholders, and adjust only where the thread requires it.
185
+
186
+ ### Example scan command
187
+
188
+ ```bash
189
+ gh issue list --state open --json number,title,author,labels,comments --limit 20
190
+ ```
191
+
192
+ ### Example review table
193
+
194
+ ```text
195
+ 📝 PAO — Community Response Drafts
196
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
197
+
198
+ | # | Item | Author | Type | Confidence | Read | Preview |
199
+ |---|------|--------|------|------------|------|---------|
200
+ | 1 | Issue #426 | @newdev | Welcome | 🟢 | 1/1 | "@newdev, signal received. Welcome aboard..." |
201
+ | 2 | Discussion #18 | @builder | Feature guidance | 🟡 | 4/4 | "Vector received. Current CLI path..." |
202
+ | 3 | Issue #431 ⚠️ | @debugger | Technical uncertainty | 🔴 | 12/12 | "Signal received, @debugger. Root cause..." |
203
+
204
+ Confidence: 🟢 High | 🟡 Medium | 🔴 Needs review
205
+
206
+ Full drafts below ▼
207
+ ```
208
+
209
+ ### Example audit entry (post action)
210
+
211
+ ```markdown
212
+ ---
213
+ timestamp: "2026-03-16T21:30:00Z"
214
+ action: "post"
215
+ item_number: 426
216
+ draft_id: 1
217
+ reviewer: "@bradygaster"
218
+ ---
219
+
220
+ ## Context (draft, approve, edit, skip, post, delete actions)
221
+ - Thread depth: 3
222
+ - Response type: welcome
223
+ - Confidence: 🟢
224
+ - Long thread flag: false
225
+
226
+ ## Draft Content (draft, edit, post actions)
227
+ Thread: 3 comments, last activity 2026-03-16, reporter hit a preview-build regression after install.
228
+
229
+ @newdev, signal received. Welcome aboard.
230
+ We reproduced the fault in preview builds. Regression point is under telemetry now.
231
+ Transmit the command you ran right before the failure.
232
+
233
+ ## Post Result (post, delete actions)
234
+ https://github.com/bradygaster/Mercury Mesh/issues/426#issuecomment-123456
235
+ ```
236
+
237
+ ### T1 — Welcome
238
+
239
+ ```text
240
+ {author}, signal received. Welcome aboard.
241
+ {specific acknowledgment or first answer}
242
+ Telemetry remains open if the thread picks up drift.
243
+ ```
244
+
245
+ ### T2 — Troubleshooting
246
+
247
+ ```text
248
+ Telemetry locked, {author}.
249
+ Current read: {explanation}
250
+ {steps or workaround}
251
+ If the drift persists, transmit {specific ask}.
252
+ ```
253
+
254
+ ### T3 — Feature Guidance
255
+
256
+ ```text
257
+ Vector received. {context on current state}
258
+ {guidance or workaround}
259
+ Queued on the flight path: {tracking info if applicable}.
260
+ ```
261
+
262
+ ### T4 — Redirect
263
+
264
+ ```text
265
+ Routing correction, {author}. This belongs in {correct location}.
266
+ {brief explanation of why}
267
+ Open the thread there and carry this context forward: {handoff note}.
268
+ ```
269
+
270
+ ### T5 — Acknowledgment
271
+
272
+ ```text
273
+ Confirmed, {author}. Real fault.
274
+ {what we know so far}
275
+ Patch is not in the burn yet. Telemetry will update here when it is.
276
+ ```
277
+
278
+ ### T6 — Closing
279
+
280
+ ```text
281
+ Patch landed in {version/PR}.
282
+ {brief summary of what changed}
283
+ Re-enter the burn and confirm hull integrity.
284
+ ```
285
+
286
+ ### T7 — Technical Uncertainty
287
+
288
+ ```text
289
+ Signal received, {author}. Root cause is still in the dark.
290
+ Ruled out: {list}
291
+ Transmit {specific ask}.
292
+ That narrows the drift. Telemetry will update when the fault resolves.
293
+ ```
294
+
295
+ ### T8 — Empathetic Disagreement
296
+
297
+ ```text
298
+ Signal received, {author}. The concern is valid.
299
+
300
+ The current design holds because {reason}. It will not fit every use case.
301
+
302
+ {what alternatives exist or what trade-off was made}
303
+
304
+ If your use case breaks that geometry, open a discussion with the boundary conditions.
305
+ ```
306
+
307
+ ### T9 — Information Request
308
+
309
+ ```text
310
+ Telemetry incomplete, {author}.
311
+
312
+ Transmit:
313
+ - {specific ask 1}
314
+ - {specific ask 2}
315
+ - {specific ask 3, if applicable}
316
+
317
+ That signal is enough to narrow the fault.
318
+ ```
319
+
320
+ ## Anti-Patterns
321
+
322
+ - ❌ Posting without human review (NEVER — this is the cardinal rule)
323
+ - ❌ Drafting without reading full thread (context is everything)
324
+ - ❌ Ignoring confidence flags (🔴 items need Flight/human review)
325
+ - ❌ Scanning closed issues (only open items)
326
+ - ❌ Responding to issues labeled `Mercury Mesh:internal` or `wontfix`
327
+ - ❌ Skipping audit logging (every action must be recorded)
328
+ - ❌ Drafting for issues where a Mercury Mesh member already responded (avoid duplicates)
329
+ - ❌ Drafting pull request responses in Phase 1 (issues/discussions only)
330
+ - ❌ Treating templates like loose examples instead of reusable drafting assets
331
+ - ❌ Asking for more info without specific requests
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: "gh-auth-isolation"
3
+ description: "Safely manage multiple GitHub identities (EMU + personal) in agent workflows"
4
+ domain: "security, github-integration, authentication, multi-account"
5
+ confidence: "high"
6
+ source: "earned (production usage across 50+ sessions with EMU corp + personal GitHub accounts)"
7
+ tools:
8
+ - name: "gh"
9
+ description: "GitHub CLI for authenticated operations"
10
+ when: "When accessing GitHub resources requiring authentication"
11
+ ---
12
+
13
+ ## Context
14
+
15
+ Many developers use GitHub through an Enterprise Managed User (EMU) account at work while maintaining a personal GitHub account for open-source contributions. AI agents spawned by Mercury Mesh inherit the shell's default `gh` authentication — which is usually the EMU account. This causes failures when agents try to push to personal repos, create PRs on forks, or interact with resources outside the enterprise org.
16
+
17
+ This skill teaches agents how to detect the active identity, switch contexts safely, and avoid mixing credentials across operations.
18
+
19
+ ## Patterns
20
+
21
+ ### Detect Current Identity
22
+
23
+ Before any GitHub operation, check which account is active:
24
+
25
+ ```bash
26
+ gh auth status
27
+ ```
28
+
29
+ Look for:
30
+ - `Logged in to github.com as USERNAME` — the active account
31
+ - `Token scopes: ...` — what permissions are available
32
+ - Multiple accounts will show separate entries
33
+
34
+ ### Extract a Specific Account's Token
35
+
36
+ When you need to operate as a specific user (not the default):
37
+
38
+ ```bash
39
+ # Get the personal account token (by username)
40
+ gh auth token --user personaluser
41
+
42
+ # Get the EMU account token
43
+ gh auth token --user corpalias_enterprise
44
+ ```
45
+
46
+ **Use case:** Push to a personal fork while the default `gh` auth is the EMU account.
47
+
48
+ ### Push to Personal Repos from EMU Shell
49
+
50
+ The most common scenario: your shell defaults to the EMU account, but you need to push to a personal GitHub repo.
51
+
52
+ ```bash
53
+ # 1. Extract the personal token
54
+ $token = gh auth token --user personaluser
55
+
56
+ # 2. Push using token-authenticated HTTPS
57
+ git push https://personaluser:$token@github.com/personaluser/repo.git branch-name
58
+ ```
59
+
60
+ **Why this works:** `gh auth token --user` reads from `gh`'s credential store without switching the active account. The token is used inline for a single operation and never persisted.
61
+
62
+ ### Create PRs on Personal Forks
63
+
64
+ When the default `gh` context is EMU but you need to create a PR from a personal fork:
65
+
66
+ ```bash
67
+ # Option 1: Use --repo flag (works if token has access)
68
+ gh pr create --repo upstream/repo --head personaluser:branch --title "..." --body "..."
69
+
70
+ # Option 2: Temporarily set GH_TOKEN for one command
71
+ $env:GH_TOKEN = $(gh auth token --user personaluser)
72
+ gh pr create --repo upstream/repo --head personaluser:branch --title "..."
73
+ Remove-Item Env:\GH_TOKEN
74
+ ```
75
+
76
+ ### Config Directory Isolation (Advanced)
77
+
78
+ For complete isolation between accounts, use separate `gh` config directories:
79
+
80
+ ```bash
81
+ # Personal account operations
82
+ $env:GH_CONFIG_DIR = "$HOME/.config/gh-public"
83
+ gh auth login # Login with personal account (one-time setup)
84
+ gh repo clone personaluser/repo
85
+
86
+ # EMU account operations (default)
87
+ Remove-Item Env:\GH_CONFIG_DIR
88
+ gh auth status # Back to EMU account
89
+ ```
90
+
91
+ **Setup (one-time):**
92
+ ```bash
93
+ # Create isolated config for personal account
94
+ mkdir ~/.config/gh-public
95
+ $env:GH_CONFIG_DIR = "$HOME/.config/gh-public"
96
+ gh auth login --web --git-protocol https
97
+ ```
98
+
99
+ ### Shell Aliases for Quick Switching
100
+
101
+ Add to your shell profile for convenience:
102
+
103
+ ```powershell
104
+ # PowerShell profile
105
+ function ghp { $env:GH_CONFIG_DIR = "$HOME/.config/gh-public"; gh @args; Remove-Item Env:\GH_CONFIG_DIR }
106
+ function ghe { gh @args } # Default EMU
107
+
108
+ # Usage:
109
+ # ghp repo clone personaluser/repo # Uses personal account
110
+ # ghe issue list # Uses EMU account
111
+ ```
112
+
113
+ ```bash
114
+ # Bash/Zsh profile
115
+ alias ghp='GH_CONFIG_DIR=~/.config/gh-public gh'
116
+ alias ghe='gh'
117
+
118
+ # Usage:
119
+ # ghp repo clone personaluser/repo
120
+ # ghe issue list
121
+ ```
122
+
123
+ ## Examples
124
+
125
+ ### ✓ Correct: Agent pushes blog post to personal GitHub Pages
126
+
127
+ ```powershell
128
+ # Agent needs to push to personaluser.github.io (personal repo)
129
+ # Default gh auth is corpalias_enterprise (EMU)
130
+
131
+ $token = gh auth token --user personaluser
132
+ git remote set-url origin https://personaluser:$token@github.com/personaluser/personaluser.github.io.git
133
+ git push origin main
134
+
135
+ # Clean up — don't leave token in remote URL
136
+ git remote set-url origin https://github.com/personaluser/personaluser.github.io.git
137
+ ```
138
+
139
+ ### ✓ Correct: Agent creates a PR from personal fork to upstream
140
+
141
+ ```powershell
142
+ # Fork: personaluser/Mercury Mesh, Upstream: bradygaster/Mercury Mesh
143
+ # Agent is on branch contrib/fix-docs in the fork clone
144
+
145
+ git push origin contrib/fix-docs # Pushes to fork (may need token auth)
146
+
147
+ # Create PR targeting upstream
148
+ gh pr create --repo bradygaster/Mercury Mesh --head personaluser:contrib/fix-docs `
149
+ --title "docs: fix installation guide" `
150
+ --body "Fixes #123"
151
+ ```
152
+
153
+ ### ✗ Incorrect: Blindly pushing with wrong account
154
+
155
+ ```bash
156
+ # BAD: Agent assumes default gh auth works for personal repos
157
+ git push origin main
158
+ # ERROR: Permission denied — EMU account has no access to personal repo
159
+
160
+ # BAD: Hardcoding tokens in scripts
161
+ git push https://personaluser:ghp_xxxxxxxxxxxx@github.com/personaluser/repo.git main
162
+ # SECURITY RISK: Token exposed in command history and process list
163
+ ```
164
+
165
+ ### ✓ Correct: Check before you push
166
+
167
+ ```bash
168
+ # Always verify which account has access before operations
169
+ gh auth status
170
+ # If wrong account, use token extraction:
171
+ $token = gh auth token --user personaluser
172
+ git push https://personaluser:$token@github.com/personaluser/repo.git main
173
+ ```
174
+
175
+ ## Anti-Patterns
176
+
177
+ - ❌ **Hardcoding tokens** in scripts, environment variables, or committed files. Use `gh auth token --user` to extract at runtime.
178
+ - ❌ **Assuming the default `gh` auth works** for all repos. EMU accounts can't access personal repos and vice versa.
179
+ - ❌ **Switching `gh auth login`** globally mid-session. This changes the default for ALL processes and can break parallel agents.
180
+ - ❌ **Storing personal tokens in `.env`** or `.mesh/` files. These get committed by Scribe. Use `gh`'s credential store.
181
+ - ❌ **Ignoring token cleanup** after inline HTTPS pushes. Always reset the remote URL to avoid persisting tokens.
182
+ - ❌ **Using `gh auth switch`** in multi-agent sessions. One agent switching affects all others sharing the shell.
183
+ - ❌ **Mixing EMU and personal operations** in the same git clone. Use separate clones or explicit remote URLs per operation.