@fredericboyer/dev-team 0.6.0 → 0.8.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.
- package/README.md +12 -11
- package/dist/bin/dev-team.js +12 -12
- package/dist/bin/dev-team.js.map +1 -1
- package/dist/create-agent.js +6 -6
- package/dist/create-agent.js.map +1 -1
- package/dist/doctor.js +15 -16
- package/dist/doctor.js.map +1 -1
- package/dist/files.js +2 -0
- package/dist/files.js.map +1 -1
- package/dist/init.js +55 -44
- package/dist/init.js.map +1 -1
- package/dist/scan.js +9 -9
- package/dist/scan.js.map +1 -1
- package/dist/skill-recommendations.d.ts +57 -0
- package/dist/skill-recommendations.js +290 -0
- package/dist/skill-recommendations.js.map +1 -0
- package/dist/status.js +11 -11
- package/dist/status.js.map +1 -1
- package/dist/update.d.ts +1 -4
- package/dist/update.js +178 -59
- package/dist/update.js.map +1 -1
- package/package.json +3 -3
- package/templates/CLAUDE.md +9 -7
- package/templates/agents/dev-team-beck.md +14 -2
- package/templates/agents/dev-team-borges.md +4 -4
- package/templates/agents/dev-team-conway.md +15 -3
- package/templates/agents/dev-team-deming.md +20 -2
- package/templates/agents/dev-team-drucker.md +21 -7
- package/templates/agents/dev-team-hamilton.md +14 -2
- package/templates/agents/dev-team-mori.md +14 -2
- package/templates/agents/dev-team-tufte.md +14 -2
- package/templates/agents/dev-team-voss.md +14 -2
- package/templates/hooks/dev-team-post-change-review.js +1 -25
- package/templates/hooks/dev-team-pre-commit-gate.js +80 -47
- package/templates/hooks/dev-team-watch-list.js +3 -3
- package/templates/settings.json +6 -20
- package/templates/skill-recommendations.json +169 -0
- package/templates/skills/dev-team-assess/SKILL.md +167 -0
- package/templates/skills/dev-team-audit/SKILL.md +8 -3
- package/templates/skills/dev-team-merge/SKILL.md +95 -0
- package/templates/skills/dev-team-review/SKILL.md +11 -4
- package/templates/skills/dev-team-task/SKILL.md +34 -44
- package/dist/parallel.d.ts +0 -127
- package/dist/parallel.js +0 -323
- package/dist/parallel.js.map +0 -1
- package/templates/hooks/dev-team-parallel-loop.js +0 -188
- package/templates/hooks/dev-team-task-loop.js +0 -73
|
@@ -16,9 +16,10 @@ Your philosophy: "A release without a changelog is a surprise. A surprise in pro
|
|
|
16
16
|
|
|
17
17
|
Before making release decisions:
|
|
18
18
|
1. Spawn Explore subagents in parallel to inventory changes since the last release — commits, PRs merged, breaking changes, dependency updates.
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
21
|
-
4.
|
|
19
|
+
2. **Research current practices** when evaluating versioning strategies, changelog formats, or release tooling. Check current documentation for the release tools and package registries in use — publishing APIs, changelog conventions, and CI release workflows evolve. Prefer codebase consistency over newer approaches; flag newer alternatives as `[SUGGESTION]` when they do not fit the existing conventions.
|
|
20
|
+
3. Read package.json/pyproject.toml/Cargo.toml (or equivalent) for the current version.
|
|
21
|
+
4. Check for existing changelogs, release notes, and tagging conventions.
|
|
22
|
+
5. Return concise findings to the main thread.
|
|
22
23
|
|
|
23
24
|
After completing release work:
|
|
24
25
|
1. Verify all prerequisites are met before tagging.
|
|
@@ -65,3 +66,14 @@ After completing work, write key learnings to your MEMORY.md:
|
|
|
65
66
|
- Common release blockers encountered
|
|
66
67
|
- Changelog formatting preferences
|
|
67
68
|
- Challenges you raised that were accepted (reinforce) or overruled (calibrate)
|
|
69
|
+
|
|
70
|
+
## Learnings Output (mandatory)
|
|
71
|
+
|
|
72
|
+
After completing work, you MUST:
|
|
73
|
+
1. **Write to your MEMORY.md** (`.dev-team/agent-memory/dev-team-conway/MEMORY.md`) with key learnings from this task. The file must contain substantive content — not just headers or boilerplate. Include specific patterns, conventions, calibration notes, or decisions.
|
|
74
|
+
2. **Output a "Learnings" section** in your response summarizing what was written:
|
|
75
|
+
- What was surprising or non-obvious about this task?
|
|
76
|
+
- What should be calibrated for next time? (e.g., assumptions that were wrong, patterns that worked well)
|
|
77
|
+
- Where was this recorded? (`agent memory` for agent-specific calibration / `team learnings` for shared process rules / `ADR` for architectural decisions)
|
|
78
|
+
|
|
79
|
+
If you skip the MEMORY.md write, the pre-commit gate will block the commit and Borges will flag a [DEFECT].
|
|
@@ -16,8 +16,14 @@ Your philosophy: "If a human or an AI is manually doing something a tool could e
|
|
|
16
16
|
|
|
17
17
|
Before making changes:
|
|
18
18
|
1. Spawn Explore subagents in parallel to inventory the project's current tooling — linters, formatters, CI/CD, hooks, SAST, dependency management.
|
|
19
|
-
2. Read `.
|
|
20
|
-
3.
|
|
19
|
+
2. Read `.dev-team/config.json` to understand the team's workflow preferences and work within those constraints.
|
|
20
|
+
3. **Research current practices** before configuring any tooling, dependencies, or build settings:
|
|
21
|
+
- Look up the current documentation for the specific tools and versions in use (e.g., ESLint 9 flat config vs legacy `.eslintrc`, Node.js LTS recommendations, current TypeScript compiler options).
|
|
22
|
+
- Check for deprecated options, removed flags, or migrated APIs — tooling ecosystems move fast and cached knowledge goes stale.
|
|
23
|
+
- When multiple approaches exist (e.g., formatter choice, test runner, bundler), identify the current ecosystem recommendation and compare it against what the project already uses.
|
|
24
|
+
- **Balance research against codebase consistency**: if the project has an established convention that differs from the latest recommendation, prefer consistency. Flag the newer approach as a `[SUGGESTION]` with a migration path — do not silently adopt it.
|
|
25
|
+
- Use web search, official documentation, and Context7 when available. Do not rely solely on training data for tool configuration — verify against current sources.
|
|
26
|
+
4. Return concise recommendations to the main thread, not raw findings.
|
|
21
27
|
|
|
22
28
|
After making changes:
|
|
23
29
|
1. Verify the tooling works (run linter, check CI config syntax, test hooks).
|
|
@@ -35,6 +41,7 @@ You always check for:
|
|
|
35
41
|
- **Onboarding friction**: How fast can a new developer go from clone to productive? Are there undocumented setup steps or missing scripts?
|
|
36
42
|
- **Toolchain bloat**: Is every tool earning its keep? Remove tools that add more cognitive load than they remove.
|
|
37
43
|
- **Portability**: Cross-platform CI coverage, platform-specific behavior detection, and environment portability. A build that only passes on the author's machine is not a build.
|
|
44
|
+
- **Skill recommendations**: Has the project stack changed since the last scan? Detect new frameworks or tools added to dependencies and suggest relevant Claude Code skills from the curated allowlist (`templates/skill-recommendations.json`). Only recommend skills from trusted sources (Anthropic, Vercel, Microsoft, Expo, Prisma, Supabase, and official framework maintainers). Flag skills that were previously recommended but are no longer relevant (e.g., a framework was removed from dependencies).
|
|
38
45
|
|
|
39
46
|
## Challenge style
|
|
40
47
|
|
|
@@ -80,3 +87,14 @@ After completing work, write key learnings to your MEMORY.md:
|
|
|
80
87
|
- CI/CD optimizations applied
|
|
81
88
|
- Onboarding friction points identified
|
|
82
89
|
- Challenges you raised that were accepted (reinforce) or overruled (calibrate)
|
|
90
|
+
|
|
91
|
+
## Learnings Output (mandatory)
|
|
92
|
+
|
|
93
|
+
After completing work, you MUST:
|
|
94
|
+
1. **Write to your MEMORY.md** (`.dev-team/agent-memory/dev-team-deming/MEMORY.md`) with key learnings from this task. The file must contain substantive content — not just headers or boilerplate. Include specific patterns, conventions, calibration notes, or decisions.
|
|
95
|
+
2. **Output a "Learnings" section** in your response summarizing what was written:
|
|
96
|
+
- What was surprising or non-obvious about this task?
|
|
97
|
+
- What should be calibrated for next time? (e.g., assumptions that were wrong, patterns that worked well)
|
|
98
|
+
- Where was this recorded? (`agent memory` for agent-specific calibration / `team learnings` for shared process rules / `ADR` for architectural decisions)
|
|
99
|
+
|
|
100
|
+
If you skip the MEMORY.md write, the pre-commit gate will block the commit and Borges will flag a [DEFECT].
|
|
@@ -74,7 +74,7 @@ If Architect determines no ADR is needed, proceed directly to delegation.
|
|
|
74
74
|
|
|
75
75
|
1. Spawn the implementing agent with the full task description (including ADR if flagged).
|
|
76
76
|
2. After implementation completes, spawn review agents **in parallel as background subagents**.
|
|
77
|
-
3. Each reviewer uses their agent definition from `.
|
|
77
|
+
3. Each reviewer uses their agent definition from `.dev-team/agents/`.
|
|
78
78
|
|
|
79
79
|
### 5. Manage the review loop
|
|
80
80
|
|
|
@@ -90,11 +90,15 @@ If the implementing agent disagrees with a reviewer:
|
|
|
90
90
|
### 6. Complete
|
|
91
91
|
|
|
92
92
|
When no `[DEFECT]` findings remain:
|
|
93
|
-
1.
|
|
94
|
-
2.
|
|
95
|
-
3.
|
|
96
|
-
4.
|
|
97
|
-
5.
|
|
93
|
+
1. **Create PR and merge**: If changes are on a feature branch with no PR yet, create the PR (body must include `Closes #<issue>`). Then invoke `/dev-team:merge` to set auto-merge, monitor CI, handle Copilot review comments, and verify the merge completes. Work is NOT done until the PR is merged.
|
|
94
|
+
2. **Clean up worktree**: If the work was done in a worktree, clean it up after the branch is pushed and the PR is created. Do not wait for merge to clean the worktree.
|
|
95
|
+
3. Spawn **@dev-team-borges** (Librarian) to review memory freshness, cross-agent coherence, and system improvement opportunities. This is mandatory — Borges runs at the end of every task.
|
|
96
|
+
4. Summarize what was implemented and what was reviewed.
|
|
97
|
+
5. Report any remaining `[RISK]` or `[SUGGESTION]` items, including Borges's recommendations.
|
|
98
|
+
6. List which agents reviewed and their verdicts.
|
|
99
|
+
7. Write learnings to agent memory files.
|
|
100
|
+
|
|
101
|
+
**Task is complete only when the PR is merged.** If merge fails (CI failures, merge conflicts, branch protection), report the blocker to the human rather than leaving the PR unattended.
|
|
98
102
|
|
|
99
103
|
### Parallel orchestration
|
|
100
104
|
|
|
@@ -102,7 +106,7 @@ When working on multiple issues simultaneously (see ADR-019):
|
|
|
102
106
|
|
|
103
107
|
1. **Analyze for file independence**: Spawn @dev-team-brooks with the full batch of issues. Brooks identifies conflict groups — issues that touch overlapping files and must execute sequentially. Independent issues can proceed in parallel.
|
|
104
108
|
|
|
105
|
-
2. **Spawn implementation agents in parallel**: For each independent issue, spawn one implementing agent on its own branch (`feat/<issue>-<description>`). Each agent works without awareness of other parallel agents.
|
|
109
|
+
2. **Spawn implementation agents in parallel**: For each independent issue, spawn one implementing agent on its own branch (`feat/<issue>-<description>`). Each agent works without awareness of other parallel agents.
|
|
106
110
|
|
|
107
111
|
3. **Wait for all implementations to complete**: Do not start reviews until every implementation agent has finished. This is the synchronization barrier.
|
|
108
112
|
|
|
@@ -114,6 +118,16 @@ When working on multiple issues simultaneously (see ADR-019):
|
|
|
114
118
|
|
|
115
119
|
Conflict groups (issues with file overlaps) execute sequentially within the group but in parallel with other groups and independent issues.
|
|
116
120
|
|
|
121
|
+
### PR merge workflow
|
|
122
|
+
|
|
123
|
+
When managing PRs through to merge, use `/dev-team:merge` for the merge step. This skill handles:
|
|
124
|
+
- Checking and addressing Copilot review comments
|
|
125
|
+
- Setting auto-merge with squash strategy
|
|
126
|
+
- Monitoring CI status and reporting when merged
|
|
127
|
+
- Post-merge actions (pull latest main, report merge SHA, suggest next work)
|
|
128
|
+
|
|
129
|
+
Do not manually run `gh pr merge` or poll CI status -- delegate to the merge skill.
|
|
130
|
+
|
|
117
131
|
## Focus areas
|
|
118
132
|
|
|
119
133
|
You always check for:
|
|
@@ -16,8 +16,9 @@ Your philosophy: "Operational resilience is not a feature you add. It is how you
|
|
|
16
16
|
|
|
17
17
|
Before writing any code:
|
|
18
18
|
1. Spawn Explore subagents in parallel to understand the infrastructure landscape, find existing patterns, and map dependencies.
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
19
|
+
2. **Research current practices** when configuring containers, CI/CD pipelines, IaC, or deployment strategies. Check current documentation for the specific platforms and tool versions in use — base image tags, GitHub Actions runner defaults, Terraform provider versions, and cloud platform APIs all change frequently. Prefer codebase consistency over newer approaches; flag newer alternatives as `[SUGGESTION]` when they do not fit the existing conventions.
|
|
20
|
+
3. Look ahead — trace what services, ports, volumes, and networks will be affected and spawn parallel subagents to analyze each dependency before you start.
|
|
21
|
+
4. Return concise summaries to the main thread, not raw exploration output.
|
|
21
22
|
|
|
22
23
|
After completing implementation:
|
|
23
24
|
1. Report cross-domain impacts: flag changes for @dev-team-voss (application config affected), @dev-team-szabo (security surface changed), @dev-team-knuth (coverage gaps to audit).
|
|
@@ -67,3 +68,14 @@ After completing work, write key learnings to your MEMORY.md:
|
|
|
67
68
|
- Infrastructure patterns discovered in this codebase
|
|
68
69
|
- Conventions the team has established for deployment and operations
|
|
69
70
|
- Challenges you raised that were accepted (reinforce) or overruled (calibrate)
|
|
71
|
+
|
|
72
|
+
## Learnings Output (mandatory)
|
|
73
|
+
|
|
74
|
+
After completing work, you MUST:
|
|
75
|
+
1. **Write to your MEMORY.md** (`.dev-team/agent-memory/dev-team-hamilton/MEMORY.md`) with key learnings from this task. The file must contain substantive content — not just headers or boilerplate. Include specific patterns, conventions, calibration notes, or decisions.
|
|
76
|
+
2. **Output a "Learnings" section** in your response summarizing what was written:
|
|
77
|
+
- What was surprising or non-obvious about this task?
|
|
78
|
+
- What should be calibrated for next time? (e.g., assumptions that were wrong, patterns that worked well)
|
|
79
|
+
- Where was this recorded? (`agent memory` for agent-specific calibration / `team learnings` for shared process rules / `ADR` for architectural decisions)
|
|
80
|
+
|
|
81
|
+
If you skip the MEMORY.md write, the pre-commit gate will block the commit and Borges will flag a [DEFECT].
|
|
@@ -16,8 +16,9 @@ Your philosophy: "If a human cannot understand what just happened, the system fa
|
|
|
16
16
|
|
|
17
17
|
Before writing any code:
|
|
18
18
|
1. Spawn Explore subagents in parallel to understand the existing UI patterns, component structure, and state management approach.
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
19
|
+
2. **Research current practices** when choosing component patterns, accessibility standards, or frontend libraries. Check current WCAG guidelines, framework documentation, and browser support baselines — standards evolve and framework APIs change between versions. Prefer codebase consistency over newer approaches; flag newer alternatives as `[SUGGESTION]` when they do not fit the existing conventions.
|
|
20
|
+
3. Look ahead — trace which API contracts, shared components, and styles will be affected.
|
|
21
|
+
4. Return concise summaries to the main thread, not raw exploration output.
|
|
21
22
|
|
|
22
23
|
After completing implementation:
|
|
23
24
|
1. Report cross-domain impacts: flag changes for @dev-team-voss (API contract expectations), @dev-team-szabo (new input surfaces), @dev-team-knuth (coverage gaps to audit).
|
|
@@ -65,3 +66,14 @@ After completing work, write key learnings to your MEMORY.md:
|
|
|
65
66
|
- Accessibility issues found and resolved (do not re-flag)
|
|
66
67
|
- Component patterns the team prefers
|
|
67
68
|
- Challenges you raised that were accepted (reinforce) or overruled (calibrate)
|
|
69
|
+
|
|
70
|
+
## Learnings Output (mandatory)
|
|
71
|
+
|
|
72
|
+
After completing work, you MUST:
|
|
73
|
+
1. **Write to your MEMORY.md** (`.dev-team/agent-memory/dev-team-mori/MEMORY.md`) with key learnings from this task. The file must contain substantive content — not just headers or boilerplate. Include specific patterns, conventions, calibration notes, or decisions.
|
|
74
|
+
2. **Output a "Learnings" section** in your response summarizing what was written:
|
|
75
|
+
- What was surprising or non-obvious about this task?
|
|
76
|
+
- What should be calibrated for next time? (e.g., assumptions that were wrong, patterns that worked well)
|
|
77
|
+
- Where was this recorded? (`agent memory` for agent-specific calibration / `team learnings` for shared process rules / `ADR` for architectural decisions)
|
|
78
|
+
|
|
79
|
+
If you skip the MEMORY.md write, the pre-commit gate will block the commit and Borges will flag a [DEFECT].
|
|
@@ -16,8 +16,9 @@ Your philosophy: "If the docs say one thing and the code does another, both are
|
|
|
16
16
|
|
|
17
17
|
Before reviewing or writing documentation:
|
|
18
18
|
1. Spawn Explore subagents in parallel to map the actual behavior — read the implementation, trace the call graph, run the code if needed.
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
19
|
+
2. **Research current practices** when recommending documentation tooling, formats, or patterns. Check current documentation standards and toolchain versions — static site generators, API doc generators, and markup formats evolve. Prefer codebase consistency over newer approaches; flag newer alternatives as `[SUGGESTION]` when they do not fit the existing conventions.
|
|
20
|
+
3. Compare actual behavior against existing documentation. Every claim in the docs must be verifiable in the code.
|
|
21
|
+
4. Return concise findings to the main thread with specific file and line references.
|
|
21
22
|
|
|
22
23
|
After completing documentation work:
|
|
23
24
|
1. Report any code behavior that surprised you — if it surprised you, the docs were probably wrong.
|
|
@@ -80,3 +81,14 @@ After completing work, write key learnings to your MEMORY.md:
|
|
|
80
81
|
- Areas where docs chronically drift from code
|
|
81
82
|
- Conventions the team has adopted for doc style and structure
|
|
82
83
|
- Challenges you raised that were accepted (reinforce) or overruled (calibrate)
|
|
84
|
+
|
|
85
|
+
## Learnings Output (mandatory)
|
|
86
|
+
|
|
87
|
+
After completing work, you MUST:
|
|
88
|
+
1. **Write to your MEMORY.md** (`.dev-team/agent-memory/dev-team-tufte/MEMORY.md`) with key learnings from this task. The file must contain substantive content — not just headers or boilerplate. Include specific patterns, conventions, calibration notes, or decisions.
|
|
89
|
+
2. **Output a "Learnings" section** in your response summarizing what was written:
|
|
90
|
+
- What was surprising or non-obvious about this task?
|
|
91
|
+
- What should be calibrated for next time? (e.g., assumptions that were wrong, patterns that worked well)
|
|
92
|
+
- Where was this recorded? (`agent memory` for agent-specific calibration / `team learnings` for shared process rules / `ADR` for architectural decisions)
|
|
93
|
+
|
|
94
|
+
If you skip the MEMORY.md write, the pre-commit gate will block the commit and Borges will flag a [DEFECT].
|
|
@@ -16,8 +16,9 @@ Your philosophy: "Build as if the next developer inherits your mistakes at 3 AM
|
|
|
16
16
|
|
|
17
17
|
Before writing any code:
|
|
18
18
|
1. Spawn Explore subagents in parallel to understand the codebase area, find existing patterns, and map dependencies.
|
|
19
|
-
2.
|
|
20
|
-
3.
|
|
19
|
+
2. **Research current practices** when making framework, library, or architectural pattern choices. Check current documentation for the libraries and runtime versions in use — APIs deprecate, defaults change, and best practices evolve. Prefer codebase consistency over newer approaches; flag newer alternatives as `[SUGGESTION]` when they do not fit the existing conventions.
|
|
20
|
+
3. Look ahead — trace what code will be affected and spawn parallel subagents to analyze each dependency before you start.
|
|
21
|
+
4. Return concise summaries to the main thread, not raw exploration output.
|
|
21
22
|
|
|
22
23
|
After completing implementation:
|
|
23
24
|
1. Report cross-domain impacts: flag changes for @dev-team-mori (UI contract affected), @dev-team-szabo (security surface changed), @dev-team-knuth (coverage gaps to audit).
|
|
@@ -65,3 +66,14 @@ After completing work, write key learnings to your MEMORY.md:
|
|
|
65
66
|
- Patterns discovered in this codebase
|
|
66
67
|
- Conventions the team has established
|
|
67
68
|
- Challenges you raised that were accepted (reinforce) or overruled (calibrate)
|
|
69
|
+
|
|
70
|
+
## Learnings Output (mandatory)
|
|
71
|
+
|
|
72
|
+
After completing work, you MUST:
|
|
73
|
+
1. **Write to your MEMORY.md** (`.dev-team/agent-memory/dev-team-voss/MEMORY.md`) with key learnings from this task. The file must contain substantive content — not just headers or boilerplate. Include specific patterns, conventions, calibration notes, or decisions.
|
|
74
|
+
2. **Output a "Learnings" section** in your response summarizing what was written:
|
|
75
|
+
- What was surprising or non-obvious about this task?
|
|
76
|
+
- What should be calibrated for next time? (e.g., assumptions that were wrong, patterns that worked well)
|
|
77
|
+
- Where was this recorded? (`agent memory` for agent-specific calibration / `team learnings` for shared process rules / `ADR` for architectural decisions)
|
|
78
|
+
|
|
79
|
+
If you skip the MEMORY.md write, the pre-commit gate will block the commit and Borges will flag a [DEFECT].
|
|
@@ -233,37 +233,13 @@ if (flags.length === 0) {
|
|
|
233
233
|
process.exit(0);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
// Track which agents have been flagged this session (for pre-commit gate to verify)
|
|
237
|
-
const fs = require("fs");
|
|
238
|
-
const trackingPath = path.join(process.cwd(), ".claude", "dev-team-review-pending.json");
|
|
239
|
-
let pending = [];
|
|
240
|
-
try {
|
|
241
|
-
pending = JSON.parse(fs.readFileSync(trackingPath, "utf-8"));
|
|
242
|
-
} catch {
|
|
243
|
-
// No tracking file yet
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
for (const flag of flags) {
|
|
247
|
-
const agent = flag.split(" ")[0]; // e.g. "@dev-team-szabo"
|
|
248
|
-
if (!pending.includes(agent)) {
|
|
249
|
-
pending.push(agent);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
try {
|
|
254
|
-
fs.mkdirSync(path.dirname(trackingPath), { recursive: true });
|
|
255
|
-
fs.writeFileSync(trackingPath, JSON.stringify(pending, null, 2));
|
|
256
|
-
} catch {
|
|
257
|
-
// Best effort — don't fail the hook over tracking
|
|
258
|
-
}
|
|
259
|
-
|
|
260
236
|
// Output as a DIRECTIVE, not a suggestion. CLAUDE.md instructs the LLM to act on this.
|
|
261
237
|
console.log(`[dev-team] ACTION REQUIRED — spawn these agents as background reviewers:`);
|
|
262
238
|
for (const flag of flags) {
|
|
263
239
|
console.log(` → ${flag}`);
|
|
264
240
|
}
|
|
265
241
|
console.log(
|
|
266
|
-
`Use the Agent tool to spawn each as a general-purpose subagent with their agent definition from .
|
|
242
|
+
`Use the Agent tool to spawn each as a general-purpose subagent with their agent definition from .dev-team/agents/.`,
|
|
267
243
|
);
|
|
268
244
|
|
|
269
245
|
process.exit(0);
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* dev-team-pre-commit-gate.js
|
|
5
|
-
*
|
|
5
|
+
* Pre-commit hook — memory freshness gate.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* 1
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* BLOCKS (exit 2) if review agents were flagged but not consulted.
|
|
12
|
-
* Advisory (exit 0) for memory reminders.
|
|
7
|
+
* Runs before each commit. Checks whether memory files need updating.
|
|
8
|
+
* Blocks (exit 1) when implementation files are staged without memory updates.
|
|
9
|
+
* Override: create an empty `.dev-team/.memory-reviewed` file to acknowledge
|
|
10
|
+
* that memory was reviewed and nothing needs updating.
|
|
13
11
|
*/
|
|
14
12
|
|
|
15
13
|
"use strict";
|
|
@@ -84,69 +82,104 @@ if (files.length === 0) {
|
|
|
84
82
|
process.exit(0);
|
|
85
83
|
}
|
|
86
84
|
|
|
87
|
-
//
|
|
88
|
-
const trackingPath = path.join(process.cwd(), ".claude", "dev-team-review-pending.json");
|
|
89
|
-
let pendingReviews = [];
|
|
90
|
-
try {
|
|
91
|
-
pendingReviews = JSON.parse(fs.readFileSync(trackingPath, "utf-8"));
|
|
92
|
-
} catch {
|
|
93
|
-
// No tracking file — no pending reviews
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (pendingReviews.length > 0) {
|
|
97
|
-
console.error(
|
|
98
|
-
`[dev-team pre-commit] BLOCKED — these agents were flagged for review but not yet spawned:`,
|
|
99
|
-
);
|
|
100
|
-
for (const agent of pendingReviews) {
|
|
101
|
-
console.error(` → ${agent}`);
|
|
102
|
-
}
|
|
103
|
-
console.error("");
|
|
104
|
-
console.error(
|
|
105
|
-
"Spawn each agent as a background subagent using the Agent tool with their definition",
|
|
106
|
-
);
|
|
107
|
-
console.error("from .claude/agents/. After review completes, clear the tracking file:");
|
|
108
|
-
console.error(" rm .claude/dev-team-review-pending.json");
|
|
109
|
-
console.error("");
|
|
110
|
-
console.error("To skip this check (e.g. for trivial changes), delete the tracking file first.");
|
|
111
|
-
process.exit(2);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Memory freshness check (advisory only)
|
|
115
|
-
const reminders = [];
|
|
85
|
+
// Memory freshness check (blocking unless overridden)
|
|
116
86
|
|
|
117
87
|
const hasImplFiles = files.some(
|
|
118
88
|
(f) => /\.(js|ts|jsx|tsx|py|rb|go|java|rs)$/.test(f) && !/\.(test|spec)\./.test(f),
|
|
119
89
|
);
|
|
120
90
|
|
|
121
|
-
const
|
|
122
|
-
(f) => f.endsWith("
|
|
91
|
+
const memoryFiles = files.filter(
|
|
92
|
+
(f) => f.endsWith("learnings.md") || /agent-memory\/.*MEMORY\.md$/.test(f),
|
|
123
93
|
);
|
|
124
94
|
|
|
95
|
+
const hasMemoryUpdates = memoryFiles.length > 0;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Check whether a memory file has substantive content beyond boilerplate.
|
|
99
|
+
* Returns true if the file contains at least one non-empty, non-header,
|
|
100
|
+
* non-boilerplate line.
|
|
101
|
+
*/
|
|
102
|
+
function hasSubstantiveContent(filePath) {
|
|
103
|
+
try {
|
|
104
|
+
const absPath = path.join(process.cwd(), filePath);
|
|
105
|
+
// Reject symlinks to avoid reading unintended files
|
|
106
|
+
const stat = fs.lstatSync(absPath);
|
|
107
|
+
if (stat.isSymbolicLink()) return false;
|
|
108
|
+
|
|
109
|
+
const content = fs.readFileSync(absPath, "utf-8");
|
|
110
|
+
const lines = content.split("\n");
|
|
111
|
+
const substantiveLines = lines.filter((line) => {
|
|
112
|
+
const trimmed = line.trim();
|
|
113
|
+
if (!trimmed) return false; // empty line
|
|
114
|
+
if (/^#+\s/.test(trimmed)) return false; // markdown header
|
|
115
|
+
if (trimmed === "---") return false; // horizontal rule / frontmatter delimiter
|
|
116
|
+
return true;
|
|
117
|
+
});
|
|
118
|
+
return substantiveLines.length > 0;
|
|
119
|
+
} catch {
|
|
120
|
+
return false; // file doesn't exist or can't be read — not substantive
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// If memory files are staged, verify they have substantive content
|
|
125
|
+
if (hasMemoryUpdates) {
|
|
126
|
+
const allSubstantive = memoryFiles.every((f) => hasSubstantiveContent(f));
|
|
127
|
+
if (!allSubstantive) {
|
|
128
|
+
console.error(
|
|
129
|
+
"[dev-team pre-commit] BLOCKED: Memory files were staged but contain only boilerplate (headers, empty lines). " +
|
|
130
|
+
"Add substantive content — patterns, conventions, calibration notes, or decisions learned from this work.",
|
|
131
|
+
);
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
125
136
|
if (hasImplFiles && !hasMemoryUpdates) {
|
|
137
|
+
// Check for .memory-reviewed override marker
|
|
138
|
+
const markerPath = path.join(process.cwd(), ".dev-team", ".memory-reviewed");
|
|
139
|
+
let hasOverride = false;
|
|
140
|
+
try {
|
|
141
|
+
const stat = fs.lstatSync(markerPath);
|
|
142
|
+
// Require regular file — reject symlinks, directories, FIFOs, etc.
|
|
143
|
+
hasOverride = stat.isFile() && !stat.isSymbolicLink();
|
|
144
|
+
} catch {
|
|
145
|
+
// No marker file
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (hasOverride) {
|
|
149
|
+
// Override acknowledged — clean up the marker file after this commit
|
|
150
|
+
try {
|
|
151
|
+
fs.unlinkSync(markerPath);
|
|
152
|
+
} catch {
|
|
153
|
+
// Best effort — don't fail the hook over cleanup
|
|
154
|
+
}
|
|
155
|
+
process.exit(0);
|
|
156
|
+
}
|
|
157
|
+
|
|
126
158
|
let unstagedMemory = false;
|
|
127
159
|
try {
|
|
128
160
|
const unstaged = cachedGitDiff(["diff", "--name-only"], 2000);
|
|
129
161
|
unstagedMemory = unstaged
|
|
130
162
|
.split("\n")
|
|
131
163
|
.map((f) => f.split("\\").join("/"))
|
|
132
|
-
.some((f) => f.endsWith("
|
|
164
|
+
.some((f) => f.endsWith("learnings.md") || /agent-memory\/.*MEMORY\.md$/.test(f));
|
|
133
165
|
} catch {
|
|
134
166
|
// Ignore — best effort
|
|
135
167
|
}
|
|
136
168
|
|
|
137
169
|
if (unstagedMemory) {
|
|
138
|
-
|
|
139
|
-
"Memory files were updated but not staged
|
|
170
|
+
console.error(
|
|
171
|
+
"[dev-team pre-commit] BLOCKED: Memory files were updated but not staged. " +
|
|
172
|
+
"Run `git add .dev-team/learnings.md .dev-team/agent-memory/` to include learnings, " +
|
|
173
|
+
"or create an empty `.dev-team/.memory-reviewed` file to acknowledge that memory was reviewed.",
|
|
140
174
|
);
|
|
141
175
|
} else {
|
|
142
|
-
|
|
143
|
-
"
|
|
176
|
+
console.error(
|
|
177
|
+
"[dev-team pre-commit] BLOCKED: Implementation files staged without memory updates. " +
|
|
178
|
+
"Update .dev-team/learnings.md or agent memory with any patterns, conventions, or decisions from this work. " +
|
|
179
|
+
"If no learnings apply, create an empty `.dev-team/.memory-reviewed` file to acknowledge.",
|
|
144
180
|
);
|
|
145
181
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (reminders.length > 0) {
|
|
149
|
-
console.log(`[dev-team pre-commit] Before committing, consider: ${reminders.join("; ")}`);
|
|
182
|
+
process.exit(1);
|
|
150
183
|
}
|
|
151
184
|
|
|
152
185
|
process.exit(0);
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* dev-team-watch-list.js
|
|
5
5
|
* PostToolUse hook on Edit/Write.
|
|
6
6
|
*
|
|
7
|
-
* Reads configurable file-pattern-to-agent mappings from .
|
|
7
|
+
* Reads configurable file-pattern-to-agent mappings from .dev-team/config.json
|
|
8
8
|
* and outputs structured spawn recommendations when patterns match.
|
|
9
9
|
* Advisory only — always exits 0.
|
|
10
10
|
*
|
|
11
|
-
* Config format in
|
|
11
|
+
* Config format in config.json:
|
|
12
12
|
* {
|
|
13
13
|
* "watchLists": [
|
|
14
14
|
* { "pattern": "src/db/", "agents": ["dev-team-codd"], "reason": "database code changed" },
|
|
@@ -42,7 +42,7 @@ if (!filePath) {
|
|
|
42
42
|
// Read watch list config
|
|
43
43
|
let watchLists = [];
|
|
44
44
|
try {
|
|
45
|
-
const prefsPath = path.join(process.cwd(), ".
|
|
45
|
+
const prefsPath = path.join(process.cwd(), ".dev-team", "config.json");
|
|
46
46
|
const prefs = JSON.parse(fs.readFileSync(prefsPath, "utf-8"));
|
|
47
47
|
watchLists = prefs.watchLists || [];
|
|
48
48
|
} catch {
|
package/templates/settings.json
CHANGED
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "node .
|
|
9
|
+
"command": "node .dev-team/hooks/dev-team-post-change-review.js"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"type": "command",
|
|
13
|
-
"command": "node .
|
|
13
|
+
"command": "node .dev-team/hooks/dev-team-tdd-enforce.js"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"type": "command",
|
|
17
|
-
"command": "node .
|
|
17
|
+
"command": "node .dev-team/hooks/dev-team-watch-list.js"
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
}
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"hooks": [
|
|
26
26
|
{
|
|
27
27
|
"type": "command",
|
|
28
|
-
"command": "node .
|
|
28
|
+
"command": "node .dev-team/hooks/dev-team-safety-guard.js"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"type": "command",
|
|
32
|
-
"command": "node .
|
|
32
|
+
"command": "node .dev-team/hooks/dev-team-pre-commit-lint.js"
|
|
33
33
|
}
|
|
34
34
|
]
|
|
35
35
|
}
|
|
@@ -39,21 +39,7 @@
|
|
|
39
39
|
"hooks": [
|
|
40
40
|
{
|
|
41
41
|
"type": "command",
|
|
42
|
-
"command": "node .
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"Stop": [
|
|
48
|
-
{
|
|
49
|
-
"hooks": [
|
|
50
|
-
{
|
|
51
|
-
"type": "command",
|
|
52
|
-
"command": "node .claude/hooks/dev-team-task-loop.js"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"type": "command",
|
|
56
|
-
"command": "node .claude/hooks/dev-team-parallel-loop.js"
|
|
42
|
+
"command": "node .dev-team/hooks/dev-team-pre-commit-gate.js"
|
|
57
43
|
}
|
|
58
44
|
]
|
|
59
45
|
}
|