cc-codeconductor 0.2.1
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/LICENSE +18 -0
- package/README.md +319 -0
- package/dist/index.js +12741 -0
- package/package.json +51 -0
- package/policy.yml +124 -0
- package/presets/claude/CLAUDE.md +598 -0
- package/presets/claude/commands/cc/feature.md +115 -0
- package/presets/claude/commands/cc/fix.md +121 -0
- package/presets/claude/commands/cc/refactor.md +148 -0
- package/presets/claude/commands/cc/review.md +126 -0
- package/presets/claude/commands/cc/tdd-cycle.md +226 -0
- package/presets/claude/commands/cc/test-plan.md +138 -0
- package/presets/claude/settings.json +37 -0
- package/presets/claude/skills/api-versioning/SKILL.md +389 -0
- package/presets/claude/skills/django-orm/SKILL.md +455 -0
- package/presets/claude/skills/django-testing/SKILL.md +409 -0
- package/presets/claude/skills/jpa-postgres/SKILL.md +618 -0
- package/presets/claude/skills/python/SKILL.md +606 -0
- package/presets/claude/skills/python-django-stack/SKILL.md +492 -0
- package/presets/claude/skills/python-fastapi-stack/SKILL.md +457 -0
- package/presets/claude/skills/spring-boot-feature/SKILL.md +558 -0
- package/presets/claude/skills/spring-boot-kotlin/SKILL.md +400 -0
- package/presets/claude/skills/sqlalchemy/SKILL.md +466 -0
- package/presets/claude/skills/testing-strategy/SKILL.md +479 -0
- package/presets/codex/AGENTS.md +883 -0
- package/presets/codex/README.md +102 -0
- package/presets/codex/skills/api-versioning/SKILL.md +389 -0
- package/presets/codex/skills/django-orm/SKILL.md +455 -0
- package/presets/codex/skills/django-testing/SKILL.md +409 -0
- package/presets/codex/skills/jpa-postgres/SKILL.md +618 -0
- package/presets/codex/skills/python/SKILL.md +606 -0
- package/presets/codex/skills/python-django-stack/SKILL.md +492 -0
- package/presets/codex/skills/python-fastapi-stack/SKILL.md +457 -0
- package/presets/codex/skills/spring-boot-feature/SKILL.md +558 -0
- package/presets/codex/skills/spring-boot-kotlin/SKILL.md +400 -0
- package/presets/codex/skills/sqlalchemy/SKILL.md +466 -0
- package/presets/codex/skills/testing-strategy/SKILL.md +479 -0
- package/presets/opencode/README.md +191 -0
- package/presets/opencode/agents/architect.md +133 -0
- package/presets/opencode/agents/docs.md +113 -0
- package/presets/opencode/agents/implementer.md +116 -0
- package/presets/opencode/agents/orchestrator.md +248 -0
- package/presets/opencode/agents/repo-explorer.md +119 -0
- package/presets/opencode/agents/reviewer.md +130 -0
- package/presets/opencode/agents/task-coach.md +103 -0
- package/presets/opencode/agents/tester.md +269 -0
- package/presets/opencode/commands/cc-feature.md +114 -0
- package/presets/opencode/commands/cc-fix.md +123 -0
- package/presets/opencode/commands/cc-refactor.md +148 -0
- package/presets/opencode/commands/cc-review.md +141 -0
- package/presets/opencode/commands/cc-tdd-cycle.md +225 -0
- package/presets/opencode/commands/cc-test-plan.md +144 -0
- package/presets/opencode/opencode.jsonc +89 -0
- package/presets/opencode/prompts/v0.1.0/architect.md +213 -0
- package/presets/opencode/prompts/v0.1.0/docs.md +181 -0
- package/presets/opencode/prompts/v0.1.0/implementer.md +154 -0
- package/presets/opencode/prompts/v0.1.0/orchestrator.md +169 -0
- package/presets/opencode/prompts/v0.1.0/repo-explorer.md +102 -0
- package/presets/opencode/prompts/v0.1.0/reviewer.md +183 -0
- package/presets/opencode/prompts/v0.1.0/task-coach.md +142 -0
- package/presets/opencode/prompts/v0.1.0/tester.md +160 -0
- package/presets/opencode/prompts/v0.2.0/architect.md +219 -0
- package/presets/opencode/prompts/v0.2.0/docs.md +187 -0
- package/presets/opencode/prompts/v0.2.0/implementer.md +160 -0
- package/presets/opencode/prompts/v0.2.0/orchestrator.md +238 -0
- package/presets/opencode/prompts/v0.2.0/repo-explorer.md +108 -0
- package/presets/opencode/prompts/v0.2.0/reviewer.md +190 -0
- package/presets/opencode/prompts/v0.2.0/task-coach.md +153 -0
- package/presets/opencode/prompts/v0.2.0/tester.md +249 -0
- package/presets/opencode/skills/api-versioning/SKILL.md +388 -0
- package/presets/opencode/skills/astro/SKILL.md +313 -0
- package/presets/opencode/skills/code-review/SKILL.md +202 -0
- package/presets/opencode/skills/django-orm/SKILL.md +455 -0
- package/presets/opencode/skills/django-testing/SKILL.md +408 -0
- package/presets/opencode/skills/django-uv/SKILL.md +400 -0
- package/presets/opencode/skills/jpa-postgres/SKILL.md +617 -0
- package/presets/opencode/skills/nextjs-typescript/SKILL.md +385 -0
- package/presets/opencode/skills/python/SKILL.md +605 -0
- package/presets/opencode/skills/python-django-stack/SKILL.md +491 -0
- package/presets/opencode/skills/python-fastapi-stack/SKILL.md +456 -0
- package/presets/opencode/skills/security/SKILL.md +376 -0
- package/presets/opencode/skills/spring-boot-feature/SKILL.md +557 -0
- package/presets/opencode/skills/spring-boot-kotlin/SKILL.md +399 -0
- package/presets/opencode/skills/spring-boot-testing-strategy/SKILL.md +470 -0
- package/presets/opencode/skills/sqlalchemy/SKILL.md +465 -0
- package/presets/opencode/skills/testing-tdd/SKILL.md +586 -0
- package/src/presets/council/council.yml +59 -0
- package/src/presets/manifests/claude.yml +23 -0
- package/src/presets/manifests/codex.yml +12 -0
- package/src/presets/manifests/opencode.yml +18 -0
- package/src/presets/models/claude.yml +37 -0
- package/src/presets/models/codex.yml +38 -0
- package/src/presets/models/opencode.yml +37 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
Run the full feature workflow — task validation, technical design,
|
|
4
|
+
implementation, testing, review, and documentation.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Feature Workflow
|
|
8
|
+
|
|
9
|
+
Feature request: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
## Step 1 — Task Card validation (task-coach)
|
|
12
|
+
|
|
13
|
+
Invoke `task-coach` with the feature description above.
|
|
14
|
+
|
|
15
|
+
task-coach must produce a complete Task Card before any other agent runs. The
|
|
16
|
+
Task Card is ready when it contains: title, type, risk classification, scope,
|
|
17
|
+
context, acceptance criteria, and constraints.
|
|
18
|
+
|
|
19
|
+
If any field is missing or ambiguous, task-coach must ask one clarifying
|
|
20
|
+
question at a time and wait for the answer. Do not proceed with an incomplete
|
|
21
|
+
Task Card.
|
|
22
|
+
|
|
23
|
+
**STOP here. Show the completed Task Card and wait for human confirmation before
|
|
24
|
+
continuing.**
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step 2 — Technical Plan (architect)
|
|
29
|
+
|
|
30
|
+
Invoke `architect` with the validated Task Card from Step 1.
|
|
31
|
+
|
|
32
|
+
architect must produce a Technical Plan that covers:
|
|
33
|
+
|
|
34
|
+
- Chosen approach and rationale
|
|
35
|
+
- Affected files and modules
|
|
36
|
+
- Data model changes (if any)
|
|
37
|
+
- API contract changes (if any)
|
|
38
|
+
- Identified risks and mitigations
|
|
39
|
+
- Open questions that require a human decision
|
|
40
|
+
|
|
41
|
+
**STOP here. Show the Technical Plan and wait for explicit human approval. Do
|
|
42
|
+
not invoke implementer until the plan is approved.**
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Step 3 — Implementation (implementer)
|
|
47
|
+
|
|
48
|
+
Invoke `implementer` with the approved Technical Plan and the Task Card.
|
|
49
|
+
Implementer creates a Git Worktree before touching any file; all edits happen inside it.
|
|
50
|
+
|
|
51
|
+
implementer must:
|
|
52
|
+
|
|
53
|
+
1. Read the Technical Plan before touching any file
|
|
54
|
+
2. Apply the minimal diff — only what the plan specifies
|
|
55
|
+
3. Run the project test suite after implementation
|
|
56
|
+
4. Produce an Implementation Summary: what changed, which files, how to verify
|
|
57
|
+
locally
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Step 4 — Test coverage (tester)
|
|
62
|
+
|
|
63
|
+
Invoke `tester` with the Implementation Summary and the Task Card.
|
|
64
|
+
|
|
65
|
+
tester must:
|
|
66
|
+
|
|
67
|
+
1. Write or extend tests to cover the new behavior
|
|
68
|
+
2. Ensure all acceptance criteria from the Task Card have at least one test
|
|
69
|
+
3. Run the full test suite and confirm it passes
|
|
70
|
+
4. Produce a Coverage Summary: test files added or modified, cases covered
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Step 5 — Code review (reviewer)
|
|
75
|
+
|
|
76
|
+
Invoke `reviewer` with the complete diff and the Task Card.
|
|
77
|
+
|
|
78
|
+
reviewer must produce a Review Report with findings categorized as:
|
|
79
|
+
|
|
80
|
+
- CRITICAL — must be fixed before merge
|
|
81
|
+
- WARNING — must be resolved before merge
|
|
82
|
+
- SUGGESTION — optional improvement
|
|
83
|
+
|
|
84
|
+
If any CRITICAL findings exist, **STOP and report them**. Do not proceed until
|
|
85
|
+
they are resolved and re-reviewed.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Step 6 — Documentation (docs)
|
|
90
|
+
|
|
91
|
+
Invoke `docs` only if any of the following changed:
|
|
92
|
+
|
|
93
|
+
- A public API endpoint was added or modified
|
|
94
|
+
- A public interface or module was introduced
|
|
95
|
+
- Behavior visible to end users changed
|
|
96
|
+
|
|
97
|
+
docs must update: README (if applicable), OpenAPI spec (if applicable),
|
|
98
|
+
CHANGELOG (always), ADR (if an architectural decision was made).
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Completion
|
|
103
|
+
|
|
104
|
+
Report the following to the human:
|
|
105
|
+
|
|
106
|
+
- Task Card (final)
|
|
107
|
+
- Technical Plan (approved)
|
|
108
|
+
- Implementation Summary
|
|
109
|
+
- Coverage Summary
|
|
110
|
+
- Review Report (all findings resolved)
|
|
111
|
+
- List of documentation files updated (if any)
|
|
112
|
+
|
|
113
|
+
The feature is complete only when: all tests pass, no CRITICAL review findings
|
|
114
|
+
remain, and documentation reflects the implemented behavior.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
Run the bug fix workflow — risk-based routing through task validation,
|
|
4
|
+
implementation, testing, and optional review.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Bug Fix Workflow
|
|
8
|
+
|
|
9
|
+
Bug description: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
Provide the following information in $ARGUMENTS:
|
|
12
|
+
|
|
13
|
+
- What is the incorrect behavior (actual)
|
|
14
|
+
- What is the expected behavior
|
|
15
|
+
- Steps to reproduce
|
|
16
|
+
- Environment or version where the bug occurs (if known)
|
|
17
|
+
- Any relevant error messages or stack traces
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Step 1 — Task Card validation (task-coach)
|
|
22
|
+
|
|
23
|
+
Invoke `task-coach` with the bug description above.
|
|
24
|
+
|
|
25
|
+
task-coach must produce a Task Card that includes:
|
|
26
|
+
|
|
27
|
+
- A clear statement of actual vs. expected behavior
|
|
28
|
+
- Reproduction steps (or a note that they are unknown)
|
|
29
|
+
- Risk classification: `low`, `medium`, or `high`
|
|
30
|
+
- Scope: which files or modules are likely affected
|
|
31
|
+
|
|
32
|
+
If reproduction steps are missing, task-coach must ask for them before
|
|
33
|
+
classifying risk. A bug without a reproduction path cannot be classified
|
|
34
|
+
reliably.
|
|
35
|
+
|
|
36
|
+
**STOP here. Show the Task Card and wait for human confirmation.**
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Step 2 — Route by risk
|
|
41
|
+
|
|
42
|
+
Read the risk field from the Task Card and follow the corresponding route.
|
|
43
|
+
|
|
44
|
+
### Low-risk route
|
|
45
|
+
|
|
46
|
+
Applies when: the bug is isolated to a single component, existing tests cover
|
|
47
|
+
the affected code, and no public API or shared state is involved.
|
|
48
|
+
|
|
49
|
+
Route: `task-coach` → `implementer` → `tester`
|
|
50
|
+
|
|
51
|
+
Proceed directly to Step 3a.
|
|
52
|
+
|
|
53
|
+
### Medium or high-risk route
|
|
54
|
+
|
|
55
|
+
Applies when: the bug touches shared state, a public API, auth or payment paths,
|
|
56
|
+
database writes, or the root cause is not yet understood.
|
|
57
|
+
|
|
58
|
+
Route: `task-coach` → `architect` → `implementer` → `tester` → `reviewer`
|
|
59
|
+
|
|
60
|
+
Invoke `architect` before implementation. architect must:
|
|
61
|
+
|
|
62
|
+
- Identify the root cause (or document that it is unknown)
|
|
63
|
+
- Define the fix approach and affected files
|
|
64
|
+
- Flag any regression risk to adjacent components
|
|
65
|
+
- Produce a Technical Plan
|
|
66
|
+
|
|
67
|
+
**STOP here if high-risk. Show the Technical Plan and wait for human approval
|
|
68
|
+
before continuing.**
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Step 3a — Implementation, low-risk (implementer)
|
|
73
|
+
|
|
74
|
+
Invoke `implementer` with the Task Card.
|
|
75
|
+
Implementer creates a Git Worktree before touching any file; all edits happen inside it.
|
|
76
|
+
|
|
77
|
+
implementer must:
|
|
78
|
+
|
|
79
|
+
1. Locate the defect using the reproduction steps
|
|
80
|
+
2. Apply the minimal fix — no unrelated changes
|
|
81
|
+
3. Run the test suite
|
|
82
|
+
4. Produce an Implementation Summary: root cause, fix applied, files changed
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Step 3b — Implementation, medium/high-risk (implementer)
|
|
87
|
+
|
|
88
|
+
Invoke `implementer` with the approved Technical Plan and the Task Card.
|
|
89
|
+
Implementer creates a Git Worktree before touching any file; all edits happen inside it.
|
|
90
|
+
|
|
91
|
+
implementer must follow the plan exactly. Any deviation requires a new Technical
|
|
92
|
+
Plan approval. After implementation, run the full test suite.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Step 4 — Regression tests (tester)
|
|
97
|
+
|
|
98
|
+
Invoke `tester` for all risk levels.
|
|
99
|
+
|
|
100
|
+
tester must:
|
|
101
|
+
|
|
102
|
+
1. Write a regression test that reproduces the original bug (fails before the
|
|
103
|
+
fix, passes after)
|
|
104
|
+
2. Verify that existing tests still pass
|
|
105
|
+
3. Produce a Coverage Summary: test added, case covered
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Step 5 — Review (reviewer) — medium/high-risk only
|
|
110
|
+
|
|
111
|
+
Invoke `reviewer` with the diff and Task Card.
|
|
112
|
+
|
|
113
|
+
reviewer produces a Review Report with CRITICAL / WARNING / SUGGESTION findings.
|
|
114
|
+
If any CRITICAL findings exist, **STOP**. Do not close the fix until they are
|
|
115
|
+
resolved.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Completion
|
|
120
|
+
|
|
121
|
+
Report: Task Card, Implementation Summary, regression test added, Review Report
|
|
122
|
+
(if applicable). The fix is complete only when: the regression test passes, the
|
|
123
|
+
full suite passes, and no CRITICAL review findings remain.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
Run the refactor workflow — mandatory architectural justification, test
|
|
4
|
+
verification, risk-based implementation, and scope enforcement.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Refactor Workflow
|
|
8
|
+
|
|
9
|
+
Refactor description: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
Describe what you want to refactor and why. Include:
|
|
12
|
+
|
|
13
|
+
- The current structure or pattern being changed
|
|
14
|
+
- The target structure or pattern
|
|
15
|
+
- The motivation (performance, readability, architectural alignment, etc.)
|
|
16
|
+
- Known risk areas or dependencies
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Prerequisite — Test coverage check
|
|
21
|
+
|
|
22
|
+
Before any agent is invoked, verify that the code being refactored has adequate
|
|
23
|
+
test coverage.
|
|
24
|
+
|
|
25
|
+
A refactor without tests is not a refactor — it is a rewrite with unknown
|
|
26
|
+
behavioral consequences.
|
|
27
|
+
|
|
28
|
+
If coverage is insufficient:
|
|
29
|
+
|
|
30
|
+
1. **STOP**. Report the coverage gap to the human.
|
|
31
|
+
2. Suggest invoking `/cc:test-plan` first to establish coverage.
|
|
32
|
+
3. Do not proceed with the refactor until coverage is confirmed.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step 1 — Architectural justification (architect)
|
|
37
|
+
|
|
38
|
+
Always invoke `architect` first, regardless of risk level. A refactor without a
|
|
39
|
+
written justification is scope creep in disguise.
|
|
40
|
+
|
|
41
|
+
architect must produce a Refactor Plan that includes:
|
|
42
|
+
|
|
43
|
+
- Statement of the problem with the current structure
|
|
44
|
+
- Proposed target structure and rationale
|
|
45
|
+
- Affected files and module boundaries
|
|
46
|
+
- Risk level: `low`, `medium`, or `high`
|
|
47
|
+
- Behavioral invariants that must not change
|
|
48
|
+
- Open questions requiring human input
|
|
49
|
+
|
|
50
|
+
**Scope creep warning:** If during planning architect identifies unrelated
|
|
51
|
+
improvements, they must be listed separately as "Out of scope." They are not
|
|
52
|
+
part of this refactor.
|
|
53
|
+
|
|
54
|
+
**STOP here. Show the Refactor Plan and wait for explicit human approval. Do not
|
|
55
|
+
proceed without written approval of the plan.**
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Step 2 — Route by risk
|
|
60
|
+
|
|
61
|
+
Read the risk field from the Refactor Plan and follow the corresponding route.
|
|
62
|
+
|
|
63
|
+
### Low-risk route
|
|
64
|
+
|
|
65
|
+
Applies when: the refactor is purely internal, no public interfaces change, full
|
|
66
|
+
test coverage exists for the affected code, and behavioral impact is isolated to
|
|
67
|
+
the refactored module.
|
|
68
|
+
|
|
69
|
+
Route: `architect` (done) → `implementer`
|
|
70
|
+
|
|
71
|
+
Proceed to Step 3a.
|
|
72
|
+
|
|
73
|
+
### Medium or high-risk route
|
|
74
|
+
|
|
75
|
+
Applies when: module boundaries change, shared interfaces are affected,
|
|
76
|
+
performance characteristics may change, or the refactor touches more than two
|
|
77
|
+
files with behavioral impact.
|
|
78
|
+
|
|
79
|
+
Route: `architect` (done) → `implementer` → `reviewer`
|
|
80
|
+
|
|
81
|
+
Proceed to Step 3b.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Step 3a — Implementation, low-risk (implementer)
|
|
86
|
+
|
|
87
|
+
Invoke `implementer` with the approved Refactor Plan.
|
|
88
|
+
Implementer creates a Git Worktree before touching any file; all edits happen inside it.
|
|
89
|
+
|
|
90
|
+
implementer must:
|
|
91
|
+
|
|
92
|
+
1. Read the Refactor Plan before opening any file
|
|
93
|
+
2. Apply only the changes specified in the plan
|
|
94
|
+
3. Run the full test suite before and after — both runs must pass
|
|
95
|
+
4. Produce an Implementation Summary: what changed, what did not change, test
|
|
96
|
+
results before and after
|
|
97
|
+
|
|
98
|
+
Any deviation from the plan — including "obvious improvements" encountered
|
|
99
|
+
during implementation — must be flagged and held for a separate task.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Step 3b — Implementation, medium/high-risk (implementer)
|
|
104
|
+
|
|
105
|
+
Same rules as 3a. Additionally:
|
|
106
|
+
|
|
107
|
+
- implementer must document any unexpected complexity discovered during
|
|
108
|
+
implementation and pause if the complexity changes the risk assessment
|
|
109
|
+
- If new risks are found, **STOP** and report to the human before continuing
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Step 4 — Test suite verification
|
|
114
|
+
|
|
115
|
+
For all risk levels, confirm:
|
|
116
|
+
|
|
117
|
+
- All tests that existed before the refactor still pass
|
|
118
|
+
- No test was deleted or commented out to make the suite pass
|
|
119
|
+
- Behavior documented in the Task Card remains unchanged
|
|
120
|
+
|
|
121
|
+
If any test fails that was passing before, the refactor has introduced a
|
|
122
|
+
regression. **STOP and report.**
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Step 5 — Code review (reviewer) — medium/high-risk only
|
|
127
|
+
|
|
128
|
+
Invoke `reviewer` with the diff and Refactor Plan.
|
|
129
|
+
|
|
130
|
+
reviewer must verify:
|
|
131
|
+
|
|
132
|
+
- The implementation matches the approved plan
|
|
133
|
+
- No behavior was changed beyond the plan's scope
|
|
134
|
+
- No unrelated files were modified
|
|
135
|
+
|
|
136
|
+
Review Report must include CRITICAL / WARNING / SUGGESTION findings. CRITICAL
|
|
137
|
+
findings block completion.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Completion
|
|
142
|
+
|
|
143
|
+
Report: Refactor Plan (approved), Implementation Summary, test results before
|
|
144
|
+
and after, Review Report (if applicable).
|
|
145
|
+
|
|
146
|
+
The refactor is complete only when: all pre-existing tests still pass, the
|
|
147
|
+
implementation matches the approved plan exactly, and no CRITICAL review
|
|
148
|
+
findings remain.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
Run a structured code review — produces a Review Report with CRITICAL,
|
|
4
|
+
WARNING, and SUGGESTION findings; CRITICAL findings block merge.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Review Workflow
|
|
8
|
+
|
|
9
|
+
Review target: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
Specify what to review. Accepted formats:
|
|
12
|
+
|
|
13
|
+
- A branch name: `feature/my-branch`
|
|
14
|
+
- A file or set of files: `src/api/UserController.kt`
|
|
15
|
+
- A pull request reference: `PR #42`
|
|
16
|
+
- Empty — defaults to the current working diff (`git diff`)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Step 1 — Diff collection
|
|
21
|
+
|
|
22
|
+
Before invoking `reviewer`, collect the diff for the specified target.
|
|
23
|
+
|
|
24
|
+
If $ARGUMENTS is empty or not provided:
|
|
25
|
+
|
|
26
|
+
- Use `git diff HEAD` as the review target
|
|
27
|
+
|
|
28
|
+
If $ARGUMENTS is a branch name:
|
|
29
|
+
|
|
30
|
+
- Use `git diff main...$ARGUMENTS` (or `develop` if main is not the base)
|
|
31
|
+
|
|
32
|
+
If $ARGUMENTS is a PR reference:
|
|
33
|
+
|
|
34
|
+
- Retrieve the PR diff and the PR description for context
|
|
35
|
+
|
|
36
|
+
If $ARGUMENTS is a file path:
|
|
37
|
+
|
|
38
|
+
- Use `git diff HEAD -- $ARGUMENTS`
|
|
39
|
+
|
|
40
|
+
Show the diff summary (files changed, lines added/removed) before invoking
|
|
41
|
+
reviewer.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 2 — Code review (reviewer)
|
|
46
|
+
|
|
47
|
+
Invoke `reviewer` with:
|
|
48
|
+
|
|
49
|
+
- The full diff
|
|
50
|
+
- The Task Card or PR description (if available)
|
|
51
|
+
- The target specification from $ARGUMENTS
|
|
52
|
+
|
|
53
|
+
reviewer must evaluate the diff against the following checklist:
|
|
54
|
+
|
|
55
|
+
**Correctness**
|
|
56
|
+
|
|
57
|
+
- Does the implementation match the stated intent?
|
|
58
|
+
- Are there logic errors, off-by-one errors, or unhandled edge cases?
|
|
59
|
+
|
|
60
|
+
**Architecture alignment**
|
|
61
|
+
|
|
62
|
+
- Does the change follow existing module boundaries?
|
|
63
|
+
- Does it introduce unplanned coupling or layering violations?
|
|
64
|
+
|
|
65
|
+
**Security**
|
|
66
|
+
|
|
67
|
+
- Are inputs validated before use?
|
|
68
|
+
- Is there any credential, token, or secret in the diff?
|
|
69
|
+
- Are there SQL injection, XSS, or injection risks?
|
|
70
|
+
|
|
71
|
+
**Performance**
|
|
72
|
+
|
|
73
|
+
- Does the change introduce N+1 queries, blocking I/O, or O(n^2) loops?
|
|
74
|
+
|
|
75
|
+
**Test coverage**
|
|
76
|
+
|
|
77
|
+
- Do tests exist for the new or changed behavior?
|
|
78
|
+
- Are assertions meaningful (not just checking that no exception is thrown)?
|
|
79
|
+
|
|
80
|
+
**Documentation**
|
|
81
|
+
|
|
82
|
+
- Are public interfaces documented?
|
|
83
|
+
- Is CHANGELOG updated if behavior changed?
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Step 3 — Review Report
|
|
88
|
+
|
|
89
|
+
reviewer produces a structured Review Report with findings in three categories:
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
## Review Report
|
|
93
|
+
|
|
94
|
+
### CRITICAL
|
|
95
|
+
|
|
96
|
+
[Findings that must be fixed before merge. Each finding includes:
|
|
97
|
+
|
|
98
|
+
- Location (file:line)
|
|
99
|
+
- Description of the problem
|
|
100
|
+
- Suggested resolution]
|
|
101
|
+
|
|
102
|
+
### WARNING
|
|
103
|
+
|
|
104
|
+
[Findings that should be resolved before merge but are not blockers in
|
|
105
|
+
exceptional cases with human approval. Same format as CRITICAL.]
|
|
106
|
+
|
|
107
|
+
### SUGGESTION
|
|
108
|
+
|
|
109
|
+
[Optional improvements — style, readability, future-proofing. These do not block
|
|
110
|
+
merge.]
|
|
111
|
+
|
|
112
|
+
### Summary
|
|
113
|
+
|
|
114
|
+
- Files reviewed: N
|
|
115
|
+
- Total findings: N (X critical, Y warnings, Z suggestions)
|
|
116
|
+
- Merge recommendation: APPROVED | BLOCKED
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Step 4 — Merge decision
|
|
122
|
+
|
|
123
|
+
If any CRITICAL findings exist:
|
|
124
|
+
|
|
125
|
+
- The Review Report status is **BLOCKED**
|
|
126
|
+
- Report all CRITICAL findings to the human
|
|
127
|
+
- Do not proceed until each CRITICAL finding is resolved
|
|
128
|
+
- After resolution, invoke `/cc:review` again on the same target
|
|
129
|
+
|
|
130
|
+
If no CRITICAL findings exist:
|
|
131
|
+
|
|
132
|
+
- The Review Report status is **APPROVED**
|
|
133
|
+
- Report any WARNINGs and SUGGESTIONs for human awareness
|
|
134
|
+
- The human makes the final merge decision
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Completion
|
|
139
|
+
|
|
140
|
+
Deliver the complete Review Report. Never summarize or omit findings. Every
|
|
141
|
+
finding must include a location and an actionable description.
|