@gempack/squad-mcp 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +3 -2
  3. package/CHANGELOG.md +260 -17
  4. package/INSTALL.md +156 -24
  5. package/README.md +279 -27
  6. package/agents/{PO.md → product-owner.md} +33 -1
  7. package/agents/{Senior-Architect.md → senior-architect.md} +33 -1
  8. package/agents/{Senior-DBA.md → senior-dba.md} +33 -1
  9. package/agents/{Senior-Dev-Reviewer.md → senior-dev-reviewer.md} +33 -1
  10. package/agents/{Senior-Dev-Security.md → senior-dev-security.md} +33 -1
  11. package/agents/{Senior-Developer.md → senior-developer.md} +33 -1
  12. package/agents/{Senior-QA.md → senior-qa.md} +33 -1
  13. package/agents/{TechLead-Consolidator.md → tech-lead-consolidator.md} +7 -1
  14. package/agents/{TechLead-Planner.md → tech-lead-planner.md} +7 -1
  15. package/commands/squad-review.md +10 -58
  16. package/commands/squad.md +11 -70
  17. package/dist/config/ownership-matrix.d.ts +24 -2
  18. package/dist/config/ownership-matrix.js +466 -139
  19. package/dist/config/ownership-matrix.js.map +1 -1
  20. package/dist/config/squad-yaml.d.ts +242 -0
  21. package/dist/config/squad-yaml.js +403 -0
  22. package/dist/config/squad-yaml.js.map +1 -0
  23. package/dist/errors.d.ts +1 -1
  24. package/dist/errors.js +1 -1
  25. package/dist/errors.js.map +1 -1
  26. package/dist/format/pr-review.d.ts +61 -0
  27. package/dist/format/pr-review.js +146 -0
  28. package/dist/format/pr-review.js.map +1 -0
  29. package/dist/index.js +19 -13
  30. package/dist/index.js.map +1 -1
  31. package/dist/learning/format.d.ts +29 -0
  32. package/dist/learning/format.js +55 -0
  33. package/dist/learning/format.js.map +1 -0
  34. package/dist/learning/store.d.ts +102 -0
  35. package/dist/learning/store.js +169 -0
  36. package/dist/learning/store.js.map +1 -0
  37. package/dist/resources/agent-loader.d.ts +1 -1
  38. package/dist/resources/agent-loader.js +53 -40
  39. package/dist/resources/agent-loader.js.map +1 -1
  40. package/dist/tasks/select.d.ts +64 -0
  41. package/dist/tasks/select.js +84 -0
  42. package/dist/tasks/select.js.map +1 -0
  43. package/dist/tasks/store.d.ts +338 -0
  44. package/dist/tasks/store.js +321 -0
  45. package/dist/tasks/store.js.map +1 -0
  46. package/dist/tools/compose-advisory-bundle.d.ts +5 -5
  47. package/dist/tools/compose-advisory-bundle.js +24 -12
  48. package/dist/tools/compose-advisory-bundle.js.map +1 -1
  49. package/dist/tools/compose-prd-parse.d.ts +53 -0
  50. package/dist/tools/compose-prd-parse.js +167 -0
  51. package/dist/tools/compose-prd-parse.js.map +1 -0
  52. package/dist/tools/compose-squad-workflow.d.ts +28 -10
  53. package/dist/tools/compose-squad-workflow.js +0 -0
  54. package/dist/tools/compose-squad-workflow.js.map +1 -1
  55. package/dist/tools/consolidate.d.ts +55 -4
  56. package/dist/tools/consolidate.js +87 -15
  57. package/dist/tools/consolidate.js.map +1 -1
  58. package/dist/tools/expand-task.d.ts +51 -0
  59. package/dist/tools/expand-task.js +35 -0
  60. package/dist/tools/expand-task.js.map +1 -0
  61. package/dist/tools/list-tasks.d.ts +31 -0
  62. package/dist/tools/list-tasks.js +50 -0
  63. package/dist/tools/list-tasks.js.map +1 -0
  64. package/dist/tools/next-task.d.ts +37 -0
  65. package/dist/tools/next-task.js +60 -0
  66. package/dist/tools/next-task.js.map +1 -0
  67. package/dist/tools/read-learnings.d.ts +53 -0
  68. package/dist/tools/read-learnings.js +72 -0
  69. package/dist/tools/read-learnings.js.map +1 -0
  70. package/dist/tools/read-squad-config.d.ts +23 -0
  71. package/dist/tools/read-squad-config.js +34 -0
  72. package/dist/tools/read-squad-config.js.map +1 -0
  73. package/dist/tools/record-learning.d.ts +62 -0
  74. package/dist/tools/record-learning.js +80 -0
  75. package/dist/tools/record-learning.js.map +1 -0
  76. package/dist/tools/record-tasks.d.ts +71 -0
  77. package/dist/tools/record-tasks.js +45 -0
  78. package/dist/tools/record-tasks.js.map +1 -0
  79. package/dist/tools/registry.d.ts +1 -1
  80. package/dist/tools/registry.js +71 -39
  81. package/dist/tools/registry.js.map +1 -1
  82. package/dist/tools/score-rubric.d.ts +74 -0
  83. package/dist/tools/score-rubric.js +140 -0
  84. package/dist/tools/score-rubric.js.map +1 -0
  85. package/dist/tools/slice-files-for-task.d.ts +31 -0
  86. package/dist/tools/slice-files-for-task.js +52 -0
  87. package/dist/tools/slice-files-for-task.js.map +1 -0
  88. package/dist/tools/update-task-status.d.ts +29 -0
  89. package/dist/tools/update-task-status.js +35 -0
  90. package/dist/tools/update-task-status.js.map +1 -0
  91. package/package.json +4 -1
  92. package/skills/squad/SKILL.md +454 -0
  93. package/tools/post-review.mjs +212 -0
  94. /package/agents/{Skill-Squad-Dev.md → _shared/Skill-Squad-Dev.md} +0 -0
  95. /package/agents/{Skill-Squad-Review.md → _shared/Skill-Squad-Review.md} +0 -0
  96. /package/agents/{_Severity-and-Ownership.md → _shared/_Severity-and-Ownership.md} +0 -0
