@fredericboyer/dev-team 0.5.0 → 0.7.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 (43) hide show
  1. package/README.md +12 -11
  2. package/dist/bin/dev-team.js +12 -12
  3. package/dist/bin/dev-team.js.map +1 -1
  4. package/dist/create-agent.js +6 -6
  5. package/dist/create-agent.js.map +1 -1
  6. package/dist/doctor.js +15 -16
  7. package/dist/doctor.js.map +1 -1
  8. package/dist/files.js +2 -0
  9. package/dist/files.js.map +1 -1
  10. package/dist/init.js +53 -40
  11. package/dist/init.js.map +1 -1
  12. package/dist/scan.js +9 -9
  13. package/dist/scan.js.map +1 -1
  14. package/dist/status.js +11 -11
  15. package/dist/status.js.map +1 -1
  16. package/dist/update.d.ts +1 -4
  17. package/dist/update.js +178 -59
  18. package/dist/update.js.map +1 -1
  19. package/package.json +2 -2
  20. package/templates/CLAUDE.md +14 -11
  21. package/templates/agent-memory/dev-team-hamilton/MEMORY.md +12 -0
  22. package/templates/agents/dev-team-beck.md +7 -0
  23. package/templates/agents/dev-team-borges.md +4 -4
  24. package/templates/agents/dev-team-brooks.md +42 -5
  25. package/templates/agents/dev-team-conway.md +7 -0
  26. package/templates/agents/dev-team-deming.md +16 -2
  27. package/templates/agents/dev-team-drucker.md +17 -5
  28. package/templates/agents/dev-team-hamilton.md +77 -0
  29. package/templates/agents/dev-team-mori.md +11 -2
  30. package/templates/agents/dev-team-tufte.md +24 -0
  31. package/templates/agents/dev-team-voss.md +12 -3
  32. package/templates/hooks/dev-team-post-change-review.js +69 -40
  33. package/templates/hooks/dev-team-pre-commit-gate.js +65 -52
  34. package/templates/hooks/dev-team-tdd-enforce.js +27 -6
  35. package/templates/hooks/dev-team-watch-list.js +3 -3
  36. package/templates/settings.json +6 -16
  37. package/templates/skills/dev-team-assess/SKILL.md +167 -0
  38. package/templates/skills/dev-team-audit/SKILL.md +8 -3
  39. package/templates/skills/dev-team-merge/SKILL.md +95 -0
  40. package/templates/skills/dev-team-review/SKILL.md +9 -4
  41. package/templates/skills/dev-team-security-status/SKILL.md +43 -0
  42. package/templates/skills/dev-team-task/SKILL.md +28 -41
  43. package/templates/hooks/dev-team-task-loop.js +0 -73
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: dev-team:merge
3
+ description: Merge a PR with monitoring -- checks Copilot comments, sets auto-merge, monitors until complete, triggers next steps.
4
+ user_invocable: true
5
+ ---
6
+
7
+ Merge a pull request with full monitoring: $ARGUMENTS
8
+
9
+ ## Setup
10
+
11
+ 1. Determine the PR number:
12
+ - If provided as argument, use it directly
13
+ - Otherwise, detect from current branch: `gh pr view --json number --jq .number`
14
+ - If no PR found, report error and stop
15
+
16
+ 2. Capture repo context:
17
+ - `gh repo view --json nameWithOwner --jq .nameWithOwner` to get {owner}/{repo}
18
+
19
+ ## Step 1: Check for Copilot review comments
20
+
21
+ Before proceeding with merge, check for Copilot (and other automated) review comments:
22
+
23
+ ```
24
+ gh api repos/{owner}/{repo}/pulls/{number}/reviews
25
+ gh api repos/{owner}/{repo}/pulls/{number}/comments
26
+ ```
27
+
28
+ Filter for reviews/comments from bot accounts (especially `copilot` and `github-actions`).
29
+
30
+ - If Copilot has left comments or suggestions:
31
+ 1. Display each finding with file, line, and comment body
32
+ 2. For actionable suggestions: apply the fix in code, commit, and push
33
+ 3. For each comment thread: reply acknowledging the finding and resolve the thread using `gh api repos/{owner}/{repo}/pulls/{number}/comments/{id}/replies`
34
+ 4. After addressing all findings, re-push and wait for CI to restart
35
+
36
+ - If no Copilot comments: proceed to Step 2
37
+
38
+ ## Step 2: Set auto-merge
39
+
40
+ ```bash
41
+ gh pr merge {number} --squash --auto --delete-branch
42
+ ```
43
+
44
+ This tells GitHub to merge automatically once all required checks pass.
45
+
46
+ ## Step 3: Check CI status and monitor
47
+
48
+ Check current CI status:
49
+
50
+ ```bash
51
+ gh pr checks {number}
52
+ ```
53
+
54
+ **If all checks are passing:**
55
+ - The PR will merge immediately (or within seconds)
56
+ - Verify by checking: `gh pr view {number} --json state --jq .state`
57
+ - If state is `MERGED`, proceed to Step 4
58
+
59
+ **If checks are pending:**
60
+ - Inform the user that auto-merge is set and CI is running
61
+ - Spawn a background monitoring agent to poll until completion:
62
+ - Poll every 30 seconds: `gh pr view {number} --json state --jq .state`
63
+ - If state becomes `MERGED`: report success and proceed to Step 4
64
+ - If checks fail: report the failure with details from `gh pr checks {number}`
65
+ - Timeout after 15 minutes of polling
66
+
67
+ **If checks are failing:**
68
+ - Report which checks failed: `gh pr checks {number}`
69
+ - Do NOT proceed with merge
70
+ - Suggest investigating the failures
71
+
72
+ ## Step 4: Post-merge actions
73
+
74
+ After merge is confirmed:
75
+
76
+ 1. **Switch to main and pull latest:**
77
+ ```bash
78
+ git checkout main
79
+ git pull origin main
80
+ ```
81
+
82
+ 2. **Report the merge commit:**
83
+ ```bash
84
+ git log -1 --format="%H %s"
85
+ ```
86
+
87
+ 3. **Check for next work:**
88
+ - If there is a known next issue in the current milestone or the user mentioned follow-up work, suggest starting it
89
+ - If the branch was a worktree, note that the worktree can be cleaned up
90
+
91
+ ## Error handling
92
+
93
+ - If `gh` commands fail, check authentication: `gh auth status`
94
+ - If merge conflicts are reported, inform the user -- do not attempt automatic resolution
95
+ - If branch protection rules block the merge, report which rules are not satisfied
@@ -19,7 +19,7 @@ Run a multi-agent parallel review of: $ARGUMENTS
19
19
  | `auth`, `login`, `password`, `token`, `session`, `crypto`, `secret`, `permission`, `oauth`, `jwt`, `cors`, `csrf` | @dev-team-szabo | Security surface |
