cc-codeconductor 1.0.0 → 1.1.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/README.md +324 -87
- package/dist/core/compilation/compile-checker.d.ts +2 -0
- package/dist/core/loop/loop-engine.d.ts +3 -0
- package/dist/index.js +2701 -577
- package/dist/library.js +167 -18
- package/dist/validation/schemas.d.ts +390 -44
- package/package.json +4 -1
- package/presets/agy/AGENTS.md +3 -0
- package/presets/agy/gates/pre-commit/GATE.md +5 -4
- package/presets/agy/skills/backlog/SKILL.md +91 -0
- package/presets/agy/skills/openspec/SKILL.md +5 -1
- package/presets/agy/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/agy/skills/security-blue-team/SKILL.md +43 -0
- package/presets/agy/skills/security-cloud/SKILL.md +43 -0
- package/presets/agy/skills/security-crypto/SKILL.md +43 -0
- package/presets/agy/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/agy/skills/security-grc/SKILL.md +43 -0
- package/presets/agy/skills/security-incident-response/SKILL.md +45 -0
- package/presets/agy/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/agy/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/agy/skills/security-mobile/SKILL.md +43 -0
- package/presets/agy/skills/security-network/SKILL.md +43 -0
- package/presets/agy/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/agy/skills/security-recon/SKILL.md +45 -0
- package/presets/agy/skills/security-red-team/SKILL.md +44 -0
- package/presets/agy/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/agy/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/agy/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/agy/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/agy/skills/security-web/SKILL.md +44 -0
- package/presets/agy/workflows/cc-ask.md +2 -1
- package/presets/agy/workflows/cc-backlog.md +69 -0
- package/presets/agy/workflows/cc-explore.md +1 -1
- package/presets/agy/workflows/cc-openspec.md +3 -1
- package/presets/agy/workflows/cc-security.md +180 -0
- package/presets/claude/CLAUDE.md +4 -0
- package/presets/claude/commands/cc/ask.md +2 -1
- package/presets/claude/commands/cc/backlog.md +104 -0
- package/presets/claude/commands/cc/explore.md +1 -1
- package/presets/claude/commands/cc/openspec.md +16 -1
- package/presets/claude/commands/cc/security.md +179 -0
- package/presets/claude/gates/pre-commit/GATE.md +5 -4
- package/presets/claude/skills/backlog/SKILL.md +91 -0
- package/presets/claude/skills/openspec/SKILL.md +5 -1
- package/presets/claude/skills/security/SKILL.md +382 -0
- package/presets/claude/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/claude/skills/security-blue-team/SKILL.md +43 -0
- package/presets/claude/skills/security-cloud/SKILL.md +43 -0
- package/presets/claude/skills/security-crypto/SKILL.md +43 -0
- package/presets/claude/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/claude/skills/security-grc/SKILL.md +43 -0
- package/presets/claude/skills/security-incident-response/SKILL.md +45 -0
- package/presets/claude/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/claude/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/claude/skills/security-mobile/SKILL.md +43 -0
- package/presets/claude/skills/security-network/SKILL.md +43 -0
- package/presets/claude/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/claude/skills/security-recon/SKILL.md +45 -0
- package/presets/claude/skills/security-red-team/SKILL.md +44 -0
- package/presets/claude/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/claude/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/claude/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/claude/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/claude/skills/security-web/SKILL.md +44 -0
- package/presets/codex/commands/cc-ask.md +2 -1
- package/presets/codex/gates/pre-commit/GATE.md +5 -4
- package/presets/cursor/AGENTS.md +2 -2
- package/presets/cursor/commands/cc/ask.md +2 -1
- package/presets/cursor/commands/cc/backlog.md +105 -0
- package/presets/cursor/commands/cc/explore.md +1 -1
- package/presets/cursor/commands/cc/openspec.md +16 -1
- package/presets/cursor/commands/cc/security.md +179 -0
- package/presets/cursor/gates/pre-commit/GATE.md +5 -4
- package/presets/cursor/skills/backlog/SKILL.md +91 -0
- package/presets/cursor/skills/openspec/SKILL.md +5 -1
- package/presets/cursor/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/cursor/skills/security-blue-team/SKILL.md +43 -0
- package/presets/cursor/skills/security-cloud/SKILL.md +43 -0
- package/presets/cursor/skills/security-crypto/SKILL.md +43 -0
- package/presets/cursor/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/cursor/skills/security-grc/SKILL.md +43 -0
- package/presets/cursor/skills/security-incident-response/SKILL.md +45 -0
- package/presets/cursor/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/cursor/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/cursor/skills/security-mobile/SKILL.md +43 -0
- package/presets/cursor/skills/security-network/SKILL.md +43 -0
- package/presets/cursor/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/cursor/skills/security-recon/SKILL.md +45 -0
- package/presets/cursor/skills/security-red-team/SKILL.md +44 -0
- package/presets/cursor/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/cursor/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/cursor/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/cursor/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/cursor/skills/security-web/SKILL.md +44 -0
- package/presets/opencode/commands/cc-ask.md +2 -1
- package/presets/opencode/commands/cc-backlog.md +68 -0
- package/presets/opencode/commands/cc-explore.md +1 -1
- package/presets/opencode/commands/cc-openspec.md +3 -1
- package/presets/opencode/commands/cc-security.md +179 -0
- package/presets/opencode/gates/pre-commit/GATE.md +5 -4
- package/presets/opencode/skills/backlog/SKILL.md +91 -0
- package/presets/opencode/skills/openspec/SKILL.md +5 -1
- package/presets/opencode/skills/security-ai-llm/SKILL.md +43 -0
- package/presets/opencode/skills/security-blue-team/SKILL.md +43 -0
- package/presets/opencode/skills/security-cloud/SKILL.md +43 -0
- package/presets/opencode/skills/security-crypto/SKILL.md +43 -0
- package/presets/opencode/skills/security-exploit-dev/SKILL.md +45 -0
- package/presets/opencode/skills/security-grc/SKILL.md +43 -0
- package/presets/opencode/skills/security-incident-response/SKILL.md +45 -0
- package/presets/opencode/skills/security-log-analysis/SKILL.md +43 -0
- package/presets/opencode/skills/security-malware-analysis/SKILL.md +44 -0
- package/presets/opencode/skills/security-mobile/SKILL.md +43 -0
- package/presets/opencode/skills/security-network/SKILL.md +43 -0
- package/presets/opencode/skills/security-ot-ics/SKILL.md +43 -0
- package/presets/opencode/skills/security-recon/SKILL.md +45 -0
- package/presets/opencode/skills/security-red-team/SKILL.md +44 -0
- package/presets/opencode/skills/security-reverse-engineering/SKILL.md +44 -0
- package/presets/opencode/skills/security-soc-automation/SKILL.md +43 -0
- package/presets/opencode/skills/security-threat-hunting/SKILL.md +43 -0
- package/presets/opencode/skills/security-vuln-assessment/SKILL.md +45 -0
- package/presets/opencode/skills/security-web/SKILL.md +44 -0
- package/src/presets/council/council.yml +12 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
[cc: alias] Author BACKLOG.md — wayfinding, grilling, create or append items,
|
|
4
|
+
validate with openspec, and plan OpenSpec change folders for /cc:openspec.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Backlog Authoring Workflow
|
|
8
|
+
|
|
9
|
+
Objectives: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
Create or append valid `BACKLOG.md` items and OpenSpec change docs. Do **not**
|
|
12
|
+
deliver implementation — that is `/cc:openspec`.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Step 0 — CCEP Bootstrap
|
|
17
|
+
|
|
18
|
+
Command: `backlog` (fixed for this workflow — do not infer from user text)
|
|
19
|
+
|
|
20
|
+
1. Run: `npx cc-codeconductor ccep parse --command backlog "$ARGUMENTS" --output json`
|
|
21
|
+
2. Run: `npx cc-codeconductor ccep resolve --command backlog "$ARGUMENTS" --output json`
|
|
22
|
+
3. Run: `npx cc-codeconductor ccep profile backlog --output json`
|
|
23
|
+
4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command backlog --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
|
|
24
|
+
5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Step 1 — Wayfinding (Repo Explorer role)
|
|
29
|
+
|
|
30
|
+
If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
|
|
31
|
+
`graphify path` / `graphify explain` when needed). Then adopt the **Repo
|
|
32
|
+
Explorer** role. Do not write `BACKLOG.md` in this step. Record a Repo Map so
|
|
33
|
+
Scope names real files or modules.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Step 2 — Relentless Grilling (Task Coach role)
|
|
38
|
+
|
|
39
|
+
Adopt the **Task Coach** role. Produce complete backlog item fields: title,
|
|
40
|
+
type, risk, scope, description, out of scope, measurable acceptance criteria.
|
|
41
|
+
|
|
42
|
+
Every assumption must survive one grilling question. Reject vague acceptance
|
|
43
|
+
("improve UX", "fix bugs").
|
|
44
|
+
|
|
45
|
+
If any field is missing or ambiguous, ask one clarifying question at a time.
|
|
46
|
+
|
|
47
|
+
**STOP here.** Unresolved grilling questions populate `questionsForUser` in the
|
|
48
|
+
CCEP-1 `planner-output`; `ccep evaluate --command backlog` halts until a human
|
|
49
|
+
answers. Do not write `BACKLOG.md` until that confirmation.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Step 3 — Write or append BACKLOG.md (Docs role)
|
|
54
|
+
|
|
55
|
+
Apply skill `backlog`.
|
|
56
|
+
|
|
57
|
+
- If `BACKLOG.md` is absent, create it from the canonical template. Set Global
|
|
58
|
+
`Product` from `package.json` `name` when present.
|
|
59
|
+
- If it exists, append new `### BC-xxx` items under `## Items`. Do not rewrite
|
|
60
|
+
`## Global` or `## Archive`.
|
|
61
|
+
- Next ID = max `BC-NNN` across Items and Archive, plus one.
|
|
62
|
+
- New items: Status `READY`, Progress `0%`, measurable Acceptance checklist.
|
|
63
|
+
|
|
64
|
+
Do **not** `git add` `BACKLOG.md` or `openspec/`.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Step 4 — Validate (mandatory gate)
|
|
69
|
+
|
|
70
|
+
Run:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx cc-codeconductor openspec validate
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
If validation fails:
|
|
77
|
+
|
|
78
|
+
1. List all errors and recommendations from the CLI output.
|
|
79
|
+
2. Show the canonical BACKLOG.md structure (## Global, ## Items, ### BC-001 | Title, Priority, Status, Type, Depends on, Description, Scope, Acceptance).
|
|
80
|
+
3. Fix the file and re-run validate. **STOP** planning until valid.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Step 5 — Plan new items
|
|
85
|
+
|
|
86
|
+
For each **new** `BC-xxx` from this run:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx cc-codeconductor openspec plan <BC-id>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Show TaskCards and `openspec/changes/<slug>/` (proposal, design, tasks, specs).
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Completion
|
|
97
|
+
|
|
98
|
+
Report: item IDs added, validate result, change folder paths.
|
|
99
|
+
|
|
100
|
+
Tell the user to run `/cc:openspec` (optionally `/cc:openspec BC-xxx`) to
|
|
101
|
+
deliver. Do not start delivery in this workflow.
|
|
102
|
+
|
|
103
|
+
Apply skill `backlog` for create/append rules. Apply skill `openspec` only for
|
|
104
|
+
format and state-machine reference.
|
|
@@ -27,7 +27,7 @@ If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"`. Invoke `
|
|
|
27
27
|
|
|
28
28
|
## Step 2 — Suggest next command (orchestrator)
|
|
29
29
|
|
|
30
|
-
Recommend exactly one next slash command (`/cc:feature`, `/cc:fix`, `/cc:refactor`, `/cc:review`, `/cc:triage`, …) with a one-sentence rationale. Do not start that workflow.
|
|
30
|
+
Recommend exactly one next slash command (`/cc:feature`, `/cc:fix`, `/cc:refactor`, `/cc:review`, `/cc:backlog`, `/cc:openspec`, `/cc:triage`, …) with a one-sentence rationale. Do not start that workflow.
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
@@ -96,6 +96,21 @@ Update BACKLOG item status to `PLANNED` (CLI does this automatically).
|
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
|
+
## Drive card status (CLI)
|
|
100
|
+
|
|
101
|
+
Do not edit `.codeconductor/openspec-state.json` by hand.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx cc-codeconductor openspec start <cardId>
|
|
105
|
+
npx cc-codeconductor openspec done <cardId>
|
|
106
|
+
npx cc-codeconductor openspec block <cardId> --reason "waiting on design"
|
|
107
|
+
npx cc-codeconductor openspec archive <itemId>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`start` moves the card `pending → doing` and the item `PLANNED → IN_PROGRESS`. `done` marks the card complete, updates Progress, and moves the item to `REVIEW` when every card is done and review is required. `archive` requires all cards done (and review evidence when Global review is required) and moves `openspec/changes/<slug>` to `archive/`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
99
114
|
## Step 4 — Model matrix and execute loop
|
|
100
115
|
|
|
101
116
|
Before executing phases, show resolved models:
|
|
@@ -125,7 +140,7 @@ Use the model configured in the installed preset for each agent role.
|
|
|
125
140
|
After each phase:
|
|
126
141
|
|
|
127
142
|
- Mark progress in deliverable summary.
|
|
128
|
-
-
|
|
143
|
+
- Run `npx cc-codeconductor openspec done <cardId>` when the phase completes. Do not edit openspec-state.json by hand.
|
|
129
144
|
|
|
130
145
|
Implementer: create a Git worktree before editing (`git worktree add ../<branch>-session <branch>`).
|
|
131
146
|
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: >-
|
|
3
|
+
[cc: alias] Run the authorized defensive security workflow — domain
|
|
4
|
+
security-* skills, authorization gate, risk-based routing, hardening, and review.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Defensive Security Workflow
|
|
8
|
+
|
|
9
|
+
Security objective: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
Provide the following information in $ARGUMENTS:
|
|
12
|
+
|
|
13
|
+
- What must be reviewed or hardened, and why
|
|
14
|
+
- Domain: a `security-*` skill id (recon, vuln-assessment, web, cloud, IR,
|
|
15
|
+
hunting, GRC, …) or `web-app` / `api` / `cloud-config` /
|
|
16
|
+
`dependency-supply-chain` / `secrets`
|
|
17
|
+
- Authorization: who authorized this work on this target, and the scope boundary
|
|
18
|
+
- Risk classification (`low`, `medium`, or `high`), if known
|
|
19
|
+
- Scope: which files, modules, repos, or environments are in and out of bounds
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Scope and authorization
|
|
24
|
+
|
|
25
|
+
This workflow performs **authorized defensive security work only**: threat
|
|
26
|
+
modeling, hardening, secure configuration, dependency and supply-chain review,
|
|
27
|
+
secret hygiene, and detection coverage.
|
|
28
|
+
|
|
29
|
+
Refuse outright and offer the defensive equivalent instead (threat model,
|
|
30
|
+
hardening, detection coverage, dependency audit):
|
|
31
|
+
|
|
32
|
+
- Exploit or proof-of-concept development
|
|
33
|
+
- Malware authoring, or malware analysis intended for reuse
|
|
34
|
+
- Reverse engineering aimed at bypassing a control
|
|
35
|
+
- Red-team playbooks
|
|
36
|
+
- Any unauthorized-access procedure
|
|
37
|
+
|
|
38
|
+
Scope is limited to the repository under analysis. Do not scan, probe, or
|
|
39
|
+
perform reconnaissance against third-party hosts.
|
|
40
|
+
|
|
41
|
+
Do not proceed without an authorization statement. Do not produce exploit
|
|
42
|
+
payloads, malware, or attack procedures.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Step 0 — CCEP Bootstrap
|
|
47
|
+
|
|
48
|
+
Command: `security` (fixed for this workflow — do not infer from user text)
|
|
49
|
+
|
|
50
|
+
1. Run: `npx cc-codeconductor ccep parse --command security "$ARGUMENTS" --output json`
|
|
51
|
+
2. Run: `npx cc-codeconductor ccep resolve --command security "$ARGUMENTS" --output json`
|
|
52
|
+
3. Run: `npx cc-codeconductor ccep profile security --output json`
|
|
53
|
+
4. After planner/intake JSON is available, run: `npx cc-codeconductor ccep evaluate --command security --input <planner.json> --output json`. If `stop` is true, show questions or risks and wait for human input.
|
|
54
|
+
5. Delegate to subagents using compiled CCEP prompts — never forward raw `$ARGUMENTS` to planners.
|
|
55
|
+
Canonical delivery order is test-before-implement whenever both phases apply.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Step 1 — Wayfinding (repo-explorer)
|
|
60
|
+
|
|
61
|
+
If `graphify-out/graph.json` exists, run `graphify query "$ARGUMENTS"` (and
|
|
62
|
+
`graphify path` / `graphify explain` when needed). Then invoke `repo-explorer`
|
|
63
|
+
to map modules, conventions, and impact radius. Do not write code in this step.
|
|
64
|
+
Record a Repo Map artifact before intake. Load the matching `security-*` skill
|
|
65
|
+
for the named domain (see `.claude/skills/security-*/SKILL.md`). Keep the OWASP
|
|
66
|
+
`security` skill for application-security reviews.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Step 2 — Task Card validation (task-coach)
|
|
71
|
+
|
|
72
|
+
Invoke `task-coach` with the security objective above.
|
|
73
|
+
|
|
74
|
+
task-coach must produce a Task Card that includes:
|
|
75
|
+
|
|
76
|
+
- Objective: what must be reviewed or hardened, in one sentence
|
|
77
|
+
- Domain: which `security-*` skill applies, or `web-app` / `api` /
|
|
78
|
+
`cloud-config` / `dependency-supply-chain` / `secrets`
|
|
79
|
+
- Authorization: who authorized this work on this target, and the scope boundary
|
|
80
|
+
- Risk classification: `low`, `medium`, or `high`
|
|
81
|
+
- Scope: which files or modules are likely affected
|
|
82
|
+
|
|
83
|
+
If authorization is absent, unclear, or names a system the requester does not
|
|
84
|
+
own or operate, **STOP and refuse. Do not route the task.**
|
|
85
|
+
|
|
86
|
+
Redact secrets, tokens, and credentials from any evidence before it enters the
|
|
87
|
+
Task Card. Summarize logs; do not paste env files.
|
|
88
|
+
|
|
89
|
+
**STOP here. Show the Task Card and wait for human confirmation.**
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Step 3 — Route by risk
|
|
94
|
+
|
|
95
|
+
Read the risk field from the Task Card and follow the corresponding route.
|
|
96
|
+
|
|
97
|
+
### Low-risk route
|
|
98
|
+
|
|
99
|
+
Applies when: the weakness is isolated, not exploitable in the current
|
|
100
|
+
configuration, and no authentication, secret, or dependency boundary is
|
|
101
|
+
involved.
|
|
102
|
+
|
|
103
|
+
Route: `task-coach` → `tester` → `implementer`
|
|
104
|
+
|
|
105
|
+
Proceed directly to Step 4 (tests), then Step 5a.
|
|
106
|
+
|
|
107
|
+
### Medium or high-risk route
|
|
108
|
+
|
|
109
|
+
Applies when: the work touches authentication, authorization, secrets,
|
|
110
|
+
cryptography, trust-boundary input validation, or a dependency upgrade.
|
|
111
|
+
|
|
112
|
+
Route: `task-coach` → `architect` → `tester` → `implementer` → `reviewer`
|
|
113
|
+
|
|
114
|
+
Invoke `architect` before implementation. architect must:
|
|
115
|
+
|
|
116
|
+
- Identify the weakness and the affected trust boundary
|
|
117
|
+
- Define the hardening approach and affected files
|
|
118
|
+
- Flag any regression risk to adjacent components
|
|
119
|
+
- Produce a Technical Plan
|
|
120
|
+
|
|
121
|
+
On **high** risk, also invoke `security-reviewer` before Reviewer.
|
|
122
|
+
|
|
123
|
+
**STOP here if high-risk. Show the Technical Plan and wait for human approval
|
|
124
|
+
before continuing.**
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Step 4 — Tests (tester)
|
|
129
|
+
|
|
130
|
+
Invoke `tester` for all risk levels.
|
|
131
|
+
|
|
132
|
+
tester must:
|
|
133
|
+
|
|
134
|
+
1. Write a regression test that proves the weakness exists and confirm it fails
|
|
135
|
+
before any change (RED)
|
|
136
|
+
2. Verify that existing tests still pass
|
|
137
|
+
3. Produce a Coverage Summary: test added, case covered
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Step 5a — Implementation, low-risk (implementer)
|
|
142
|
+
|
|
143
|
+
Invoke `implementer` with the Task Card.
|
|
144
|
+
Implementer creates a Git Worktree before touching any file; all edits happen inside it.
|
|
145
|
+
|
|
146
|
+
implementer must:
|
|
147
|
+
|
|
148
|
+
1. Apply the minimal hardening change — no unrelated changes
|
|
149
|
+
2. Run the suite and make the RED regression test pass
|
|
150
|
+
3. Produce an Implementation Summary: weakness, change applied, files changed
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Step 5b — Implementation, medium/high-risk (implementer)
|
|
155
|
+
|
|
156
|
+
Invoke `implementer` with the approved Technical Plan and the Task Card.
|
|
157
|
+
Implementer creates a Git Worktree before touching any file; all edits happen inside it.
|
|
158
|
+
|
|
159
|
+
implementer must follow the plan exactly. Any deviation requires a new Technical
|
|
160
|
+
Plan approval. After implementation, run the full test suite. No exploit code.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Step 6 — Review (Reviewer role) — medium/high-risk only
|
|
165
|
+
|
|
166
|
+
Invoke `reviewer` with the diff and Task Card. The Reviewer must apply the OWASP
|
|
167
|
+
rules in the `security` skill.
|
|
168
|
+
|
|
169
|
+
reviewer produces a Review Report with CRITICAL / WARNING / SUGGESTION findings.
|
|
170
|
+
If any CRITICAL findings exist, **STOP**. Do not close the task until they are
|
|
171
|
+
resolved.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Completion
|
|
176
|
+
|
|
177
|
+
Report: Task Card, Implementation Summary, regression test added, Review Report
|
|
178
|
+
(if applicable). The task is complete only when: the regression test passes, the
|
|
179
|
+
full suite passes, and no CRITICAL review findings remain.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Pre-commit Gate: Typecheck and Test
|
|
1
|
+
# Pre-commit Gate: Typecheck, Lint, and Test
|
|
2
2
|
|
|
3
|
-
Este gate instala un hook `pre-commit` que ejecuta `bun run typecheck` y `bun run test` antes de permitir commits en el repositorio. Si cualquiera de estos comandos falla, el commit es bloqueado.
|
|
3
|
+
Este gate instala un hook `pre-commit` que ejecuta `bun run typecheck`, `bun run lint` y `bun run test` antes de permitir commits en el repositorio. Si cualquiera de estos comandos falla, el commit es bloqueado.
|
|
4
4
|
|
|
5
5
|
## Cuándo usar
|
|
6
6
|
|
|
@@ -63,6 +63,7 @@ mkdir -p "$GIT_DIR/hooks"
|
|
|
63
63
|
cat > "$HOOK_PATH" << 'HOOK_EOF'
|
|
64
64
|
#!/bin/bash
|
|
65
65
|
bun run typecheck || exit 1
|
|
66
|
+
bun run lint || exit 1
|
|
66
67
|
bun run test || exit 1
|
|
67
68
|
HOOK_EOF
|
|
68
69
|
|
|
@@ -78,7 +79,7 @@ echo "Pre-commit hook installed successfully."
|
|
|
78
79
|
- **Resolución dinámica de git dir**: Usa `git rev-parse --git-dir` para localizar el directorio correcto, incluso en worktrees.
|
|
79
80
|
- **Detección de conflictos**: Si Husky o lint-staged ya está en `package.json`, el script avisa y no instala para evitar conflictos.
|
|
80
81
|
- **Protección de hooks existentes**: Si ya existe un `.git/hooks/pre-commit`, el script no lo sobrescribe.
|
|
81
|
-
- **Solo Bun**: El hook ejecuta `bun run typecheck` y `bun run test`. Asegúrate de que estos scripts están definidos en `package.json`.
|
|
82
|
+
- **Solo Bun**: El hook ejecuta `bun run typecheck`, `bun run lint` y `bun run test`. Asegúrate de que estos scripts están definidos en `package.json`.
|
|
82
83
|
|
|
83
84
|
## Verificación
|
|
84
85
|
|
|
@@ -121,7 +122,7 @@ Verifica que el hook es ejecutable:
|
|
|
121
122
|
|
|
122
123
|
chmod +x .git/hooks/pre-commit
|
|
123
124
|
|
|
124
|
-
Verifica que `bun run typecheck` y `bun run test` existen en `package.json`:
|
|
125
|
+
Verifica que `bun run typecheck`, `bun run lint` y `bun run test` existen en `package.json`:
|
|
125
126
|
|
|
126
127
|
cat package.json | grep -A 5 '"scripts"'
|
|
127
128
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backlog
|
|
3
|
+
description: >
|
|
4
|
+
Author BACKLOG.md and OpenSpec change folders for CodeConductor.
|
|
5
|
+
Trigger: /cc-backlog, /cc:backlog, creating or appending backlog items,
|
|
6
|
+
writing BACKLOG.md, or preparing work for /cc-openspec.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Backlog authoring
|
|
10
|
+
|
|
11
|
+
Use this skill to **create or append** `BACKLOG.md` and generate OpenSpec
|
|
12
|
+
change docs. Delivery of an existing item is `/cc-openspec` (skill `openspec`).
|
|
13
|
+
|
|
14
|
+
## BACKLOG.md contract
|
|
15
|
+
|
|
16
|
+
Canonical template: `presets/templates/BACKLOG.md` (or the installed copy).
|
|
17
|
+
Required sections:
|
|
18
|
+
|
|
19
|
+
- `## Global` — Product, Strategy, Policy, Review required, TDD required
|
|
20
|
+
- `## Items` — active entries
|
|
21
|
+
- `## Archive` — completed entries (never re-execute; never rewrite)
|
|
22
|
+
|
|
23
|
+
Each item: `### BC-001 | Short title` with Priority (P0–P3), Status, Type,
|
|
24
|
+
Depends on, Description, Scope, Out of scope, Acceptance (measurable checklist).
|
|
25
|
+
|
|
26
|
+
Status after grilling: `READY`. `openspec plan` then moves the item to `PLANNED`.
|
|
27
|
+
|
|
28
|
+
## Create vs append
|
|
29
|
+
|
|
30
|
+
- **No `BACKLOG.md`:** create it from the template. Set Global `Product` from
|
|
31
|
+
`package.json` `name` when present.
|
|
32
|
+
- **File exists:** append new `### BC-xxx` blocks under `## Items`. Do not
|
|
33
|
+
rewrite `## Global` or `## Archive`.
|
|
34
|
+
|
|
35
|
+
Next ID = max numeric suffix across Items and Archive, plus one, zero-padded
|
|
36
|
+
to three digits (`BC-013` after `BC-012`).
|
|
37
|
+
|
|
38
|
+
## Wayfinding (before Scope)
|
|
39
|
+
|
|
40
|
+
If `graphify-out/graph.json` exists, run `graphify query "<objectives>"` (and
|
|
41
|
+
`graphify path` / `graphify explain` when needed). Then invoke `repo-explorer`.
|
|
42
|
+
Scope must name real files or modules. Do not write `BACKLOG.md` in this step.
|
|
43
|
+
|
|
44
|
+
## Grilling (before write)
|
|
45
|
+
|
|
46
|
+
Invoke `task-coach`. One grilling question per assumption. Reject vague
|
|
47
|
+
acceptance ("improve UX", "fix bugs"). Criteria must be measurable (same rules
|
|
48
|
+
as `openspec validate` / `VAGUE_ACCEPTANCE`).
|
|
49
|
+
|
|
50
|
+
Unresolved questions go in `questionsForUser`. Run `ccep evaluate --command
|
|
51
|
+
backlog`. If `stop` is true, **STOP** and wait for the human.
|
|
52
|
+
|
|
53
|
+
Do not write items until the gate passes.
|
|
54
|
+
|
|
55
|
+
## Validate loop
|
|
56
|
+
|
|
57
|
+
After writing:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx cc-codeconductor openspec validate
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Local CodeConductor dogfood: `bun run dev openspec validate`.
|
|
64
|
+
|
|
65
|
+
If invalid: list errors and recommendations, show the canonical structure,
|
|
66
|
+
fix the file, re-validate. Do not plan until valid.
|
|
67
|
+
|
|
68
|
+
## Plan new items only
|
|
69
|
+
|
|
70
|
+
For each **new** `BC-xxx` this run:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx cc-codeconductor openspec plan BC-xxx
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
That writes `openspec/changes/<slug>/` (`proposal.md`, `design.md`, `tasks.md`,
|
|
77
|
+
`specs/`). Then tell the user to run `/cc-openspec` (optionally with the ID).
|
|
78
|
+
|
|
79
|
+
## Local artifacts — do not version
|
|
80
|
+
|
|
81
|
+
In consumer projects these paths are gitignored (see `init`):
|
|
82
|
+
|
|
83
|
+
- `BACKLOG.md`
|
|
84
|
+
- `openspec/`
|
|
85
|
+
- `.codeconductor/openspec-state.json`
|
|
86
|
+
|
|
87
|
+
Do **not** `git add` them. Do not edit `openspec-state.json` by hand.
|
|
88
|
+
|
|
89
|
+
## Delivery
|
|
90
|
+
|
|
91
|
+
Format and state machine: skill `openspec`. Authoring is this skill.
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
name: openspec
|
|
3
3
|
description:
|
|
4
4
|
OpenSpec backlog format, state machine, and delivery workflow for CodeConductor.
|
|
5
|
-
Use when running /cc:openspec or
|
|
5
|
+
Use when running /cc:openspec or delivering a BACKLOG.md item.
|
|
6
|
+
To create or append BACKLOG.md, use /cc:backlog (skill backlog).
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# OpenSpec / BACKLOG Skill
|
|
9
10
|
|
|
11
|
+
Authoring (create or append `BACKLOG.md`, then `openspec validate` / `plan`) is
|
|
12
|
+
`/cc:backlog` and skill `backlog`. This skill is **delivery**.
|
|
13
|
+
|
|
10
14
|
## BACKLOG.md contract
|
|
11
15
|
|
|
12
16
|
`BACKLOG.md` at repo root is the operational queue. Required sections:
|