maestro-flow 0.4.9 → 0.4.10

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 (187) hide show
  1. package/.agy/agents/cli-explore-agent.md +186 -0
  2. package/.agy/agents/conceptual-planning-agent.md +244 -0
  3. package/.agy/agents/impeccable-agent.md +97 -0
  4. package/.agy/agents/team-supervisor.md +142 -0
  5. package/.agy/agents/team-worker.md +236 -0
  6. package/.agy/agents/ui-design-agent.md +286 -0
  7. package/.agy/agents/workflow-analyzer.md +114 -0
  8. package/.agy/agents/workflow-codebase-mapper.md +76 -0
  9. package/.agy/agents/workflow-collab-planner.md +142 -0
  10. package/.agy/agents/workflow-debugger.md +102 -0
  11. package/.agy/agents/workflow-executor.md +131 -0
  12. package/.agy/agents/workflow-external-researcher.md +86 -0
  13. package/.agy/agents/workflow-integration-checker.md +82 -0
  14. package/.agy/agents/workflow-nyquist-auditor.md +84 -0
  15. package/.agy/agents/workflow-phase-researcher.md +84 -0
  16. package/.agy/agents/workflow-plan-checker.md +89 -0
  17. package/.agy/agents/workflow-planner.md +194 -0
  18. package/.agy/agents/workflow-project-researcher.md +73 -0
  19. package/.agy/agents/workflow-research-synthesizer.md +70 -0
  20. package/.agy/agents/workflow-reviewer.md +81 -0
  21. package/.agy/agents/workflow-roadmapper.md +81 -0
  22. package/.agy/agents/workflow-verifier.md +119 -0
  23. package/.agy/skills/codify-to-knowhow/SKILL.md +172 -0
  24. package/.agy/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  25. package/.agy/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  26. package/.agy/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  27. package/.agy/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  28. package/.agy/skills/learn-decompose/SKILL.md +118 -0
  29. package/.agy/skills/learn-follow/SKILL.md +129 -0
  30. package/.agy/skills/learn-investigate/SKILL.md +154 -0
  31. package/.agy/skills/learn-retro/SKILL.md +159 -0
  32. package/.agy/skills/learn-second-opinion/SKILL.md +124 -0
  33. package/.agy/skills/maestro/SKILL.md +221 -0
  34. package/.agy/skills/maestro-amend/SKILL.md +162 -0
  35. package/.agy/skills/maestro-analyze/SKILL.md +135 -0
  36. package/.agy/skills/maestro-brainstorm/SKILL.md +118 -0
  37. package/.agy/skills/maestro-collab/SKILL.md +174 -0
  38. package/.agy/skills/maestro-composer/SKILL.md +180 -0
  39. package/.agy/skills/maestro-execute/SKILL.md +133 -0
  40. package/.agy/skills/maestro-fork/SKILL.md +88 -0
  41. package/.agy/skills/maestro-guard/SKILL.md +101 -0
  42. package/.agy/skills/maestro-help/SKILL.md +267 -0
  43. package/.agy/skills/maestro-help/index/catalog.json +184 -0
  44. package/.agy/skills/maestro-help/phases/01-parse-intent.md +122 -0
  45. package/.agy/skills/maestro-help/phases/02-search-present.md +181 -0
  46. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +186 -0
  47. package/.agy/skills/maestro-impeccable/SKILL.md +250 -0
  48. package/.agy/skills/maestro-init/SKILL.md +80 -0
  49. package/.agy/skills/maestro-learn/SKILL.md +142 -0
  50. package/.agy/skills/maestro-merge/SKILL.md +66 -0
  51. package/.agy/skills/maestro-milestone-audit/SKILL.md +70 -0
  52. package/.agy/skills/maestro-milestone-complete/SKILL.md +77 -0
  53. package/.agy/skills/maestro-milestone-release/SKILL.md +98 -0
  54. package/.agy/skills/maestro-overlay/SKILL.md +177 -0
  55. package/.agy/skills/maestro-plan/SKILL.md +172 -0
  56. package/.agy/skills/maestro-player/SKILL.md +176 -0
  57. package/.agy/skills/maestro-quick/SKILL.md +67 -0
  58. package/.agy/skills/maestro-ralph/SKILL.md +546 -0
  59. package/.agy/skills/maestro-ralph-execute/SKILL.md +255 -0
  60. package/.agy/skills/maestro-roadmap/SKILL.md +170 -0
  61. package/.agy/skills/maestro-tools-execute/SKILL.md +119 -0
  62. package/.agy/skills/maestro-tools-register/SKILL.md +159 -0
  63. package/.agy/skills/maestro-ui-codify/SKILL.md +81 -0
  64. package/.agy/skills/maestro-update/SKILL.md +175 -0
  65. package/.agy/skills/maestro-verify/SKILL.md +111 -0
  66. package/.agy/skills/manage-codebase-rebuild/SKILL.md +77 -0
  67. package/.agy/skills/manage-codebase-refresh/SKILL.md +59 -0
  68. package/.agy/skills/manage-harvest/SKILL.md +96 -0
  69. package/.agy/skills/manage-issue/SKILL.md +72 -0
  70. package/.agy/skills/manage-issue-discover/SKILL.md +83 -0
  71. package/.agy/skills/manage-knowhow/SKILL.md +76 -0
  72. package/.agy/skills/manage-knowhow-capture/SKILL.md +78 -0
  73. package/.agy/skills/manage-learn/SKILL.md +64 -0
  74. package/.agy/skills/manage-status/SKILL.md +51 -0
  75. package/.agy/skills/manage-wiki/SKILL.md +61 -0
  76. package/.agy/skills/quality-auto-test/SKILL.md +135 -0
  77. package/.agy/skills/quality-debug/SKILL.md +122 -0
  78. package/.agy/skills/quality-refactor/SKILL.md +69 -0
  79. package/.agy/skills/quality-retrospective/SKILL.md +79 -0
  80. package/.agy/skills/quality-review/SKILL.md +130 -0
  81. package/.agy/skills/quality-sync/SKILL.md +53 -0
  82. package/.agy/skills/quality-test/SKILL.md +119 -0
  83. package/.agy/skills/security-audit/SKILL.md +157 -0
  84. package/.agy/skills/skill-iter-tune/SKILL.md +381 -0
  85. package/.agy/skills/skill-iter-tune/phases/01-setup.md +144 -0
  86. package/.agy/skills/skill-iter-tune/phases/02-execute.md +292 -0
  87. package/.agy/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  88. package/.agy/skills/skill-iter-tune/phases/04-improve.md +198 -0
  89. package/.agy/skills/skill-iter-tune/phases/05-report.md +166 -0
  90. package/.agy/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  91. package/.agy/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  92. package/.agy/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  93. package/.agy/skills/spec-add/SKILL.md +67 -0
  94. package/.agy/skills/spec-load/SKILL.md +70 -0
  95. package/.agy/skills/spec-remove/SKILL.md +50 -0
  96. package/.agy/skills/spec-setup/SKILL.md +47 -0
  97. package/.agy/skills/team-coordinate/SKILL.md +267 -0
  98. package/.agy/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  99. package/.agy/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
  100. package/.agy/skills/team-coordinate/roles/coordinator/commands/monitor.md +348 -0
  101. package/.agy/skills/team-coordinate/roles/coordinator/role.md +362 -0
  102. package/.agy/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  103. package/.agy/skills/team-coordinate/specs/pipelines.md +97 -0
  104. package/.agy/skills/team-coordinate/specs/quality-gates.md +112 -0
  105. package/.agy/skills/team-coordinate/specs/role-spec-template.md +198 -0
  106. package/.agy/skills/team-executor/SKILL.md +180 -0
  107. package/.agy/skills/team-executor/roles/executor/commands/monitor.md +235 -0
  108. package/.agy/skills/team-executor/roles/executor/role.md +171 -0
  109. package/.agy/skills/team-executor/specs/session-schema.md +264 -0
  110. package/.agy/skills/team-lifecycle-v4/SKILL.md +189 -0
  111. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +92 -0
  112. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  113. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
  114. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
  115. package/.agy/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
  116. package/.agy/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  117. package/.agy/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
  118. package/.agy/skills/team-lifecycle-v4/roles/executor/role.md +64 -0
  119. package/.agy/skills/team-lifecycle-v4/roles/planner/role.md +82 -0
  120. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
  121. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  122. package/.agy/skills/team-lifecycle-v4/roles/reviewer/role.md +65 -0
  123. package/.agy/skills/team-lifecycle-v4/roles/supervisor/role.md +188 -0
  124. package/.agy/skills/team-lifecycle-v4/roles/tester/role.md +84 -0
  125. package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +92 -0
  126. package/.agy/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
  127. package/.agy/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
  128. package/.agy/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  129. package/.agy/skills/team-lifecycle-v4/templates/architecture.md +254 -0
  130. package/.agy/skills/team-lifecycle-v4/templates/epics.md +196 -0
  131. package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  132. package/.agy/skills/team-lifecycle-v4/templates/requirements.md +224 -0
  133. package/.agy/skills/team-quality-assurance/SKILL.md +148 -0
  134. package/.agy/skills/team-quality-assurance/roles/analyst/role.md +85 -0
  135. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  136. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
  137. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +235 -0
  138. package/.agy/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  139. package/.agy/skills/team-quality-assurance/roles/executor/role.md +62 -0
  140. package/.agy/skills/team-quality-assurance/roles/generator/role.md +65 -0
  141. package/.agy/skills/team-quality-assurance/roles/scout/role.md +72 -0
  142. package/.agy/skills/team-quality-assurance/roles/strategist/role.md +69 -0
  143. package/.agy/skills/team-quality-assurance/specs/pipelines.md +115 -0
  144. package/.agy/skills/team-quality-assurance/specs/team-config.json +131 -0
  145. package/.agy/skills/team-review/SKILL.md +149 -0
  146. package/.agy/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  147. package/.agy/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
  148. package/.agy/skills/team-review/roles/coordinator/commands/monitor.md +209 -0
  149. package/.agy/skills/team-review/roles/coordinator/role.md +132 -0
  150. package/.agy/skills/team-review/roles/fixer/role.md +74 -0
  151. package/.agy/skills/team-review/roles/reviewer/role.md +66 -0
  152. package/.agy/skills/team-review/roles/scanner/role.md +77 -0
  153. package/.agy/skills/team-review/specs/dimensions.md +82 -0
  154. package/.agy/skills/team-review/specs/finding-schema.json +82 -0
  155. package/.agy/skills/team-review/specs/pipelines.md +102 -0
  156. package/.agy/skills/team-review/specs/team-config.json +27 -0
  157. package/.agy/skills/team-tech-debt/SKILL.md +133 -0
  158. package/.agy/skills/team-tech-debt/roles/assessor/role.md +76 -0
  159. package/.agy/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  160. package/.agy/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
  161. package/.agy/skills/team-tech-debt/roles/coordinator/commands/monitor.md +198 -0
  162. package/.agy/skills/team-tech-debt/roles/coordinator/role.md +123 -0
  163. package/.agy/skills/team-tech-debt/roles/executor/role.md +76 -0
  164. package/.agy/skills/team-tech-debt/roles/planner/role.md +68 -0
  165. package/.agy/skills/team-tech-debt/roles/scanner/role.md +90 -0
  166. package/.agy/skills/team-tech-debt/roles/validator/role.md +78 -0
  167. package/.agy/skills/team-tech-debt/specs/pipelines.md +47 -0
  168. package/.agy/skills/team-tech-debt/specs/team-config.json +129 -0
  169. package/.agy/skills/team-testing/SKILL.md +144 -0
  170. package/.agy/skills/team-testing/roles/analyst/role.md +101 -0
  171. package/.agy/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  172. package/.agy/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
  173. package/.agy/skills/team-testing/roles/coordinator/commands/monitor.md +242 -0
  174. package/.agy/skills/team-testing/roles/coordinator/role.md +134 -0
  175. package/.agy/skills/team-testing/roles/executor/role.md +95 -0
  176. package/.agy/skills/team-testing/roles/generator/role.md +95 -0
  177. package/.agy/skills/team-testing/roles/strategist/role.md +81 -0
  178. package/.agy/skills/team-testing/specs/pipelines.md +101 -0
  179. package/.agy/skills/team-testing/specs/team-config.json +93 -0
  180. package/.agy/skills/wiki-connect/SKILL.md +64 -0
  181. package/.agy/skills/wiki-digest/SKILL.md +70 -0
  182. package/.agy/skills/workflow-skill-designer/SKILL.md +506 -0
  183. package/.agy/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  184. package/.agy/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  185. package/.agy/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  186. package/.agy/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  187. package/package.json +3 -1
