@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,139 @@
1
+ ---
2
+ name: "model-selection"
3
+ description: "Determines which LLM model to use for each agent spawn based on a 5-layer resolution hierarchy, including user preferences, session directives, charter specifications, task-aware defaults, and a hardcoded fallback."
4
+ ---
5
+ # Model Selection
6
+
7
+ > Determines which LLM model to use for each agent spawn.
8
+
9
+ ## SCOPE
10
+
11
+ ✅ THIS SKILL PRODUCES:
12
+ - A resolved `model` parameter for every `task` tool call
13
+ - Persistent model preferences in `.mesh/config.json`
14
+ - Spawn acknowledgments that include the resolved model
15
+
16
+ ❌ THIS SKILL DOES NOT PRODUCE:
17
+ - Code, tests, or documentation
18
+ - Model performance benchmarks
19
+ - Cost reports or billing artifacts
20
+
21
+ ## Context
22
+
23
+ Mercury Mesh supports 18+ models across three tiers (premium, standard, fast). The coordinator must select the right model for each agent spawn. Users can set persistent preferences that survive across sessions.
24
+
25
+ ## 5-Layer Model Resolution Hierarchy
26
+
27
+ Resolution is **first-match-wins** — the highest layer with a value wins.
28
+
29
+ | Layer | Name | Source | Persistence |
30
+ |-------|------|--------|-------------|
31
+ | **0a** | Per-Agent Config | `.mesh/config.json` → `agentModelOverrides.{name}` | Persistent (survives sessions) |
32
+ | **0b** | Global Config | `.mesh/config.json` → `defaultModel` | Persistent (survives sessions) |
33
+ | **1** | Session Directive | User said "use X" in current session | Session-only |
34
+ | **2** | Charter Preference | Agent's `charter.md` → `## Model` section | Persistent (in charter) |
35
+ | **3** | Task-Aware Auto | `.mesh/config.json` → `modelRouting.taskTypes` | Computed per-spawn |
36
+ | **4** | Default | `.mesh/config.json` → `modelRouting.default`, then `defaultModel`, then omit model param | Configured fallback |
37
+
38
+ **Key principle:** Layer 0 (persistent config) beats everything. If the user said "always use opus" and it was saved to config.json, every agent gets opus regardless of role or task type. This is intentional — the user explicitly chose quality over cost.
39
+
40
+ ## AGENT WORKFLOW
41
+
42
+ ### On Session Start
43
+
44
+ 1. READ `.mesh/config.json`
45
+ 2. CHECK for `defaultModel` field — if present, this is the Layer 0 override for all spawns
46
+ 3. CHECK for `agentModelOverrides` field — if present, these are per-agent Layer 0a overrides
47
+ 4. STORE both values in session context for the duration
48
+
49
+ ### On Every Agent Spawn
50
+
51
+ 1. CHECK Layer 0a: Is there an `agentModelOverrides.{agentName}` in config.json? → Use it.
52
+ 2. CHECK Layer 0b: Is there a `defaultModel` in config.json? → Use it.
53
+ 3. CHECK Layer 1: Did the user give a session directive? → Use it.
54
+ 4. CHECK Layer 2: Does the agent's charter have a `## Model` section? → Use it.
55
+ 5. CHECK Layer 3: Read the active `config.json` → `modelRouting.taskTypes`:
56
+ - Code (implementation, tests, refactoring, bug fixes) → `taskTypes.code`
57
+ - Prompts, agent designs → `taskTypes.prompts` or `taskTypes.code`
58
+ - Lead, architecture, reviewer, or security work → `taskTypes.lead`
59
+ - Visual/design with image analysis → `taskTypes.visual`
60
+ - Non-code (docs, planning, triage, changelogs) → `taskTypes.docs`
61
+ 6. FALLBACK Layer 4: `modelRouting.default`, then `defaultModel`, then omit the model param
62
+ 7. INCLUDE model in spawn acknowledgment: `🔧 {Name} ({resolved_model}) — {task}`
63
+
64
+ ### When User Sets a Preference
65
+
66
+ **Trigger phrases:** "always use X", "use X for everything", "switch to X", "default to X"
67
+
68
+ 1. VALIDATE the model ID against the catalog (18+ models)
69
+ 2. WRITE `defaultModel` to the active `config.json` (merge, don't overwrite)
70
+ 3. ACKNOWLEDGE: `✅ Model preference saved: {model} — all future sessions will use this until changed.`
71
+
72
+ **Per-agent trigger:** "use X for {agent}"
73
+
74
+ 1. VALIDATE model ID
75
+ 2. WRITE to `agentModelOverrides.{agent}` in the active `config.json`
76
+ 3. ACKNOWLEDGE: `✅ {Agent} will always use {model} — saved to config.`
77
+
78
+ **Per-category trigger:** "use X for code" / "use X for docs" / "use X for lead reviews"
79
+
80
+ 1. VALIDATE model ID
81
+ 2. WRITE to the active `config.json` → `modelRouting.taskTypes.{category}`
82
+ 3. ACKNOWLEDGE: `✅ {category} tasks now route to {model}.`
83
+
84
+ ### When User Clears a Preference
85
+
86
+ **Trigger phrases:** "switch back to automatic", "clear model preference", "use default models"
87
+
88
+ 1. REMOVE `defaultModel` from the active `config.json`
89
+ 2. ACKNOWLEDGE: `✅ Model preference cleared — returning to automatic selection.`
90
+
91
+ ### STOP
92
+
93
+ After resolving the model and including it in the spawn template, this skill is done. Do NOT:
94
+ - Generate model comparison reports
95
+ - Run benchmarks or speed tests
96
+ - Create new config files (only modify existing `config.json` in the active runtime root)
97
+ - Change the model after spawn (fallback chains handle runtime failures)
98
+
99
+ ## Config Schema
100
+
101
+ The active `config.json` (`.mesh/config.json` or `.mesh/config.json`) model-related fields:
102
+
103
+ ```json
104
+ {
105
+ "version": 1,
106
+ "modelRouting": {
107
+ "default": "gpt-5.4",
108
+ "taskTypes": {
109
+ "code": "gpt-5.4",
110
+ "prompts": "gpt-5.4",
111
+ "docs": "gpt-5.4",
112
+ "lead": "claude-opus-4.6",
113
+ "visual": "claude-opus-4.6"
114
+ },
115
+ "fallbacks": {
116
+ "premium": ["claude-opus-4.6", "gpt-5.4"],
117
+ "standard": ["gpt-5.4"],
118
+ "fast": ["gpt-5.4"]
119
+ }
120
+ }
121
+ }
122
+ ```
123
+
124
+ - `modelRouting.default` — default model for task-aware routing when no category-specific route matches
125
+ - `modelRouting.taskTypes` — config-driven category routing for Layer 3
126
+ - `modelRouting.fallbacks` — ordered fallback lists per tier, filtered by `allowedModels` when present
127
+ - `defaultModel` and `agentModelOverrides` remain valid explicit overrides above task routing
128
+
129
+ ## Fallback Chains
130
+
131
+ If a model is unavailable (rate limit, plan restriction), retry within the same tier:
132
+
133
+ ```
134
+ Premium: `modelRouting.fallbacks.premium[]`
135
+ Standard: `modelRouting.fallbacks.standard[]`
136
+ Fast: `modelRouting.fallbacks.fast[]`
137
+ ```
138
+
139
+ **Keep fallbacks inside the repo allowlist when `allowedModels` is active.** If no allowed fallback exists, omit the model parameter.
@@ -0,0 +1,24 @@
1
+ # Skill: nap
2
+
3
+ > Context hygiene — compress, prune, archive .mesh/ state
4
+
5
+ ## What It Does
6
+
7
+ Reclaims context window budget by compressing agent histories, pruning old logs,
8
+ archiving stale decisions, and cleaning orphaned inbox files.
9
+
10
+ ## When To Use
11
+
12
+ - Before heavy fan-out work (many agents will spawn)
13
+ - When history.md files exceed 15KB
14
+ - When .mesh/ total size exceeds 1MB
15
+ - After long-running sessions or sprints
16
+
17
+ ## Invocation
18
+
19
+ - CLI: `Mercury Mesh nap` / `Mercury Mesh nap --deep` / `Mercury Mesh nap --dry-run`
20
+ - REPL: `/nap` / `/nap --dry-run` / `/nap --deep`
21
+
22
+ ## Confidence
23
+
24
+ medium — Confirmed by team vote (4-1) and initial implementation
@@ -0,0 +1,57 @@
1
+ # Personal Mercury Mesh — Skill Document
2
+
3
+ ## What is a Personal Mercury Mesh?
4
+
5
+ A personal Mercury Mesh is a user-level collection of AI agents that travel with you across projects. Unlike project agents (defined in a project's `.mesh/` directory), personal agents live in your global config directory and are automatically discovered when you start a Mercury Mesh session.
6
+
7
+ ## Directory Structure
8
+
9
+ ```
10
+ ~/.config/Mercury Mesh/personal-Mercury Mesh/ # Linux/macOS
11
+ %APPDATA%/Mercury Mesh/personal-Mercury Mesh/ # Windows
12
+ ├── agents/
13
+ │ ├── {agent-name}/
14
+ │ │ ├── charter.md
15
+ │ │ └── history.md
16
+ │ └── ...
17
+ └── config.json # Optional: personal Mercury Mesh config
18
+ ```
19
+
20
+ ## How It Works
21
+
22
+ 1. **Ambient Discovery:** When Mercury Mesh starts a session, it checks for a personal Mercury Mesh directory
23
+ 2. **Merge:** Personal agents are merged into the session cast alongside project agents
24
+ 3. **Ghost Protocol:** Personal agents can read project state but not write to it
25
+ 4. **Kill Switch:** Set `MESH_NO_PERSONAL=1` to disable ambient discovery
26
+
27
+ ## Commands
28
+
29
+ - `Mercury Mesh personal init` — Bootstrap a personal Mercury Mesh directory
30
+ - `Mercury Mesh personal list` — List your personal agents
31
+ - `Mercury Mesh personal add {name} --role {role}` — Add a personal agent
32
+ - `Mercury Mesh personal remove {name}` — Remove a personal agent
33
+ - `Mercury Mesh cast` — Show the current session cast (project + personal)
34
+
35
+ ## Ghost Protocol
36
+
37
+ See `templates/ghost-protocol.md` for the full rules. Key points:
38
+ - Personal agents advise; project agents execute
39
+ - No writes to project `.mesh/` state
40
+ - Transparent origin tagging in logs
41
+ - Project agents take precedence on conflicts
42
+
43
+ ## Configuration
44
+
45
+ Optional `config.json` in the personal Mercury Mesh directory:
46
+ ```json
47
+ {
48
+ "defaultModel": "auto",
49
+ "ghostProtocol": true,
50
+ "agents": {}
51
+ }
52
+ ```
53
+
54
+ ## Environment Variables
55
+
56
+ - `MESH_NO_PERSONAL` — Set to any value to disable personal Mercury Mesh discovery
57
+ - `MESH_PERSONAL_DIR` — Override the default personal Mercury Mesh directory path
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: "project-conventions"
3
+ description: "Core conventions and patterns for this codebase"
4
+ domain: "project-conventions"
5
+ confidence: "medium"
6
+ source: "template"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ > **This is a starter template.** Replace the placeholder patterns below with your actual project conventions. Skills train agents on codebase-specific practices — accurate documentation here improves agent output quality.
12
+
13
+ ## Patterns
14
+
15
+ ### [Pattern Name]
16
+
17
+ Describe a key convention or practice used in this codebase. Be specific about what to do and why.
18
+
19
+ ### Error Handling
20
+
21
+ <!-- Example: How does your project handle errors? -->
22
+ <!-- - Use try/catch with specific error types? -->
23
+ <!-- - Log to a specific service? -->
24
+ <!-- - Return error objects vs throwing? -->
25
+
26
+ ### Testing
27
+
28
+ <!-- Example: What test framework? Where do tests live? How to run them? -->
29
+ <!-- - Test framework: Jest/Vitest/node:test/etc. -->
30
+ <!-- - Test location: test/, __tests__/, *.test.ts, etc. -->
31
+ <!-- - Run command: npm test, etc. -->
32
+
33
+ ### Code Style
34
+
35
+ <!-- Example: Linting, formatting, naming conventions -->
36
+ <!-- - Linter: ESLint config? -->
37
+ <!-- - Formatter: Prettier? -->
38
+ <!-- - Naming: camelCase, snake_case, etc.? -->
39
+
40
+ ### File Structure
41
+
42
+ <!-- Example: How is the project organized? -->
43
+ <!-- - src/ — Source code -->
44
+ <!-- - test/ — Tests -->
45
+ <!-- - docs/ — Documentation -->
46
+
47
+ ## Examples
48
+
49
+ ```
50
+ // Add code examples that demonstrate your conventions
51
+ ```
52
+
53
+ ## Anti-Patterns
54
+
55
+ <!-- List things to avoid in this codebase -->
56
+ - **[Anti-pattern]** — Explanation of what not to do and why.