cc-codeconductor 1.0.0 → 1.2.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 +326 -87
- package/dist/core/compilation/compile-checker.d.ts +2 -0
- package/dist/core/loop/loop-engine.d.ts +3 -0
- package/dist/core/verification/verification-runner.d.ts +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3825 -597
- package/dist/library.js +195 -18
- package/dist/validation/schemas.d.ts +461 -44
- package/package.json +4 -1
- package/presets/agy/AGENTS.md +13 -9
- package/presets/agy/gates/pre-commit/GATE.md +5 -4
- package/presets/agy/hooks.json +2 -2
- package/presets/agy/scripts/invoke-hook.cjs +115 -0
- package/presets/agy/skills/backlog/SKILL.md +61 -0
- package/presets/agy/skills/cc-spec-mutation/SKILL.md +165 -0
- package/presets/agy/skills/cc-tdd-cycle/SKILL.md +3 -0
- package/presets/agy/skills/evaluation/SKILL.md +61 -2
- package/presets/agy/skills/openspec/SKILL.md +50 -16
- 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/skills/testing-tdd/SKILL.md +53 -0
- package/presets/agy/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/agy/workflows/cc-api-contract.md +14 -0
- package/presets/agy/workflows/cc-ask.md +2 -1
- package/presets/agy/workflows/cc-backlog.md +69 -0
- package/presets/agy/workflows/cc-db-migration.md +14 -0
- package/presets/agy/workflows/cc-explore.md +1 -1
- package/presets/agy/workflows/cc-feature.md +18 -0
- package/presets/agy/workflows/cc-fix.md +14 -0
- package/presets/agy/workflows/cc-iterative.md +14 -0
- package/presets/agy/workflows/cc-openspec.md +17 -1
- package/presets/agy/workflows/cc-scorecard.md +2 -0
- package/presets/agy/workflows/cc-security.md +180 -0
- package/presets/agy/workflows/cc-spec-mutation.md +191 -0
- package/presets/agy/workflows/cc-tdd-cycle.md +14 -0
- package/presets/claude/CLAUDE.md +4 -0
- package/presets/claude/commands/cc/api-contract.md +14 -0
- package/presets/claude/commands/cc/ask.md +2 -1
- package/presets/claude/commands/cc/backlog.md +104 -0
- package/presets/claude/commands/cc/db-migration.md +14 -0
- package/presets/claude/commands/cc/explore.md +1 -1
- package/presets/claude/commands/cc/feature.md +18 -0
- package/presets/claude/commands/cc/fix.md +17 -0
- package/presets/claude/commands/cc/iterative.md +14 -0
- package/presets/claude/commands/cc/openspec.md +30 -1
- package/presets/claude/commands/cc/review.md +3 -0
- package/presets/claude/commands/cc/scorecard.md +2 -0
- package/presets/claude/commands/cc/security.md +179 -0
- package/presets/claude/commands/cc/spec-mutation.md +190 -0
- package/presets/claude/commands/cc/tdd-cycle.md +17 -0
- package/presets/claude/gates/pre-commit/GATE.md +5 -4
- package/presets/claude/settings.json +13 -11
- package/presets/claude/skills/backlog/SKILL.md +61 -0
- package/presets/claude/skills/evaluation/SKILL.md +47 -24
- package/presets/claude/skills/openspec/SKILL.md +46 -34
- 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/claude/skills/testing-tdd/SKILL.md +53 -0
- package/presets/claude/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/codex/AGENTS.md +16 -12
- package/presets/codex/commands/cc-ask.md +2 -1
- package/presets/codex/gates/pre-commit/GATE.md +5 -4
- package/presets/codex/skills/backlog/SKILL.md +61 -0
- package/presets/codex/skills/cc-api-contract/SKILL.md +87 -0
- package/presets/codex/skills/cc-backlog/SKILL.md +108 -0
- package/presets/codex/skills/cc-clarify/SKILL.md +36 -0
- package/presets/codex/skills/cc-council/SKILL.md +92 -0
- package/presets/codex/skills/cc-db-migration/SKILL.md +88 -0
- package/presets/codex/skills/cc-explore/SKILL.md +40 -0
- package/presets/codex/skills/cc-feature/SKILL.md +154 -0
- package/presets/codex/skills/cc-fix/SKILL.md +165 -0
- package/presets/codex/skills/cc-handoff/SKILL.md +45 -0
- package/presets/codex/skills/cc-iterative/SKILL.md +150 -0
- package/presets/codex/skills/cc-openspec/SKILL.md +191 -0
- package/presets/codex/skills/cc-pagespeed/SKILL.md +124 -0
- package/presets/codex/skills/cc-prototype/SKILL.md +42 -0
- package/presets/codex/skills/cc-refactor/SKILL.md +163 -0
- package/presets/codex/skills/cc-review/SKILL.md +152 -0
- package/presets/codex/skills/cc-scorecard/SKILL.md +82 -0
- package/presets/codex/skills/cc-security/SKILL.md +182 -0
- package/presets/codex/skills/cc-spec-mutation/SKILL.md +192 -0
- package/presets/codex/skills/cc-tdd-cycle/SKILL.md +266 -0
- package/presets/codex/skills/cc-test-plan/SKILL.md +153 -0
- package/presets/codex/skills/cc-triage/SKILL.md +38 -0
- package/presets/codex/skills/evaluation/SKILL.md +65 -0
- package/presets/codex/skills/openspec/SKILL.md +66 -0
- package/presets/codex/skills/testing-tdd/SKILL.md +53 -0
- package/presets/codex/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/cursor/AGENTS.md +2 -2
- package/presets/cursor/commands/cc/api-contract.md +14 -0
- package/presets/cursor/commands/cc/ask.md +2 -1
- package/presets/cursor/commands/cc/backlog.md +105 -0
- package/presets/cursor/commands/cc/db-migration.md +14 -0
- package/presets/cursor/commands/cc/explore.md +1 -1
- package/presets/cursor/commands/cc/feature.md +18 -0
- package/presets/cursor/commands/cc/fix.md +17 -0
- package/presets/cursor/commands/cc/iterative.md +14 -0
- package/presets/cursor/commands/cc/openspec.md +30 -1
- package/presets/cursor/commands/cc/scorecard.md +2 -0
- package/presets/cursor/commands/cc/security.md +179 -0
- package/presets/cursor/commands/cc/spec-mutation.md +190 -0
- package/presets/cursor/commands/cc/tdd-cycle.md +14 -0
- package/presets/cursor/gates/pre-commit/GATE.md +5 -4
- package/presets/cursor/skills/backlog/SKILL.md +61 -0
- package/presets/cursor/skills/evaluation/SKILL.md +61 -4
- package/presets/cursor/skills/openspec/SKILL.md +47 -33
- 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/cursor/skills/testing-tdd/SKILL.md +35 -574
- package/presets/cursor/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/gemini/commands/cc/api-contract.toml +82 -0
- package/presets/gemini/commands/cc/ask.toml +54 -0
- package/presets/gemini/commands/cc/backlog.toml +103 -0
- package/presets/gemini/commands/cc/clarify.toml +31 -0
- package/presets/gemini/commands/cc/council.toml +87 -0
- package/presets/gemini/commands/cc/db-migration.toml +83 -0
- package/presets/gemini/commands/cc/explore.toml +35 -0
- package/presets/gemini/commands/cc/feature.toml +153 -0
- package/presets/gemini/commands/cc/fix.toml +163 -0
- package/presets/gemini/commands/cc/handoff.toml +40 -0
- package/presets/gemini/commands/cc/iterative.toml +145 -0
- package/presets/gemini/commands/cc/openspec.toml +186 -0
- package/presets/gemini/commands/cc/pagespeed.toml +119 -0
- package/presets/gemini/commands/cc/prototype.toml +37 -0
- package/presets/gemini/commands/cc/refactor.toml +158 -0
- package/presets/gemini/commands/cc/review.toml +150 -0
- package/presets/gemini/commands/cc/scorecard.toml +77 -0
- package/presets/gemini/commands/cc/security.toml +177 -0
- package/presets/gemini/commands/cc/spec-mutation.toml +187 -0
- package/presets/gemini/commands/cc/tdd-cycle.toml +264 -0
- package/presets/gemini/commands/cc/test-plan.toml +148 -0
- package/presets/gemini/commands/cc/triage.toml +33 -0
- package/presets/opencode/README.md +24 -21
- package/presets/opencode/agents/architect.md +6 -0
- package/presets/opencode/agents/implementer.md +7 -0
- package/presets/opencode/agents/reviewer.md +6 -0
- package/presets/opencode/agents/tester.md +6 -0
- package/presets/opencode/commands/cc-api-contract.md +14 -0
- package/presets/opencode/commands/cc-ask.md +2 -1
- package/presets/opencode/commands/cc-backlog.md +68 -0
- package/presets/opencode/commands/cc-db-migration.md +14 -0
- package/presets/opencode/commands/cc-explore.md +1 -1
- package/presets/opencode/commands/cc-feature.md +18 -0
- package/presets/opencode/commands/cc-fix.md +17 -0
- package/presets/opencode/commands/cc-iterative.md +14 -0
- package/presets/opencode/commands/cc-openspec.md +17 -1
- package/presets/opencode/commands/cc-scorecard.md +2 -0
- package/presets/opencode/commands/cc-security.md +179 -0
- package/presets/opencode/commands/cc-spec-mutation.md +190 -0
- package/presets/opencode/commands/cc-tdd-cycle.md +14 -0
- package/presets/opencode/gates/pre-commit/GATE.md +5 -4
- package/presets/opencode/opencode.jsonc +1 -1
- package/presets/opencode/prompts/v1.0.0/architect.md +6 -0
- package/presets/opencode/prompts/v1.0.0/implementer.md +7 -0
- package/presets/opencode/prompts/v1.0.0/reviewer.md +6 -0
- package/presets/opencode/prompts/v1.0.0/tester.md +6 -0
- package/presets/opencode/skills/backlog/SKILL.md +61 -0
- package/presets/opencode/skills/evaluation/SKILL.md +61 -2
- package/presets/opencode/skills/openspec/SKILL.md +47 -31
- 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/presets/opencode/skills/testing-tdd/SKILL.md +35 -574
- package/presets/opencode/skills/using-cc-skills/SKILL.md +48 -0
- package/presets/shared/__pycache__/mutation_runner.cpython-314.pyc +0 -0
- package/presets/shared/invoke-hook.cjs +115 -0
- package/presets/shared/mutation_runner.py +273 -0
- package/src/presets/council/council.yml +12 -0
- package/src/presets/manifests/agy.yml +2 -0
- package/src/presets/manifests/claude.yml +3 -0
- package/src/presets/manifests/gemini.yml +15 -0
- package/src/presets/models/agy.yml +24 -24
- package/src/presets/models/claude.yml +10 -10
- package/src/presets/models/codex.yml +10 -10
- package/src/presets/models/cursor.yml +10 -10
- package/src/presets/models/gemini.yml +10 -10
- package/src/presets/models/opencode.yml +10 -10
- package/presets/agy/scripts/post-tool.sh +0 -25
- package/presets/agy/scripts/pre-tool.sh +0 -56
|
@@ -1,42 +1,65 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: evaluation
|
|
3
3
|
description:
|
|
4
|
-
|
|
5
|
-
Use when running /cc
|
|
4
|
+
Guides agents through scorecards, outcomes, model profiles, and eval suites.
|
|
5
|
+
Use when running /cc-scorecard or /cc:scorecard, measuring a deliverable, or
|
|
6
|
+
checking workflow gates with suite-run.
|
|
6
7
|
---
|
|
7
8
|
|
|
8
|
-
# Evaluation
|
|
9
|
+
# Evaluation
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Overview
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
A scorecard measures the deliverable against eight weighted criteria. Spec
|
|
14
|
+
quality checklists are reviewer-owned. "Seems right" is not a verdict.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
Pass threshold: weighted score >= 2.0 and no criterion at 0.
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
- After implement/review, before `openspec archive`
|
|
21
|
+
- Comparing models or prompt versions
|
|
22
|
+
- Proving the workflow tools still work (`suite-run`)
|
|
23
|
+
|
|
24
|
+
**NOT** for rewriting specs (reviewer checklist) or for implementing code.
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
Local: `bun run dev`. Published: `npx cc-codeconductor`.
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
scorecard create --task BC-001 --from-diff
|
|
32
|
+
scorecard record --task BC-001 --verdict PASS --score 2.5
|
|
33
|
+
scorecard list | aggregate | models | regression | matrix | compare-models
|
|
34
|
+
scorecard prompt-diff 0.4.0 0.5.0 --agent architect
|
|
35
|
+
scorecard experiment start --suite harness-v1
|
|
36
|
+
scorecard suite-run --suite workflow-gates
|
|
37
|
+
scorecard suite-run --suite hook-guardrails
|
|
38
|
+
scorecard suite-run --suite scorecard-signals
|
|
26
39
|
```
|
|
27
40
|
|
|
28
|
-
|
|
41
|
+
`openspec analyze` can auto-suggest `acceptance` / `tests` on `--from-diff`.
|
|
42
|
+
Archive needs PASS when review is required.
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
Outcomes append to `.codeconductor/evaluation/outcomes.jsonl`.
|
|
31
45
|
|
|
32
|
-
|
|
46
|
+
## Common Rationalizations
|
|
33
47
|
|
|
34
|
-
|
|
48
|
+
| Rationalization | Reality |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| I'll fill the scorecard by hand without a diff | Use `--from-diff` and runner evidence. |
|
|
51
|
+
| Suites are optional toys | `suite-run` is the workflow tool that proves gates. |
|
|
52
|
+
| Handmade TDD JSON is fine | The runner rejects it. |
|
|
35
53
|
|
|
36
|
-
|
|
54
|
+
## Red Flags
|
|
37
55
|
|
|
38
|
-
|
|
56
|
+
- PASS with a criterion at 0
|
|
57
|
+
- Archive without a recorded scorecard when review is required
|
|
58
|
+
- Declaring the workflow ready without `suite-run` or `scorecard record`
|
|
39
59
|
|
|
40
|
-
##
|
|
60
|
+
## Verification
|
|
41
61
|
|
|
42
|
-
|
|
62
|
+
- [ ] Scorecard created from diff (or explicit scores)
|
|
63
|
+
- [ ] Verdict PASS / REVISE / REJECT recorded
|
|
64
|
+
- [ ] For process changes: `scorecard suite-run --suite hook-guardrails` (and
|
|
65
|
+
`workflow-gates` / `scorecard-signals` when those gates changed)
|
|
@@ -1,54 +1,66 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: openspec
|
|
3
3
|
description:
|
|
4
|
-
|
|
5
|
-
Use when running /cc
|
|
4
|
+
Guides agents through OpenSpec delivery from BACKLOG.md (validate, analyze,
|
|
5
|
+
test-before-implement, scorecard, archive). Use when running /cc-openspec,
|
|
6
|
+
/cc:openspec, or delivering an existing backlog item. Authoring BACKLOG.md
|
|
7
|
+
is skill backlog, not this skill.
|
|
6
8
|
---
|
|
7
9
|
|
|
8
|
-
# OpenSpec
|
|
10
|
+
# OpenSpec delivery
|
|
9
11
|
|
|
10
|
-
##
|
|
12
|
+
## Overview
|
|
11
13
|
|
|
12
|
-
`BACKLOG.md`
|
|
14
|
+
This skill delivers an existing `BACKLOG.md` item. It is a workflow with CLI
|
|
15
|
+
gates, not a reference doc. Specs describe WHAT; `design.md` describes HOW.
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
- `## Items` — active backlog entries
|
|
16
|
-
- `## Archive` — completed entries (do not re-execute)
|
|
17
|
+
## When to Use
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
- `/cc-openspec` or `openspec next` / `plan` / `done` / `archive`
|
|
20
|
+
- An item is `READY` or later and must move through the state machine
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
**NOT** for creating `BACKLOG.md` (use skill `backlog`) or for stack-specific
|
|
23
|
+
coding rules.
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
## Process
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
Local CLI is `bun run dev`. Published package is `npx cc-codeconductor`.
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
1. `openspec validate` — must pass before delivery.
|
|
30
|
+
2. `openspec plan BC-xxx` if the item is not yet `PLANNED`.
|
|
31
|
+
3. `openspec analyze --output json` — CRITICAL findings exit 1. Do not implement.
|
|
32
|
+
4. Phases: discover (`repo-explorer`) → design (`architect`) → test (`tester`) →
|
|
33
|
+
implement (`implementer`) → review (`reviewer`). If Global `TDD required: yes`,
|
|
34
|
+
test runs before implement.
|
|
35
|
+
5. `openspec done` on test/implement requires `captureTddSuiteEvidence`. Handmade
|
|
36
|
+
evidence JSON is rejected.
|
|
37
|
+
6. `scorecard create --task BC-xxx --from-diff` then record a verdict.
|
|
38
|
+
7. `openspec archive` only after human review when `Review required: yes` and
|
|
39
|
+
the scorecard is PASS.
|
|
27
40
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
npx cc-codeconductor openspec plan BC-001
|
|
32
|
-
npx cc-codeconductor openspec status
|
|
33
|
-
npx cc-codeconductor openspec next
|
|
34
|
-
```
|
|
41
|
+
Status machine: `TODO` → `READY` → `PLANNED` → `IN_PROGRESS` → `REVIEW` → `DONE`
|
|
42
|
+
→ Archive. `BLOCKED` returns to `READY`. Reviewer rejection: `REVIEW` →
|
|
43
|
+
`IN_PROGRESS`.
|
|
35
44
|
|
|
36
|
-
##
|
|
45
|
+
## Common Rationalizations
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
| Rationalization | Reality |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| Validate is bureaucracy | `openspec validate` is the gate. Skipping it is a defect. |
|
|
50
|
+
| I'll add tests after green | Global TDD required means tester before implementer. |
|
|
51
|
+
| I'll write the evidence JSON myself | Handmade TDD JSON is rejected. Use the verification runner. |
|
|
52
|
+
| The item is small; skip analyze | `openspec analyze` CRITICAL still stops implement. |
|
|
39
53
|
|
|
40
|
-
##
|
|
54
|
+
## Red Flags
|
|
41
55
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
| design | architect |
|
|
46
|
-
| test | tester |
|
|
47
|
-
| implement | implementer |
|
|
48
|
-
| review | reviewer |
|
|
56
|
+
- Implementing while analyze reports CRITICAL
|
|
57
|
+
- Archive without a PASS scorecard when review is required
|
|
58
|
+
- Acceptance like "improve UX" with no measurable check
|
|
49
59
|
|
|
50
|
-
|
|
60
|
+
## Verification
|
|
51
61
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
- [ ] `openspec validate` exit 0
|
|
63
|
+
- [ ] `openspec analyze --output json` has no CRITICAL
|
|
64
|
+
- [ ] TDD evidence from the runner when TDD is required
|
|
65
|
+
- [ ] `scorecard create --from-diff` recorded
|
|
66
|
+
- [ ] Suite check (optional): `bun run dev scorecard suite-run --suite workflow-gates`
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: security
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
name: Security
|
|
5
|
+
description: >
|
|
6
|
+
Provides expert knowledge for implementing and reviewing application security following OWASP Top 10 (2021), with stack-specific patterns for Spring Boot, Django, Next.js, and Astro.
|
|
7
|
+
|
|
8
|
+
user-invokable: true
|
|
9
|
+
license: MIT
|
|
10
|
+
metadata:
|
|
11
|
+
author: lgzarturo
|
|
12
|
+
category: security
|
|
13
|
+
|
|
14
|
+
compatibility:
|
|
15
|
+
tools: [claude, codex, gemini, agy, opencode]
|
|
16
|
+
stacks:
|
|
17
|
+
languages: []
|
|
18
|
+
frameworks: []
|
|
19
|
+
|
|
20
|
+
risk:
|
|
21
|
+
level: high
|
|
22
|
+
can_execute_shell: false
|
|
23
|
+
can_modify_files: true
|
|
24
|
+
requires_network: false
|
|
25
|
+
|
|
26
|
+
inputs: []
|
|
27
|
+
|
|
28
|
+
outputs: []
|
|
29
|
+
|
|
30
|
+
quality:
|
|
31
|
+
reviewed_by: codeconductor-core
|
|
32
|
+
version: 0.1.0
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# Security
|
|
38
|
+
|
|
39
|
+
## OWASP Top 10 (2021) — Quick Reference
|
|
40
|
+
|
|
41
|
+
| # | Category | What to check |
|
|
42
|
+
|---|----------|--------------|
|
|
43
|
+
| A01 | Broken Access Control | Is authorization enforced on every endpoint? |
|
|
44
|
+
| A02 | Cryptographic Failures | Are secrets encrypted at rest and in transit? |
|
|
45
|
+
| A03 | Injection | Is all input sanitized or parameterized? |
|
|
46
|
+
| A04 | Insecure Design | Is the threat model documented? |
|
|
47
|
+
| A05 | Security Misconfiguration | Are defaults changed? Debug off in prod? |
|
|
48
|
+
| A06 | Vulnerable Components | Are dependencies up to date? |
|
|
49
|
+
| A07 | Auth & Session Failures | Are sessions invalidated on logout? Token expiry set? |
|
|
50
|
+
| A08 | Software Integrity Failures | Are supply-chain dependencies verified? |
|
|
51
|
+
| A09 | Logging & Monitoring Failures | Are security events logged without leaking PII? |
|
|
52
|
+
| A10 | SSRF | Are outbound URLs allowlisted? |
|
|
53
|
+
|
|
54
|
+
## Input Validation
|
|
55
|
+
|
|
56
|
+
Validate all input at system boundaries. Never trust data from: HTTP request
|
|
57
|
+
body, query parameters, headers, cookies, or environment variables passed by
|
|
58
|
+
external systems.
|
|
59
|
+
|
|
60
|
+
**Rules:**
|
|
61
|
+
|
|
62
|
+
- Validate type, format, length, and range
|
|
63
|
+
- Reject unknown fields — do not silently ignore them
|
|
64
|
+
- Use allowlists (accept known-good), not blocklists (reject known-bad)
|
|
65
|
+
- Validate at the API layer before it reaches the service layer
|
|
66
|
+
|
|
67
|
+
```kotlin
|
|
68
|
+
// Spring Boot — Bean Validation
|
|
69
|
+
data class CreateUserRequest(
|
|
70
|
+
@field:NotBlank @field:Email val email: String,
|
|
71
|
+
@field:Size(min = 8, max = 72) val password: String,
|
|
72
|
+
@field:Size(max = 100) val name: String
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
@PostMapping
|
|
76
|
+
fun createUser(@Valid @RequestBody request: CreateUserRequest): ResponseEntity<UserResponse> {
|
|
77
|
+
// request is guaranteed valid here
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
# Django REST Framework — serializer validation
|
|
83
|
+
class CreateUserSerializer(serializers.Serializer):
|
|
84
|
+
email = serializers.EmailField(max_length=254)
|
|
85
|
+
password = serializers.CharField(min_length=8, max_length=72, write_only=True)
|
|
86
|
+
name = serializers.CharField(max_length=100)
|
|
87
|
+
|
|
88
|
+
def validate_email(self, value):
|
|
89
|
+
if User.objects.filter(email=value).exists():
|
|
90
|
+
raise serializers.ValidationError("Email already registered.")
|
|
91
|
+
return value.lower()
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
// Next.js / Astro — Zod
|
|
96
|
+
import { z } from 'zod';
|
|
97
|
+
|
|
98
|
+
const CreateUserSchema = z.object({
|
|
99
|
+
email: z.string().email().max(254),
|
|
100
|
+
password: z.string().min(8).max(72),
|
|
101
|
+
name: z.string().max(100),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const result = CreateUserSchema.safeParse(body);
|
|
105
|
+
if (!result.success) {
|
|
106
|
+
return Response.json({ error: result.error.flatten() }, { status: 400 });
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Authentication
|
|
111
|
+
|
|
112
|
+
### JWT (Stateless)
|
|
113
|
+
|
|
114
|
+
Use JWTs for stateless API authentication. Keep access tokens short-lived.
|
|
115
|
+
|
|
116
|
+
**Token lifetimes:**
|
|
117
|
+
|
|
118
|
+
| Token | Lifetime | Storage |
|
|
119
|
+
|-------|----------|---------|
|
|
120
|
+
| Access token | 15 minutes | Memory (never localStorage) |
|
|
121
|
+
| Refresh token | 7–30 days | HttpOnly cookie |
|
|
122
|
+
|
|
123
|
+
Never store access tokens in `localStorage` — XSS can read them. Store in
|
|
124
|
+
memory (React state, module variable) and refresh via the HttpOnly cookie.
|
|
125
|
+
|
|
126
|
+
```kotlin
|
|
127
|
+
// Spring Security 6 + JWT
|
|
128
|
+
@Configuration
|
|
129
|
+
@EnableWebSecurity
|
|
130
|
+
class SecurityConfig(private val jwtFilter: JwtAuthenticationFilter) {
|
|
131
|
+
|
|
132
|
+
@Bean
|
|
133
|
+
fun filterChain(http: HttpSecurity): SecurityFilterChain = http
|
|
134
|
+
.csrf { it.disable() } // stateless API — CSRF not needed
|
|
135
|
+
.sessionManagement { it.sessionCreationPolicy(SessionCreationPolicy.STATELESS) }
|
|
136
|
+
.authorizeHttpRequests { auth ->
|
|
137
|
+
auth
|
|
138
|
+
.requestMatchers("/api/auth/**").permitAll()
|
|
139
|
+
.requestMatchers("/api/admin/**").hasRole("ADMIN")
|
|
140
|
+
.anyRequest().authenticated()
|
|
141
|
+
}
|
|
142
|
+
.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter::class.java)
|
|
143
|
+
.build()
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
# Django — djangorestframework-simplejwt
|
|
149
|
+
# settings.py
|
|
150
|
+
SIMPLE_JWT = {
|
|
151
|
+
"ACCESS_TOKEN_LIFETIME": timedelta(minutes=15),
|
|
152
|
+
"REFRESH_TOKEN_LIFETIME": timedelta(days=7),
|
|
153
|
+
"ROTATE_REFRESH_TOKENS": True,
|
|
154
|
+
"BLACKLIST_AFTER_ROTATION": True,
|
|
155
|
+
"ALGORITHM": "HS256",
|
|
156
|
+
"AUTH_HEADER_TYPES": ("Bearer",),
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
// Next.js — Auth.js (NextAuth v5)
|
|
162
|
+
// auth.ts
|
|
163
|
+
import NextAuth from 'next-auth';
|
|
164
|
+
import Credentials from 'next-auth/providers/credentials';
|
|
165
|
+
|
|
166
|
+
export const { auth, signIn, signOut } = NextAuth({
|
|
167
|
+
providers: [
|
|
168
|
+
Credentials({
|
|
169
|
+
authorize: async (credentials) => {
|
|
170
|
+
// validate and return user or null
|
|
171
|
+
},
|
|
172
|
+
}),
|
|
173
|
+
],
|
|
174
|
+
session: { strategy: 'jwt', maxAge: 7 * 24 * 60 * 60 },
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Password Hashing
|
|
179
|
+
|
|
180
|
+
Never store plaintext passwords. Never use MD5 or SHA-1 for password hashing.
|
|
181
|
+
|
|
182
|
+
| Algorithm | Use | Work factor |
|
|
183
|
+
|-----------|-----|-------------|
|
|
184
|
+
| bcrypt | default | cost=12 |
|
|
185
|
+
| Argon2id | preferred when available | m=65536, t=3 |
|
|
186
|
+
| PBKDF2 | FIPS environments | iterations=600000 |
|
|
187
|
+
|
|
188
|
+
```kotlin
|
|
189
|
+
// Spring Security uses bcrypt by default
|
|
190
|
+
@Bean
|
|
191
|
+
fun passwordEncoder(): PasswordEncoder = BCryptPasswordEncoder(12)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
```python
|
|
195
|
+
# Django uses PBKDF2 by default; switch to Argon2 for stronger hashing
|
|
196
|
+
# pip install django[argon2]
|
|
197
|
+
PASSWORD_HASHERS = [
|
|
198
|
+
"django.contrib.auth.hashers.Argon2PasswordHasher",
|
|
199
|
+
"django.contrib.auth.hashers.PBKDF2PasswordHasher", # fallback for existing hashes
|
|
200
|
+
]
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Authorization
|
|
204
|
+
|
|
205
|
+
**Principle of least privilege:** every endpoint must explicitly declare who
|
|
206
|
+
can access it. Deny by default.
|
|
207
|
+
|
|
208
|
+
```kotlin
|
|
209
|
+
// Spring — method-level security
|
|
210
|
+
@PreAuthorize("hasRole('ADMIN') or #userId == authentication.name")
|
|
211
|
+
fun getUser(userId: String): UserResponse { ... }
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
# Django REST Framework
|
|
216
|
+
class UserDetailView(RetrieveUpdateAPIView):
|
|
217
|
+
permission_classes = [IsAuthenticated, IsOwnerOrAdmin]
|
|
218
|
+
queryset = User.objects.all()
|
|
219
|
+
|
|
220
|
+
class IsOwnerOrAdmin(BasePermission):
|
|
221
|
+
def has_object_permission(self, request, view, obj):
|
|
222
|
+
return request.user.is_staff or obj == request.user
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Always check authorization at the **object level**, not just the endpoint
|
|
226
|
+
level. An authenticated user should not be able to access another user's data
|
|
227
|
+
by changing an ID in the URL.
|
|
228
|
+
|
|
229
|
+
## CORS
|
|
230
|
+
|
|
231
|
+
```kotlin
|
|
232
|
+
// Spring Boot — explicit allowlist; never use "*" in production
|
|
233
|
+
@Bean
|
|
234
|
+
fun corsConfigurationSource(): CorsConfigurationSource {
|
|
235
|
+
val config = CorsConfiguration().apply {
|
|
236
|
+
allowedOrigins = listOf("https://app.example.com")
|
|
237
|
+
allowedMethods = listOf("GET", "POST", "PUT", "DELETE")
|
|
238
|
+
allowedHeaders = listOf("Authorization", "Content-Type")
|
|
239
|
+
allowCredentials = true
|
|
240
|
+
maxAge = 3600L
|
|
241
|
+
}
|
|
242
|
+
return UrlBasedCorsConfigurationSource().apply {
|
|
243
|
+
registerCorsConfiguration("/api/**", config)
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
# Django — django-cors-headers
|
|
250
|
+
CORS_ALLOWED_ORIGINS = [
|
|
251
|
+
"https://app.example.com",
|
|
252
|
+
]
|
|
253
|
+
CORS_ALLOW_CREDENTIALS = True
|
|
254
|
+
CORS_ALLOW_ALL_ORIGINS = False # never True in production
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Security Headers
|
|
258
|
+
|
|
259
|
+
Set these headers on every response. They defend against XSS, clickjacking,
|
|
260
|
+
and MIME sniffing.
|
|
261
|
+
|
|
262
|
+
```text
|
|
263
|
+
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
|
|
264
|
+
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'
|
|
265
|
+
X-Frame-Options: DENY
|
|
266
|
+
X-Content-Type-Options: nosniff
|
|
267
|
+
Referrer-Policy: strict-origin-when-cross-origin
|
|
268
|
+
Permissions-Policy: camera=(), microphone=(), geolocation=()
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
// Next.js — next.config.ts
|
|
273
|
+
const securityHeaders = [
|
|
274
|
+
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
275
|
+
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
276
|
+
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
|
|
277
|
+
{
|
|
278
|
+
key: 'Strict-Transport-Security',
|
|
279
|
+
value: 'max-age=63072000; includeSubDomains; preload',
|
|
280
|
+
},
|
|
281
|
+
];
|
|
282
|
+
|
|
283
|
+
export default {
|
|
284
|
+
headers: async () => [
|
|
285
|
+
{ source: '/(.*)', headers: securityHeaders },
|
|
286
|
+
],
|
|
287
|
+
};
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Secrets Management
|
|
291
|
+
|
|
292
|
+
**Never commit secrets to source control.** No exceptions.
|
|
293
|
+
|
|
294
|
+
```text
|
|
295
|
+
✗ DATABASE_URL = "postgres://user:password@prod.example.com/db" # in source
|
|
296
|
+
✓ DATABASE_URL = env("DATABASE_URL") # from environment
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Rules:
|
|
300
|
+
|
|
301
|
+
- Load secrets from environment variables or a secrets manager (AWS Secrets
|
|
302
|
+
Manager, Vault, GCP Secret Manager)
|
|
303
|
+
- Rotate credentials on any suspected exposure
|
|
304
|
+
- Use separate credentials per environment (dev, staging, prod)
|
|
305
|
+
- Add `.env` to `.gitignore` and never commit it
|
|
306
|
+
|
|
307
|
+
```python
|
|
308
|
+
# Django — django-environ
|
|
309
|
+
import environ
|
|
310
|
+
env = environ.Env()
|
|
311
|
+
environ.Env.read_env() # reads .env in development only
|
|
312
|
+
|
|
313
|
+
SECRET_KEY = env("SECRET_KEY")
|
|
314
|
+
DATABASE_URL = env.db("DATABASE_URL")
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Rate Limiting
|
|
318
|
+
|
|
319
|
+
Protect authentication endpoints. Brute-force without rate limiting can
|
|
320
|
+
compromise any account with a weak password.
|
|
321
|
+
|
|
322
|
+
```kotlin
|
|
323
|
+
// Spring Boot — Bucket4j
|
|
324
|
+
@Component
|
|
325
|
+
class RateLimitFilter(private val rateLimiter: RateLimiter) : OncePerRequestFilter() {
|
|
326
|
+
|
|
327
|
+
override fun doFilterInternal(request: HttpServletRequest, response: HttpServletResponse, chain: FilterChain) {
|
|
328
|
+
if (request.requestURI.startsWith("/api/auth/")) {
|
|
329
|
+
val probe = rateLimiter.tryConsumeAndReturnRemaining(1)
|
|
330
|
+
if (!probe.isConsumed) {
|
|
331
|
+
response.status = HttpStatus.TOO_MANY_REQUESTS.value()
|
|
332
|
+
return
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
chain.doFilter(request, response)
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Minimum rate limits for auth endpoints: 5 requests per minute per IP. Stricter
|
|
341
|
+
limits (e.g., 3 per 15 minutes) are better for login endpoints.
|
|
342
|
+
|
|
343
|
+
## SQL Injection Prevention
|
|
344
|
+
|
|
345
|
+
Never concatenate user input into SQL strings. Always use parameterized queries
|
|
346
|
+
or an ORM.
|
|
347
|
+
|
|
348
|
+
```kotlin
|
|
349
|
+
// bad — SQL injection risk
|
|
350
|
+
val user = jdbcTemplate.queryForObject("SELECT * FROM users WHERE email = '$email'")
|
|
351
|
+
|
|
352
|
+
// good — parameterized
|
|
353
|
+
val user = jdbcTemplate.queryForObject(
|
|
354
|
+
"SELECT * FROM users WHERE email = ?",
|
|
355
|
+
UserRowMapper(),
|
|
356
|
+
email
|
|
357
|
+
)
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
```python
|
|
361
|
+
# bad
|
|
362
|
+
User.objects.raw(f"SELECT * FROM users WHERE email = '{email}'")
|
|
363
|
+
|
|
364
|
+
# good — Django ORM handles parameterization automatically
|
|
365
|
+
User.objects.filter(email=email)
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
## Logging Security Events
|
|
369
|
+
|
|
370
|
+
Log authentication events without including sensitive data.
|
|
371
|
+
|
|
372
|
+
```text
|
|
373
|
+
Log: login success/failure, permission denied, password reset, token refresh
|
|
374
|
+
Never: passwords, tokens, PII (full email in prod logs), credit card numbers
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
```kotlin
|
|
378
|
+
// Log security events at INFO level; failures at WARN
|
|
379
|
+
log.info("Authentication successful for user={}", userId)
|
|
380
|
+
log.warn("Authentication failed: invalid credentials for user={}", maskedEmail)
|
|
381
|
+
log.warn("Authorization denied: user={} attempted access to resource={}", userId, resourceId)
|
|
382
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-ai-llm
|
|
3
|
+
description: >
|
|
4
|
+
Harden LLM and agent integrations you operate: prompt injection, tool allowlists, secret leakage, and supply-chain of models. Defensive only.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AI / LLM Security
|
|
8
|
+
|
|
9
|
+
## Authorization
|
|
10
|
+
|
|
11
|
+
Use this skill only with **explicit written authorization** for a named
|
|
12
|
+
scope (systems, environments, and time window). If authorization is missing,
|
|
13
|
+
expired, or the request is for someone else's systems, **stop**.
|
|
14
|
+
|
|
15
|
+
This skill is **defensive and owner-authorized**. It does not authorize
|
|
16
|
+
offensive cyber operations.
|
|
17
|
+
|
|
18
|
+
## Do
|
|
19
|
+
|
|
20
|
+
- Treat model output as untrusted; never exec it without a schema
|
|
21
|
+
- Allowlist tools and paths; contain file writes
|
|
22
|
+
- Keep secrets out of prompts and logs
|
|
23
|
+
|
|
24
|
+
## Do not
|
|
25
|
+
|
|
26
|
+
- Help jailbreak third-party products or steal model weights
|
|
27
|
+
- Log raw user PII to prompt-debug stores
|
|
28
|
+
|
|
29
|
+
- Do not produce exploit payloads, malware, or attack procedures.
|
|
30
|
+
|
|
31
|
+
## How to Use
|
|
32
|
+
|
|
33
|
+
Load this skill from `/cc-security` when the Task Card domain is `security-ai-llm`.
|
|
34
|
+
Example prompts:
|
|
35
|
+
|
|
36
|
+
- `Review our agent tool runner for path traversal and unbounded shell.`
|
|
37
|
+
- `Add tests that a prompt cannot make the bot dump .env.`
|
|
38
|
+
|
|
39
|
+
## Integration
|
|
40
|
+
|
|
41
|
+
- Workflow: `/cc-security` (CCEP command `security`)
|
|
42
|
+
- Existing OWASP application-security skill remains `security` (not this id)
|
|
43
|
+
- High-risk changes still require `security-reviewer`
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-blue-team
|
|
3
|
+
description: >
|
|
4
|
+
Improve detections, hardening, and response for the estate you defend. Detection-as-code and control design, not offense.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Blue Team Defense
|
|
8
|
+
|
|
9
|
+
## Authorization
|
|
10
|
+
|
|
11
|
+
Use this skill only with **explicit written authorization** for a named
|
|
12
|
+
scope (systems, environments, and time window). If authorization is missing,
|
|
13
|
+
expired, or the request is for someone else's systems, **stop**.
|
|
14
|
+
|
|
15
|
+
This skill is **defensive and owner-authorized**. It does not authorize
|
|
16
|
+
offensive cyber operations.
|
|
17
|
+
|
|
18
|
+
## Do
|
|
19
|
+
|
|
20
|
+
- Tune detections for true positives; document exceptions
|
|
21
|
+
- Pair every new control with a test or canary
|
|
22
|
+
- Share hunt hypotheses with IR, not with the public internet
|
|
23
|
+
|
|
24
|
+
## Do not
|
|
25
|
+
|
|
26
|
+
- Disable EDR or logging to 'reduce noise' without a ticket
|
|
27
|
+
- Copy attacker malware into production 'for training'
|
|
28
|
+
|
|
29
|
+
- Do not produce exploit payloads, malware, or attack procedures.
|
|
30
|
+
|
|
31
|
+
## How to Use
|
|
32
|
+
|
|
33
|
+
Load this skill from `/cc-security` when the Task Card domain is `security-blue-team`.
|
|
34
|
+
Example prompts:
|
|
35
|
+
|
|
36
|
+
- `We missed a token-replay. Propose a detection plus a unit test for the API gateway.`
|
|
37
|
+
- `Harden CI: pin actions, require reviews on workflows that deploy.`
|
|
38
|
+
|
|
39
|
+
## Integration
|
|
40
|
+
|
|
41
|
+
- Workflow: `/cc-security` (CCEP command `security`)
|
|
42
|
+
- Existing OWASP application-security skill remains `security` (not this id)
|
|
43
|
+
- High-risk changes still require `security-reviewer`
|