agentic-swe 1.0.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/.claude/agents/developer.md +133 -0
- package/.claude/agents/git-ops.md +94 -0
- package/.claude/agents/panel/adversarial.md +35 -0
- package/.claude/agents/panel/architect.md +36 -0
- package/.claude/agents/panel/security.md +36 -0
- package/.claude/agents/pr-manager.md +76 -0
- package/.claude/agents/subagents/01-core-development/api-designer.md +237 -0
- package/.claude/agents/subagents/01-core-development/backend-developer.md +222 -0
- package/.claude/agents/subagents/01-core-development/electron-pro.md +251 -0
- package/.claude/agents/subagents/01-core-development/frontend-developer.md +159 -0
- package/.claude/agents/subagents/01-core-development/fullstack-developer.md +246 -0
- package/.claude/agents/subagents/01-core-development/graphql-architect.md +238 -0
- package/.claude/agents/subagents/01-core-development/microservices-architect.md +239 -0
- package/.claude/agents/subagents/01-core-development/mobile-developer.md +283 -0
- package/.claude/agents/subagents/01-core-development/ui-designer.md +200 -0
- package/.claude/agents/subagents/01-core-development/websocket-engineer.md +150 -0
- package/.claude/agents/subagents/02-language-specialists/angular-architect.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/cpp-pro.md +277 -0
- package/.claude/agents/subagents/02-language-specialists/csharp-developer.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/django-developer.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/dotnet-core-expert.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/dotnet-framework-4.8-expert.md +306 -0
- package/.claude/agents/subagents/02-language-specialists/elixir-expert.md +311 -0
- package/.claude/agents/subagents/02-language-specialists/expo-react-native-expert.md +268 -0
- package/.claude/agents/subagents/02-language-specialists/fastapi-developer.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/flutter-expert.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/golang-pro.md +277 -0
- package/.claude/agents/subagents/02-language-specialists/java-architect.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/javascript-pro.md +277 -0
- package/.claude/agents/subagents/02-language-specialists/kotlin-specialist.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/laravel-specialist.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/nextjs-developer.md +298 -0
- package/.claude/agents/subagents/02-language-specialists/php-pro.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/powershell-5.1-expert.md +59 -0
- package/.claude/agents/subagents/02-language-specialists/powershell-7-expert.md +57 -0
- package/.claude/agents/subagents/02-language-specialists/python-pro.md +277 -0
- package/.claude/agents/subagents/02-language-specialists/rails-expert.md +358 -0
- package/.claude/agents/subagents/02-language-specialists/react-specialist.md +298 -0
- package/.claude/agents/subagents/02-language-specialists/rust-engineer.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/spring-boot-engineer.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/sql-pro.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/swift-expert.md +287 -0
- package/.claude/agents/subagents/02-language-specialists/symfony-specialist.md +354 -0
- package/.claude/agents/subagents/02-language-specialists/typescript-pro.md +277 -0
- package/.claude/agents/subagents/02-language-specialists/vue-expert.md +298 -0
- package/.claude/agents/subagents/03-infrastructure/azure-infra-engineer.md +53 -0
- package/.claude/agents/subagents/03-infrastructure/cloud-architect.md +277 -0
- package/.claude/agents/subagents/03-infrastructure/database-administrator.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/deployment-engineer.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/devops-engineer.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/devops-incident-responder.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/docker-expert.md +278 -0
- package/.claude/agents/subagents/03-infrastructure/incident-responder.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/kubernetes-specialist.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/network-engineer.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/platform-engineer.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/security-engineer.md +277 -0
- package/.claude/agents/subagents/03-infrastructure/sre-engineer.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/terraform-engineer.md +287 -0
- package/.claude/agents/subagents/03-infrastructure/terragrunt-expert.md +307 -0
- package/.claude/agents/subagents/03-infrastructure/windows-infra-admin.md +52 -0
- package/.claude/agents/subagents/04-quality-security/accessibility-tester.md +277 -0
- package/.claude/agents/subagents/04-quality-security/ad-security-reviewer.md +56 -0
- package/.claude/agents/subagents/04-quality-security/architect-reviewer.md +287 -0
- package/.claude/agents/subagents/04-quality-security/chaos-engineer.md +277 -0
- package/.claude/agents/subagents/04-quality-security/code-reviewer.md +287 -0
- package/.claude/agents/subagents/04-quality-security/compliance-auditor.md +277 -0
- package/.claude/agents/subagents/04-quality-security/debugger.md +287 -0
- package/.claude/agents/subagents/04-quality-security/error-detective.md +287 -0
- package/.claude/agents/subagents/04-quality-security/penetration-tester.md +287 -0
- package/.claude/agents/subagents/04-quality-security/performance-engineer.md +287 -0
- package/.claude/agents/subagents/04-quality-security/powershell-security-hardening.md +54 -0
- package/.claude/agents/subagents/04-quality-security/qa-expert.md +287 -0
- package/.claude/agents/subagents/04-quality-security/security-auditor.md +287 -0
- package/.claude/agents/subagents/04-quality-security/test-automator.md +287 -0
- package/.claude/agents/subagents/05-data-ai/ai-engineer.md +287 -0
- package/.claude/agents/subagents/05-data-ai/data-analyst.md +277 -0
- package/.claude/agents/subagents/05-data-ai/data-engineer.md +287 -0
- package/.claude/agents/subagents/05-data-ai/data-scientist.md +287 -0
- package/.claude/agents/subagents/05-data-ai/database-optimizer.md +287 -0
- package/.claude/agents/subagents/05-data-ai/llm-architect.md +287 -0
- package/.claude/agents/subagents/05-data-ai/machine-learning-engineer.md +277 -0
- package/.claude/agents/subagents/05-data-ai/ml-engineer.md +287 -0
- package/.claude/agents/subagents/05-data-ai/mlops-engineer.md +287 -0
- package/.claude/agents/subagents/05-data-ai/nlp-engineer.md +287 -0
- package/.claude/agents/subagents/05-data-ai/postgres-pro.md +287 -0
- package/.claude/agents/subagents/05-data-ai/prompt-engineer.md +287 -0
- package/.claude/agents/subagents/05-data-ai/reinforcement-learning-engineer.md +277 -0
- package/.claude/agents/subagents/06-developer-experience/build-engineer.md +286 -0
- package/.claude/agents/subagents/06-developer-experience/cli-developer.md +286 -0
- package/.claude/agents/subagents/06-developer-experience/dependency-manager.md +286 -0
- package/.claude/agents/subagents/06-developer-experience/documentation-engineer.md +276 -0
- package/.claude/agents/subagents/06-developer-experience/dx-optimizer.md +286 -0
- package/.claude/agents/subagents/06-developer-experience/git-workflow-manager.md +286 -0
- package/.claude/agents/subagents/06-developer-experience/legacy-modernizer.md +286 -0
- package/.claude/agents/subagents/06-developer-experience/mcp-developer.md +275 -0
- package/.claude/agents/subagents/06-developer-experience/powershell-module-architect.md +58 -0
- package/.claude/agents/subagents/06-developer-experience/powershell-ui-architect.md +135 -0
- package/.claude/agents/subagents/06-developer-experience/refactoring-specialist.md +286 -0
- package/.claude/agents/subagents/06-developer-experience/slack-expert.md +232 -0
- package/.claude/agents/subagents/06-developer-experience/tooling-engineer.md +286 -0
- package/.claude/agents/subagents/07-specialized-domains/api-documenter.md +277 -0
- package/.claude/agents/subagents/07-specialized-domains/blockchain-developer.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/embedded-systems.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/fintech-engineer.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/game-developer.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/iot-engineer.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/m365-admin.md +48 -0
- package/.claude/agents/subagents/07-specialized-domains/mobile-app-developer.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/payment-integration.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/quant-analyst.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/risk-manager.md +287 -0
- package/.claude/agents/subagents/07-specialized-domains/seo-specialist.md +184 -0
- package/.claude/agents/subagents/08-business-product/business-analyst.md +287 -0
- package/.claude/agents/subagents/08-business-product/content-marketer.md +287 -0
- package/.claude/agents/subagents/08-business-product/customer-success-manager.md +287 -0
- package/.claude/agents/subagents/08-business-product/legal-advisor.md +287 -0
- package/.claude/agents/subagents/08-business-product/product-manager.md +287 -0
- package/.claude/agents/subagents/08-business-product/project-manager.md +287 -0
- package/.claude/agents/subagents/08-business-product/sales-engineer.md +287 -0
- package/.claude/agents/subagents/08-business-product/scrum-master.md +287 -0
- package/.claude/agents/subagents/08-business-product/technical-writer.md +287 -0
- package/.claude/agents/subagents/08-business-product/ux-researcher.md +287 -0
- package/.claude/agents/subagents/08-business-product/wordpress-master.md +316 -0
- package/.claude/agents/subagents/09-meta-orchestration/agent-installer.md +97 -0
- package/.claude/agents/subagents/09-meta-orchestration/agent-organizer.md +287 -0
- package/.claude/agents/subagents/09-meta-orchestration/context-manager.md +287 -0
- package/.claude/agents/subagents/09-meta-orchestration/error-coordinator.md +287 -0
- package/.claude/agents/subagents/09-meta-orchestration/it-ops-orchestrator.md +60 -0
- package/.claude/agents/subagents/09-meta-orchestration/knowledge-synthesizer.md +287 -0
- package/.claude/agents/subagents/09-meta-orchestration/multi-agent-coordinator.md +287 -0
- package/.claude/agents/subagents/09-meta-orchestration/performance-monitor.md +287 -0
- package/.claude/agents/subagents/09-meta-orchestration/task-distributor.md +287 -0
- package/.claude/agents/subagents/09-meta-orchestration/workflow-orchestrator.md +287 -0
- package/.claude/agents/subagents/10-research-analysis/competitive-analyst.md +287 -0
- package/.claude/agents/subagents/10-research-analysis/data-researcher.md +287 -0
- package/.claude/agents/subagents/10-research-analysis/market-researcher.md +287 -0
- package/.claude/agents/subagents/10-research-analysis/research-analyst.md +287 -0
- package/.claude/agents/subagents/10-research-analysis/scientific-literature-researcher.md +151 -0
- package/.claude/agents/subagents/10-research-analysis/search-specialist.md +287 -0
- package/.claude/agents/subagents/10-research-analysis/trend-analyst.md +287 -0
- package/.claude/commands/check.md +58 -0
- package/.claude/commands/ci-status.md +68 -0
- package/.claude/commands/conflict-resolver.md +76 -0
- package/.claude/commands/diff-review.md +123 -0
- package/.claude/commands/evaluate-work.md +25 -0
- package/.claude/commands/install.md +60 -0
- package/.claude/commands/lint.md +86 -0
- package/.claude/commands/plan-only.md +28 -0
- package/.claude/commands/repo-scan.md +96 -0
- package/.claude/commands/security-scan.md +98 -0
- package/.claude/commands/subagent.md +109 -0
- package/.claude/commands/test-runner.md +85 -0
- package/.claude/commands/work.md +76 -0
- package/.claude/phases/code-review.md +92 -0
- package/.claude/phases/completion.md +57 -0
- package/.claude/phases/design-review.md +66 -0
- package/.claude/phases/design.md +59 -0
- package/.claude/phases/escalate-code.md +34 -0
- package/.claude/phases/escalate-validation.md +33 -0
- package/.claude/phases/failed.md +35 -0
- package/.claude/phases/fast-implementation.md +59 -0
- package/.claude/phases/fast-path-check.md +46 -0
- package/.claude/phases/feasibility.md +80 -0
- package/.claude/phases/implementation.md +43 -0
- package/.claude/phases/permissions.md +42 -0
- package/.claude/phases/pr-created.md +50 -0
- package/.claude/phases/self-review.md +53 -0
- package/.claude/phases/subagent-selection.md +298 -0
- package/.claude/phases/test.md +68 -0
- package/.claude/phases/validation.md +58 -0
- package/.claude/phases/verification.md +45 -0
- package/.claude/references/frontend-aesthetics.md +91 -0
- package/.claude/references/github.md +73 -0
- package/.claude/templates/artifact-format.md +33 -0
- package/.claude/templates/audit.log +30 -0
- package/.claude/templates/evidence-standard.md +19 -0
- package/.claude/templates/phase-checklist.md +62 -0
- package/.claude/templates/progress.md +15 -0
- package/.claude/templates/state.json +108 -0
- package/.claude/tools/subagent-catalog/README.md +58 -0
- package/.claude/tools/subagent-catalog/config.sh +88 -0
- package/.claude/tools/subagent-catalog/fetch.md +54 -0
- package/.claude/tools/subagent-catalog/invalidate.md +47 -0
- package/.claude/tools/subagent-catalog/list.md +48 -0
- package/.claude/tools/subagent-catalog/search.md +41 -0
- package/CLAUDE.md +342 -0
- package/LICENSE +21 -0
- package/README.md +204 -0
- package/bin/agentic-swe.js +241 -0
- package/package.json +43 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# /lint
|
|
2
|
+
|
|
3
|
+
Detect and run the target repository's linter(s) and formatter check(s) with structured result reporting.
|
|
4
|
+
|
|
5
|
+
## Prompt
|
|
6
|
+
|
|
7
|
+
You are running lint and format checks for the target repository. Detect the tools, execute them, and return structured results.
|
|
8
|
+
|
|
9
|
+
Arguments: `$ARGUMENTS`
|
|
10
|
+
|
|
11
|
+
- If arguments are provided, treat them as a scope filter (e.g., file path, directory, or glob pattern).
|
|
12
|
+
- If no arguments, run against the full codebase using the project's default configuration.
|
|
13
|
+
|
|
14
|
+
### Procedure
|
|
15
|
+
|
|
16
|
+
1. **Detect linting tools**:
|
|
17
|
+
- Check for tool indicators in order:
|
|
18
|
+
- `package.json` → scripts.lint, scripts."lint:fix", devDependencies (eslint, biome, oxlint)
|
|
19
|
+
- `.eslintrc*`, `eslint.config.*` → ESLint
|
|
20
|
+
- `biome.json`, `biome.jsonc` → Biome
|
|
21
|
+
- `pyproject.toml` [tool.ruff], `ruff.toml` → Ruff
|
|
22
|
+
- `pyproject.toml` [tool.flake8], `.flake8` → Flake8
|
|
23
|
+
- `pyproject.toml` [tool.mypy], `mypy.ini` → mypy (typecheck)
|
|
24
|
+
- `.golangci.yml` → golangci-lint
|
|
25
|
+
- `Cargo.toml` → `cargo clippy`
|
|
26
|
+
- `.rubocop.yml` → RuboCop
|
|
27
|
+
- `Makefile` / `Justfile` → lint targets
|
|
28
|
+
- Collect all applicable tools; run each separately.
|
|
29
|
+
|
|
30
|
+
2. **Detect formatters** (check mode only):
|
|
31
|
+
- `.prettierrc*`, `prettier.config.*` → `prettier --check`
|
|
32
|
+
- `pyproject.toml` [tool.black], `pyproject.toml` [tool.ruff.format] → `ruff format --check` or `black --check`
|
|
33
|
+
- `rustfmt.toml` → `cargo fmt --check`
|
|
34
|
+
- `gofmt` / `goimports` → check mode
|
|
35
|
+
- `biome.json` → `biome check` (covers both lint and format)
|
|
36
|
+
|
|
37
|
+
3. **Pre-flight checks**:
|
|
38
|
+
- Verify each tool is available.
|
|
39
|
+
- If a tool is missing, report it as a blocker rather than installing it.
|
|
40
|
+
|
|
41
|
+
4. **Execute each tool**:
|
|
42
|
+
- Run in check/report mode — do NOT auto-fix.
|
|
43
|
+
- Apply scope filter if provided.
|
|
44
|
+
- Capture stdout and stderr.
|
|
45
|
+
- Set a 3-minute timeout per tool.
|
|
46
|
+
|
|
47
|
+
5. **Parse results**:
|
|
48
|
+
- For each tool: extract total issues, errors, warnings, fixable count.
|
|
49
|
+
- For each issue: file, line, rule/code, severity, message.
|
|
50
|
+
- Cap detailed issue listing at 50 items; note if truncated.
|
|
51
|
+
|
|
52
|
+
### Output Format
|
|
53
|
+
|
|
54
|
+
```markdown
|
|
55
|
+
# Lint Results
|
|
56
|
+
|
|
57
|
+
## Summary
|
|
58
|
+
- **Status**: CLEAN | ISSUES | ERROR | BLOCKED
|
|
59
|
+
- **Scope**: <full codebase | scoped to: X>
|
|
60
|
+
|
|
61
|
+
## Tools Run
|
|
62
|
+
|
|
63
|
+
### <Tool Name>
|
|
64
|
+
- **Command**: `<exact command>`
|
|
65
|
+
- **Exit code**: <code>
|
|
66
|
+
- **Issues**: <count> (<errors> errors, <warnings> warnings)
|
|
67
|
+
- **Fixable**: <count>
|
|
68
|
+
|
|
69
|
+
| File | Line | Rule | Severity | Message |
|
|
70
|
+
|------|------|------|----------|---------|
|
|
71
|
+
| ... | ... | ... | ... | ... |
|
|
72
|
+
|
|
73
|
+
<!-- Repeat for each tool -->
|
|
74
|
+
|
|
75
|
+
## Aggregate
|
|
76
|
+
| Tool | Errors | Warnings | Fixable |
|
|
77
|
+
|------|--------|----------|---------|
|
|
78
|
+
| ... | ... | ... | ... |
|
|
79
|
+
| **Total** | ... | ... | ... |
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Failure Protocol
|
|
83
|
+
|
|
84
|
+
- If no linting tool is detected, report `BLOCKED` with reason "no linter configured".
|
|
85
|
+
- If a tool is missing or not installed, report `BLOCKED` for that tool and continue with others.
|
|
86
|
+
- Do not auto-fix, install packages, or modify configuration. Report findings only.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# /plan-only
|
|
2
|
+
|
|
3
|
+
Plan work without implementing. Stops after the planning stages.
|
|
4
|
+
|
|
5
|
+
## Prompt
|
|
6
|
+
|
|
7
|
+
You are planning work for: `$ARGUMENTS`
|
|
8
|
+
|
|
9
|
+
Instructions:
|
|
10
|
+
|
|
11
|
+
1. If you are in a target repository and `.claude/CLAUDE.md` or the required `.claude/templates/` files are missing, run `/install` first.
|
|
12
|
+
2. Create `.claude/.work/<id>/state.json` from `.claude/templates/state.json`.
|
|
13
|
+
3. Fill in `work_id`, `task`, and keep `current_state: "initialized"`.
|
|
14
|
+
4. Execute only:
|
|
15
|
+
- `feasibility`
|
|
16
|
+
- `fast-path-check`
|
|
17
|
+
- if full path is required (fast-path-check verdict is `complex`), `design`
|
|
18
|
+
5. If ambiguity is found, stop at `ambiguity-wait`.
|
|
19
|
+
6. If the task is fast-path eligible, stop after `fast-path-check` and record the recommendation instead of implementing.
|
|
20
|
+
7. Do not proceed into:
|
|
21
|
+
- `verification`
|
|
22
|
+
- `test`
|
|
23
|
+
- `fast-implementation`
|
|
24
|
+
- `implementation`
|
|
25
|
+
- `code-review`
|
|
26
|
+
- `validation`
|
|
27
|
+
- `pr-created`
|
|
28
|
+
8. Return the work id, current state, and recommended next state.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# /repo-scan
|
|
2
|
+
|
|
3
|
+
Produce a structured snapshot of the target repository for rapid task analysis.
|
|
4
|
+
|
|
5
|
+
## Prompt
|
|
6
|
+
|
|
7
|
+
You are scanning the repository to produce a structured overview. This is a read-only operation — do not modify any files.
|
|
8
|
+
|
|
9
|
+
### Procedure
|
|
10
|
+
|
|
11
|
+
1. **Language and framework detection**:
|
|
12
|
+
- Inspect root-level config files: `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `Gemfile`, `pom.xml`, `build.gradle`, `Makefile`, `CMakeLists.txt`, etc.
|
|
13
|
+
- Identify primary language(s), framework(s), and package manager(s).
|
|
14
|
+
- Note language version constraints if declared.
|
|
15
|
+
|
|
16
|
+
2. **Project structure**:
|
|
17
|
+
- List top-level directories with a one-line purpose for each.
|
|
18
|
+
- Identify source roots (e.g., `src/`, `lib/`, `app/`), test roots (e.g., `tests/`, `__tests__/`, `spec/`), and config roots.
|
|
19
|
+
- Note monorepo indicators (workspaces, Lerna, Nx, Turborepo).
|
|
20
|
+
|
|
21
|
+
3. **Test infrastructure**:
|
|
22
|
+
- Identify test framework(s): jest, pytest, go test, cargo test, rspec, junit, etc.
|
|
23
|
+
- Locate test config files (e.g., `jest.config.*`, `pytest.ini`, `conftest.py`, `.mocharc.*`).
|
|
24
|
+
- Note test commands from `package.json` scripts, `Makefile` targets, or CI config.
|
|
25
|
+
- Report approximate test file count.
|
|
26
|
+
|
|
27
|
+
4. **CI/CD configuration**:
|
|
28
|
+
- Check for: `.github/workflows/`, `.gitlab-ci.yml`, `Jenkinsfile`, `.circleci/`, `buildkite/`, `.travis.yml`, `azure-pipelines.yml`.
|
|
29
|
+
- Summarize what CI runs: build, test, lint, typecheck, deploy, etc.
|
|
30
|
+
- Note required checks or branch protection indicators.
|
|
31
|
+
|
|
32
|
+
5. **Linting and formatting**:
|
|
33
|
+
- Identify linter configs: `.eslintrc*`, `ruff.toml`, `.golangci.yml`, `.rubocop.yml`, `biome.json`, `.prettierrc*`, etc.
|
|
34
|
+
- Note lint/format commands from scripts or CI.
|
|
35
|
+
|
|
36
|
+
6. **Entry points and exports**:
|
|
37
|
+
- Identify main entry points: `main.*`, `index.*`, `app.*`, `server.*`, CLI entry points.
|
|
38
|
+
- Note public API surface if applicable (exports, `__init__.py`, barrel files).
|
|
39
|
+
|
|
40
|
+
7. **Dependencies overview**:
|
|
41
|
+
- Count direct vs dev dependencies.
|
|
42
|
+
- Flag notable dependencies (ORMs, HTTP frameworks, auth libraries, cloud SDKs).
|
|
43
|
+
- Note lockfile presence and type.
|
|
44
|
+
|
|
45
|
+
### Output Format
|
|
46
|
+
|
|
47
|
+
Write output as structured markdown:
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
# Repository Scan
|
|
51
|
+
|
|
52
|
+
## Identity
|
|
53
|
+
- **Languages**: <list>
|
|
54
|
+
- **Frameworks**: <list>
|
|
55
|
+
- **Package manager**: <name> (lockfile: yes/no)
|
|
56
|
+
|
|
57
|
+
## Structure
|
|
58
|
+
| Directory | Purpose |
|
|
59
|
+
|-----------|---------|
|
|
60
|
+
| ... | ... |
|
|
61
|
+
|
|
62
|
+
- **Source root(s)**: <paths>
|
|
63
|
+
- **Test root(s)**: <paths>
|
|
64
|
+
- **Monorepo**: yes/no (tool: <if applicable>)
|
|
65
|
+
|
|
66
|
+
## Test Infrastructure
|
|
67
|
+
- **Framework(s)**: <list>
|
|
68
|
+
- **Config**: <files>
|
|
69
|
+
- **Run command**: <command>
|
|
70
|
+
- **Approximate test count**: <number>
|
|
71
|
+
|
|
72
|
+
## CI/CD
|
|
73
|
+
- **Platform**: <name>
|
|
74
|
+
- **Pipelines**: <summary of what runs>
|
|
75
|
+
- **Required checks**: <list or "none detected">
|
|
76
|
+
|
|
77
|
+
## Linting & Formatting
|
|
78
|
+
- **Linter(s)**: <list with config files>
|
|
79
|
+
- **Formatter(s)**: <list with config files>
|
|
80
|
+
- **Run command**: <command>
|
|
81
|
+
|
|
82
|
+
## Entry Points
|
|
83
|
+
- <path>: <description>
|
|
84
|
+
|
|
85
|
+
## Notable Dependencies
|
|
86
|
+
- <name>: <purpose>
|
|
87
|
+
|
|
88
|
+
## Observations
|
|
89
|
+
- <anything unusual, missing, or noteworthy>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Failure Protocol
|
|
93
|
+
|
|
94
|
+
- If the repository is empty or has no recognizable structure, report that fact.
|
|
95
|
+
- Do not guess framework details — report only what config files and code confirm.
|
|
96
|
+
- If a section has no findings, write "None detected" rather than omitting it.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# /security-scan
|
|
2
|
+
|
|
3
|
+
Run baseline security checks against the target repository with structured findings.
|
|
4
|
+
|
|
5
|
+
## Prompt
|
|
6
|
+
|
|
7
|
+
You are performing a security scan of the repository. Execute available checks and report findings with evidence.
|
|
8
|
+
|
|
9
|
+
Arguments: `$ARGUMENTS`
|
|
10
|
+
|
|
11
|
+
- If arguments specify a scope (file path, directory, or "dependencies-only"), limit the scan.
|
|
12
|
+
- If no arguments, scan the full repository.
|
|
13
|
+
|
|
14
|
+
### Procedure
|
|
15
|
+
|
|
16
|
+
1. **Dependency audit**:
|
|
17
|
+
- Detect package manager and run its audit command:
|
|
18
|
+
- `npm`: `npm audit --json`
|
|
19
|
+
- `yarn`: `yarn audit --json`
|
|
20
|
+
- `pnpm`: `pnpm audit --json`
|
|
21
|
+
- `pip`: `pip-audit` (if available) or check `safety` output
|
|
22
|
+
- `cargo`: `cargo audit` (if available)
|
|
23
|
+
- `go`: `govulncheck ./...` (if available)
|
|
24
|
+
- `bundler`: `bundle audit check`
|
|
25
|
+
- If the audit tool is not installed, note it as unavailable rather than installing.
|
|
26
|
+
- Parse: vulnerability count by severity (critical, high, medium, low), affected packages, fix availability.
|
|
27
|
+
|
|
28
|
+
2. **Secret scanning**:
|
|
29
|
+
- Search for common secret patterns in tracked files (not in `.git/`):
|
|
30
|
+
- API keys: patterns like `AKIA[0-9A-Z]{16}`, `sk-[a-zA-Z0-9]{48}`, `ghp_[a-zA-Z0-9]{36}`
|
|
31
|
+
- Private keys: `-----BEGIN (RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----`
|
|
32
|
+
- Connection strings: `postgres://`, `mysql://`, `mongodb://`, `redis://` with credentials
|
|
33
|
+
- Generic high-entropy strings in assignment context (be conservative — flag only high-confidence matches)
|
|
34
|
+
- Check `.gitignore` for common exclusions: `.env`, `*.pem`, `*.key`, `credentials.*`
|
|
35
|
+
- Report missing `.gitignore` entries for sensitive patterns.
|
|
36
|
+
|
|
37
|
+
3. **Configuration review**:
|
|
38
|
+
- Check for overly permissive CORS, disabled security headers, debug modes left on.
|
|
39
|
+
- Check for hardcoded `0.0.0.0` bindings, disabled TLS verification, `NODE_ENV=development` in production configs.
|
|
40
|
+
- Check Dockerfile (if present) for: running as root, using `latest` tag, copying secrets into image.
|
|
41
|
+
- This is a surface-level scan — flag obvious issues, not deep application logic.
|
|
42
|
+
|
|
43
|
+
4. **Dangerous patterns in code** (scope to changed files when scoped):
|
|
44
|
+
- `eval()`, `exec()`, `subprocess` with shell=True, `child_process.exec` with unsanitized input
|
|
45
|
+
- SQL string concatenation (vs parameterized queries)
|
|
46
|
+
- `dangerouslySetInnerHTML`, `innerHTML` assignments with dynamic content
|
|
47
|
+
- Deserialization of untrusted data (`pickle.loads`, `yaml.load` without SafeLoader, `JSON.parse` on user input passed to eval)
|
|
48
|
+
|
|
49
|
+
### Output Format
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
# Security Scan
|
|
53
|
+
|
|
54
|
+
## Summary
|
|
55
|
+
- **Status**: CLEAN | FINDINGS | BLOCKED
|
|
56
|
+
- **Scope**: <full repo | scoped to: X>
|
|
57
|
+
- **Critical**: <count>
|
|
58
|
+
- **High**: <count>
|
|
59
|
+
- **Medium**: <count>
|
|
60
|
+
- **Low**: <count>
|
|
61
|
+
|
|
62
|
+
## Dependency Audit
|
|
63
|
+
- **Tool**: <command run>
|
|
64
|
+
- **Vulnerabilities**: <count>
|
|
65
|
+
|
|
66
|
+
| Package | Severity | CVE/Advisory | Fix Available | Description |
|
|
67
|
+
|---------|----------|-------------|---------------|-------------|
|
|
68
|
+
| ... | ... | ... | ... | ... |
|
|
69
|
+
|
|
70
|
+
## Secret Scan
|
|
71
|
+
| Pattern | File | Line | Confidence |
|
|
72
|
+
|---------|------|------|------------|
|
|
73
|
+
| ... | ... | ... | high/medium |
|
|
74
|
+
|
|
75
|
+
### Missing .gitignore Entries
|
|
76
|
+
- <pattern that should be ignored>
|
|
77
|
+
|
|
78
|
+
## Configuration Issues
|
|
79
|
+
| File | Issue | Severity |
|
|
80
|
+
|------|-------|----------|
|
|
81
|
+
| ... | ... | ... |
|
|
82
|
+
|
|
83
|
+
## Dangerous Code Patterns
|
|
84
|
+
| File | Line | Pattern | Risk |
|
|
85
|
+
|------|------|---------|------|
|
|
86
|
+
| ... | ... | ... | ... |
|
|
87
|
+
|
|
88
|
+
## Recommendations
|
|
89
|
+
- <prioritized list of actions>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Failure Protocol
|
|
93
|
+
|
|
94
|
+
- If no package manager is detected, skip dependency audit and note it.
|
|
95
|
+
- If audit tools are not installed, report them as unavailable — do not install them.
|
|
96
|
+
- Be conservative with secret detection — false positives erode trust. Only flag high-confidence matches.
|
|
97
|
+
- Do not modify any files. Report findings only.
|
|
98
|
+
- Apply `.claude/templates/evidence-standard.md` to all findings.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: subagent
|
|
3
|
+
description: "Browse, search, and invoke specialized subagents for specific development tasks."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /subagent — Discover and Invoke Specialized Subagents
|
|
7
|
+
|
|
8
|
+
Browse, search, and invoke from 135+ specialized subagents covering 10 categories of development expertise.
|
|
9
|
+
|
|
10
|
+
## Input: $ARGUMENTS
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
- `/subagent` — list all categories and agents
|
|
14
|
+
- `/subagent search <query>` — find agents by keyword
|
|
15
|
+
- `/subagent info <name>` — show full agent definition
|
|
16
|
+
- `/subagent invoke <name> <task description>` — spawn agent for a task
|
|
17
|
+
|
|
18
|
+
## Categories
|
|
19
|
+
|
|
20
|
+
| # | Category | Count | Examples |
|
|
21
|
+
|---|----------|-------|----------|
|
|
22
|
+
| 01 | Core Development | 10 | api-designer, backend-developer, frontend-developer, fullstack-developer |
|
|
23
|
+
| 02 | Language Specialists | 29 | python-pro, typescript-pro, rust-engineer, golang-pro, react-developer |
|
|
24
|
+
| 03 | Infrastructure | 16 | cloud-architect, devops-engineer, kubernetes-specialist, terraform-engineer |
|
|
25
|
+
| 04 | Quality & Security | 14 | code-reviewer, security-auditor, debugger, performance-engineer |
|
|
26
|
+
| 05 | Data & AI | 13 | data-engineer, ml-engineer, llm-architect, prompt-engineer |
|
|
27
|
+
| 06 | Developer Experience | 13 | documentation-engineer, cli-developer, refactoring-specialist, mcp-developer |
|
|
28
|
+
| 07 | Specialized Domains | 12 | blockchain-developer, fintech-developer, gaming-developer, iot-engineer |
|
|
29
|
+
| 08 | Business & Product | 11 | product-manager, project-manager, technical-writer, ux-researcher |
|
|
30
|
+
| 09 | Meta & Orchestration | 10 | multi-agent-coordinator, workflow-orchestrator, context-manager |
|
|
31
|
+
| 10 | Research & Analysis | 7 | research-analyst, competitive-analyst, trend-analyst |
|
|
32
|
+
|
|
33
|
+
## Instructions
|
|
34
|
+
|
|
35
|
+
### Action: list (no arguments or `list`)
|
|
36
|
+
|
|
37
|
+
List all categories with their agents:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
source .claude/tools/subagent-catalog/config.sh
|
|
41
|
+
for category in $(subagent_catalog_list_categories); do
|
|
42
|
+
echo "### $category"
|
|
43
|
+
subagent_catalog_list_agents_in "$category" | tr '\n' ', ' | sed 's/,$//'
|
|
44
|
+
echo ""
|
|
45
|
+
done
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Action: search <query>
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
source .claude/tools/subagent-catalog/config.sh
|
|
52
|
+
subagent_catalog_search "<query>"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Display results as a table with category, name, and description.
|
|
56
|
+
|
|
57
|
+
### Action: info <name>
|
|
58
|
+
|
|
59
|
+
1. Find the agent file:
|
|
60
|
+
```bash
|
|
61
|
+
source .claude/tools/subagent-catalog/config.sh
|
|
62
|
+
subagent_catalog_find "<name>"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
2. Read and display the full agent definition with parsed frontmatter (name, description, tools, model).
|
|
66
|
+
|
|
67
|
+
3. Show invocation example:
|
|
68
|
+
```
|
|
69
|
+
Agent(prompt="agents/subagents/<category>/<name>.md", model="<model>")
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Action: invoke <name> <task>
|
|
73
|
+
|
|
74
|
+
1. Find the agent file path.
|
|
75
|
+
2. Read the agent definition to determine the recommended model.
|
|
76
|
+
3. Spawn the agent:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Agent(
|
|
80
|
+
prompt="<read agent file content>\n\n---\n\nTask: <task description>",
|
|
81
|
+
model="<model from frontmatter>",
|
|
82
|
+
description="<name>: <short task summary>"
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Model routing from agent frontmatter:**
|
|
87
|
+
- `opus` — deep reasoning (security audits, architecture reviews)
|
|
88
|
+
- `sonnet` — everyday coding (most developers and specialists)
|
|
89
|
+
- `haiku` — quick tasks (documentation, searches, dependency checks)
|
|
90
|
+
|
|
91
|
+
## When to Use Subagents
|
|
92
|
+
|
|
93
|
+
The orchestrator should consider invoking a subagent when:
|
|
94
|
+
|
|
95
|
+
1. **Language-specific expertise needed** — e.g., Rust borrow checker issues, Python async patterns
|
|
96
|
+
2. **Domain specialist required** — e.g., Kubernetes deployment, database optimization, security audit
|
|
97
|
+
3. **Parallel review** — spawn multiple reviewers (code-reviewer + security-auditor) simultaneously
|
|
98
|
+
4. **Research tasks** — competitive analysis, trend research, literature review
|
|
99
|
+
5. **Infrastructure work** — Terraform plans, Docker optimization, CI/CD pipelines
|
|
100
|
+
|
|
101
|
+
## Integration with Pipeline
|
|
102
|
+
|
|
103
|
+
Subagents complement the core pipeline agents:
|
|
104
|
+
|
|
105
|
+
- **developer.md** handles general implementation; language specialists handle language-specific expertise
|
|
106
|
+
- **panel/*.md** handles design review; quality-security subagents provide deeper audits
|
|
107
|
+
- **git-ops.md** handles git workflow; devops subagents handle infrastructure concerns
|
|
108
|
+
|
|
109
|
+
The orchestrator delegates to subagents the same way as core agents — with explicit scope, evidence requirements, and audit logging.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# /test-runner
|
|
2
|
+
|
|
3
|
+
Discover and execute the target repository's test suite with structured result reporting.
|
|
4
|
+
|
|
5
|
+
## Prompt
|
|
6
|
+
|
|
7
|
+
You are running tests for the target repository. Detect the test framework, execute tests, and return structured results.
|
|
8
|
+
|
|
9
|
+
Arguments: `$ARGUMENTS`
|
|
10
|
+
|
|
11
|
+
- If arguments are provided, treat them as a test scope filter (e.g., file path, test name pattern, or directory).
|
|
12
|
+
- If no arguments, run the full default test suite.
|
|
13
|
+
|
|
14
|
+
### Procedure
|
|
15
|
+
|
|
16
|
+
1. **Detect test framework and command**:
|
|
17
|
+
- Check for framework indicators in order:
|
|
18
|
+
- `package.json` → scripts.test, scripts."test:unit", scripts."test:integration"
|
|
19
|
+
- `Makefile` / `Justfile` → test targets
|
|
20
|
+
- `pyproject.toml` / `setup.cfg` / `pytest.ini` → pytest configuration
|
|
21
|
+
- `go.mod` → `go test ./...`
|
|
22
|
+
- `Cargo.toml` → `cargo test`
|
|
23
|
+
- `Gemfile` → `bundle exec rspec` or `bundle exec rake test`
|
|
24
|
+
- `.github/workflows/*.yml` → extract test commands from CI
|
|
25
|
+
- If multiple test commands exist, prefer the most specific match for the scope requested.
|
|
26
|
+
|
|
27
|
+
2. **Pre-flight checks**:
|
|
28
|
+
- Verify the test command is available (e.g., `npx jest --version`, `pytest --version`).
|
|
29
|
+
- If dependencies appear uninstalled, report that as a blocker rather than installing them silently.
|
|
30
|
+
- Check for required environment setup (`.env.test`, database fixtures, docker-compose test services).
|
|
31
|
+
|
|
32
|
+
3. **Execute tests**:
|
|
33
|
+
- Run the detected command with the scope filter applied.
|
|
34
|
+
- If scoped to a specific file or pattern, pass it as an argument to the test runner.
|
|
35
|
+
- Capture both stdout and stderr.
|
|
36
|
+
- Set a reasonable timeout (5 minutes for full suite, 2 minutes for scoped).
|
|
37
|
+
|
|
38
|
+
4. **Parse results**:
|
|
39
|
+
- Extract: total tests, passed, failed, skipped, errored.
|
|
40
|
+
- For failures: capture test name, assertion message, and file location.
|
|
41
|
+
- Note execution time.
|
|
42
|
+
|
|
43
|
+
### Output Format
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
# Test Results
|
|
47
|
+
|
|
48
|
+
## Summary
|
|
49
|
+
- **Framework**: <name>
|
|
50
|
+
- **Command**: `<exact command run>`
|
|
51
|
+
- **Scope**: <full suite | scoped to: X>
|
|
52
|
+
- **Status**: PASS | FAIL | ERROR | BLOCKED
|
|
53
|
+
|
|
54
|
+
## Counts
|
|
55
|
+
| Total | Passed | Failed | Skipped | Errored |
|
|
56
|
+
|-------|--------|--------|---------|---------|
|
|
57
|
+
| ... | ... | ... | ... | ... |
|
|
58
|
+
|
|
59
|
+
## Failures
|
|
60
|
+
<!-- Only if failures exist -->
|
|
61
|
+
| Test | Location | Message |
|
|
62
|
+
|------|----------|---------|
|
|
63
|
+
| ... | ... | ... |
|
|
64
|
+
|
|
65
|
+
## Execution
|
|
66
|
+
- **Duration**: <time>
|
|
67
|
+
- **Exit code**: <code>
|
|
68
|
+
|
|
69
|
+
## Raw Output
|
|
70
|
+
<details>
|
|
71
|
+
<summary>Full output</summary>
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
<stdout + stderr>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
</details>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Failure Protocol
|
|
81
|
+
|
|
82
|
+
- If no test framework is detected, report `BLOCKED` with reason "no test framework found".
|
|
83
|
+
- If dependencies are missing, report `BLOCKED` with the missing dependency.
|
|
84
|
+
- If tests timeout, report `ERROR` with partial results if available.
|
|
85
|
+
- Do not install packages, start services, or modify configuration. Report blockers instead.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# /work
|
|
2
|
+
|
|
3
|
+
Start a new work item or resume an existing one.
|
|
4
|
+
|
|
5
|
+
## Prompt
|
|
6
|
+
|
|
7
|
+
You are running `/work`.
|
|
8
|
+
|
|
9
|
+
**Dispatch:** If `$ARGUMENTS` matches an existing work ID in `.claude/.work/`, resume that work item. Otherwise, treat `$ARGUMENTS` as a new task description.
|
|
10
|
+
|
|
11
|
+
### Start Mode (new task)
|
|
12
|
+
|
|
13
|
+
1. If you are in a target repository and `.claude/CLAUDE.md` or the required `.claude/templates/` files are missing, run `/install` first.
|
|
14
|
+
2. Generate a short kebab-case work ID from the task description (e.g., `add-retry-logic`).
|
|
15
|
+
3. Create `.claude/.work/<id>/`.
|
|
16
|
+
4. Create `.claude/.work/<id>/state.json` from `.claude/templates/state.json`, filling in:
|
|
17
|
+
- `work_id`, `task`, `current_state: "initialized"`
|
|
18
|
+
- `created_at` and `updated_at` with current ISO-8601 timestamp
|
|
19
|
+
- `timeout_at` with current timestamp + 24 hours
|
|
20
|
+
5. Create `.claude/.work/<id>/audit.log` and `.claude/.work/<id>/progress.md` from the templates.
|
|
21
|
+
6. Branch setup (delegate to `.claude/agents/git-ops.md` if complex):
|
|
22
|
+
a. Detect base branch: check for `main`, then `master`, then current. Record in `state.json.git.base_branch`.
|
|
23
|
+
b. `git fetch origin <base> && git checkout <base> && git pull origin <base>`
|
|
24
|
+
c. `git checkout -b work/<work-id>` (check `git branch --list work/<work-id>` first for collision).
|
|
25
|
+
d. Record `state.json.git.working_branch = "work/<work-id>"`.
|
|
26
|
+
e. Do NOT push yet — no remote branch until commits exist.
|
|
27
|
+
7. Read `CLAUDE.md` for the authoritative state machine and operating loop.
|
|
28
|
+
8. Execute the operating loop (see below).
|
|
29
|
+
|
|
30
|
+
### Resume Mode (existing work ID)
|
|
31
|
+
|
|
32
|
+
1. Read the current `state.json`.
|
|
33
|
+
2. Set `resume.detected` to `true`, `resume.detected_at` to current timestamp.
|
|
34
|
+
3. Git state validation:
|
|
35
|
+
a. `git status --short` — if dirty worktree with unrelated changes, STOP and surface to user.
|
|
36
|
+
b. `git branch --show-current` — if not on `state.json.git.working_branch`, checkout it.
|
|
37
|
+
c. If working branch does not exist locally: `git fetch origin && git checkout -b <branch> origin/<branch>`. If not on remote either: STOP — branch was deleted, escalate.
|
|
38
|
+
d. `git fetch origin <base_branch>`
|
|
39
|
+
e. `git log HEAD..origin/<base_branch> --oneline` — if base has advanced: `git rebase origin/<base_branch>`. If conflicts: STOP, surface to user with conflict details.
|
|
40
|
+
f. Set `resume.branch_validated = true`, `resume.rebase_performed = (true if rebased)`.
|
|
41
|
+
g. Record git state (branch, SHA, rebase status) in history entry.
|
|
42
|
+
4. Check `timeout_at` — if the work item has been idle beyond the timeout, warn the user before continuing.
|
|
43
|
+
5. Read any existing artifacts in `.claude/.work/<id>/`.
|
|
44
|
+
6. If the current state is a human gate (`ambiguity-wait`, `approval-wait`, `escalate-code`, `escalate-validation`), do not proceed without user input.
|
|
45
|
+
7. Respect loop budgets already recorded in `state.json`.
|
|
46
|
+
8. Update `timeout_at` to current timestamp + 24 hours on resume.
|
|
47
|
+
9. Continue the operating loop (see below).
|
|
48
|
+
|
|
49
|
+
### Operating Loop
|
|
50
|
+
|
|
51
|
+
- Before each phase: invoke `/check budget`
|
|
52
|
+
- Before each transition: invoke `/check transition`
|
|
53
|
+
- After artifact creation: invoke `/check artifacts`
|
|
54
|
+
- Execute phases using the matching prompt in `.claude/phases/`
|
|
55
|
+
- Follow either:
|
|
56
|
+
- fast path: `fast-implementation → validation`
|
|
57
|
+
- full path: `design → design-review → verification → test → implementation → code-review → permissions → validation`
|
|
58
|
+
- If validation succeeds, execute `pr-created` and stop at `approval-wait`.
|
|
59
|
+
- When resuming at `approval-wait`:
|
|
60
|
+
- If `approvals.pr_approved == true`: execute `.claude/phases/completion.md`, transition to `completed`.
|
|
61
|
+
- If `approvals.changes_requested == true`:
|
|
62
|
+
a. Fetch PR feedback: `gh pr view --json reviews,comments`
|
|
63
|
+
b. Write `.claude/.work/<id>/approval-feedback.md` with structured review findings
|
|
64
|
+
c. Increment `counters.approval_iter`
|
|
65
|
+
d. Transition `approval-wait → implementation`
|
|
66
|
+
e. Implementation phase reads `approval-feedback.md` as mandatory additional input
|
|
67
|
+
- Stop only at: `ambiguity-wait`, `approval-wait`, `escalate-code`, `escalate-validation`, `completed`, `failed`
|
|
68
|
+
|
|
69
|
+
## Output
|
|
70
|
+
|
|
71
|
+
Return:
|
|
72
|
+
|
|
73
|
+
- work id
|
|
74
|
+
- current state
|
|
75
|
+
- artifacts written
|
|
76
|
+
- whether human input is required
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Code Review
|
|
2
|
+
|
|
3
|
+
## Mission
|
|
4
|
+
|
|
5
|
+
Approve only when correctness, complexity, and test adequacy are acceptable. Review code changes after `implementation` or `fast-implementation`.
|
|
6
|
+
|
|
7
|
+
## Persona
|
|
8
|
+
|
|
9
|
+
Demanding senior reviewer — correctness outranks style, regressions outrank elegance, complexity must earn its keep.
|
|
10
|
+
|
|
11
|
+
## Procedure
|
|
12
|
+
|
|
13
|
+
1. Read `feasibility.md`, `design.md` (when present), `implementation.md`, `self-review.md` (when present), and the actual changed files.
|
|
14
|
+
|
|
15
|
+
### Parallel Specialist Review (Auto-Selection)
|
|
16
|
+
|
|
17
|
+
2. Read `## Subagent Signals` from `feasibility.md`. If `subagent_auto_select` is enabled and `subagent-mode` is `full`:
|
|
18
|
+
- Select 0-2 review-oriented subagents based on domain signals per `.claude/phases/subagent-selection.md` (Parallel Review Mode). Typical selections:
|
|
19
|
+
- Security-sensitive code → `security-auditor` (background)
|
|
20
|
+
- Performance-sensitive code → `performance-engineer` (background)
|
|
21
|
+
- Accessibility changes → `accessibility-tester` (background)
|
|
22
|
+
- Infrastructure changes → `security-engineer` (background)
|
|
23
|
+
- Spawn selected subagent(s) in **background** with the changed files and implementation context.
|
|
24
|
+
- They run in parallel with the main review — do NOT wait for them before proceeding.
|
|
25
|
+
- If `budget_remaining` < 3, skip specialist spawning.
|
|
26
|
+
|
|
27
|
+
### Main Review
|
|
28
|
+
|
|
29
|
+
3. Invoke `/diff-review` against the changed files for structured, evidence-backed findings.
|
|
30
|
+
4. Compare the code against required behavior, design intent, repo conventions, and likely edge cases.
|
|
31
|
+
5. Review with a defect-oriented mindset:
|
|
32
|
+
- wrong or partial behavior
|
|
33
|
+
- missing failure case handling
|
|
34
|
+
- unjustified complexity
|
|
35
|
+
- poor test coverage for risky branches
|
|
36
|
+
5. Review with a defect-oriented mindset:
|
|
37
|
+
- wrong or partial behavior
|
|
38
|
+
- missing failure case handling
|
|
39
|
+
- unjustified complexity
|
|
40
|
+
- poor test coverage for risky branches
|
|
41
|
+
6. Separate blocking findings, non-blocking concerns, and speculative risks.
|
|
42
|
+
7. Score the implementation against each dimension (1=fail, 2=acceptable, 3=strong):
|
|
43
|
+
- **Correctness**: behavior vs. spec (1=wrong behavior, 2=correct happy path with edge gaps, 3=edge cases handled)
|
|
44
|
+
- **Safety**: failure modes and error handling (1=unsafe paths, 2=major paths covered, 3=defensive throughout)
|
|
45
|
+
- **Test adequacy**: regression coverage (1=no/trivial tests, 2=happy path tested, 3=edge+error paths tested)
|
|
46
|
+
- **Design conformance**: match to approved design (1=significant deviation, 2=minor deviations documented, 3=faithful)
|
|
47
|
+
- **Complexity**: proportionality to problem (1=unnecessary complexity, 2=acceptable, 3=simplest viable)
|
|
48
|
+
8. Verdict rule: any dimension scored 1 → rejected. All 2+ → approved.
|
|
49
|
+
|
|
50
|
+
### Integrate Specialist Findings
|
|
51
|
+
|
|
52
|
+
9. If background specialist reviewers have returned, append their findings to the review artifact under `## Specialist Review Findings`.
|
|
53
|
+
10. If any specialist finding is severity `high` or `critical`, flag it in the verdict rationale — but the main rubric scores still control the transition.
|
|
54
|
+
11. If specialists have not returned yet, proceed with main verdict. Specialist findings arriving later are noted in the artifact but do not retroactively change the verdict.
|
|
55
|
+
12. Log all specialist spawns and results in `audit.log`.
|
|
56
|
+
|
|
57
|
+
## Reflection on Rejection
|
|
58
|
+
|
|
59
|
+
When verdict is `rejected`, also append a structured entry to `.claude/.work/<id>/reflection-log.md`:
|
|
60
|
+
|
|
61
|
+
- **What failed**: concrete file:line evidence of the deficiency
|
|
62
|
+
- **Root cause**: the underlying reason (not just the symptom)
|
|
63
|
+
- **Strategy change**: specific approach the next implementation attempt should take
|
|
64
|
+
|
|
65
|
+
## Inputs
|
|
66
|
+
|
|
67
|
+
- `.claude/.work/<id>/feasibility.md`
|
|
68
|
+
- `.claude/.work/<id>/design.md` (if exists)
|
|
69
|
+
- `.claude/.work/<id>/implementation.md`
|
|
70
|
+
- `.claude/.work/<id>/self-review.md` (if exists)
|
|
71
|
+
- Actual changed source files
|
|
72
|
+
|
|
73
|
+
## Required Output
|
|
74
|
+
|
|
75
|
+
Write one of:
|
|
76
|
+
|
|
77
|
+
- `.claude/.work/<id>/review-pass.md` (when approved)
|
|
78
|
+
- `.claude/.work/<id>/review-feedback.md` (when rejected or escalated)
|
|
79
|
+
|
|
80
|
+
Following `.claude/templates/artifact-format.md`, include:
|
|
81
|
+
|
|
82
|
+
- verdict: `approved`, `rejected`, or `escalated`
|
|
83
|
+
- rubric scores (5 dimensions, 1-3 scale) with evidence for each score
|
|
84
|
+
- findings by severity, confidence, evidence basis
|
|
85
|
+
- recommended next state
|
|
86
|
+
|
|
87
|
+
Apply `.claude/templates/evidence-standard.md` throughout.
|
|
88
|
+
|
|
89
|
+
## Failure Protocol
|
|
90
|
+
|
|
91
|
+
- do not hide weak evidence behind "looks good"
|
|
92
|
+
- if a finding depends on a specific input or state, describe it concretely
|