cc-codeconductor 0.4.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +2642 -226
  3. package/package.json +1 -1
  4. package/presets/agy/skills/evaluation/SKILL.md +6 -0
  5. package/presets/agy/skills/openspec/SKILL.md +32 -0
  6. package/presets/agy/workflows/cc-openspec.md +62 -0
  7. package/presets/agy/workflows/cc-scorecard.md +17 -0
  8. package/presets/claude/commands/cc/openspec.md +144 -0
  9. package/presets/claude/commands/cc/review.md +13 -2
  10. package/presets/claude/commands/cc/scorecard.md +65 -0
  11. package/presets/claude/skills/evaluation/SKILL.md +42 -0
  12. package/presets/claude/skills/openspec/SKILL.md +54 -0
  13. package/presets/codex/AGENTS.md +57 -0
  14. package/presets/cursor/.cursorignore +15 -0
  15. package/presets/cursor/AGENTS.md +504 -0
  16. package/presets/cursor/agents/architect.md +211 -0
  17. package/presets/cursor/agents/complexity-auditor.md +76 -0
  18. package/presets/cursor/agents/contract-builder.md +75 -0
  19. package/presets/cursor/agents/docs.md +180 -0
  20. package/presets/cursor/agents/goal-planner.md +71 -0
  21. package/presets/cursor/agents/implementer.md +161 -0
  22. package/presets/cursor/agents/orchestrator.md +377 -0
  23. package/presets/cursor/agents/repo-explorer.md +100 -0
  24. package/presets/cursor/agents/reviewer.md +237 -0
  25. package/presets/cursor/agents/security-reviewer.md +113 -0
  26. package/presets/cursor/agents/task-coach.md +145 -0
  27. package/presets/cursor/agents/tester.md +241 -0
  28. package/presets/cursor/commands/cc/api-contract.md +58 -0
  29. package/presets/cursor/commands/cc/db-migration.md +58 -0
  30. package/presets/cursor/commands/cc/feature.md +115 -0
  31. package/presets/cursor/commands/cc/fix.md +121 -0
  32. package/presets/cursor/commands/cc/openspec.md +144 -0
  33. package/presets/cursor/commands/cc/pagespeed.md +103 -0
  34. package/presets/cursor/commands/cc/refactor.md +148 -0
  35. package/presets/cursor/commands/cc/review.md +137 -0
  36. package/presets/cursor/commands/cc/scorecard.md +65 -0
  37. package/presets/cursor/commands/cc/tdd-cycle.md +226 -0
  38. package/presets/cursor/commands/cc/test-plan.md +138 -0
  39. package/presets/cursor/rules/behavioral-discipline.mdc +14 -0
  40. package/presets/cursor/rules/context-budget.mdc +12 -0
  41. package/presets/cursor/rules/orchestration.mdc +12 -0
  42. package/presets/cursor/rules/yagni-stdlib.mdc +11 -0
  43. package/presets/cursor/skills/android/SKILL.md +122 -0
  44. package/presets/cursor/skills/api-versioning/SKILL.md +394 -0
  45. package/presets/cursor/skills/astro/SKILL.md +322 -0
  46. package/presets/cursor/skills/auth-token-inspector/SKILL.md +33 -0
  47. package/presets/cursor/skills/code-review/SKILL.md +208 -0
  48. package/presets/cursor/skills/conductor-setup/SKILL.md +127 -0
  49. package/presets/cursor/skills/django-orm/SKILL.md +463 -0
  50. package/presets/cursor/skills/django-testing/SKILL.md +417 -0
  51. package/presets/cursor/skills/django-uv/SKILL.md +409 -0
  52. package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +54 -0
  53. package/presets/cursor/skills/evaluation/SKILL.md +8 -0
  54. package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +46 -0
  55. package/presets/cursor/skills/find-skills/SKILL.md +144 -0
  56. package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +49 -0
  57. package/presets/cursor/skills/jpa-postgres/SKILL.md +626 -0
  58. package/presets/cursor/skills/laravel-specialist/SKILL.md +267 -0
  59. package/presets/cursor/skills/laravel-specialist/references/eloquent.md +351 -0
  60. package/presets/cursor/skills/laravel-specialist/references/livewire.md +512 -0
  61. package/presets/cursor/skills/laravel-specialist/references/queues.md +423 -0
  62. package/presets/cursor/skills/laravel-specialist/references/routing.md +362 -0
  63. package/presets/cursor/skills/laravel-specialist/references/testing.md +522 -0
  64. package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +39 -0
  65. package/presets/cursor/skills/multi-agent-orchestration/README.md +144 -0
  66. package/presets/cursor/skills/multi-agent-orchestration/SKILL.md +579 -0
  67. package/presets/cursor/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  68. package/presets/cursor/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  69. package/presets/cursor/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  70. package/presets/cursor/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  71. package/presets/cursor/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  72. package/presets/cursor/skills/nextjs-typescript/SKILL.md +394 -0
  73. package/presets/cursor/skills/openspec/SKILL.md +52 -0
  74. package/presets/cursor/skills/pagespeed-insights/SKILL.md +445 -0
  75. package/presets/cursor/skills/pagespeed-insights/reference.md +50 -0
  76. package/presets/cursor/skills/pagespeed-perf/SKILL.md +281 -0
  77. package/presets/cursor/skills/php-pro/SKILL.md +210 -0
  78. package/presets/cursor/skills/php-pro/references/async-patterns.md +412 -0
  79. package/presets/cursor/skills/php-pro/references/laravel-patterns.md +377 -0
  80. package/presets/cursor/skills/php-pro/references/modern-php-features.md +323 -0
  81. package/presets/cursor/skills/php-pro/references/symfony-patterns.md +466 -0
  82. package/presets/cursor/skills/php-pro/references/testing-quality.md +466 -0
  83. package/presets/cursor/skills/python/SKILL.md +613 -0
  84. package/presets/cursor/skills/python-django-stack/SKILL.md +500 -0
  85. package/presets/cursor/skills/python-fastapi-stack/SKILL.md +464 -0
  86. package/presets/cursor/skills/security/SKILL.md +384 -0
  87. package/presets/cursor/skills/seo-analytics-injector/SKILL.md +44 -0
  88. package/presets/cursor/skills/spring-auth-auditor/SKILL.md +33 -0
  89. package/presets/cursor/skills/spring-boot-feature/SKILL.md +566 -0
  90. package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +408 -0
  91. package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +479 -0
  92. package/presets/cursor/skills/sqlalchemy/SKILL.md +473 -0
  93. package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +32 -0
  94. package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +28 -0
  95. package/presets/cursor/skills/testing-tdd/SKILL.md +592 -0
  96. package/presets/cursor/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  97. package/presets/cursor/skills/workflow-orchestration-patterns/references/details.md +223 -0
  98. package/presets/opencode/agents/architect.md +1 -2
  99. package/presets/opencode/agents/complexity-auditor.md +1 -0
  100. package/presets/opencode/agents/contract-builder.md +93 -0
  101. package/presets/opencode/agents/docs.md +1 -2
  102. package/presets/opencode/agents/goal-planner.md +82 -0
  103. package/presets/opencode/agents/implementer.md +9 -2
  104. package/presets/opencode/agents/orchestrator.md +50 -12
  105. package/presets/opencode/agents/repo-explorer.md +0 -1
  106. package/presets/opencode/agents/reviewer.md +23 -2
  107. package/presets/opencode/agents/security-reviewer.md +129 -0
  108. package/presets/opencode/agents/task-coach.md +1 -2
  109. package/presets/opencode/agents/tester.md +1 -2
  110. package/presets/opencode/commands/cc-openspec.md +61 -0
  111. package/presets/opencode/commands/cc-scorecard.md +16 -0
  112. package/presets/opencode/prompts/v0.5.0/architect.md +222 -0
  113. package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +91 -0
  114. package/presets/opencode/prompts/v0.5.0/contract-builder.md +84 -0
  115. package/presets/opencode/prompts/v0.5.0/docs.md +190 -0
  116. package/presets/opencode/prompts/v0.5.0/goal-planner.md +80 -0
  117. package/presets/opencode/prompts/v0.5.0/implementer.md +171 -0
  118. package/presets/opencode/prompts/v0.5.0/orchestrator.md +388 -0
  119. package/presets/opencode/prompts/v0.5.0/repo-explorer.md +111 -0
  120. package/presets/opencode/prompts/v0.5.0/reviewer.md +248 -0
  121. package/presets/opencode/prompts/v0.5.0/security-reviewer.md +123 -0
  122. package/presets/opencode/prompts/v0.5.0/task-coach.md +156 -0
  123. package/presets/opencode/prompts/v0.5.0/tester.md +252 -0
  124. package/presets/opencode/skills/evaluation/SKILL.md +6 -0
  125. package/presets/opencode/skills/openspec/SKILL.md +50 -0
  126. package/presets/templates/BACKLOG.md +33 -0
  127. package/presets/templates/execution-profile.yml +6 -0
  128. package/presets/templates/model-comparison.md +11 -0
  129. package/presets/templates/regression-checklist.yml +10 -0
  130. package/src/presets/manifests/agy.yml +2 -2
  131. package/src/presets/manifests/claude.yml +2 -2
  132. package/src/presets/manifests/codex.yml +2 -2
  133. package/src/presets/manifests/cursor.yml +19 -3
  134. package/src/presets/manifests/gemini.yml +2 -2
  135. package/src/presets/manifests/opencode.yml +2 -2
  136. package/src/presets/models/agy.yml +21 -0
  137. package/src/presets/models/claude.yml +18 -0
  138. package/src/presets/models/codex.yml +18 -0
  139. package/src/presets/models/cursor.yml +39 -9
  140. package/src/presets/models/gemini.yml +18 -0
  141. package/src/presets/models/opencode.yml +18 -0