20
20
  | `/api/`, `/routes/`, `schema`, `.graphql`, `.proto`, `openapi` | @dev-team-mori | API/UI contract |
21
21
  | `docker`, `.env`, `config`, `migration`, `database`, `.sql`, `deploy` | @dev-team-voss | Infrastructure |
22
- | `.github/workflows`, `.claude/`, `tsconfig`, `eslint`, `prettier`, `package.json` | @dev-team-deming | Tooling |
22
+ | `.github/workflows`, `.dev-team/`, `tsconfig`, `eslint`, `prettier`, `package.json` | @dev-team-deming | Tooling |
23
23
  | `readme`, `changelog`, `.md`, `/docs/` | @dev-team-tufte | Documentation |
24
24
  | `/adr/`, `architecture`, `/core/`, `/domain/` | @dev-team-brooks | Architecture |
25
25
  | `package.json`, `version`, `changelog`, release workflows | @dev-team-conway | Release artifacts |
@@ -32,7 +32,7 @@ Run a multi-agent parallel review of: $ARGUMENTS
32
32
  1. Spawn each selected agent as a **parallel background subagent** using the Agent tool with `subagent_type: "general-purpose"`.
33
33
 
34
34
  2. Each agent's prompt must include:
35
- - The agent's full definition (read from `.claude/agents/<agent>.md`)
35
+ - The agent's full definition (read from `.dev-team/agents/<agent>.md`)
36
36
  - The list of changed files relevant to their domain
37
37
  - Instruction to produce classified findings: `[DEFECT]`, `[RISK]`, `[QUESTION]`, `[SUGGESTION]`
38
38
  - Instruction to read the actual code — not just the diff — for full context
@@ -67,8 +67,13 @@ Group by severity:
67
67
 
68
68
  State the verdict clearly. List what must be fixed for approval if requesting changes.
69
69
 
70
+ ### Security preamble
71
+
72
+ Before starting the review, check for open security alerts: run `/dev-team:security-status` if available, or check `gh api repos/{owner}/{repo}/code-scanning/alerts?state=open` and `gh api repos/{owner}/{repo}/dependabot/alerts?state=open`. Flag any critical findings in the review report.
73
+
70
74
  ### Completion