@@ -11,8 +11,8 @@
11
11
  "source": "github",
12
12
  "repo": "ggemba/squad-mcp"
13
13
  },
14
- "description": "Squad-dev workflow: deterministic classification, risk scoring, agent selection, advisory orchestration over MCP, plus /squad and /squad-review slash commands.",
15
- "version": "0.4.0",
14
+ "description": "Squad-dev workflow: deterministic classification, risk scoring, agent selection, advisory orchestration over MCP, native subagents, plus /squad and /squad-review slash commands.",
15
+ "version": "0.6.0",
16
16
  "license": "Apache-2.0",
17
17
  "homepage": "https://github.com/ggemba/squad-mcp"
18
18
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "squad",
3
- "version": "0.5.0",
4
- "description": "Squad-dev workflow as a Claude Code plugin: classification, risk scoring, agent selection, advisory orchestration. Bundles an MCP server and the /squad and /squad-review slash commands.",
3
+ "version": "0.6.0",
4
+ "description": "Squad-dev workflow as a Claude Code plugin: classification, risk scoring, agent selection, advisory orchestration. Bundles an MCP server, native subagents, and the /squad and /squad-review slash commands.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
7
7
  "name": "Gustavo",
@@ -10,6 +10,7 @@
10
10
  "homepage": "https://github.com/ggemba/squad-mcp#readme",
11
11
  "repository": "https://github.com/ggemba/squad-mcp",
12
12
  "keywords": ["mcp", "squad-dev", "code-review", "advisory", "agent"],
13
+ "agents": "./agents/",
13
14
  "commands": "./commands/",
14
15
  "skills": "./skills/",