@@ -0,0 +1,144 @@
1
+ ---
2
+ description: >-
3
+ [cc: alias] Run OpenSpec backlog delivery — validate BACKLOG.md, plan TaskCards,
4
+ orchestrate agents by phase, review gate, and update backlog state.
5
+ ---
6
+
7
+ # OpenSpec Backlog Workflow
8
+
9
+ Scope: $ARGUMENTS
10
+
11
+ Orchestrate FIFO delivery from `BACKLOG.md`. CodeConductor owns planning; agents execute one TaskCard per phase with the installed preset model for each role.
12
+
13
+ ---
14
+
15
+ ## Step 0 — Validate (mandatory gate)
16
+
17
+ Run:
18
+
19
+ ```bash
20
+ npx cc-codeconductor openspec validate
21
+ ```
22
+
23
+ If validation fails:
24
+
25
+ 1. List all errors and recommendations from the CLI output.
26
+ 2. Show the canonical BACKLOG.md structure (## Global, ## Items, ### BC-001 | Title, Priority, Status, Type, Depends on, Description, Scope, Acceptance).
27
+ 3. **STOP.** Do not scan, plan, or execute until the user fixes BACKLOG.md.
28
+
29
+ ---
30
+
31
+ ## Step 1 — Scan
32
+
33
+ Run:
34
+
35
+ ```bash
36
+ npx cc-codeconductor openspec scan
37
+ ```
38
+
39
+ Report: new items, modified items, closed/archived items, and whether the file changed.
40
+
41
+ ---
42
+
43
+ ## Step 2 — Select item
44
+
45
+ If `$ARGUMENTS` contains a `BC-xxx` ID, use that item. Otherwise run:
46
+
47
+ ```bash
48
+ npx cc-codeconductor openspec status
49
+ ```
50
+
51
+ Pick the next `READY` item with satisfied dependencies (FIFO by priority). Skip items in `DONE` or `Archive`.
52
+
53
+ **STOP if no eligible item.** Report backlog status and wait for the user.
54
+
55
+ ---
56
+
57
+ ## Step 3 — Plan
58
+
59
+ Run:
60
+
61
+ ```bash
62
+ npx cc-codeconductor openspec plan <BC-id>
63
+ ```
64
+
65
+ Show:
66
+
67
+ - Generated TaskCards (discover → design → test → implement → review when TDD required)
68
+ - Path to `openspec/changes/<slug>/` (proposal, design, tasks, specs)
69
+
70
+ Update BACKLOG item status to `PLANNED` (CLI does this automatically).
71
+
72
+ ---
73
+
74
+ ## Step 4 — Model matrix and execute loop
75
+
76
+ Before executing phases, show resolved models:
77
+
78
+ ```bash
79
+ npx cc-codeconductor scorecard models
80
+ ```
81
+
82
+ For each pending TaskCard, run:
83
+
84
+ ```bash
85
+ npx cc-codeconductor openspec next
86
+ ```
87
+
88
+ Invoke the agent named on the card with **isolated** context (`/clear` between phases unless continuation is required):
89
+
90
+ | Phase | Agent | Role |
91
+ |-------|-------|------|
92
+ | discover | repo-explorer | Map repo and impact |
93
+ | design | architect | Technical plan |
94
+ | test | tester | TDD tests (before implement if TDD required) |
95
+ | implement | implementer | Minimal diff in worktree |
96
+ | review | reviewer | Acceptance + scope gate |
97
+
98
+ Use the model configured in the installed preset for each agent role.
99
+
100
+ After each phase:
101
+
102
+ - Mark progress in deliverable summary.
103
+ - Set TaskCard status to `done` in `.codeconductor/openspec-state.json` when phase completes.
104
+
105
+ Implementer: create a Git worktree before editing (`git worktree add ../<branch>-session <branch>`).
106
+
107
+ ---
108
+
109
+ ## Step 5 — Review gate
110
+
111
+ Run regression when BACKLOG Global `Review required: yes`:
112
+
113
+ ```bash
114
+ npx cc-codeconductor scorecard regression
115
+ ```
116
+
117
+ The `reviewer` agent must verify:
118
+
119
+ - All acceptance criteria from BACKLOG.md
120
+ - Tests pass
121
+ - Scope matches the backlog item
122
+ - No architectural violations
123
+
124
+ If **rejected**: set item status `IN_PROGRESS`, record findings in state, **STOP** and report to user.
125
+
126
+ If **approved**: proceed to Step 6.
127
+
128
+ ---
129
+
130
+ ## Step 6 — Scorecard and update backlog
131
+
132
+ 1. `npx cc-codeconductor scorecard create --task <BC-id> --from-diff`
133
+ 2. Complete criteria; `scorecard record` with verdict and optional cost/tokens
134
+ 3. Set item `Progress: 100%`, `Status: DONE` if PASS
135
+ 4. Move item to `## Archive` in BACKLOG.md if DONE
136
+ 5. Run `npx cc-codeconductor openspec scan`
137
+
138
+ Report completion: Task Cards executed, scorecard verdict, change folder path, files changed.
139
+
140
+ ---
141
+
142
+ ## Skill
143
+
144
+ Apply `.claude/skills/openspec/SKILL.md` for backlog format rules and state transitions.
@@ -0,0 +1,103 @@
1
+ # PageSpeed Performance Audit
2
+
3
+ Audit web performance using the PageSpeed Insights API. Applies the 80/20
4
+ principle: identify the 20% of changes that produce 80% of the performance gain.
5
+ Produces a prioritized report in the current working directory.
6
+
7
+ ## Usage
8
+
9
+ ```
10
+ /cc-pagespeed --url <url> [--strategy mobile|desktop|both]
11
+ ```
12
+
13
+ ## Parameters
14
+
15
+ | Parameter | Required | Description |
16
+ | ------------- | -------- | -------------------------------------------------------------- |
17
+ | `--url` | Yes | Full URL to audit (must include scheme: https://...) |
18
+ | `--strategy` | No | Analysis strategy: `mobile`, `desktop`, or `both` (default: `both`) |
19
+
20
+ ## Requirements
21
+
22
+ ### `PAGESPEED_API_KEY` — Optional but strongly recommended
23
+
24
+ | Mode | Lab data | CrUX field data | Rate limits |
25
+ | ------------ | -------- | --------------- | ---------------- |
26
+ | **With key** | ✅ | ✅ (real users) | 25,000 req/day |
27
+ | **Without** | ✅ | ❌ | ~2 req/s shared |
28
+
29
+ Without the key, Core Web Vitals field data (real user experience via CrUX) is
30
+ unavailable. Lab data from Lighthouse still runs.
31
+
32
+ Set the key before invoking the command:
33
+
34
+ ```powershell
35
+ # Windows PowerShell
36
+ $env:PAGESPEED_API_KEY = "your-api-key"
37
+
38
+ # macOS / Linux
39
+ export PAGESPEED_API_KEY="your-api-key"
40
+ ```
41
+
42
+ Get a free key (Google account required):
43
+ <https://developers.google.com/speed/docs/insights/v5/get-started>
44
+
45
+ ## Workflow
46
+
47
+ When `/cc-pagespeed` is invoked, load the `pagespeed-perf` skill and execute
48
+ the following steps in order:
49
+
50
+ 1. **Pre-flight** — Read `$env:PAGESPEED_API_KEY` from the environment. Compute
51
+ the output filename: `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md`.
52
+
53
+ 2. **Collect** — Call the PageSpeed Insights API for the requested strategy
54
+ (`mobile`, `desktop`, or `both`). Prefer the Bun scripts in
55
+ `~/.claude/skills/pagespeed-perf/scripts/run.ts` if Bun is available.
56
+ Otherwise, use `WebFetch` to call the PSI endpoint directly.
57
+
58
+ 3. **Analyze** — Extract Core Web Vitals (LCP, INP, CLS, FCP, TTFB, TBT),
59
+ identify the LCP element, enumerate third-party scripts by blocking time,
60
+ and inspect resource hints in the HTML `<head>`.
61
+
62
+ 4. **Prioritize** — Score each identified optimization using the 80/20 matrix:
63
+ `Impact × Ease` (each 1–5). Order findings by descending score. Highlight
64
+ the top actions with Score ≥ 20 as the critical 20%.
65
+
66
+ 5. **Report** — Write the structured markdown report to
67
+ `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md` in the current directory.
68
+
69
+ ## Output File
70
+
71
+ The report is saved as `{YYYY-MM-DD}_pagespeed-{hostname}-claude.md`.
72
+
73
+ - Hostname characters outside `[a-zA-Z0-9]` are replaced with `-`.
74
+ - Example: `https://www.example.com` → `2026-06-07_pagespeed-www-example-com-claude.md`
75
+
76
+ ## Skills Loaded
77
+
78
+ - `pagespeed-perf` — Web Performance Engineering: PSI API, Core Web Vitals
79
+ thresholds, 80/20 optimization matrix, resource-hint analysis, third-party
80
+ script auditing, framework-specific implementation templates.
81
+
82
+ ## Examples
83
+
84
+ ```bash
85
+ # Full audit — mobile + desktop
86
+ /cc-pagespeed --url https://www.example.com
87
+
88
+ # Mobile only
89
+ /cc-pagespeed --url https://www.example.com --strategy mobile
90
+
91
+ # Desktop only
92
+ /cc-pagespeed --url https://www.example.com --strategy desktop
93
+ ```
94
+
95
+ ## Hard Rules
96
+
97
+ - **GET only.** Never send POST, PUT, or DELETE to the target URL.
98
+ - **No auth.** Never include cookies, tokens, or auth headers.
99
+ - **No external crawling.** Audit only the provided URL.
100
+ - **Quantify every finding.** Never write "it would improve LCP". Always cite
101
+ the observed value and estimated gain (e.g., "reduces LCP from 4.2 s to ~3.0 s").
102
+ - **No generic recommendations.** Every finding must be backed by data from
103
+ the audit of this specific URL.
@@ -0,0 +1,148 @@
1
+ ---
2
+ description: >-
3
+ [cc: alias] Run the refactor workflow — mandatory architectural justification,
4
+ test 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 role is adopted, 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.
31
+ 2. Suggest running `/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 role)
37
+
38
+ Invoke the `architect` subagent via the Task tool. Always invoke this step
39
+ first, regardless of risk level. A refactor without a written justification is
40
+ scope creep in disguise.
41
+
42
+ Produce a Refactor Plan that includes:
43
+
44
+ - Statement of the problem with the current structure
45
+ - Proposed target structure and rationale
46
+ - Affected files and module boundaries
47
+ - Risk level: `low`, `medium`, or `high`
48
+ - Behavioral invariants that must not change
49
+ - Open questions requiring human input
50
+
51
+ **Scope creep warning:** If during planning you identify unrelated improvements,
52
+ list them separately as "Out of scope." They are not 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 role)
86
+
87
+ Invoke the `implementer` subagent via the Task tool. Use the approved
88
+ Refactor Plan.
89
+ Implementer creates a Git Worktree before touching any file; all edits happen inside it.
90
+
91
+ 1. Read the Refactor Plan before opening any file.
92
+ 2. Apply only the changes specified in the plan.
93
+ 3. Run the full test suite before and after — both runs must pass.
94
+ 4. Produce an Implementation Summary: what changed, what did not change, test
95
+ results before and after.
96
+
97
+ Any deviation from the plan — including "obvious improvements" encountered
98
+ during implementation — must be flagged and held for a separate task.
99
+
100
+ ---
101
+
102
+ ## Step 3b — Implementation, medium/high-risk (Implementer role)
103
+
104
+ Same rules as Step 3a. Additionally:
105
+
106
+ - Document any unexpected complexity discovered during implementation.
107
+ - Pause and report if complexity changes the risk assessment.
108
+ - If new risks are found, **STOP** and report before continuing.
109
+
110
+ ---
111
+
112
+ ## Step 4 — Test suite verification
113
+
114
+ For all risk levels, confirm:
115
+
116
+ - All tests that existed before the refactor still pass.
117
+ - No test was deleted or commented out to make the suite pass.
118
+ - Behavior documented in the Task Card remains unchanged.
119
+
120
+ If any test fails that was passing before, the refactor has introduced a
121
+ regression. **STOP and report.**
122
+
123
+ ---
124
+
125
+ ## Step 5 — Code review (Reviewer role) — medium/high-risk only
126
+
127
+ Invoke the `reviewer` subagent via the Task tool. Use the diff and Refactor
128
+ Plan.
129
+
130
+ 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,137 @@
1
+ ---
2
+ description: >-
3
+ [cc: alias] Run a structured code review — produces a Review Report with
4
+ CRITICAL, 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 adopting the Reviewer role, 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 proceeding.
41
+
42
+ ---
43
+
44
+ ## Step 2 — Code review (Reviewer role)
45
+
46
+ Invoke the `reviewer` subagent via the Task tool.
47
+
48
+ Evaluate the diff against the following checklist:
49
+
50
+ **Correctness**
51
+
52
+ - Does the implementation match the stated intent?
53
+ - Are there logic errors, off-by-one errors, or unhandled edge cases?
54
+
55
+ **Architecture alignment**
56
+
57
+ - Does the change follow existing module boundaries?
58
+ - Does it introduce unplanned coupling or layering violations?
59
+
60
+ **Security**
61
+
62
+ - Are inputs validated before use?
63
+ - Is there any credential, token, or secret in the diff?
64
+ - Are there SQL injection, XSS, or injection risks?
65
+
66
+ **Performance**
67
+
68
+ - Does the change introduce N+1 queries, blocking I/O, or O(n²) loops?
69
+
70
+ **Test coverage**
71
+
72
+ - Do tests exist for the new or changed behavior?
73
+ - Are assertions meaningful (not just checking that no exception is thrown)?
74
+
75
+ **Documentation**
76
+
77
+ - Are public interfaces documented?
78
+ - Is CHANGELOG updated if behavior changed?
79
+
80
+ ---
81
+
82
+ ## Step 3 — Review Report
83
+
84
+ Produce a structured Review Report with findings in three categories:
85
+
86
+ ```markdown
87
+ ## Review Report
88
+
89
+ ### CRITICAL
90
+ [Findings that must be fixed before merge — file:line, description, suggested resolution]
91
+
92
+ ### WARNING
93
+ [Findings that should be resolved before merge — same format as CRITICAL]
94
+
95
+ ### SUGGESTION
96
+ [Optional improvements — style, readability, future-proofing. These do not block merge.]
97
+
98
+ ### Summary
99
+ - Files reviewed: N
100
+ - Total findings: N (X critical, Y warnings, Z suggestions)
101
+ - Merge recommendation: APPROVED | BLOCKED
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Step 4 — Merge decision
107
+
108
+ If any CRITICAL findings exist:
109
+
110
+ - The Review Report status is **BLOCKED**.
111
+ - Report all CRITICAL findings.
112
+ - Do not proceed until each CRITICAL finding is resolved.
113
+ - After resolution, run `/review` again on the same target.
114
+
115
+ If no CRITICAL findings exist:
116
+
117
+ - The Review Report status is **APPROVED**.
118
+ - Report any WARNINGs and SUGGESTIONs for human awareness.
119
+ - The human makes the final merge decision.
120
+
121
+ ---
122
+
123
+ ## Completion
124
+
125
+ Deliver the complete Review Report. Never summarize or omit findings.
126
+
127
+ ---
128
+
129
+ ## Step 5 — Scorecard and outcome
130
+
131
+ ```bash
132
+ npx cc-codeconductor scorecard create --from-diff --agent reviewer
133
+ npx cc-codeconductor scorecard record --verdict PASS|REVISE|REJECT --score <weighted>
134
+ npx cc-codeconductor scorecard regression
135
+ ```
136
+
137
+ Map merge recommendation to scorecard verdict. Record outcome for trend tracking.
@@ -0,0 +1,65 @@
1
+ ---
2
+ description: >-
3
+ [cc: alias] Evaluate deliverable quality — scorecard, outcome tracking, regression
4
+ checklist, and aggregate stats.
5
+ ---
6
+
7
+ # Scorecard Evaluation Workflow
8
+
9
+ Scope: $ARGUMENTS
10
+
11
+ ---
12
+
13
+ ## Step 1 — Identify task
14
+
15
+ Use `$ARGUMENTS` as task id (e.g. `BC-001`) or read active item from `npx cc-codeconductor openspec status`.
16
+
17
+ ---
18
+
19
+ ## Step 2 — Create scorecard with auto-signals
20
+
21
+ ```bash
22
+ npx cc-codeconductor scorecard create --task <id> --agent reviewer --from-diff
23
+ ```
24
+
25
+ Review auto-suggested criteria (minimal diff, cc-gain). Complete remaining scores 0–3 per [`docs/agent-scorecard.md`](docs/agent-scorecard.md).
26
+
27
+ ---
28
+
29
+ ## Step 3 — Regression (optional)
30
+
31
+ ```bash
32
+ npx cc-codeconductor scorecard regression
33
+ ```
34
+
35
+ If required checks fail, **STOP** and report failures.
36
+
37
+ ---
38
+
39
+ ## Step 4 — Record outcome
40
+
41
+ ```bash
42
+ npx cc-codeconductor scorecard record --task <id> --agent reviewer --model <model> --verdict PASS --score 2.5
43
+ ```
44
+
45
+ Include `--cost` and `--tokens` when available from session metrics.
46
+
47
+ ---
48
+
49
+ ## Step 5 — Aggregate
50
+
51
+ ```bash
52
+ npx cc-codeconductor scorecard aggregate
53
+ ```
54
+
55
+ Report pass rate and average weighted score.
56
+
57
+ ---
58
+
59
+ ## Routing on verdict
60
+
61
+ - **PASS** — accept deliverable; update backlog if applicable
62
+ - **REVISE** — return to implementer/tester with findings
63
+ - **REJECT** — route to task-coach for re-scoping
64
+
65
+ Apply skill `evaluation`.