71
75
 
72
76
  After the review report is delivered:
73
- 1. Spawn **@dev-team-borges** (Librarian) to review memory freshness and capture any learnings from the review findings. This is mandatory.
74
- 2. Include Borges's recommendations in the final report.
77
+ 1. You MUST spawn **@dev-team-borges** (Librarian) as the final step to review memory freshness and capture any learnings from the review findings. Do NOT skip this.
78
+ 2. If Borges was not spawned, the review is INCOMPLETE.
79
+ 3. Include Borges's recommendations in the final report.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: security-status
3
+ description: Check GitHub security signals — code scanning, Dependabot, secret scanning, and compliance status. Use at session start and before releases.
4
+ user_invocable: true
5
+ ---
6
+
7
+ # Security Status Check
8
+
9
+ Proactively monitor all GitHub Advanced Security signals for this repository.
10
+
11
+ ## Steps
12
+
13
+ 1. **Run all checks in parallel** using the Bash tool with `gh api`. Derive {owner}/{repo} from `gh repo view --json nameWithOwner --jq .nameWithOwner`:
14
+
15
+ - Code scanning alerts (CodeQL, code quality): `gh api --paginate repos/{owner}/{repo}/code-scanning/alerts?state=open`
16
+ - Dependabot alerts (vulnerable dependencies): `gh api --paginate repos/{owner}/{repo}/dependabot/alerts?state=open`
17
+ - Secret scanning alerts: `gh api --paginate repos/{owner}/{repo}/secret-scanning/alerts?state=open`
18
+ - Pending Dependabot PRs: `gh pr list --label dependencies`
19
+ - Copilot review status on open PRs: check reviews on each open PR
20
+
21
+ 2. **Report findings** in a summary table:
22
+
23
+ | Signal | Status | Details |
24
+ |--------|--------|---------|
25
+ | Code Scanning (CodeQL) | X open alerts | severity breakdown |
26
+ | Dependabot Security | X open alerts | affected packages |
27
+ | Dependabot Updates | X pending PRs | age of oldest |
28
+ | Secret Scanning | X open alerts | types |
29
+ | Copilot Review | X comments on open PRs | blocking? |
30
+
31
+ 3. **Classify findings:**
32
+ - `[DEFECT]` — Critical/high severity security alerts, exposed secrets
33
+ - `[RISK]` — Medium severity alerts, stale Dependabot PRs (>7 days)
34
+ - `[SUGGESTION]` — Low severity, informational
35
+
36
+ 4. **Recommend actions** for any open alerts — who should fix, urgency, and whether it blocks the current work.
37
+
38
+ ## When to run
39
+
40
+ - **Every session start** — quick baseline check
41
+ - **Before creating a release** — compliance gate
42
+ - **After merging Dependabot PRs** — verify alerts resolved
43
+ - **On request** — `/dev-team:security-status`
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dev-team:task
3
- description: Start an iterative task loop with adversarial review gates. Use when the user wants a task implemented with automatic quality convergence the loop continues until no [DEFECT] challenges remain or max iterations are reached.
3
+ description: Start an iterative task loop with adversarial review gates. Use when the user wants a task implemented with automatic quality convergence -- the loop continues until no [DEFECT] challenges remain or max iterations are reached.
4
4
  ---
5
5
 
6
6
  Start a task loop for: $ARGUMENTS
@@ -11,25 +11,15 @@ Start a task loop for: $ARGUMENTS
11
11
  - `--max-iterations N` (default: 10)
12
12
  - `--reviewers` (default: @dev-team-szabo, @dev-team-knuth)
13
13
 
14
- 2. Create the state file `.claude/dev-team-task.json`:
15
- ```json
16
- {
17
- "prompt": "<the original task description>",
18
- "iteration": 1,
19
- "maxIterations": <N>,
20
- "reviewers": ["dev-team-szabo", "dev-team-knuth"]
21
- }
22
- ```
23
-
24
- 3. Determine the right implementing agent based on the task:
25
- - Backend/API/data work → @dev-team-voss
26
- - Frontend/UI work → @dev-team-mori
27
- - Test writing → @dev-team-beck
28
- - Tooling/config → @dev-team-deming
29
- - Documentation → @dev-team-tufte
30
- - Release/versioning → @dev-team-conway
31
-
32
- 4. **Architect pre-assessment** (skip for bug fixes, typo fixes, config tweaks):
14
+ 2. Determine the right implementing agent based on the task:
15
+ - Backend/API/data work -> @dev-team-voss
16
+ - Frontend/UI work -> @dev-team-mori
17
+ - Test writing -> @dev-team-beck
18
+ - Tooling/config -> @dev-team-deming
19
+ - Documentation -> @dev-team-tufte
20
+ - Release/versioning -> @dev-team-conway
21
+
22
+ 3. **Architect pre-assessment** (skip for bug fixes, typo fixes, config tweaks):
33
23
  Spawn @dev-team-brooks to assess:
34
24
  - Does this task introduce a new pattern, tool, or convention?
35
25
  - Does it change module boundaries, dependency direction, or layer responsibilities?
@@ -39,20 +29,26 @@ Start a task loop for: $ARGUMENTS
39
29
 
40
30
  If an ADR is needed, include "Write ADR-NNN: <title>" in the implementation task. The implementing agent writes the ADR file. Architect reviews it post-implementation alongside code review.
41
31
 
32
+ ## Pre-implementation: best-practices research
33
+
34
+ Before the first iteration, the implementing agent should research current best practices relevant to the task — checking official documentation for the tools, frameworks, and platforms involved. This ensures decisions are based on current ecosystem recommendations, not stale assumptions. When current best practices conflict with established codebase conventions, prefer consistency and flag the newer approach as a `[SUGGESTION]` with a migration path.
35
+
42
36
  ## Execution loop
43
37
 
44
- Each iteration:
38
+ Track iterations in conversation context (no state files). For each iteration:
39
+
45
40
  1. The implementing agent works on the task.
46
41
  2. After implementation, spawn review agents in parallel as background tasks.
47
42
  3. Collect classified challenges from reviewers.
48
43
  4. If any `[DEFECT]` challenges exist, address them in the next iteration.
49
- 5. If no `[DEFECT]` remains, output `<promise>DONE</promise>` to exit the loop.
44
+ 5. If no `[DEFECT]` remains, output DONE to exit the loop.
45
+ 6. If max iterations reached without convergence, report remaining defects and exit.
50
46
 
51
- The Stop hook (`dev-team-task-loop.js`) manages iteration counting and re-injection.
47
+ The convergence check happens in conversation context: count iterations, check for `[DEFECT]` findings, and decide whether to continue or exit.
52
48
 
53
49
  ## Parallel mode
54
50
 
55
- When multiple issues are being addressed in a single session, the task loop switches to parallel orchestration (see ADR-019). Drucker coordinates all phases.
51
+ When multiple issues are being addressed in a single session, the task loop switches to parallel orchestration (see ADR-019). Drucker coordinates all phases in conversation context.
56
52
 
57
53
  ### Phase 0: Brooks pre-assessment (batch)
58
54
  Spawn @dev-team-brooks once with all issues. Brooks identifies:
@@ -63,22 +59,10 @@ Spawn @dev-team-brooks once with all issues. Brooks identifies:
63
59
  Issues in the same conflict group execute sequentially. Independent issues proceed in parallel.
64
60
 
65
61
  ### Phase 1: Parallel implementation
66
- Drucker spawns one implementing agent per independent issue, each on its own branch (`feat/<issue>-<description>`). Agents work concurrently without awareness of each other. Track state in `.claude/dev-team-parallel.json`:
67
- ```json
68
- {
69
- "mode": "parallel",
70
- "issues": [
71
- { "issue": 42, "branch": "feat/42-add-auth", "agent": "dev-team-voss", "status": "implementing" },
72
- { "issue": 43, "branch": "feat/43-fix-nav", "agent": "dev-team-mori", "status": "implementing" }
73
- ],
74
- "phase": "implementation",
75
- "conflictGroups": [[42, 55]],
76
- "reviewWave": null
77
- }
78
- ```
62
+ Drucker spawns one implementing agent per independent issue, each on its own branch (`feat/<issue>-<description>`). Agents work concurrently without awareness of each other. Drucker tracks which issues are assigned to which agents and branches in conversation context.
79
63
 
80
64
  ### Phase 2: Review wave
81
- Reviews do **not** start until **all** implementation agents have completed. Once all are done, spawn review agents (Szabo + Knuth, plus conditional reviewers) in parallel across all branches simultaneously. Each reviewer receives the diff for one specific branch and produces classified findings scoped to that branch.
65
+ Reviews do **not** start until **all** implementation agents have completed (Agent tool provides completion notifications as the sync barrier). Once all are done, spawn review agents (Szabo + Knuth, plus conditional reviewers) in parallel across all branches simultaneously. Each reviewer receives the diff for one specific branch and produces classified findings scoped to that branch.
82
66
 