15
16
  "mcpServers": {
package/CHANGELOG.md CHANGED
@@ -7,20 +7,263 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added — Tasks: PRD-decomposed atomic work units (anti-bloat for the squad)
11
+
12
+ Borrows the core idea from claude-task-master and adapts it to squad-mcp's primitives. A PRD is decomposed by the host LLM into atomic tasks; each task carries optional `scope` (glob) and `agent_hints`; the squad runs against ONE task's scope at a time. Less context per pass, fewer tokens, less drift.
13
+
14
+ - `src/tasks/store.ts` — mutable JSON store with mtime-keyed cache, atomic write (tmp + rename), stable id-sorted serialisation. Schema (zod): `{ id, title, description, status, dependencies, priority, details, test_strategy, scope?, agent_hints?, subtasks[], created_at, updated_at }`. Status: pending / in-progress / review / done / blocked / cancelled. Schema-versioned (`version: 1`) so future breaking changes can ship cleanly.
15
+ - `src/tasks/select.ts` — pure helpers. `listTasks` filters by status / agent / scope. `nextTask` does topo-aware selection: candidate status (default pending), all deps in done_statuses, optional agent + changed_files filter; tiebreak priority then id; returns a structured result with `reason: no_candidates | all_blocked | ok` + the blocked list (so callers can show "X is next when Y completes").
16
+ - 7 new MCP tools:
17
+ - `list_tasks`, `next_task`, `record_tasks`, `update_task_status`, `expand_task`, `slice_files_for_task` — the data-plane operations.
18
+ - `compose_prd_parse` — pure-MCP composer that builds a prompt + JSON schema for the host LLM to decompose a PRD. Server does NO LLM calls; the host already has provider keys and user consent. Includes existing tasks in the prompt so the LLM doesn't duplicate.
19
+ - New `.squad.yaml` section `tasks`:
20
+ - `path` (default `.squad/tasks.json`)
21
+ - `enabled` (default true — turn off to silence reads without deleting the file; writes stay open, matching the learnings policy)
22
+ - `tools/{list-tasks,next-task,record-tasks,update-task-status}.mjs` — non-MCP CLI helpers sharing a tiny `tools/_tasks-io.mjs` module. Run anywhere with node 18+.
23
+ - `skills/squad/SKILL.md` adds:
24
+ - **Phase 0.5 — Decompose PRD into tasks** (task-mode only). Build prompt → run LLM → preview → user-confirm → `record_tasks`. Inviolable: never bulk-record without per-list confirmation, never invent dependencies, never alter ids the user reviewed.
25
+ - **Phase 0.6 — Pick a task** via `/squad-next` or `/squad-task <id>`. Slice files via `slice_files_for_task`, narrow squad via the task's `agent_hints`, run normal advisory. When done, flip status via `update_task_status`.
26
+ - 38 new tests cover store (read / record / update / expand / cache invalidation / on-disk format) and select (filter / topo / priority tiebreak / blocked surfacing). Smoke test now verifies 23 tools (was 16).
27
+
28
+ ### Added — Learning JSONL: persistent accept/reject memory
29
+
30
+ Closes the squad's biggest UX gap: re-running review on the same repo no
31
+ longer re-raises findings the team already considered and rejected (with
32
+ reason). Every accept/reject decision becomes one append-only line in
33
+ `.squad/learnings.jsonl`, versioned in git, surfaced as a markdown block
34
+ injected into the next run's agent and consolidator prompts.
35
+
36
+ - `src/learning/store.ts` — JSONL store with mtime-keyed cache.
37
+ `readLearnings`, `appendLearning`, and `tailRecent` (filterable by agent
38
+ / decision). Schema: `{ ts, pr?, branch?, agent, severity?, finding,
39
+ decision, reason?, scope? }`. Schema violations on read are loud
40
+ rejections — silent corruption is worse.
41
+ - `src/learning/format.ts` — pure formatter rendering a most-recent-first
42
+ numbered list under a `## Past team decisions` heading. Filters scoped
43
+ entries by glob match against `changedFiles`; entries without a scope
44
+ are repo-wide and always pass. Returns `''` when no entries qualify
45
+ (callers check before injecting — no empty headers in prompts).
46
+ - New tool `read_learnings` — load, filter (agent / decision / scope),
47
+ return both raw entries and the rendered markdown block. Honors the
48
+ master switch `learnings.enabled` from `.squad.yaml`.
49
+ - New tool `record_learning` — append a decision. Side-effecting; the
50
+ skill (or CLI) is responsible for user confirmation per finding.
51
+ - New `.squad.yaml` section `learnings`:
52
+ - `path` (default `.squad/learnings.jsonl`)
53
+ - `max_recent` (default 50, hard cap 200)
54
+ - `enabled` (default true — turn off to disable injection without
55
+ deleting the journal)
56
+ - `tools/record-learning.mjs` — CLI helper for non-MCP clients. Direct
57
+ JSONL append, no MCP round-trip. Same flags as the MCP tool plus
58
+ `--workspace` / `--file`.
59
+ - `skills/squad/SKILL.md` adds **Phase 14 — Post-PR record decision**
60
+ (opt-in, per-finding authorisation required) and injects
61
+ `read_learnings` output into Phase 5 (per-agent advisory) and Phase 10
62
+ (consolidator). Inviolable rules: never record without explicit
63
+ per-finding authorisation, never invent a `reason`, never amend or
64
+ delete past entries through the skill.
65
+
66
+ 38 new tests cover the store (read / append / cache invalidation /
67
+ schema violations) and the formatter (limits, scope filtering,
68
+ rendering variants). Smoke test now verifies 16 tools (was 14).
69
+
70
+ ### Added — Post `/squad-review` results as a GitHub PR review
71
+
72
+ Closes the loop from "advisory in your terminal" to "advisory on the PR
73
+ where the team works". The verdict + scorecard go up as a `gh pr review`
74
+ with the appropriate action (`--approve` / `--comment` / `--request-changes`)
75
+ chosen deterministically from verdict + score.
76
+
77
+ - `src/format/pr-review.ts` — pure formatter taking `ConsolidationOutput`
78
+ plus options, returning markdown body, chosen `gh` action, and summary
79
+ line. Header, fenced rubric scorecard, per-agent finding sections
80
+ (sorted), severity totals, footer. Verdict-to-action mapping in
81
+ `chooseGhAction` (exported separately for testability).
82
+ - `tools/post-review.mjs` — CLI helper that lives outside the MCP server
83
+ (alongside the commit-msg hook). Reads consolidation JSON from stdin,
84
+ formats, invokes `gh pr review --<action> --body-file -`. Supports
85
+ `--dry-run`, `--repo owner/name`, `--request-changes-below N`,
86
+ `--no-footer`, `--pr <n>` (required). Exit codes:
87
+ `2` invalid input, `3` gh missing/unauthenticated, `4` gh failed.
88
+ - New `.squad.yaml` section `pr_posting`:
89
+ - `auto_post: bool` (default false — skill always confirms)
90
+ - `request_changes_below_score: number` (opt-in floor)
91
+ - `omit_attribution_footer: bool` (default false)
92
+ - `skills/squad/SKILL.md` adds **Phase 13 — Post to PR** (review mode,
93
+ opt-in). Inviolable rules: never post without showing the body first,
94
+ never post `--request-changes` on someone else's PR without explicit
95
+ user instruction, never amend or delete a posted review.
96
+
97
+ 23 new tests cover the formatter (header variants, rubric block, findings
98
+ section, footer, summary, action mapping). The action mapping never
99
+ promotes a verdict (low-severity can't become approve) and only demotes
100
+ APPROVED — never downgrades CHANGES_REQUIRED further.
101
+
102
+ ### Added — `.squad.yaml` repo configuration
103
+
104
+ Per-repo configuration file (versioned with the code) lets each project tune
105
+ the rubric, thresholds, and scope without editing call sites.
106
+
107
+ - `src/config/squad-yaml.ts` — reader with zod schema, mtime-keyed cache, and
108
+ the `applySkipPaths` / `applyDisableAgents` helpers. YAML-to-zod path uses
109
+ `js-yaml` (FAILSAFE_SCHEMA + numeric coercion for known fields). Looks up
110
+ `.squad.yaml` then `.squad.yml` at workspace_root; absent file falls back to
111
+ package defaults silently.
112
+ - New tool `read_squad_config` — MCP wrapper for direct introspection by
113
+ non-Claude-Code clients or callers that build their own bundle.
114
+ - `compose_squad_workflow` now reads `.squad.yaml` and: applies `skip_paths`
115
+ to changed_files BEFORE classification (skipped paths still count toward
116
+ risk signals — disabling a file from advisory does not make the change
117
+ less risky), then applies `disable_agents` to the selected squad. Returns
118
+ the resolved `config`, `skipped_paths`, and `disabled_agents` so callers
119
+ see why the slice list got narrower.
120
+ - `compose_advisory_bundle` propagates `skip_paths` filtering through to
121
+ per-agent slices, so an agent never receives a path the composer hid.
122
+ - New `CONFIG_READ_FAILED` error code.
123
+ - New dep: `js-yaml` (^4.1) + `@types/js-yaml`. Battle-tested, MIT, ~70KB.
124
+ - `force_agents` in tool calls still wins over `config.disable_agents` —
125
+ config is a default policy, not a veto over explicit caller intent.
126
+
127
+ Validation: weights that don't sum to 100 across the listed agents → reject.
128
+ Unknown agent names in `weights` or `disable_agents` → reject. Threshold or
129
+ min_score outside 0-100 → reject. Errors carry `source` (file path) for
130
+ diagnosability.
131
+
132
+ Example `.squad.yaml`:
133
+
134
+ ```yaml
135
+ weights:
136
+ senior-dev-security: 30 # PCI compliance
137
+ senior-dba: 22
138
+ senior-developer: 20
139
+ senior-architect: 15
140
+ senior-qa: 13
141
+ threshold: 80
142
+ min_score: 75
143
+ skip_paths:
144
+ - "docs/**"
145
+ - "**/*.md"
146
+ - "**/generated/**"
147
+ disable_agents:
148
+ - product-owner # internal tool, no PO involved
149
+ ```
150
+
151
+ 22 new tests cover reader (file presence, weights override, skip_paths,
152
+ disable_agents, caching, mtime invalidation, glob matching). Backward
153
+ compatible: callers that don't pass `workspace_root` to non-composer tools
154
+ get the legacy behaviour (no config read).
155
+
156
+ ### Added — weighted rubric scorecard
157
+
158
+ Each advisory agent now represents a dimension of a multi-dimensional rubric
159
+ with a default weight. The consolidator emits a pre-formatted ASCII scorecard
160
+ alongside the legacy verdict.
161
+
162
+ - New tool `score_rubric` (`src/tools/score-rubric.ts`): pure function over
163
+ per-agent scores (0-100) and optional weight overrides; returns
164
+ `weighted_score`, per-dimension breakdown with bars, `passes_threshold`,
165
+ `ignored_agents`, and a pre-formatted `scorecard_text`.
166
+ - `AgentDef` extended with `weight: number` and `dimension: string`. Default
167
+ weights sum to 100 across the seven advisory agents (Architecture 18%,
168
+ Security 18%, Application Code 18%, Data Layer 14%, Testing & QA 14%, Code
169
+ Quality 10%, Business & UX 8%). Meta-agents (tech-lead-planner,
170
+ tech-lead-consolidator) carry weight 0 — they don't score a dimension.
171
+ - `apply_consolidation_rules` accepts optional per-agent `score`/`score_rationale`,
172
+ optional `weights` override, optional `threshold` (default 75), and optional
173
+ `min_score`. Returns `rubric: RubricOutput | null` and `downgraded_by_score`.
174
+ When `min_score` is set, an APPROVED verdict with weighted score below the
175
+ floor is downgraded to CHANGES_REQUIRED. Backward compatible: callers that
176
+ omit scores get the legacy output shape and verdict logic.
177
+ - Each advisory agent file (`agents/*.md`) now ships a `## Score` section with
178
+ a calibration table (90-100 / 70-89 / 50-69 / 30-49 / 0-29 bands) specific
179
+ to that dimension, plus the protocol for emitting `Score: NN/100`.
180
+ - Skill `skills/squad/SKILL.md` updated to capture per-agent scores into the
181
+ reports array and surface `rubric.scorecard_text` verbatim in the final
182
+ output. Tech-lead-planner/consolidator excluded (weight 0).
183
+ - Weight renormalisation: when only a subset of agents scores (partial pass),
184
+ the rubric renormalises across the agents that actually scored. A 4-of-9
185
+ advisory still produces a meaningful weighted score over those 4.
186
+ - `tests/score-rubric.test.ts` and `tests/consolidate-rubric.test.ts` cover
187
+ the math (renormalisation, weight overrides, sum=100 validation, threshold
188
+ edge cases), backward compatibility, and the `min_score` downgrade rule.
189
+
10
190
  Planned for a future minor:
11
191
 
12
- - Promote bundled agent markdowns to Claude Code native plugin agents (rename to
13
- kebab-case + add YAML frontmatter), with a migration path for existing
14
- `%APPDATA%\squad-mcp\agents` overrides.
15
- - Retire the legacy `/squad` and `/squad-review` skills now that the plugin
16
- ships them as slash commands.
17
- - Extract `tools/sync-agents.mjs` helpers into a `tools/sync/` module
18
- (`baseline-store.mjs`, `safe-copy.mjs`, `agents.mjs`, `skills.mjs`) once a
19
- third sync target lands.
20
- - Streaming SHA-256 over `fs.createReadStream` for skill files larger than a
21
- threshold (avoids `readFileSync` doubling memory on large bundled assets).
22
- - Property-based tests for `hasPathSeparator` and the tri-state baseline
23
- policy state machine via `fast-check`.
192
+ - Per-PR memory of accept/reject decisions feeding back into agent prompts.
193
+ - Inline line-by-line annotations on the diff (one `gh` review comment per finding with file:line links).
194
+ - GitHub Action wrapper for PR posting in CI.
195
+ - Streaming SHA-256 over `fs.createReadStream` for any large bundled asset
196
+ reads (avoids `readFileSync` doubling memory).
197
+ - Property-based tests for severity/consolidation rules via `fast-check`.
198
+
199
+ ## [0.6.0] - 2026-05-10
200
+
201
+ ### Architectural cleanup separation of concerns
202
+
203
+ This release rationalizes the role of each layer of the project. The MCP server
204
+ owns deterministic primitives + agent definitions. The Claude Code plugin owns
205
+ packaging (skill, commands, native subagents, MCP wiring). One skill (`squad`)
206
+ hosts both `implement` and `review` modes — no client bifurcation, no skill
207
+ fragmentation. Agent markdowns live in **one** place per install: the plugin's
208
+ `agents/` directory at install time, exposed both as native Claude Code
209
+ subagents and as MCP `agent://…` resources for non-Claude-Code clients.
210
+
211
+ ### Changed (BREAKING)
212
+
213
+ - **Agent markdown filenames renamed to kebab-case** with YAML frontmatter so
214
+ Claude Code registers them as native subagents. Old (PascalCase) filenames
215
+ no longer exist:
216
+ - `agents/PO.md` → `agents/product-owner.md`
217
+ - `agents/Senior-Architect.md` → `agents/senior-architect.md`
218
+ - `agents/Senior-DBA.md` → `agents/senior-dba.md`
219
+ - `agents/Senior-Developer.md` → `agents/senior-developer.md`
220
+ - `agents/Senior-Dev-Reviewer.md` → `agents/senior-dev-reviewer.md`
221
+ - `agents/Senior-Dev-Security.md` → `agents/senior-dev-security.md`
222
+ - `agents/Senior-QA.md` → `agents/senior-qa.md`
223
+ - `agents/TechLead-Planner.md` → `agents/tech-lead-planner.md`
224
+ - `agents/TechLead-Consolidator.md` → `agents/tech-lead-consolidator.md`
225
+ - **Shared docs moved to `agents/_shared/`**: `_Severity-and-Ownership.md`,
226
+ `Skill-Squad-Dev.md`, `Skill-Squad-Review.md`. They are not registered as
227
+ subagents; they're reference material. Cross-references inside agent files
228
+ updated accordingly.
229
+ - **AgentName `'po'` renamed to `'product-owner'`** across the type, AGENTS
230
+ registry, AGENT_FILE_MAP, ownership matrix entries, MCP resource URI, and
231
+ tests — full consistency with the file/frontmatter name. MCP resource URI
232
+ changes from `agent://po` to `agent://product-owner`.
233
+ - **Plugin manifest declares `agents/`**: `.claude-plugin/plugin.json` now
234
+ includes `"agents": "./agents/"`, registering the nine subagents natively
235
+ in Claude Code.
236
+ - **Single `squad` skill replaces the two command-only entries.** Both
237
+ `/squad` and `/squad-review` invoke `skills/squad/SKILL.md`; the entry
238
+ command selects mode (`implement` vs `review`). Phases 2/4/8/9/11 only run
239
+ in implement mode.
240
+
241
+ ### Removed (BREAKING)
242
+
243
+ - **`tools/sync-agents.mjs` deleted.** The plugin install path is the canonical
244
+ Claude Code distribution; non-Claude-Code MCP clients consume agent
245
+ definitions over MCP. Users on the previous "npm install + sync to
246
+ `~/.claude/`" flow should migrate to the plugin install (Path A in
247
+ INSTALL.md).
248
+ - **`tests/sync-agents.test.ts` deleted** alongside the script.
249
+
250
+ ### Migration
251
+
252
+ If you had `%APPDATA%\squad-mcp\agents` (Windows) or
253
+ `$XDG_CONFIG_HOME/squad-mcp/agents` (Unix) overrides for the old PascalCase
254
+ filenames, rename them to the new kebab-case names. The override allowlist and
255
+ loader semantics are unchanged. Shared-doc overrides moved into a `_shared/`
256
+ subdirectory under the same override root.
257
+
258
+ If you depended on `~/.claude/agents/` being populated by the sync script,
259
+ install the plugin (`/plugin install squad@gempack`) — Claude Code now
260
+ registers the agents directly from the plugin's bundled `agents/` directory.
261
+
262
+ ### Added
263
+
264
+ - `initLocalConfig` ensures the `_shared/` subdirectory exists before copying
265
+ shared docs (previously a latent bug on first init when the override root
266
+ did not yet contain a subdirectory).
24
267
 
25
268
  ## [0.5.0] - 2026-05-04
26
269
 
@@ -39,11 +282,11 @@ Planned for a future minor:
39
282
  (market patterns, best practices, pitfalls, examples); spawns specialist
40
283
  agents for multi-domain perspectives; synthesizes findings into a sourced
41
284
  options matrix with a recommendation. Exploratory only — produces no code or
42
- file changes. Position in the workflow: `/brainstorm` decides *what* to
285
+ file changes. Position in the workflow: `/brainstorm` decides _what_ to
43
286
  build; `/squad` implements; `/squad-review` reviews. Triggered via
44
287
  `/brainstorm` or natural-language asks ("brainstorm", "research approaches",
45
288
  "explore options", "what does the industry use"). Supports `--depth
46
- quick|medium|deep`, `--no-web`, `--focus <domain>`, and `--sources <N>`.
289
+ quick|medium|deep`, `--no-web`, `--focus <domain>`, and `--sources <N>`.
47
290
  - **`commit-suggest` skill.** Read-only Conventional Commits message suggester.
48
291
  Runs only an allowlist of git commands (`status`, `diff`, `log`, `rev-parse`,
49
292
  `config --get`, `ls-files`, `show <ref>:<path>`); never executes any
@@ -55,8 +298,8 @@ Planned for a future minor:
55
298
  enabled in Claude Code.
56
299
  - **`tools/git-hooks/commit-msg`**. Optional opt-in hook that rejects commits
57
300
  whose messages contain AI-attribution trailers (`Co-Authored-By: Claude /
58
- Anthropic / GPT / OpenAI / Gemini / Copilot / AI`, `Generated with [Claude
59
- Code]`, `Made by AI`, `<noreply@anthropic.com>`). Install via `cp` to
301
+ Anthropic / GPT / OpenAI / Gemini / Copilot / AI`, `Generated with [Claude
302
+ Code]`, `Made by AI`, `<noreply@anthropic.com>`). Install via `cp` to
60
303
  `.git/hooks/` or repo-wide via `git config core.hooksPath tools/git-hooks`.
