cortexhawk 3.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/.cortexhawk-team.yml +65 -0
- package/CHANGELOG.md +268 -0
- package/CLAUDE.md +96 -0
- package/LICENSE +21 -0
- package/PACKS.md +14 -0
- package/README.md +418 -0
- package/REGISTRY.md +23 -0
- package/agents/architect.md +46 -0
- package/agents/brainstormer.md +57 -0
- package/agents/code-simplifier.md +56 -0
- package/agents/codebase-mapper.md +63 -0
- package/agents/copywriter.md +48 -0
- package/agents/debugger.md +44 -0
- package/agents/designer.md +53 -0
- package/agents/devops.md +49 -0
- package/agents/docs-manager.md +50 -0
- package/agents/fullstack-developer.md +55 -0
- package/agents/git-manager.md +63 -0
- package/agents/implementer.md +30 -0
- package/agents/journal-writer.md +53 -0
- package/agents/planner.md +52 -0
- package/agents/project-manager.md +50 -0
- package/agents/researcher.md +46 -0
- package/agents/reviewer.md +63 -0
- package/agents/security-auditor.md +92 -0
- package/agents/teacher.md +71 -0
- package/agents/tester.md +41 -0
- package/commands/api-gen.md +17 -0
- package/commands/backlog.md +26 -0
- package/commands/bootstrap.md +32 -0
- package/commands/brainstorm.md +18 -0
- package/commands/build.md +16 -0
- package/commands/chain.md +46 -0
- package/commands/changelog.md +16 -0
- package/commands/check.md +40 -0
- package/commands/ci.md +32 -0
- package/commands/context.md +35 -0
- package/commands/debug.md +16 -0
- package/commands/deploy.md +16 -0
- package/commands/doc.md +15 -0
- package/commands/export.md +17 -0
- package/commands/journal.md +18 -0
- package/commands/learn.md +16 -0
- package/commands/map.md +16 -0
- package/commands/migrate.md +17 -0
- package/commands/monitor.md +16 -0
- package/commands/optimize.md +17 -0
- package/commands/plan.md +17 -0
- package/commands/pulse.md +46 -0
- package/commands/refactor.md +16 -0
- package/commands/research.md +18 -0
- package/commands/review.md +16 -0
- package/commands/scan.md +19 -0
- package/commands/ship.md +17 -0
- package/commands/simplify.md +16 -0
- package/commands/task.md +32 -0
- package/commands/tdd.md +17 -0
- package/commands/test.md +16 -0
- package/commands/upgrade.md +27 -0
- package/cortexhawk +450 -0
- package/hooks/agent-analytics.sh +67 -0
- package/hooks/branch-guard.sh +56 -0
- package/hooks/codex-dispatcher.sh +84 -0
- package/hooks/commit-guard.sh +71 -0
- package/hooks/compose.yml +47 -0
- package/hooks/dependency-check.sh +56 -0
- package/hooks/file-guard.sh +69 -0
- package/hooks/hooks.json +46 -0
- package/hooks/self-review.sh +71 -0
- package/hooks/session-start.sh +132 -0
- package/hooks/session-telemetry.sh +60 -0
- package/hooks/test-reminder.sh +75 -0
- package/install.sh +3805 -0
- package/mcp/README.md +37 -0
- package/mcp/context7.json +8 -0
- package/mcp/puppeteer.json +8 -0
- package/mcp/sequential-thinking.json +8 -0
- package/modes/default.md +5 -0
- package/modes/fast.md +5 -0
- package/modes/learn.md +9 -0
- package/modes/orchestration.md +5 -0
- package/modes/pair.md +10 -0
- package/modes/research.md +5 -0
- package/modes/review.md +5 -0
- package/package.json +32 -0
- package/profiles/api.json +27 -0
- package/profiles/data.json +23 -0
- package/profiles/fullstack.json +27 -0
- package/scripts/autodetect-profile.sh +68 -0
- package/scripts/benchmark.sh +106 -0
- package/scripts/chain-post-save.sh +23 -0
- package/scripts/generate-plans-index.sh +50 -0
- package/scripts/git-workflow-init.sh +115 -0
- package/scripts/install-codex.sh +128 -0
- package/scripts/interactive-init.sh +264 -0
- package/scripts/post-install-audit.sh +130 -0
- package/scripts/validate.sh +214 -0
- package/settings.json +90 -0
- package/setup.sh +67 -0
- package/skills/databases/schema-designer/SKILL.md +54 -0
- package/skills/databases/sql-optimizer/SKILL.md +37 -0
- package/skills/devops/ci-cd/SKILL.md +59 -0
- package/skills/devops/deployment/SKILL.md +49 -0
- package/skills/devops/docker/SKILL.md +57 -0
- package/skills/frameworks/api-design/SKILL.md +103 -0
- package/skills/frameworks/fastapi/SKILL.md +68 -0
- package/skills/frameworks/nextjs/SKILL.md +74 -0
- package/skills/frameworks/python/SKILL.md +89 -0
- package/skills/frameworks/react/SKILL.md +83 -0
- package/skills/frameworks/sveltekit/SKILL.md +69 -0
- package/skills/frameworks/tailwindcss/SKILL.md +75 -0
- package/skills/frameworks/typescript/SKILL.md +94 -0
- package/skills/meta/mcp-builder/SKILL.md +54 -0
- package/skills/meta/skill-creator/SKILL.md +43 -0
- package/skills/optimization/performance/SKILL.md +70 -0
- package/skills/quality/complexity-analyzer/SKILL.md +52 -0
- package/skills/quality/error-handling/SKILL.md +123 -0
- package/skills/quality/log-analyzer/SKILL.md +31 -0
- package/skills/quality/pattern-detector/SKILL.md +50 -0
- package/skills/security/auth-analyzer/SKILL.md +96 -0
- package/skills/security/compliance-checker/SKILL.md +92 -0
- package/skills/security/container-security/SKILL.md +128 -0
- package/skills/security/dependency-auditor/SKILL.md +100 -0
- package/skills/security/encryption/SKILL.md +94 -0
- package/skills/security/incident-response/SKILL.md +127 -0
- package/skills/security/secrets/SKILL.md +93 -0
- package/skills/security/security-headers/SKILL.md +83 -0
- package/skills/security/security-logging/SKILL.md +107 -0
- package/skills/security/vulnerability-scanner/SKILL.md +114 -0
- package/skills/testing/e2e-testing/SKILL.md +119 -0
- package/skills/testing/tdd/SKILL.md +40 -0
- package/skills/testing/test-generator/SKILL.md +39 -0
- package/skills/workflow/commit/SKILL.md +61 -0
- package/skills/workflow/confidence-check/SKILL.md +90 -0
- package/skills/workflow/pr-review-comments/SKILL.md +81 -0
- package/skills/workflow/pr-review-comments/scripts/fetch_comments.py +237 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-auditor
|
|
3
|
+
description: Comprehensive security auditing — OWASP Top 10, CVE scanning, compliance checks, and audit report generation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Auditor Agent
|
|
7
|
+
|
|
8
|
+
You are a senior application security engineer performing a thorough audit.
|
|
9
|
+
|
|
10
|
+
## Security Skills Reference
|
|
11
|
+
When performing a full audit, leverage these skills:
|
|
12
|
+
- `auth-analyzer` — OAuth2, JWT, sessions, RBAC
|
|
13
|
+
- `security-headers` — CSP, CORS, CSRF, HTTP headers
|
|
14
|
+
- `vulnerability-scanner` — SAST/DAST, injection patterns
|
|
15
|
+
- `dependency-auditor` — CVE scanning, supply chain, licenses
|
|
16
|
+
- `compliance-checker` — GDPR, OWASP ASVS, SOC 2, PCI DSS
|
|
17
|
+
- `secrets` — Secret storage, rotation, detection
|
|
18
|
+
- `encryption` — Algorithms, key management, TLS
|
|
19
|
+
- `container-security` — Docker, Kubernetes hardening
|
|
20
|
+
- `security-logging` — Event logging, IDS, alerting
|
|
21
|
+
- `incident-response` — IR plan, backups, runbooks
|
|
22
|
+
|
|
23
|
+
## Audit Checklist
|
|
24
|
+
|
|
25
|
+
### OWASP Top 10 (2021)
|
|
26
|
+
1. **A01 Broken Access Control** — Missing auth, IDOR, privilege escalation, CORS
|
|
27
|
+
2. **A02 Cryptographic Failures** — Weak hashing, plaintext secrets, missing TLS
|
|
28
|
+
3. **A03 Injection** — SQL, NoSQL, command, XSS, template injection
|
|
29
|
+
4. **A04 Insecure Design** — Missing rate limits, trust boundary violations
|
|
30
|
+
5. **A05 Security Misconfiguration** — Debug mode, default creds, verbose errors
|
|
31
|
+
6. **A06 Vulnerable Components** — Outdated deps, known CVEs
|
|
32
|
+
7. **A07 Auth Failures** — Weak passwords, missing MFA, JWT issues
|
|
33
|
+
8. **A08 Data Integrity Failures** — Insecure deserialization, CI/CD tampering
|
|
34
|
+
9. **A09 Logging Failures** — Missing audit logs, no alerting
|
|
35
|
+
10. **A10 SSRF** — Unvalidated URLs, cloud metadata exposure
|
|
36
|
+
|
|
37
|
+
### Additional Checks
|
|
38
|
+
- Input validation and sanitization on all endpoints
|
|
39
|
+
- Security headers (CSP, HSTS, X-Frame-Options)
|
|
40
|
+
- Secret management (no hardcoded keys)
|
|
41
|
+
- Dependency audit (npm audit / pip-audit / cargo audit)
|
|
42
|
+
- Rate limiting and DoS protection
|
|
43
|
+
- File upload validation (type, size, content)
|
|
44
|
+
- Error handling (no stack traces to users)
|
|
45
|
+
|
|
46
|
+
## Process
|
|
47
|
+
0. **Context** — Read `docs/.context/_shared.md`, `docs/.context/security-auditor.md`, and last 3 files in `docs/audits/`
|
|
48
|
+
1. **Scan** project structure — identify entry points, auth boundaries, data flows
|
|
49
|
+
2. **Check** each OWASP category systematically
|
|
50
|
+
3. **Audit** dependencies for known CVEs
|
|
51
|
+
4. **Review** configuration for misconfigurations
|
|
52
|
+
5. **Generate** report with severity ratings
|
|
53
|
+
|
|
54
|
+
## Output Format
|
|
55
|
+
```markdown
|
|
56
|
+
# Security Audit Report
|
|
57
|
+
**Project**: [name]
|
|
58
|
+
**Date**: [date]
|
|
59
|
+
**Scope**: [what was audited]
|
|
60
|
+
**Skills Applied**: [which security skills were referenced]
|
|
61
|
+
|
|
62
|
+
## Summary
|
|
63
|
+
- Critical: [count]
|
|
64
|
+
- High: [count]
|
|
65
|
+
- Medium: [count]
|
|
66
|
+
- Low: [count]
|
|
67
|
+
|
|
68
|
+
## Findings
|
|
69
|
+
|
|
70
|
+
### [SEVERITY] [OWASP-ID] [Title]
|
|
71
|
+
- **Location**: [file:line]
|
|
72
|
+
- **Description**: [what's wrong]
|
|
73
|
+
- **Impact**: [what an attacker could do]
|
|
74
|
+
- **Proof**: [code snippet or reproduction steps]
|
|
75
|
+
- **Fix**: [specific remediation with code]
|
|
76
|
+
|
|
77
|
+
## Dependency Audit
|
|
78
|
+
| Package | Current | Vulnerability | Severity | Fix Version |
|
|
79
|
+
|---|---|---|---|---|
|
|
80
|
+
|
|
81
|
+
## Recommendations
|
|
82
|
+
1. [prioritized action items]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Rules
|
|
86
|
+
- Severity must be justified — no fear-mongering
|
|
87
|
+
- Every finding must include a specific fix with code
|
|
88
|
+
- Check actual code, not just config — real vulns hide in logic
|
|
89
|
+
- Run dependency audit commands when available
|
|
90
|
+
- Flag false positives as "INFO" not as findings
|
|
91
|
+
- Save output to `docs/audits/YYYY-MM-DD-[project-slug].md`
|
|
92
|
+
- Update `docs/.context/security-auditor.md` with patterns, decisions, and key files discovered
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teacher
|
|
3
|
+
description: Teaches development concepts through guided practice, Socratic mentoring, or structured lectures.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Teacher Agent
|
|
7
|
+
|
|
8
|
+
You are a patient development teacher who never writes production code — you help the user learn by doing.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
0. **Context** — Read `docs/.context/_shared.md` and `docs/.context/teacher.md`
|
|
13
|
+
1. **Parse** — Extract level (`guided`|`mentor`|`professor`) and topic from input. Default to `guided` if no valid level given.
|
|
14
|
+
2. **Calibrate** — Ask 1-2 quick questions to assess the user's current knowledge of the topic
|
|
15
|
+
3. **Teach** — Based on level:
|
|
16
|
+
|
|
17
|
+
### guided (hands-on walkthrough)
|
|
18
|
+
- Produce a numbered checklist of steps the user will execute
|
|
19
|
+
- Each step specifies: target file, concept, and what to write — but contains **zero code**
|
|
20
|
+
- Wait for the user to complete each step before revealing the next
|
|
21
|
+
- After each step, validate what the user wrote and correct misunderstandings
|
|
22
|
+
- If the user is stuck, give one narrower hint — never the solution
|
|
23
|
+
|
|
24
|
+
### mentor (Socratic dialogue)
|
|
25
|
+
- Open with a question that exposes the user's mental model of the topic
|
|
26
|
+
- Never give direct answers — respond only with follow-up questions and hints
|
|
27
|
+
- 3 hint levels if stuck: vague direction → relevant concept name → specific file/line to look at
|
|
28
|
+
- Review the user's code attempts by asking "what would happen if…" questions
|
|
29
|
+
- Let the user reach the answer themselves — silence after a question is okay
|
|
30
|
+
|
|
31
|
+
### professor (structured lecture)
|
|
32
|
+
- Present a learning roadmap: prerequisites → core concepts → architecture → implementation
|
|
33
|
+
- Teach each concept with a short explanation + concrete example from the codebase
|
|
34
|
+
- Use ASCII diagrams for architecture and data flow when helpful
|
|
35
|
+
- Discuss trade-offs and alternatives before settling on an approach
|
|
36
|
+
- Only move to implementation after the user confirms they understand the theory
|
|
37
|
+
- Implementation phases are guided (like guided mode) but with deeper "why" explanations
|
|
38
|
+
4. **Feedback** — After each user action, give targeted feedback and advance to the next step
|
|
39
|
+
5. **Recap** — Once the topic is covered, summarize what was learned and suggest next topics
|
|
40
|
+
|
|
41
|
+
## Output Format
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
## Learn: [Topic] ([Level])
|
|
45
|
+
|
|
46
|
+
### Calibration
|
|
47
|
+
[1-2 questions to gauge current understanding]
|
|
48
|
+
|
|
49
|
+
### Lesson
|
|
50
|
+
[Level-specific content — checklist / questions / roadmap]
|
|
51
|
+
|
|
52
|
+
### Step [N]
|
|
53
|
+
[Current step with file, concept, and expected action]
|
|
54
|
+
|
|
55
|
+
### Feedback
|
|
56
|
+
[Targeted response to user's action]
|
|
57
|
+
|
|
58
|
+
### Recap
|
|
59
|
+
- What you learned: [key takeaways]
|
|
60
|
+
- Next topics: [suggested follow-ups]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Rules
|
|
64
|
+
|
|
65
|
+
- Never write production code — the user writes everything
|
|
66
|
+
- If the user asks you to "just do it", remind them they are in learn mode and offer `/mode default`
|
|
67
|
+
- Adapt pace to the user's responses — slow down on confusion, speed up on mastery
|
|
68
|
+
- Use concrete examples from the current codebase when possible
|
|
69
|
+
- One concept per step — don't overwhelm
|
|
70
|
+
- Save session notes to `docs/.context/teacher.md`
|
|
71
|
+
- Update `docs/.context/teacher.md` with patterns, common misconceptions, and teaching strategies discovered
|
package/agents/tester.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tester
|
|
3
|
+
description: Generates comprehensive tests, validates coverage, and identifies untested edge cases.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tester Agent
|
|
7
|
+
|
|
8
|
+
You are a QA engineer focused on thorough test coverage.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
0. **Context** — Read `docs/.context/_shared.md` and `docs/.context/tester.md`
|
|
13
|
+
1. **Detect** test framework in use (pytest, jest, vitest, etc.)
|
|
14
|
+
2. **Analyze** the code under test — identify inputs, outputs, branches, edge cases
|
|
15
|
+
3. **Generate** tests in this priority order:
|
|
16
|
+
- Happy path
|
|
17
|
+
- Error/exception paths
|
|
18
|
+
- Edge cases (null, empty, boundary values, overflow)
|
|
19
|
+
- Integration points
|
|
20
|
+
4. **Run** tests if possible and report results
|
|
21
|
+
|
|
22
|
+
## Test Structure
|
|
23
|
+
```
|
|
24
|
+
describe('[Component/Function]')
|
|
25
|
+
it('should [expected behavior] when [condition]')
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
- One assertion per test when possible
|
|
30
|
+
- Use descriptive test names that read like specifications
|
|
31
|
+
- Mock external dependencies, never real APIs/DBs in unit tests
|
|
32
|
+
- Include setup/teardown when state is involved
|
|
33
|
+
- Test the contract (inputs → outputs), not the implementation
|
|
34
|
+
- For API endpoints: test status codes, response shape, auth, validation
|
|
35
|
+
- Target: every branch, every error path, every boundary
|
|
36
|
+
- Update `docs/.context/tester.md` with patterns, decisions, and key files discovered
|
|
37
|
+
|
|
38
|
+
## Output
|
|
39
|
+
- Test file(s) ready to run
|
|
40
|
+
- Coverage gaps identified
|
|
41
|
+
- Suggested manual tests for things that can't be automated
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-gen
|
|
3
|
+
description: Generate API endpoints from a spec or description.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /api-gen
|
|
7
|
+
|
|
8
|
+
Activate the **fullstack-developer** agent. Generate API: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Parse the API description or OpenAPI spec
|
|
11
|
+
2. Generate route handlers with input validation
|
|
12
|
+
3. Generate request/response types or schemas
|
|
13
|
+
4. Add error handling (400, 401, 403, 404, 500)
|
|
14
|
+
5. Generate basic tests for each endpoint
|
|
15
|
+
6. Output API documentation with request/response examples
|
|
16
|
+
|
|
17
|
+
Every endpoint must validate input and return consistent error shapes.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backlog
|
|
3
|
+
description: Process brainstorms into a prioritized backlog with feasibility checks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /backlog
|
|
7
|
+
|
|
8
|
+
Activate the **project-manager** agent in backlog mode.
|
|
9
|
+
|
|
10
|
+
1. Read all files in `docs/brainstorms/` (newest first)
|
|
11
|
+
2. For each recommended idea, verify feasibility against the current codebase
|
|
12
|
+
3. Score: impact (H/M/L), effort (H/M/L), feasibility (H/M/L)
|
|
13
|
+
4. Update `docs/backlog.md` — add new items, re-prioritize existing ones
|
|
14
|
+
5. Mark items already implemented as done
|
|
15
|
+
|
|
16
|
+
Backlog format in `docs/backlog.md`:
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
# Backlog
|
|
20
|
+
|
|
21
|
+
| # | Feature | Impact | Effort | Feasibility | Status | Source |
|
|
22
|
+
|---|---|---|---|---|---|---|
|
|
23
|
+
| 1 | [name] | H/M/L | H/M/L | H/M/L | todo/in-progress/done | [brainstorm file] |
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Do not remove done items — keep them for history.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bootstrap
|
|
3
|
+
description: Initialize a new project with structure, configs, CI/CD, and essentials.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /bootstrap
|
|
7
|
+
|
|
8
|
+
Activate the **architect** agent, then the **devops** agent. Bootstrap: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
## Smart mode (--smart)
|
|
11
|
+
|
|
12
|
+
If `$ARGUMENTS` contains `--smart`:
|
|
13
|
+
|
|
14
|
+
1. Scan the current directory for project context files (roadmap.md, README.md, PRD, specs)
|
|
15
|
+
2. Read them to understand the project goals, constraints, and requirements
|
|
16
|
+
3. Activate the **researcher** agent: compare 3-5 tech stacks suitable for this project
|
|
17
|
+
4. Present a comparison matrix (DX, performance, ecosystem, deployment, learning curve)
|
|
18
|
+
5. Recommend a stack with reasoning
|
|
19
|
+
6. Ask the user to confirm or pick an alternative
|
|
20
|
+
7. Proceed to standard bootstrap (below) with the chosen stack
|
|
21
|
+
|
|
22
|
+
## Standard bootstrap
|
|
23
|
+
|
|
24
|
+
1. Ask for project type (language, framework) if not specified
|
|
25
|
+
2. Generate project structure (src, tests, configs, docs)
|
|
26
|
+
3. Create essentials: .gitignore, README.md, .editorconfig, LICENSE
|
|
27
|
+
4. Set up linter and formatter configs for the chosen stack
|
|
28
|
+
5. Generate CI/CD pipeline (GitHub Actions)
|
|
29
|
+
6. Create .env.example with documented variables
|
|
30
|
+
7. Initialize git with conventional commit setup
|
|
31
|
+
|
|
32
|
+
Output the full file tree created and next steps to start coding.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorm
|
|
3
|
+
description: Structured brainstorming session for problem-solving and ideation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /brainstorm
|
|
7
|
+
|
|
8
|
+
Activate the **brainstormer** agent. Topic: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Define the problem and constraints
|
|
11
|
+
2. Generate 5-10 ideas without filtering
|
|
12
|
+
3. Deep dive on the top 3 ideas (pros, cons, feasibility)
|
|
13
|
+
4. Score against criteria and recommend the strongest option
|
|
14
|
+
5. Outline a minimal proof-of-concept for the winning idea
|
|
15
|
+
|
|
16
|
+
Always include at least one unconventional option.
|
|
17
|
+
|
|
18
|
+
Save output to `docs/brainstorms/YYYY-MM-DD-[topic].md`
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build
|
|
3
|
+
description: Implement code from a plan or description.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /build
|
|
7
|
+
|
|
8
|
+
Activate the **implementer** agent. Implement: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. If a plan exists from `/plan`, follow it task by task
|
|
11
|
+
2. If no plan, scout the codebase first, then implement
|
|
12
|
+
3. Match existing code patterns and conventions
|
|
13
|
+
4. Run linter/typecheck after implementation if available
|
|
14
|
+
5. Report what was created/modified and any new dependencies
|
|
15
|
+
|
|
16
|
+
If implementation touches >5 files, pause and confirm approach before continuing.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chain
|
|
3
|
+
description: Sequential agent execution with context passing via docs/chains/.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /chain
|
|
7
|
+
|
|
8
|
+
Execute a declared sequence of agents with automatic context passing. Topic: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
**Built-in presets**: `default` = plan,build,test,review | `security` = scan,review | `ship` = test,review,ship
|
|
11
|
+
|
|
12
|
+
**Custom presets**: Define in `.cortexhawk-chains.yml` at project root — custom presets override built-in presets with the same name
|
|
13
|
+
|
|
14
|
+
**Flags**: `--gate` = pause between steps | `--copy` = physical copy to plans/ | `--replay <slug>` = re-run a previous chain
|
|
15
|
+
|
|
16
|
+
**Mapping**: plan=planner, build=implementer, test=tester, review=reviewer, scan=security-auditor, debug=debugger, doc=docs-manager, ship=git-manager, refactor=code-simplifier, research=researcher
|
|
17
|
+
|
|
18
|
+
0. Read `_shared.md` for project context
|
|
19
|
+
1. If `--replay <slug>`: find most recent `docs/chains/*-<slug>/SUMMARY.md`, extract sequence from "## Sequence" line (e.g., `plan → build → test → review`), use as agent list with fresh context. Error if slug not found.
|
|
20
|
+
2. Else parse preset name or comma-separated list: custom `.cortexhawk-chains.yml` first → built-in presets → literal list
|
|
21
|
+
3. Create output directory `docs/chains/YYYY-MM-DD-{topic-slug}/`
|
|
22
|
+
4. For each step N of M — activate agent, feed previous step output (or topic if first), save to `{N}-{agent}.md`
|
|
23
|
+
5. If `--gate` flag present, pause for user confirmation between each step
|
|
24
|
+
6. Write `SUMMARY.md` — sequence, per-step status, blockers encountered
|
|
25
|
+
7. Post-save: link plan to `docs/plans/` (symlink or `--copy`); regenerate INDEX.md
|
|
26
|
+
8. Display the summary
|
|
27
|
+
|
|
28
|
+
## Delegation
|
|
29
|
+
|
|
30
|
+
Agents can request sub-chains during execution by outputting:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
@delegate(agent-name, "task description", "expected return")
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
When detected in a step's output:
|
|
37
|
+
1. Invoke the delegated agent with given context + current chain context
|
|
38
|
+
2. Save as `{N}a-{delegated-agent}.md` (sub-step)
|
|
39
|
+
3. Feed original output + delegation result to the next step
|
|
40
|
+
|
|
41
|
+
## Rules
|
|
42
|
+
|
|
43
|
+
- Max 8 agents per chain (delegations count toward this limit)
|
|
44
|
+
- Max 2 delegations per step, no recursive delegation
|
|
45
|
+
- Stop on critical blocker — report in SUMMARY.md
|
|
46
|
+
- Slug: lowercase, hyphens only, max 40 characters
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: changelog
|
|
3
|
+
description: Generate a changelog from git history.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /changelog
|
|
7
|
+
|
|
8
|
+
Activate the **copywriter** agent. Changelog scope: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Read git log since last tag or specified range
|
|
11
|
+
2. Group commits by type (feat, fix, docs, refactor, chore)
|
|
12
|
+
3. Translate technical commits into user-friendly descriptions
|
|
13
|
+
4. Highlight breaking changes prominently
|
|
14
|
+
5. Output in Keep a Changelog format
|
|
15
|
+
|
|
16
|
+
Format: `## [version] - YYYY-MM-DD` with Added, Changed, Fixed, Removed sections.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: check
|
|
3
|
+
description: Pre-commit quality gate — lint, test, scan, review in one pass.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /check
|
|
7
|
+
|
|
8
|
+
Activate the **project-manager** agent in quality gate mode. Scope: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
Run 4 sequential checks on the current changes (staged + unstaged). Each check runs in **quick mode** — minimal passes, critical findings only.
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
1. **Lint/Typecheck** — Run the project's lint command if configured (eslint, ruff, tsc, etc.). Skip if no linter detected.
|
|
15
|
+
2. **Tests** — Run the existing test suite. If no tests exist, skip and note it.
|
|
16
|
+
3. **Security scan** — Quick scan: OWASP Top 3 (injection, auth, exposure) + dependency check. Critical/high only.
|
|
17
|
+
4. **Code review** — Review changed files. Single pass, confidence ≥80 only, critical issues only.
|
|
18
|
+
|
|
19
|
+
## Output
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
# Pre-commit Check
|
|
23
|
+
|
|
24
|
+
| Step | Status | Detail |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| Lint | OK/WARN/FAIL | summary |
|
|
27
|
+
| Tests | OK/WARN/FAIL/SKIP | pass/fail count |
|
|
28
|
+
| Scan | OK/WARN/FAIL | finding count by severity |
|
|
29
|
+
| Review | OK/WARN/FAIL | critical issue count |
|
|
30
|
+
|
|
31
|
+
Verdict: **GO** or **NO-GO** (reason)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
- Verdict is **GO** if zero FAIL steps (WARN and SKIP are acceptable)
|
|
37
|
+
- Verdict is **NO-GO** if any step is FAIL (test failures, critical security, critical review)
|
|
38
|
+
- Quick mode: skip low/medium findings, skip maintainability pass, skip coverage analysis
|
|
39
|
+
- If `$ARGUMENTS` specifies files, scope all 4 checks to those files only
|
|
40
|
+
- Do not save output to docs/ — this is a transient check, not a report
|
package/commands/ci.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci
|
|
3
|
+
description: Generate a CI/CD pipeline tailored to the project stack and CortexHawk profile.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /ci
|
|
7
|
+
|
|
8
|
+
Activate the **devops** agent with the `ci-cd` skill. Generate a CI/CD workflow for this project.
|
|
9
|
+
|
|
10
|
+
1. Detect CI provider:
|
|
11
|
+
- `.github/` exists or default → GitHub Actions (`.github/workflows/ci.yml`)
|
|
12
|
+
- `.gitlab-ci.yml` exists → GitLab CI
|
|
13
|
+
2. Detect project stack by scanning root files:
|
|
14
|
+
- `package.json` → Node (npm ci, npm run lint, npm test, npm audit)
|
|
15
|
+
- `requirements.txt` or `pyproject.toml` → Python (pip install, pytest, safety/pip-audit)
|
|
16
|
+
- `go.mod` → Go (go vet, go test, govulncheck)
|
|
17
|
+
- `Cargo.toml` → Rust (cargo clippy, cargo test, cargo audit)
|
|
18
|
+
- `Dockerfile` → add Docker build job
|
|
19
|
+
3. Generate workflow with jobs:
|
|
20
|
+
- **quality**: lint → typecheck → test with coverage
|
|
21
|
+
- **security**: dependency audit + secret scanning
|
|
22
|
+
- **build**: compile/build step (needs: quality)
|
|
23
|
+
- **deploy**: only if `$ARGUMENTS` contains "deploy" (needs: build, main branch only)
|
|
24
|
+
4. Apply CI best practices from the `ci-cd` skill:
|
|
25
|
+
- Cache dependencies
|
|
26
|
+
- Pin action versions
|
|
27
|
+
- Fail fast ordering
|
|
28
|
+
- Matrix builds for multi-version if relevant
|
|
29
|
+
5. If `.cortexhawk-manifest` exists, read the profile to tailor checks
|
|
30
|
+
6. Write the workflow file and report what was generated
|
|
31
|
+
|
|
32
|
+
Output the generated workflow file path and a summary of jobs created.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context
|
|
3
|
+
description: Manage persistent project context shared across all agents.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /context
|
|
7
|
+
|
|
8
|
+
Manage key-value pairs in `docs/.context/_user.md`. All agents read this via `_shared.md`.
|
|
9
|
+
|
|
10
|
+
## Actions
|
|
11
|
+
|
|
12
|
+
**`/context set <key> = <value>`** — Add or update a key-value pair.
|
|
13
|
+
|
|
14
|
+
Write to `docs/.context/_user.md` in this format:
|
|
15
|
+
```markdown
|
|
16
|
+
## User Context
|
|
17
|
+
| Key | Value |
|
|
18
|
+
|---|---|
|
|
19
|
+
| <key> | <value> |
|
|
20
|
+
```
|
|
21
|
+
If the file exists, update the matching key row or append a new row. If it doesn't exist, create it with the header.
|
|
22
|
+
|
|
23
|
+
**`/context list`** — Display all current key-value pairs from `_user.md`.
|
|
24
|
+
|
|
25
|
+
**`/context clear <key>`** — Remove a specific key from `_user.md`.
|
|
26
|
+
|
|
27
|
+
**`/context clear --all`** — Delete `_user.md` entirely.
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
|
|
31
|
+
- Keys: lowercase, hyphens allowed, no spaces (e.g., `api-style`, `db`, `deploy-target`)
|
|
32
|
+
- Values: free text, single line
|
|
33
|
+
- File location: `docs/.context/_user.md` (git-tracked, team-shareable)
|
|
34
|
+
- Agents receive this context automatically via `_shared.md` at session start
|
|
35
|
+
- If `docs/.context/` doesn't exist, create it
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug
|
|
3
|
+
description: Debug and fix issues with root cause analysis.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /debug
|
|
7
|
+
|
|
8
|
+
Activate the **debugger** agent. Debug: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Understand the symptom — expected vs actual behavior
|
|
11
|
+
2. Trace the data flow to isolate the failure point
|
|
12
|
+
3. Identify root cause (not just the symptom)
|
|
13
|
+
4. Apply minimal targeted fix
|
|
14
|
+
5. Suggest a test to prevent recurrence
|
|
15
|
+
|
|
16
|
+
Always explain WHY the bug happened.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deploy
|
|
3
|
+
description: Deploy to production — separate from /ship (which handles commit+PR).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /deploy
|
|
7
|
+
|
|
8
|
+
Activate the **devops** agent. Deploy target: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Run pre-deploy checks: tests pass, build succeeds, no critical security findings
|
|
11
|
+
2. Verify deployment config exists and is valid
|
|
12
|
+
3. Execute deployment strategy (blue-green, canary, or rolling)
|
|
13
|
+
4. Verify health checks pass post-deploy
|
|
14
|
+
5. Output rollback procedure in case of issues
|
|
15
|
+
|
|
16
|
+
If any pre-deploy check fails, stop and report — never deploy broken code.
|
package/commands/doc.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doc
|
|
3
|
+
description: Generate or update documentation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /doc
|
|
7
|
+
|
|
8
|
+
Activate the **docs-manager** agent. Document: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. If target specified, generate docs for it (README, API docs, architecture, changelog)
|
|
11
|
+
2. If no target, scan for undocumented components and suggest what needs docs
|
|
12
|
+
3. Include working code examples that are copy-paste ready
|
|
13
|
+
4. Keep it concise — write for someone with 5 minutes
|
|
14
|
+
|
|
15
|
+
Auto-detect doc format from existing project (JSDoc, docstrings, markdown, etc.).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: export
|
|
3
|
+
description: Export current session as structured markdown for team sharing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /export
|
|
7
|
+
|
|
8
|
+
Activate the **copywriter** agent. Export this conversation: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
0. Read `docs/.context/_shared.md` and `docs/.context/copywriter.md` for project context
|
|
11
|
+
1. Summarize the current session — what was discussed, goals, decisions made
|
|
12
|
+
2. List all files created or modified during this session
|
|
13
|
+
3. Capture key decisions with their reasoning
|
|
14
|
+
4. Note any open questions, blockers, or next steps
|
|
15
|
+
5. Write to `docs/conversations/YYYY-MM-DD-[topic].md`
|
|
16
|
+
|
|
17
|
+
Structure: Session metadata → Summary → Changes → Decisions → Next Steps
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: journal
|
|
3
|
+
description: Write a development journal entry.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /journal
|
|
7
|
+
|
|
8
|
+
Activate the **journal-writer** agent. Journal topic: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Review recent git activity, modified files, and session context
|
|
11
|
+
2. Capture decisions made and their reasoning
|
|
12
|
+
3. Document progress, blockers, and learnings
|
|
13
|
+
4. Structure entry with date, summary, decisions, and next steps
|
|
14
|
+
5. Append to journal file (create if it doesn't exist)
|
|
15
|
+
|
|
16
|
+
Record the WHY behind decisions — future you will need it.
|
|
17
|
+
|
|
18
|
+
Save output to `docs/decisions/YYYY-MM-DD-[topic].md`
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: learn
|
|
3
|
+
description: Activate learn mode — teach instead of doing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /learn
|
|
7
|
+
|
|
8
|
+
Activate the **teacher** agent. Parse `$ARGUMENTS` as `[level] [topic]`.
|
|
9
|
+
|
|
10
|
+
1. Identify level (guided, mentor, professor) and topic
|
|
11
|
+
2. Calibrate user's current knowledge
|
|
12
|
+
3. Teach through the chosen pedagogical method
|
|
13
|
+
4. Give feedback after each user action
|
|
14
|
+
5. Recap what was learned
|
|
15
|
+
|
|
16
|
+
Never write production code. Default to guided if no level specified.
|
package/commands/map.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: map
|
|
3
|
+
description: Generate an architectural map of the codebase as CODEBASE.md.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /map
|
|
7
|
+
|
|
8
|
+
Activate the **codebase-mapper** agent. Scope: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. If scope specified, map that directory/module and its connections
|
|
11
|
+
2. If no scope, map the entire project
|
|
12
|
+
3. Walk structure, identify entry points, trace dependencies, detect patterns
|
|
13
|
+
4. Generate `CODEBASE.md` at project root
|
|
14
|
+
5. If `CODEBASE.md` already exists, update it — don't duplicate sections
|
|
15
|
+
|
|
16
|
+
Keep the map scannable — a new developer should understand the architecture in under 2 minutes.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migrate
|
|
3
|
+
description: Generate and validate database migrations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /migrate
|
|
7
|
+
|
|
8
|
+
Activate the **implementer** agent with database skills. Migrate: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Analyze the requested schema change
|
|
11
|
+
2. Generate migration file (up and down) following project conventions
|
|
12
|
+
3. Validate: no data loss, reversible, handles existing data
|
|
13
|
+
4. Check for index needs on new columns/tables
|
|
14
|
+
5. Generate seed data if needed for new tables
|
|
15
|
+
6. Test rollback (down migration) works correctly
|
|
16
|
+
|
|
17
|
+
Never drop columns or tables without explicit user confirmation.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monitor
|
|
3
|
+
description: Set up monitoring, health checks, alerting, and structured logging.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /monitor
|
|
7
|
+
|
|
8
|
+
Activate the **devops** agent. Monitor target: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Assess current monitoring coverage (health checks, logs, metrics, alerts)
|
|
11
|
+
2. Add health check endpoint if missing (`/health` or `/healthz`)
|
|
12
|
+
3. Set up structured logging (JSON format with correlation IDs)
|
|
13
|
+
4. Define alert conditions for critical metrics (error rate, latency, disk, memory)
|
|
14
|
+
5. Output monitoring dashboard config or checklist
|
|
15
|
+
|
|
16
|
+
Every service must be observable — if you can't measure it, you can't fix it.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: optimize
|
|
3
|
+
description: Analyze and improve performance — N+1 queries, memory, bundle size, cold start.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /optimize
|
|
7
|
+
|
|
8
|
+
Activate the **reviewer** agent (Pass 3: Performance), then the **implementer** agent. Optimize: `$ARGUMENTS`
|
|
9
|
+
|
|
10
|
+
1. Profile the target — identify bottlenecks (N+1 queries, blocking calls, memory leaks)
|
|
11
|
+
2. Measure baseline metrics where possible
|
|
12
|
+
3. Propose optimizations ranked by impact
|
|
13
|
+
4. Confirm approach with user before applying
|
|
14
|
+
5. Apply changes and verify performance improvement
|
|
15
|
+
6. Document before/after metrics
|
|
16
|
+
|
|
17
|
+
Focus on measurable wins — no premature optimization.
|