83
67
  ### Phase 3: Defect routing
84
68
  Collect all findings. Route `[DEFECT]` items back to the original implementing agent for each branch. Agents fix defects on their own branch. After fixes, another review wave runs. Continue until no `[DEFECT]` findings remain or the per-branch iteration limit is reached.
@@ -90,13 +74,16 @@ Borges runs **once** across all branches after the final review wave clears. Thi
90
74
  Parallel mode is complete when:
91
75
  1. All branches have zero `[DEFECT]` findings, OR the per-branch iteration limit (default: 10) is reached
92
76
  2. Borges has run across all branches
93
- 3. `.claude/dev-team-parallel.json` is deleted
77
+
78
+ ## Security preamble
79
+
80
+ Before starting work, check for open security alerts: run `/dev-team:security-status` if available, or check `gh api repos/{owner}/{repo}/code-scanning/alerts?state=open` and `gh api repos/{owner}/{repo}/dependabot/alerts?state=open`. Flag any critical findings before proceeding.
94
81
 
95
82
  ## Completion
96
83
 
97
84
  When the loop exits:
98
- 1. Delete `.claude/dev-team-task.json`.
99
- 2. Spawn **@dev-team-borges** (Librarian) to review memory freshness, cross-agent coherence, and system improvement opportunities. This is mandatory.
85
+ 1. You MUST spawn **@dev-team-borges** (Librarian) as the final step to review memory freshness, cross-agent coherence, and system improvement opportunities. Do NOT skip this.
86
+ 2. If Borges was not spawned, the task is INCOMPLETE.
100
87
  3. Summarize what was accomplished across all iterations.
101
88
  4. Report any remaining `[RISK]` or `[SUGGESTION]` items, including Borges's recommendations.
102
89
  5. Write key learnings to agent MEMORY.md files.
@@ -1,73 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * dev-team-task-loop.js
5
- * Stop hook — implements iterative task loop with adversarial review gates.
6
- *
7
- * When a task loop is active (.claude/dev-team-task.json exists):
8
- * - Intercepts session exit
9
- * - Checks if completion criteria are met (no [DEFECT] challenges)
10
- * - If not met, feeds the task back for another iteration
11
- * - Respects max iteration limit
12
- *
13
- * State file: .claude/dev-team-task.json (created by /dev-team:task skill)
14
- */
15
-
16
- "use strict";
17
-
18
- const fs = require("fs");
19
- const path = require("path");
20
-
21
- const STATE_FILE = path.join(process.cwd(), ".claude", "dev-team-task.json");
22
-
23
- // No state file means no active task loop — allow normal exit
24
- if (!fs.existsSync(STATE_FILE)) {
25
- process.exit(0);
26
- }
27
-
28
- let state;
29
- try {
30
- state = JSON.parse(fs.readFileSync(STATE_FILE, "utf-8"));
31
- } catch {
32
- // Corrupted state file — clean up and allow exit
33
- try {
34
- fs.unlinkSync(STATE_FILE);
35
- } catch {
36
- /* ignore */
37
- }
38
- process.exit(0);
39
- }
40
-
41
- const { prompt, iteration = 1, maxIterations = 10, sessionId: _sessionId } = state;
42
-
43
- // Check iteration limit
44
- if (iteration >= maxIterations) {
45
- console.log(
46
- `[dev-team task-loop] Max iterations (${maxIterations}) reached. Exiting loop. Review remaining issues manually.`,
47
- );
48
- try {
49
- fs.unlinkSync(STATE_FILE);
50
- } catch {
51
- /* ignore */
52
- }
53
- process.exit(0);
54
- }
55
-
56
- // Increment iteration and update state
57
- state.iteration = iteration + 1;
58
- try {
59
- fs.writeFileSync(STATE_FILE, JSON.stringify(state, null, 2));
60
- } catch {
61
- // Can't write state — allow exit
62
- process.exit(0);
63
- }
64
-
65
- // Block exit and re-inject the task prompt
66
- const output = JSON.stringify({
67
- decision: "block",
68
- reason: prompt,
69
- systemMessage: `[dev-team task-loop] Iteration ${iteration + 1}/${maxIterations}. Review findings and address any [DEFECT] challenges. When no [DEFECT] remains, output <promise>DONE</promise> to exit the loop. To cancel: delete .claude/dev-team-task.json`,
70
- });
71
-
72
- console.log(output);
73
- process.exit(0);