61
304
  - **`tools/sync-agents.mjs` skills sync.** Mirrors bundled skills to
62
305
  `~/.claude/skills/` for non-plugin clients (Claude Desktop, Cursor, Warp).
@@ -291,7 +534,7 @@ content signals). No `0.2.0` git tag was created; that scope ships as part of
291
534
  - **CWD validation**: must be absolute, must exist, must be a directory,
292
535
  must contain a `.git` entry. Resolved via `realpath`.
293
536
  - **Hardening prefix**: every invocation prepends `-c core.fsmonitor=false
294
- -c diff.external= -c core.hooksPath=NUL` (or `/dev/null`).
537
+ -c diff.external= -c core.hooksPath=NUL` (or `/dev/null`).
295
538
  - **Environment scrub**: drops user env, sets `GIT_TERMINAL_PROMPT=0`,
296
539
  `GIT_OPTIONAL_LOCKS=0`, `GIT_CONFIG_NOSYSTEM=1`,
297
540
  `GIT_CEILING_DIRECTORIES=<parent of cwd>`.
package/INSTALL.md CHANGED
@@ -4,10 +4,18 @@ This guide walks through installing `squad-mcp` in every supported host: Claude
4
4
 
5
5
  After install you get:
6
6
 
7
- - 12 deterministic MCP tools (Claude Code exposes them as `mcp__squad__*`; other hosts may use a different prefix)
7
+ - 23 deterministic MCP tools (Claude Code exposes them as `mcp__squad__*`; other hosts may use a different prefix). Counts grow as new features land — the running server is authoritative; call `tools/list` to see the live count.
8
8
  - 12 MCP resources (`agent://*`, `severity://*`)