@@ -0,0 +1,90 @@
1
+ ---
2
+ role: scanner
3
+ prefix: TDSCAN
4
+ inner_loop: false
5
+ message_types: [state_update]
6
+ ---
7
+
8
+ # Tech Debt Scanner
9
+
10
+ Multi-dimension tech debt scanner. Scan codebase across 5 dimensions (code, architecture, testing, dependency, documentation), produce structured debt inventory with severity rankings.
11
+
12
+ ## Phase 2: Context & Environment Detection
13
+
14
+ | Input | Source | Required |
15
+ |-------|--------|----------|
16
+ | Scan scope | task description (regex: `scope:\s*(.+)`) | No (default: `**/*`) |
17
+ | Session path | task description (regex: `session:\s*(.+)`) | Yes |
18
+ | .msg/meta.json | <session>/.msg/meta.json | Yes |
19
+
20
+ 1. Extract session path and scan scope from task description
21
+ 2. Load debug specs: Run `ccw spec load --category debug` for known issues, workarounds, and root-cause notes
22
+ 3. Read .msg/meta.json for team context
23
+ 3. Detect project type and framework:
24
+
25
+ | Signal File | Project Type |
26
+ |-------------|-------------|
27
+ | package.json + React/Vue/Angular | Frontend Node |
28
+ | package.json + Express/Fastify/NestJS | Backend Node |
29
+ | pyproject.toml / requirements.txt | Python |
30
+ | go.mod | Go |
31
+ | No detection | Generic |
32
+
33
+ 4. Determine scan dimensions (default: code, architecture, testing, dependency, documentation)
34
+ 5. Detect perspectives from task description:
35
+
36
+ | Condition | Perspective |
37
+ |-----------|-------------|
38
+ | `security\|auth\|inject\|xss` | security |
39
+ | `performance\|speed\|optimize` | performance |
40
+ | `quality\|clean\|maintain\|debt` | code-quality |
41
+ | `architect\|pattern\|structure` | architecture |
42
+ | Default | code-quality + architecture |
43
+
44
+ 6. Assess complexity:
45
+
46
+ | Score | Complexity | Strategy |
47
+ |-------|------------|----------|
48
+ | >= 4 | High | Triple Fan-out: CLI explore + CLI 5 dimensions + multi-perspective Gemini |
49
+ | 2-3 | Medium | Dual Fan-out: CLI explore + CLI 3 dimensions |
50
+ | 0-1 | Low | Inline: ACE search + Grep |
51
+
52
+ ## Phase 3: Multi-Dimension Scan
53
+
54
+ **Low Complexity** (inline):
55
+ - Use `mcp__ace-tool__search_context` for code smells, TODO/FIXME, deprecated APIs, complex functions, dead code, missing tests
56
+ - Classify findings into dimensions
57
+
58
+ **Medium/High Complexity** (Fan-out):
59
+ - Fan-out A: CLI exploration (structure, patterns, dependencies angles) via `maestro delegate --role explore --mode analysis`
60
+ - Fan-out B: CLI dimension analysis (parallel per dimension -- code, architecture, testing, dependency, documentation) via `--role analyze`
61
+ - Fan-out C (High only): Multi-perspective analysis (security, performance, code-quality, architecture) via `--role analyze`
62
+ - Fan-in: Merge results, cross-deduplicate by file:line, boost severity for multi-source findings
63
+
64
+ **Standardize each finding**:
65
+
66
+ | Field | Description |
67
+ |-------|-------------|
68
+ | `id` | `TD-NNN` (sequential) |
69
+ | `dimension` | code, architecture, testing, dependency, documentation |
70
+ | `severity` | critical, high, medium, low |
71
+ | `file` | File path |
72
+ | `line` | Line number |
73
+ | `description` | Issue description |
74
+ | `suggestion` | Fix suggestion |
75
+ | `estimated_effort` | small, medium, large, unknown |
76
+
77
+ ### Tech Profile Scan
78
+
79
+ After multi-dimension scan, emit context-aware trigger signals (based on detected codebase characteristics):
80
+
81
+ 1. Check debt dimensions → signals (`legacy_patterns`, `test_gap`, `perf_sensitive`)
82
+ 2. Check detected patterns → risk signals (`sql_detected`, `auth_detected`, `scaling_concern`, `injection_risk`)
83
+ 3. Include `tech_profile` in Phase 5 state_update data
84
+
85
+ ## Phase 4: Aggregate & Save
86
+
87
+ 1. Deduplicate findings across Fan-out layers (file:line key), merge cross-references
88
+ 2. Sort by severity (cross-referenced items boosted)
89
+ 3. Write `<session>/scan/debt-inventory.json` with scan_date, dimensions, total_items, by_dimension, by_severity, items
90
+ 4. Update .msg/meta.json with `debt_inventory` array and `debt_score_before` count
@@ -0,0 +1,78 @@
1
+ ---
2
+ role: validator
3
+ prefix: TDVAL
4
+ inner_loop: false
5
+ message_types: [state_update]
6
+ ---
7
+
8
+ # Tech Debt Validator
9
+
10
+ Cleanup result validator. Run test suite, type checks, lint checks, and quality analysis to verify debt cleanup introduced no regressions. Compare before/after debt scores, produce validation-report.json.
11
+
12
+ ## Phase 2: Load Context
13
+
14
+ | Input | Source | Required |
15
+ |-------|--------|----------|
16
+ | Session path | task description (regex: `session:\s*(.+)`) | Yes |
17
+ | .msg/meta.json | <session>/.msg/meta.json | Yes |
18
+ | Fix log | <session>/fixes/fix-log.json | No |
19
+
20
+ 1. Extract session path from task description
21
+ 2. Read .msg/meta.json for: worktree.path, debt_inventory, fix_results, debt_score_before
22
+ 3. Determine command prefix: `cd "<worktree-path>" && ` if worktree exists
23
+ 4. Read fix-log.json for modified files list
24
+ 5. Detect available validation tools in worktree:
25
+
26
+ | Signal | Tool | Method |
27
+ |--------|------|--------|
28
+ | package.json + npm | npm test | Test suite |
29
+ | pytest available | python -m pytest | Test suite |
30
+ | npx tsc available | npx tsc --noEmit | Type check |
31
+ | npx eslint available | npx eslint | Lint check |
32
+
33
+ ## Phase 3: Run Validation Checks
34
+
35
+ Execute 4-layer validation (all commands in worktree):
36
+
37
+ **1. Test Suite**:
38
+ - Run `npm test` or `python -m pytest` in worktree
39
+ - PASS if no FAIL/error/failed keywords; FAIL with regression count otherwise
40
+ - Skip with "no-tests" if no test runner available
41
+
42
+ **2. Type Check**:
43
+ - Run `npx tsc --noEmit` in worktree
44
+ - Count `error TS` occurrences for error count
45
+
46
+ **3. Lint Check**:
47
+ - Run `npx eslint --no-error-on-unmatched-pattern <modified-files>` in worktree
48
+ - Count error occurrences
49
+
50
+ **4. Quality Analysis** (optional, when > 5 modified files):
51
+ - Use gemini CLI to compare code quality before/after
52
+ - Assess complexity, duplication, naming quality improvements
53
+
54
+ **Debt Score Calculation**:
55
+ - debt_score_after = debt items NOT in modified files (remaining unfixed items)
56
+ - improvement_percentage = ((before - after) / before) * 100
57
+
58
+ **Auto-fix attempt** (when total_regressions <= 3):
59
+ - Use CLI tool to fix regressions in worktree:
60
+ ```
61
+ run_command({
62
+ command: `cd "${worktreePath}" && maestro delegate "PURPOSE: Fix regressions found in validation
63
+ TASK: ${regressionDetails}
64
+ MODE: write
65
+ CONTEXT: @${modifiedFiles.join(' @')}
66
+ EXPECTED: Fixed regressions
67
+ CONSTRAINTS: Fix only regressions | Preserve debt cleanup changes | No suppressions" --tool gemini --mode write`,
68
+ run_in_background: false
69
+ })
70
+ ```
71
+ - Re-run validation checks after fix attempt
72
+
73
+ ## Phase 4: Compare & Report
74
+
75
+ 1. Calculate: total_regressions = test_regressions + type_errors + lint_errors; passed = (total_regressions === 0)
76
+ 2. Write `<session>/validation/validation-report.json` with: validation_date, passed, regressions, checks (per-check status), debt_score_before, debt_score_after, improvement_percentage
77
+ 3. Update .msg/meta.json with `validation_results` and `debt_score_after`
78
+ 4. Select message type: `validation_complete` if passed, `regression_found` if not
@@ -0,0 +1,47 @@
1
+ # Pipeline Definitions
2
+
3
+ Tech debt pipeline modes and task registry.
4
+
5
+ ## Pipeline Modes
6
+
7
+ | Mode | Description | Task Chain |
8
+ |------|-------------|------------|
9
+ | scan | Scan and assess only, no fixes | TDSCAN-001 -> TDEVAL-001 |
10
+ | remediate | Full pipeline: scan -> assess -> plan -> fix -> validate | TDSCAN-001 -> TDEVAL-001 -> TDPLAN-001 -> TDFIX-001 -> TDVAL-001 |
11
+ | targeted | Skip scan/assess, direct fix path | TDPLAN-001 -> TDFIX-001 -> TDVAL-001 |
12
+
13
+ ## Task Registry
14
+
15
+ | Task ID | Role | Prefix | blockedBy | Description |
16
+ |---------|------|--------|-----------|-------------|
17
+ | TDSCAN-001 | scanner | TDSCAN | [] | Fan-out multi-dimension codebase scan (code, architecture, testing, dependency, documentation) |
18
+ | TDEVAL-001 | assessor | TDEVAL | [TDSCAN-001] | Severity assessment with priority quadrant matrix |
19
+ | TDPLAN-001 | planner | TDPLAN | [TDEVAL-001] | 3-phase remediation plan with effort estimates |
20
+ | TDFIX-001 | executor | TDFIX | [TDPLAN-001] | Worktree-based incremental fixes (inner_loop: true) |
21
+ | TDVAL-001 | validator | TDVAL | [TDFIX-001] | 4-layer validation: syntax, tests, integration, regression |
22
+
23
+ ## Checkpoints
24
+
25
+ | Checkpoint | Trigger | Condition | Action |
26
+ |------------|---------|-----------|--------|
27
+ | Plan Approval Gate | TDPLAN-001 completes | Always | ask_question: Approve / Revise / Abort |
28
+ | Worktree Creation | Plan approved | Before TDFIX | git worktree add .worktrees/TD-<slug>-<date> |
29
+ | Fix-Verify GC Loop | TDVAL-* completes | Regressions found | Create TDFIX-fix-<round> + TDVAL-recheck-<round> (max 3 rounds) |
30
+
31
+ ## GC Loop Behavior
32
+
33
+ | Condition | Action |
34
+ |-----------|--------|
35
+ | No regressions | Pipeline complete |
36
+ | Regressions AND gc_rounds < 3 | Create fix-verify tasks, increment gc_rounds |
37
+ | Regressions AND gc_rounds >= 3 | Accept current state, handleComplete |
38
+
39
+ ## Output Artifacts
40
+
41
+ | Task | Output Path |
42
+ |------|-------------|
43
+ | TDSCAN-001 | <session>/scan/scan-report.json |
44
+ | TDEVAL-001 | <session>/assessment/debt-assessment.json |
45
+ | TDPLAN-001 | <session>/plan/remediation-plan.md |
46
+ | TDFIX-001 | <session>/fixes/ (worktree) |
47
+ | TDVAL-001 | <session>/validation/validation-report.md |
@@ -0,0 +1,129 @@
1
+ {
2
+ "team_name": "tech-debt",
3
+ "version": "1.0.0",
4
+ "description": "技术债务识别与清理团队 - 融合\"债务扫描\"、\"量化评估\"、\"治理规划\"、\"清理执行\"、\"验证回归\"五大能力域,形成扫描→评估→规划→清理→验证的闭环",
5
+ "skill_entry": "team-tech-debt",
6
+ "invocation": "Skill(skill=\"team-tech-debt\", args=\"--role=coordinator ...\")",
7
+
8
+ "roles": {
9
+ "coordinator": {
10
+ "name": "coordinator",
11
+ "responsibility": "Orchestration",
12
+ "task_prefix": null,
13
+ "description": "技术债务治理协调者。编排 pipeline:需求澄清 → 模式选择 → 团队创建 → 任务分发 → 监控协调 → 质量门控 → 结果汇报",
14
+ "message_types_sent": ["mode_selected", "quality_gate", "task_unblocked", "error", "shutdown"],
15
+ "message_types_received": ["scan_complete", "assessment_complete", "plan_ready", "fix_complete", "validation_complete", "regression_found", "error"],
16
+ "commands": ["dispatch", "monitor"]
17
+ },
18
+ "scanner": {
19
+ "name": "scanner",
20
+ "responsibility": "Orchestration (多维度债务扫描)",
21
+ "task_prefix": "TDSCAN",
22
+ "description": "技术债务扫描员。多维度扫描代码库:代码债务、架构债务、测试债务、依赖债务、文档债务,生成债务清单",
23
+ "message_types_sent": ["scan_complete", "debt_items_found", "error"],
24
+ "message_types_received": [],
25
+ "commands": ["scan-debt"],
26
+ "cli_tools": ["gemini"]
27
+ },
28
+ "assessor": {
29
+ "name": "assessor",
30
+ "responsibility": "Read-only analysis (量化评估)",
31
+ "task_prefix": "TDEVAL",
32
+ "description": "技术债务评估师。量化评估债务项的影响和修复成本,按优先级矩阵排序,生成评估报告",
33
+ "message_types_sent": ["assessment_complete", "error"],
34
+ "message_types_received": [],
35
+ "commands": ["evaluate"],
36
+ "cli_tools": ["gemini"]
37
+ },
38
+ "planner": {
39
+ "name": "planner",
40
+ "responsibility": "Orchestration (治理规划)",
41
+ "task_prefix": "TDPLAN",
42
+ "description": "技术债务治理规划师。制定分阶段治理方案:短期速赢、中期系统性治理、长期预防机制",
43
+ "message_types_sent": ["plan_ready", "plan_revision", "error"],
44
+ "message_types_received": [],
45
+ "commands": ["create-plan"],
46
+ "cli_tools": ["gemini"]
47
+ },
48
+ "executor": {
49
+ "name": "executor",
50
+ "responsibility": "Code generation (债务清理执行)",
51
+ "task_prefix": "TDFIX",
52
+ "description": "技术债务清理执行者。按优先级执行重构、依赖更新、代码清理、测试补充等治理动作",
53
+ "message_types_sent": ["fix_complete", "fix_progress", "error"],
54
+ "message_types_received": [],
55
+ "commands": ["remediate"],
56
+ "cli_tools": [{"tool": "gemini", "mode": "write"}]
57
+ },
58
+ "validator": {
59
+ "name": "validator",
60
+ "responsibility": "Validation (清理验证)",
61
+ "task_prefix": "TDVAL",
62
+ "description": "技术债务清理验证者。验证清理后无回归、质量指标提升、债务确实消除",
63
+ "message_types_sent": ["validation_complete", "regression_found", "error"],
64
+ "message_types_received": [],
65
+ "commands": ["verify"],
66
+ "cli_tools": [{"tool": "gemini", "mode": "write"}]
67
+ }
68
+ },
69
+
70
+ "pipeline_modes": {
71
+ "scan": {
72
+ "description": "仅扫描评估,不执行修复(审计模式)",
73
+ "stages": ["TDSCAN", "TDEVAL"],
74
+ "entry_role": "scanner"
75
+ },
76
+ "remediate": {
77
+ "description": "完整闭环:扫描 → 评估 → 规划 → 修复 → 验证",
78
+ "stages": ["TDSCAN", "TDEVAL", "TDPLAN", "TDFIX", "TDVAL"],
79
+ "entry_role": "scanner"
80
+ },
81
+ "targeted": {
82
+ "description": "定向修复:用户已知债务项,直接规划执行",
83
+ "stages": ["TDPLAN", "TDFIX", "TDVAL"],
84
+ "entry_role": "planner"
85
+ }
86
+ },
87
+
88
+ "fix_verify_loop": {
89
+ "max_iterations": 3,
90
+ "trigger": "validation fails or regression found",
91
+ "participants": ["executor", "validator"],
92
+ "flow": "TDFIX-fix → TDVAL-verify → evaluate"
93
+ },
94
+
95
+ "shared_memory": {
96
+ "file": ".msg/meta.json",
97
+ "fields": {
98
+ "debt_inventory": { "owner": "scanner", "type": "array" },
99
+ "assessment_matrix": { "owner": "assessor", "type": "object" },
100
+ "remediation_plan": { "owner": "planner", "type": "object" },
101
+ "fix_results": { "owner": "executor", "type": "object" },
102
+ "validation_results": { "owner": "validator", "type": "object" },
103
+ "debt_score_before": { "owner": "assessor", "type": "number" },
104
+ "debt_score_after": { "owner": "validator", "type": "number" }
105
+ }
106
+ },
107
+
108
+ "collaboration_patterns": [
109
+ "CP-1: Linear Pipeline (scan/remediate/targeted mode)",
110
+ "CP-2: Review-Fix Cycle (Executor ↔ Validator loop)",
111
+ "CP-3: Fan-out (Scanner multi-dimension scan)",
112
+ "CP-5: Escalation (Worker → Coordinator → User)",
113
+ "CP-6: Incremental Delivery (batch remediation)",
114
+ "CP-10: Post-Mortem (debt reduction report)"
115
+ ],
116
+
117
+ "debt_dimensions": {
118
+ "code": { "name": "代码债务", "tools": ["static-analysis", "complexity-metrics"] },
119
+ "architecture": { "name": "架构债务", "tools": ["dependency-graph", "coupling-analysis"] },
120
+ "testing": { "name": "测试债务", "tools": ["coverage-analysis", "test-quality"] },
121
+ "dependency": { "name": "依赖债务", "tools": ["outdated-check", "vulnerability-scan"] },
122
+ "documentation": { "name": "文档债务", "tools": ["doc-coverage", "api-doc-check"] }
123
+ },
124
+
125
+ "session_directory": {
126
+ "pattern": ".workflow/.team/TD-{slug}-{date}",
127
+ "subdirectories": ["scan", "assessment", "plan", "fixes", "validation"]
128
+ }
129
+ }
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: team-testing
3
+ description: Unified team skill for testing team. Progressive test coverage through Generator-Critic loops, shared memory, and dynamic layer selection. Triggers on "team testing".
4
+ allowed-tools:
5
+ - ask_question
6
+ - define_subagent
7
+ - grep_search
8
+ - invoke_subagent
9
+ - manage_subagents
10
+ - replace_file_content
11
+ - run_command
12
+ - send_message
13
+ - view_file
14
+ - write_to_file
15
+ agy-subagents:
16
+ - team-worker
17
+ ---
18
+
19
+ ## Sub-Agent Registration (Antigravity)
20
+
21
+ Before any `invoke_subagent` call below, register each sub-agent type once per session by reading the system_prompt from `<agy-agents-dir>/<name>.md` and passing it to `define_subagent`. The `<agy-agents-dir>` is:
22
+ - global install: `~/.gemini/antigravity-cli/agents/`
23
+ - workspace install: `<project>/.agents/agents/`
24
+
25
+ - `define_subagent(name="team-worker", description="<from agents/team-worker.md frontmatter>", system_prompt=<contents of agents/team-worker.md body>, enable_write_tools=true, enable_mcp_tools=true, enable_subagent_tools=false)`
26
+
27
+ **ConversationId tracking**: `invoke_subagent` returns a ConversationId per spawned instance. Subsequent `send_message(Recipient=<ConversationId>, Message=...)` calls require that ConversationId — never use the role name as the recipient.
28
+
29
+ ---
30
+
31
+ # Team Testing
32
+
33
+ Orchestrate multi-agent test pipeline: strategist -> generator -> executor -> analyst. Progressive layer coverage (L1/L2/L3) with Generator-Critic loops for coverage convergence.
34
+
35
+ ## Architecture
36
+
37
+ ```
38
+ view_file(AbsolutePath="<agy-skills-dir>/team-testing/SKILL.md") + execute inline (args: "task description")
39
+ |
40
+ SKILL.md (this file) = Router
41
+ |
42
+ +--------------+--------------+
43
+ | |
44
+ no --role flag --role <name>
45
+ | |
46
+ Coordinator Worker
47
+ roles/coordinator/role.md roles/<name>/role.md
48
+ |
49
+ +-- analyze -> dispatch -> spawn workers -> STOP
50
+ |
51
+ +-------+-------+-------+-------+
52
+ v v v v
53
+ [strat] [gen] [exec] [analyst]
54
+ team-worker agents, each loads roles/<role>/role.md
55
+ ```
56
+
57
+ ## Role Registry
58
+
59
+ | Role | Path | Prefix | Inner Loop |
60
+ |------|------|--------|------------|
61
+ | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
62
+ | strategist | [roles/strategist/role.md](roles/strategist/role.md) | STRATEGY-* | false |
63
+ | generator | [roles/generator/role.md](roles/generator/role.md) | TESTGEN-* | true |
64
+ | executor | [roles/executor/role.md](roles/executor/role.md) | TESTRUN-* | true |
65
+ | analyst | [roles/analyst/role.md](roles/analyst/role.md) | TESTANA-* | false |
66
+
67
+ ## Role Router
68
+
69
+ Parse `$ARGUMENTS`:
70
+ - Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
71
+ - No `--role` -> `@roles/coordinator/role.md`, execute entry router
72
+
73
+ ## Shared Constants
74
+
75
+ - **Session prefix**: `TST`
76
+ - **Session path**: `.workflow/.team/TST-<slug>-<date>/`
77
+ - **Team name**: `testing`
78
+ - **CLI tools**: `maestro delegate --mode analysis` (read-only), `maestro delegate --mode write` (modifications)
79
+ - **Message bus**: `mcp__ccw-tools__team_msg(session_id=<session-id>, ...)`
80
+
81
+ ## Worker Spawn Template
82
+
83
+ Coordinator spawns workers using this template:
84
+
85
+ ```
86
+ invoke_subagent([{ TypeName: "team-worker", Role: "<role>", Prompt: "<Prompt>", Workspace: "inherit" }])
87
+ ```
88
+
89
+ ## User Commands
90
+
91
+ | Command | Action |
92
+ |---------|--------|
93
+ | `check` / `status` | View pipeline status graph |
94
+ | `resume` / `continue` | Advance to next step |
95
+ | `revise <TASK-ID>` | Revise specific task |
96
+ | `feedback <text>` | Inject feedback for revision |
97
+
98
+ ## Completion Action
99
+
100
+ When pipeline completes, coordinator presents:
101
+
102
+ ```
103
+ ask_question({
104
+ questions: [{
105
+ question: "Testing pipeline complete. What would you like to do?",
106
+ header: "Completion",
107
+ multiSelect: false,
108
+ options: [
109
+ { label: "Archive & Clean (Recommended)", description: "Archive session, clean up team" },
110
+ { label: "Keep Active", description: "Keep session for follow-up work" },
111
+ { label: "Deepen Coverage", description: "Add more test layers or increase coverage targets" }
112
+ ]
113
+ }]
114
+ })
115
+ ```
116
+
117
+ ## Session Directory
118
+
119
+ ```
120
+ .workflow/.team/TST-<slug>-<date>/
121
+ ├── .msg/messages.jsonl # Team message bus
122
+ ├── .msg/meta.json # Session metadata
123
+ ├── wisdom/ # Cross-task knowledge
124
+ ├── strategy/ # Strategist output
125
+ ├── tests/ # Generator output (L1-unit/, L2-integration/, L3-e2e/)
126
+ ├── results/ # Executor output
127
+ └── analysis/ # Analyst output
128
+ ```
129
+
130
+ ## Specs Reference
131
+
132
+ - [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions and task registry
133
+ - [specs/team-config.json](specs/team-config.json) — Team configuration
134
+
135
+ ## Error Handling
136
+
137
+ | Scenario | Resolution |
138
+ |----------|------------|
139
+ | Unknown --role value | Error with available role list |
140
+ | Role not found | Error with expected path (roles/<name>/role.md) |
141
+ | CLI tool fails | Worker fallback to direct implementation |
142
+ | GC loop exceeded | Accept current coverage with warning |
143
+ | Fast-advance conflict | Coordinator reconciles on next callback |
144
+ | Completion action fails | Default to Keep Active |
@@ -0,0 +1,101 @@
1
+ ---
2
+ role: analyst
3
+ prefix: TESTANA
4
+ inner_loop: false
5
+ message_types:
6
+ ---
7
+
8
+ # Test Quality Analyst
9
+
10
+ Analyze defect patterns, identify coverage gaps, assess GC loop effectiveness, and generate a quality report with actionable recommendations.
11
+
12
+ ## Phase 2: Context Loading
13
+
14
+ | Input | Source | Required |
15
+ |-------|--------|----------|
16
+ | Task description | From task subject/description | Yes |
17
+ | Session path | Extracted from task description | Yes |
18
+ | Execution results | <session>/results/run-*.json | Yes |
19
+ | Test strategy | <session>/strategy/test-strategy.md | Yes |
20
+ | .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
21
+
22
+ 1. Extract session path from task description
23
+ 2. Read .msg/meta.json for execution context (executor, generator namespaces)
24
+ 3. Read all execution results:
25
+
26
+ ```
27
+ grep_search("<session>/results/run-*.json")
28
+ view_file("<session>/results/run-001.json")
29
+ ```
30
+
31
+ 4. Read test strategy:
32
+
33
+ ```
34
+ view_file("<session>/strategy/test-strategy.md")
35
+ ```
36
+
37
+ 5. Read test files for pattern analysis:
38
+
39
+ ```
40
+ grep_search("<session>/tests/**/*")
41
+ ```
42
+
43
+ ## Phase 3: Quality Analysis
44
+
45
+ **Analysis dimensions**:
46
+
47
+ 1. **Coverage Analysis** -- Aggregate coverage by layer:
48
+
49
+ | Layer | Coverage | Target | Status |
50
+ |-------|----------|--------|--------|
51
+ | L1 | X% | Y% | Met/Below |
52
+
53
+ 2. **Defect Pattern Analysis** -- Frequency and severity:
54
+
55
+ | Pattern | Frequency | Severity |
56
+ |---------|-----------|----------|
57
+ | pattern | count | HIGH (>=3) / MEDIUM (>=2) / LOW (<2) |
58
+
59
+ 3. **GC Loop Effectiveness**:
60
+
61
+ | Metric | Value | Assessment |
62
+ |--------|-------|------------|
63
+ | Rounds | N | - |
64
+ | Coverage Improvement | +/-X% | HIGH (>10%) / MEDIUM (>5%) / LOW (<=5%) |
65
+
66
+ 4. **Coverage Gaps** -- per module/feature:
67
+ - Area, Current %, Gap %, Reason, Recommendation
68
+
69
+ 5. **Quality Score**:
70
+
71
+ | Dimension | Score (1-10) | Weight |
72
+ |-----------|-------------|--------|
73
+ | Coverage Achievement | score | 30% |
74
+ | Test Effectiveness | score | 25% |
75
+ | Defect Detection | score | 25% |
76
+ | GC Loop Efficiency | score | 20% |
77
+
78
+ Write report to `<session>/analysis/quality-report.md`
79
+
80
+ ### Tech Profile Scan
81
+
82
+ After test analysis, emit context-aware trigger signals (based on detected codebase characteristics):
83
+
84
+ 1. Check test findings → signals (`test_gap`, `perf_sensitive`)
85
+ 2. Check tested code → risk signals (`sql_detected`, `auth_detected`, `injection_risk`)
86
+ 3. Include `tech_profile` in Phase 5 state_update data
87
+
88
+ ## Phase 4: Trend Analysis & State Update
89
+
90
+ **Historical comparison** (if multiple sessions exist):
91
+
92
+ ```
93
+ grep_search(".workflow/.team/TST-*/.msg/meta.json")
94
+ ```
95
+
96
+ - Track coverage trends over time
97
+ - Identify defect pattern evolution
98
+ - Compare GC loop effectiveness across sessions
99
+
100
+ Update `<session>/wisdom/.msg/meta.json` under `analyst` namespace:
101
+ - Merge `{ "analyst": { quality_score, coverage_gaps, top_defect_patterns, gc_effectiveness, recommendations } }`
@@ -0,0 +1,70 @@
1
+ # Analyze Task
2
+
3
+ Parse user task -> detect testing capabilities -> select pipeline -> design roles.
4
+
5
+ **CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
6
+
7
+ ## Signal Detection
8
+
9
+ | Keywords | Capability | Prefix |
10
+ |----------|------------|--------|
11
+ | strategy, plan, layers, scope | strategist | STRATEGY |
12
+ | generate tests, write tests, create tests | generator | TESTGEN |
13
+ | run tests, execute, coverage | executor | TESTRUN |
14
+ | analyze, report, quality, defects | analyst | TESTANA |
15
+
16
+ ## Pipeline Mode Detection
17
+
18
+ | Condition | Pipeline |
19
+ |-----------|----------|
20
+ | fileCount <= 3 AND moduleCount <= 1 | targeted |
21
+ | fileCount <= 10 AND moduleCount <= 3 | standard |
22
+ | Otherwise | comprehensive |
23
+
24
+ ## Dependency Graph
25
+
26
+ Natural ordering for testing pipeline:
27
+ - Tier 0: strategist (change analysis, no upstream dependency)
28
+ - Tier 1: generator (requires strategy)
29
+ - Tier 2: executor (requires generated tests; GC loop with generator)
30
+ - Tier 3: analyst (requires execution results)
31
+
32
+ ## Pipeline Definitions
33
+
34
+ ```
35
+ Targeted: STRATEGY -> TESTGEN(L1) -> TESTRUN(L1)
36
+ Standard: STRATEGY -> TESTGEN(L1) -> TESTRUN(L1) -> TESTGEN(L2) -> TESTRUN(L2) -> TESTANA
37
+ Comprehensive: STRATEGY -> [TESTGEN(L1) || TESTGEN(L2)] -> [TESTRUN(L1) || TESTRUN(L2)] -> TESTGEN(L3) -> TESTRUN(L3) -> TESTANA
38
+ ```
39
+
40
+ ## Complexity Scoring
41
+
42
+ | Factor | Points |
43
+ |--------|--------|
44
+ | Per test layer | +1 |
45
+ | Parallel tracks | +1 per track |
46
+ | GC loop enabled | +1 |
47
+ | Serial depth > 3 | +1 |
48
+
49
+ Results: 1-2 Low, 3-5 Medium, 6+ High
50
+
51
+ ## Role Minimization
52
+
53
+ - Cap at 5 roles (coordinator + 4 workers)
54
+ - GC loop: generator <-> executor iterate up to 3 rounds per layer
55
+
56
+ ## Output
57
+
58
+ Write <session>/task-analysis.json:
59
+ ```json
60
+ {
61
+ "task_description": "<original>",
62
+ "pipeline_mode": "<targeted|standard|comprehensive>",
63
+ "capabilities": [{ "name": "<cap>", "prefix": "<PREFIX>", "keywords": ["..."] }],
64
+ "dependency_graph": { "<TASK-ID>": { "role": "<role>", "blockedBy": ["..."], "layer": "L1|L2|L3" } },
65
+ "roles": [{ "name": "<role>", "prefix": "<PREFIX>", "inner_loop": true }],
66
+ "complexity": { "score": 0, "level": "Low|Medium|High" },
67
+ "coverage_targets": { "L1": 80, "L2": 60, "L3": 40 },
68
+ "gc_loop_enabled": true
69
+ }
70
+ ```