9
9
  - 3 MCP prompts (`squad_orchestration`, `agent_advisory`, `consolidator`)
10
- - 2 slash commands (`/squad`, `/squad-review`) — Claude Code only
10
+ - 4 slash commands — Claude Code only:
11
+ - `/squad <task>` — implementation workflow
12
+ - `/squad-review [target]` — advisory-only review of an existing diff/branch/PR
13
+ - `/brainstorm <topic>` — pre-implementation research
14
+ - `/commit-suggest` — Conventional Commits message suggester (read-only)
15
+ - Two on-disk stores under `.squad/` (versioned in git):
16
+ - `.squad/tasks.json` — atomic tasks decomposed from a PRD (see [`Tasks`](#path-d--using-the-tasks-store))
17
+ - `.squad/learnings.jsonl` — accept/reject decisions on past advisory findings (see [`Learnings`](#path-e--using-the-learnings-store))
18
+ - Optional repo configuration in [`.squad.yaml`](#repo-configuration--squadyaml) (weights, skip paths, disabled agents, learnings/tasks paths, PR-posting policy).
11
19
 
12
20
  ## Prerequisites
13
21
 
@@ -44,11 +52,10 @@ The plugin bundles the MCP server, the slash commands, and the agent definitions
44
52
  3. **Restart Claude Code** (close and reopen). The slash-command registry is populated at startup, so the new `/squad` and `/squad-review` commands and the `squad` MCP server only become available after a restart.
45
53
 
46
54
  4. **Verify the install.** In a fresh prompt:
47
-
48
55
  - Type `/squad ` (with the trailing space) — the autocomplete should suggest `/squad <task description>`.
49
56
  - Type `/squad-review` — same check.
50
57
  - Open Settings → MCP. You should see `squad` listed and connected.
51
- - Ask Claude to call the `list_agents` tool from the `squad` MCP server. It should return 9 agents (`po`, `tech-lead-planner`, `tech-lead-consolidator`, `senior-architect`, `senior-dba`, `senior-developer`, `senior-dev-reviewer`, `senior-dev-security`, `senior-qa`).
58
+ - Ask Claude to call the `list_agents` tool from the `squad` MCP server. It should return 9 agents (`product-owner`, `tech-lead-planner`, `tech-lead-consolidator`, `senior-architect`, `senior-dba`, `senior-developer`, `senior-dev-reviewer`, `senior-dev-security`, `senior-qa`).
52
59
 
53
60
  5. **Use it.**
54
61
 
@@ -80,16 +87,9 @@ Then restart Claude Code.
80
87
 
81
88
  Use this path for hosts that don't have a plugin marketplace (Claude Desktop, Cursor, Warp, Continue, etc.) or when you want the MCP server only without the slash commands.
82
89
 
83
- > **Path B vs Path A — what gets installed:** the npm package ships **only the MCP server** (`dist/index.js`). The bundled agents (`agents/*.md`), shared docs (`agents/_squad-shared/`), and skills (`skills/*/SKILL.md`) are **not** auto-mirrored to `~/.claude/` by `npx`. Path A (Claude Code plugin) registers them via the manifest; Path B users who want the slash commands and skills materialized in `~/.claude/agents/` and `~/.claude/skills/` must run the bundled sync script after installing:
84
- >
85
- > ```bash
86
- > # From a checkout of https://github.com/ggemba/squad-mcp at the matching tag:
87
- > node tools/sync-agents.mjs
88
- > ```
90
+ > **Path B vs Path A — what each path provides:** Path A (Claude Code plugin) registers agents, skills, slash commands, and the MCP server via the plugin manifest. Path B (npm package) ships **only the MCP server** (`dist/index.js`); slash commands and native subagents are Claude Code-specific concepts and don't apply to non-Claude-Code MCP clients. Those clients access the same agent definitions via MCP `agent://…` resources or the `get_agent_definition` tool exposed by the server.
89
91
  >
90
- > The sync is idempotent. Re-running it preserves any skill files you have edited locally (skip-with-warning policy). Delete a skill file under `~/.claude/skills/<name>/` (losing your edits) to receive the next bundled update.
91
- >
92
- > The script maintains a `~/.claude/skills/.bundle-hashes.json` baseline file that records the hash of the last bundled version of each skill file. It distinguishes "unmodified prior bundle" (overwrite on update) from "user-modified" (preserve with warning). Do **not** edit or delete this file manually — deleting it forces all existing skills to be classified as user-modified until they happen to match a future bundle.
92
+ > If you're running Claude Code, **always prefer Path A**. Path B exists for clients without a Claude-Code plugin layer (Claude Desktop, Cursor, Warp, Continue).
93
93
 
94
94
  The package is published as [`@gempack/squad-mcp`](https://www.npmjs.com/package/@gempack/squad-mcp). You don't need to install it globally — `npx` will fetch and cache it on first run.
95
95
 
@@ -98,7 +98,7 @@ The package is published as [`@gempack/squad-mcp`](https://www.npmjs.com/package
98
98
  The default `npx -y @gempack/squad-mcp` resolves to the latest published version on every host launch. To pin a specific version, append `@<version>`:
99
99
 
100
100
  ```bash
101
- npx -y @gempack/squad-mcp@0.4.0
101
+ npx -y @gempack/squad-mcp@0.6.0
102
102
  ```
103
103
 
104
104
  Releases are published from CI with [npm provenance](https://docs.npmjs.com/generating-provenance-statements). Verify the published tarball before configuring a host:
@@ -107,7 +107,7 @@ Releases are published from CI with [npm provenance](https://docs.npmjs.com/gene
107
107
  npm audit signatures @gempack/squad-mcp
108
108
  ```
109
109
 
110
- Pin in your host config the same way (e.g. `args: ["-y", "@gempack/squad-mcp@0.4.0"]`).
110
+ Pin in your host config the same way (e.g. `args: ["-y", "@gempack/squad-mcp@0.6.0"]`).
111
111
 
112
112
  > **Note:** the per-host examples below use the unpinned default (`@gempack/squad-mcp`) for readability. For production setups, replace `@gempack/squad-mcp` with `@gempack/squad-mcp@<version>` in every host's `args` array.
113
113
 
@@ -127,7 +127,7 @@ Edit the config file:
127
127
 
128
128
  - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
129
129
  - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
130
- - **Linux:** `~/.config/Claude/claude_desktop_config.json` (unofficial — not all Claude Desktop builds support Linux)
130
+ - **Linux:** `~/.config/Claude/claude_desktop_config.json` (unofficial — not all Claude Desktop builds support Linux). Flatpak builds sandbox `~/.config/`; check `~/.var/app/com.anthropic.Claude/config/Claude/` if the standard path doesn't load. Snap builds use `~/snap/claude/current/.config/Claude/`.
131
131
 
132
132
  Add (or merge) the `squad` entry:
133
133
 
@@ -240,6 +240,137 @@ To point a host at your local build, replace `command: npx, args: -y @gempack/sq
240
240
  }
241
241
  ```
242
242
 
243
+ ## Repo configuration — `.squad.yaml`
244
+
245
+ Drop a `.squad.yaml` (or `.squad.yml`) at the workspace root to override defaults per-project. Versioned with the code. Picked up automatically by the composers (`compose_squad_workflow`, `compose_advisory_bundle`).
246
+
247
+ All keys optional; partial files merge with package defaults. Cached by mtime — long-running MCP servers pick up edits without restart.
248
+
249
+ ```yaml
250
+ # .squad.yaml — example for a regulated fintech backend
251
+
252
+ # Rubric weights (must sum to 100 across the agents you list).
253
+ weights:
254
+ senior-dev-security: 30
255
+ senior-dba: 22
256
+ senior-developer: 20
257
+ senior-architect: 15
258
+ senior-qa: 13
259
+
260
+ # Per-dimension flag threshold (default 75).
261
+ threshold: 80
262
+
263
+ # Quality floor: APPROVED with weighted score below this becomes CHANGES_REQUIRED.
264
+ min_score: 75
265
+
266
+ # Files excluded from advisory.
267
+ skip_paths:
268
+ - "docs/**"
269
+ - "**/*.md"
270
+ - "**/generated/**"
271
+
272
+ # Agents not relevant for this repo.
273
+ disable_agents:
274
+ - product-owner
275
+
276
+ # Tasks store (Path D below).
277
+ tasks:
278
+ path: .squad/tasks.json
279
+ enabled: true
280
+
281
+ # Learnings store (Path E below).
282
+ learnings:
283
+ path: .squad/learnings.jsonl
284
+ max_recent: 50
285
+ enabled: true
286
+
287
+ # PR posting (used by /squad-review with PR refs).
288
+ pr_posting:
289
+ auto_post: false
290
+ request_changes_below_score: 60
291
+ omit_attribution_footer: false
292
+ ```
293
+
294
+ Validation is strict: weights must sum to 100, unknown agent names rejected, threshold/min_score 0-100. `force_agents` in tool calls still wins over `disable_agents`.
295
+
296
+ ## Path D — Using the tasks store
297
+
298
+ The squad's biggest source of token bloat is re-analysing the whole repo on every prompt. The tasks store fixes that: a PRD is decomposed into atomic tasks up front; the squad runs against ONE task's narrowed scope at a time.
299
+
300
+ **Decompose a PRD (Claude Code):**
301
+
302
+ ```
303
+ /squad-tasks docs/my-prd.md
304
+ ```
305
+
306
+ The skill:
307
+
308
+ 1. Calls `compose_prd_parse` with the PRD text.
309
+ 2. Decomposes via the host LLM (no provider keys on the server).
310
+ 3. Shows you the parsed tasks; waits for your "record".
311
+ 4. Calls `record_tasks` only after confirmation.
312
+
313
+ **Work tasks:**
314
+
315
+ ```
316
+ /squad-next # picks the highest-priority ready task
317
+ /squad-task 5 # explicit pick by id
318
+ ```
319
+
320
+ For each task, `slice_files_for_task` narrows the changed-files list to the task's `scope` glob; `compose_squad_workflow` runs against that slice with `agent_hints` as `force_agents` so only the relevant specialists wake up. When done, the skill flips status via `update_task_status`.
321
+
322
+ **CLI for non-MCP environments:**
323
+
324
+ ```bash
325
+ echo '[{"title":"Add CSRF","scope":"src/api/**"}]' | node tools/record-tasks.mjs
326
+ node tools/list-tasks.mjs --status pending
327
+ node tools/next-task.mjs --json
328
+ node tools/update-task-status.mjs --task 5 --status done
329
+ ```
330
+
331
+ The tasks file (`.squad/tasks.json` by default) is intended to live in git so the team's decomposition ships with the repo.
332
+
333
+ ## Path E — Using the learnings store
334
+
335
+ Once `/squad-review` produces a verdict, you can record per-finding decisions (accept / reject + reason) into `.squad/learnings.jsonl`. Future advisory runs read the recent tail and inject it into agent + consolidator prompts so the squad stops re-raising findings the team has already considered.
336
+
337
+ **Record a decision (Claude Code):**
338
+
339
+ ```
340
+ record reject senior-dev-security "missing CSRF on POST /api/refund"
341
+ reason: CSRF terminated at API gateway
342
+ scope: src/api/**
343
+ ```
344
+
345
+ The skill restates the decision and waits for explicit confirmation before calling `record_learning`. Per-finding authorisation is required — silence or "thanks" is not authorisation.
346
+
347
+ **CLI helper:**
348
+
349
+ ```bash
350
+ node tools/record-learning.mjs --reject \
351
+ --agent senior-dev-security \
352
+ --finding "missing CSRF on POST /api/refund" \
353
+ --reason "CSRF terminated at API gateway" \
354
+ --scope "src/api/**" \
355
+ --pr 42
356
+ ```
357
+
358
+ The journal is append-only by design — corrections are appended, never amended.
359
+
360
+ ## Path F — Posting `/squad-review` to GitHub PRs
361
+
362
+ When `/squad-review #42` runs, the verdict + scorecard can be posted to the PR via `gh pr review`. Default behaviour: dry-run + confirmation.
363
+
364
+ ```bash
365
+ echo '<consolidation JSON>' | node tools/post-review.mjs --pr 42 --dry-run
366
+ # review the body, then:
367
+ echo '<consolidation JSON>' | node tools/post-review.mjs --pr 42
368
+ ```
369
+
370
+ The CLI maps verdict → `gh` action deterministically (APPROVED → `--approve`, CHANGES_REQUIRED → `--comment`, REJECTED → `--request-changes`). Set `pr_posting.auto_post: true` in `.squad.yaml` to skip the second confirmation, but the skill still always shows the body before posting.
371
+
372
+ Inviolable: never amend or delete a posted review through this skill (re-run for a fresh review); never post `--request-changes` on a PR you do not own without explicit user instruction.
373
+
243
374
  ## Local override of agent definitions
244
375
 
245
376
  The bundled agent markdowns can be overridden without forking. The loader picks ONE local override directory:
@@ -345,12 +476,13 @@ Both layers compose: prompt rule, `permissions.deny`, and the `commit-msg` hook.
345
476
 
346
477
  ## Bundled skills
347
478
 
348
- The plugin ships these skills under `skills/` (auto-registered when the plugin is enabled, or mirrored to `~/.claude/skills/` via `node tools/sync-agents.mjs` for non-plugin clients):
479
+ The plugin ships these skills under `skills/` (auto-registered when the plugin is enabled):
349
480
 
350
- | Skill | Trigger | Purpose |
351
- |-------|---------|---------|
352
- | `commit-suggest` | `/commit-suggest` | Read-only Conventional Commits message suggester. No AI co-author trailers. |
353
- | `brainstorm` | `/brainstorm <topic>` | Pre-implementation exploration. Web research + multi-agent perspectives + options matrix with cited sources. Produces no code. |
481
+ | Skill | Trigger | Purpose |
482
+ | ---------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
483
+ | `squad` | `/squad <task>`, `/squad-review [tgt]`, `/squad-tasks <prd>`, `/squad-next`, `/squad-task <id>` | Single skill, three modes. Implement runs the full orchestration. Review runs the advisory portion only on an existing diff/branch/PR. Tasks decomposes a PRD into atomic tasks and runs the squad on one task's scope at a time. |
484
+ | `commit-suggest` | `/commit-suggest` | Read-only Conventional Commits message suggester. No AI co-author trailers. |
485
+ | `brainstorm` | `/brainstorm <topic>` | Pre-implementation exploration. Web research + multi-agent perspectives + options matrix with cited sources. Produces no code. |
354
486
 
355
487
  Workflow positioning:
356
488
 
@@ -385,10 +517,10 @@ Workflow positioning:
385
517
  After install, regardless of host:
386
518
 
387
519
  - [ ] `squad` MCP server shows as connected in the host's MCP settings.
388
- - [ ] `list_agents` tool returns 9 agents.
389
- - [ ] `compose_squad_workflow` with arguments `{"workspace_root": ".", "user_prompt": "smoke"}` returns `work_type`, `risk`, `squad.agents`. Requires a git repo with at least one prior commit (the tool defaults `base_ref` to `HEAD~1` internally).
520
+ - [ ] `list_agents` tool returns 9 agents (names: `product-owner`, `tech-lead-planner`, `tech-lead-consolidator`, `senior-architect`, `senior-dba`, `senior-developer`, `senior-dev-reviewer`, `senior-dev-security`, `senior-qa`).
521
+ - [ ] `compose_squad_workflow` with arguments `{"workspace_root": "<absolute path to a git repo>", "user_prompt": "smoke"}` returns `work_type`, `risk`, `squad.agents`. Requires a git repo with at least one prior commit (the tool defaults `base_ref` to `HEAD~1` internally). **`workspace_root` must be an absolute path** — relative paths are rejected with `PATH_INVALID`.
390
522
  - [ ] Resources `agent://senior-architect` and `severity://_severity-and-ownership` are readable.
391
- - [ ] (Claude Code only) `/squad` and `/squad-review` autocomplete.
523
+ - [ ] (Claude Code only) `/squad`, `/squad-review`, `/brainstorm`, and `/commit-suggest` autocomplete.
392
524
 
393
525
  ## Troubleshooting
394
526