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.
Files changed (136) hide show
  1. package/.cortexhawk-team.yml +65 -0
  2. package/CHANGELOG.md +268 -0
  3. package/CLAUDE.md +96 -0
  4. package/LICENSE +21 -0
  5. package/PACKS.md +14 -0
  6. package/README.md +418 -0
  7. package/REGISTRY.md +23 -0
  8. package/agents/architect.md +46 -0
  9. package/agents/brainstormer.md +57 -0
  10. package/agents/code-simplifier.md +56 -0
  11. package/agents/codebase-mapper.md +63 -0
  12. package/agents/copywriter.md +48 -0
  13. package/agents/debugger.md +44 -0
  14. package/agents/designer.md +53 -0
  15. package/agents/devops.md +49 -0
  16. package/agents/docs-manager.md +50 -0
  17. package/agents/fullstack-developer.md +55 -0
  18. package/agents/git-manager.md +63 -0
  19. package/agents/implementer.md +30 -0
  20. package/agents/journal-writer.md +53 -0
  21. package/agents/planner.md +52 -0
  22. package/agents/project-manager.md +50 -0
  23. package/agents/researcher.md +46 -0
  24. package/agents/reviewer.md +63 -0
  25. package/agents/security-auditor.md +92 -0
  26. package/agents/teacher.md +71 -0
  27. package/agents/tester.md +41 -0
  28. package/commands/api-gen.md +17 -0
  29. package/commands/backlog.md +26 -0
  30. package/commands/bootstrap.md +32 -0
  31. package/commands/brainstorm.md +18 -0
  32. package/commands/build.md +16 -0
  33. package/commands/chain.md +46 -0
  34. package/commands/changelog.md +16 -0
  35. package/commands/check.md +40 -0
  36. package/commands/ci.md +32 -0
  37. package/commands/context.md +35 -0
  38. package/commands/debug.md +16 -0
  39. package/commands/deploy.md +16 -0
  40. package/commands/doc.md +15 -0
  41. package/commands/export.md +17 -0
  42. package/commands/journal.md +18 -0
  43. package/commands/learn.md +16 -0
  44. package/commands/map.md +16 -0
  45. package/commands/migrate.md +17 -0
  46. package/commands/monitor.md +16 -0
  47. package/commands/optimize.md +17 -0
  48. package/commands/plan.md +17 -0
  49. package/commands/pulse.md +46 -0
  50. package/commands/refactor.md +16 -0
  51. package/commands/research.md +18 -0
  52. package/commands/review.md +16 -0
  53. package/commands/scan.md +19 -0
  54. package/commands/ship.md +17 -0
  55. package/commands/simplify.md +16 -0
  56. package/commands/task.md +32 -0
  57. package/commands/tdd.md +17 -0
  58. package/commands/test.md +16 -0
  59. package/commands/upgrade.md +27 -0
  60. package/cortexhawk +450 -0
  61. package/hooks/agent-analytics.sh +67 -0
  62. package/hooks/branch-guard.sh +56 -0
  63. package/hooks/codex-dispatcher.sh +84 -0
  64. package/hooks/commit-guard.sh +71 -0
  65. package/hooks/compose.yml +47 -0
  66. package/hooks/dependency-check.sh +56 -0
  67. package/hooks/file-guard.sh +69 -0
  68. package/hooks/hooks.json +46 -0
  69. package/hooks/self-review.sh +71 -0
  70. package/hooks/session-start.sh +132 -0
  71. package/hooks/session-telemetry.sh +60 -0
  72. package/hooks/test-reminder.sh +75 -0
  73. package/install.sh +3805 -0
  74. package/mcp/README.md +37 -0
  75. package/mcp/context7.json +8 -0
  76. package/mcp/puppeteer.json +8 -0
  77. package/mcp/sequential-thinking.json +8 -0
  78. package/modes/default.md +5 -0
  79. package/modes/fast.md +5 -0
  80. package/modes/learn.md +9 -0
  81. package/modes/orchestration.md +5 -0
  82. package/modes/pair.md +10 -0
  83. package/modes/research.md +5 -0
  84. package/modes/review.md +5 -0
  85. package/package.json +32 -0
  86. package/profiles/api.json +27 -0
  87. package/profiles/data.json +23 -0
  88. package/profiles/fullstack.json +27 -0
  89. package/scripts/autodetect-profile.sh +68 -0
  90. package/scripts/benchmark.sh +106 -0
  91. package/scripts/chain-post-save.sh +23 -0
  92. package/scripts/generate-plans-index.sh +50 -0
  93. package/scripts/git-workflow-init.sh +115 -0
  94. package/scripts/install-codex.sh +128 -0
  95. package/scripts/interactive-init.sh +264 -0
  96. package/scripts/post-install-audit.sh +130 -0
  97. package/scripts/validate.sh +214 -0
  98. package/settings.json +90 -0
  99. package/setup.sh +67 -0
  100. package/skills/databases/schema-designer/SKILL.md +54 -0
  101. package/skills/databases/sql-optimizer/SKILL.md +37 -0
  102. package/skills/devops/ci-cd/SKILL.md +59 -0
  103. package/skills/devops/deployment/SKILL.md +49 -0
  104. package/skills/devops/docker/SKILL.md +57 -0
  105. package/skills/frameworks/api-design/SKILL.md +103 -0
  106. package/skills/frameworks/fastapi/SKILL.md +68 -0
  107. package/skills/frameworks/nextjs/SKILL.md +74 -0
  108. package/skills/frameworks/python/SKILL.md +89 -0
  109. package/skills/frameworks/react/SKILL.md +83 -0
  110. package/skills/frameworks/sveltekit/SKILL.md +69 -0
  111. package/skills/frameworks/tailwindcss/SKILL.md +75 -0
  112. package/skills/frameworks/typescript/SKILL.md +94 -0
  113. package/skills/meta/mcp-builder/SKILL.md +54 -0
  114. package/skills/meta/skill-creator/SKILL.md +43 -0
  115. package/skills/optimization/performance/SKILL.md +70 -0
  116. package/skills/quality/complexity-analyzer/SKILL.md +52 -0
  117. package/skills/quality/error-handling/SKILL.md +123 -0
  118. package/skills/quality/log-analyzer/SKILL.md +31 -0
  119. package/skills/quality/pattern-detector/SKILL.md +50 -0
  120. package/skills/security/auth-analyzer/SKILL.md +96 -0
  121. package/skills/security/compliance-checker/SKILL.md +92 -0
  122. package/skills/security/container-security/SKILL.md +128 -0
  123. package/skills/security/dependency-auditor/SKILL.md +100 -0
  124. package/skills/security/encryption/SKILL.md +94 -0
  125. package/skills/security/incident-response/SKILL.md +127 -0
  126. package/skills/security/secrets/SKILL.md +93 -0
  127. package/skills/security/security-headers/SKILL.md +83 -0
  128. package/skills/security/security-logging/SKILL.md +107 -0
  129. package/skills/security/vulnerability-scanner/SKILL.md +114 -0
  130. package/skills/testing/e2e-testing/SKILL.md +119 -0
  131. package/skills/testing/tdd/SKILL.md +40 -0
  132. package/skills/testing/test-generator/SKILL.md +39 -0
  133. package/skills/workflow/commit/SKILL.md +61 -0
  134. package/skills/workflow/confidence-check/SKILL.md +90 -0
  135. package/skills/workflow/pr-review-comments/SKILL.md +81 -0
  136. package/skills/workflow/pr-review-comments/scripts/fetch_comments.py +237 -0
package/README.md ADDED
@@ -0,0 +1,418 @@
1
+ # CortexHawk
2
+
3
+ [![GitHub stars](https://img.shields.io/github/stars/Spechawk94/CortexHawk?style=flat-square)](https://github.com/Spechawk94/CortexHawk/stargazers)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE)
5
+ [![Version](https://img.shields.io/badge/version-3.0.0-green.svg?style=flat-square)](CHANGELOG.md)
6
+ [![Skills](https://img.shields.io/badge/skills-36%20built--in%20%7C%2087k%2B%20via%20SkillsMP-orange.svg?style=flat-square)](https://skillsmp.com)
7
+ [![Components](https://img.shields.io/badge/20%20agents%20%7C%2032%20commands%20%7C%209%20hooks%20%7C%207%20modes-purple.svg?style=flat-square)](#whats-inside)
8
+
9
+ An open-source, community-driven development toolkit for Claude Code.
10
+
11
+ CortexHawk provides a modular collection of optimized agents, skills, commands, hooks, and behavioral modes that transform Claude Code into a full-stack development team. Every prompt has been written for maximum efficiency — less token bloat, sharper instructions, better agent coordination.
12
+
13
+ ### What's New in v3.0
14
+
15
+ - **`--init` wizard overhaul** — reordered flow with git workflow config, auto `git init` + `.gitignore` creation, branching strategies (direct-main, dev-branch, git-flow)
16
+ - **`/bootstrap --smart`** — researcher agent scans roadmap, compares stacks, recommends, then scaffolds
17
+ - **Post-install gitignore** — auto-adds `.claude/`, `.kimi/`, `.codex/` to `.gitignore`, asks about `docs/`
18
+ - **`--update` checksum detection** — compares file checksums instead of just version numbers to detect changes
19
+ - **Kimi CLI overhaul** — agents, commands, hooks all converted to skills; AGENTS.md at project root; MCP optional; auto `.envrc` for local install
20
+ - **Codex CLI fixes** — config.toml format fixes (flat model key, save-all persistence)
21
+ - **`--demo` flag** — sandbox project in `/tmp/` with intentional bugs for testing
22
+ - **`/upgrade` command** — check for updates, show changelog diff, propose `--update`
23
+ - **`--publish-skill`** — publish local skills to GitHub with auto-generated README
24
+ - **Cursor CLI removed** — too unstable for maintained support
25
+
26
+ ## Quick Start
27
+
28
+ ```bash
29
+ # Install (pick one)
30
+ npm install -g cortexhawk # via npm
31
+ git clone https://github.com/Spechawk94/CortexHawk.git ~/.cortexhawk && cd ~/.cortexhawk && ./setup.sh # via git
32
+
33
+ # Set up your project
34
+ cd /path/to/your/project
35
+ cortexhawk init # interactive wizard (recommended)
36
+ cortexhawk install # direct install (all skills)
37
+ cortexhawk install --profile api # install only API skills
38
+ cortexhawk install --target auto # auto-detect installed CLIs
39
+ cortexhawk install --target kimi # Kimi CLI (experimental)
40
+
41
+ # Useful commands
42
+ cortexhawk update # update installation
43
+ cortexhawk validate # verify skills/agents discovery
44
+ cortexhawk doctor # check installation health
45
+ cortexhawk search react # search 87k+ community skills
46
+ cortexhawk self-update # update CortexHawk source
47
+ ```
48
+
49
+ <details>
50
+ <summary>Alternative: use install.sh directly (no CLI wrapper)</summary>
51
+
52
+ ```bash
53
+ git clone https://github.com/Spechawk94/CortexHawk.git /tmp/cortexhawk
54
+ cd /path/to/your/project
55
+ bash /tmp/cortexhawk/install.sh --init
56
+
57
+ # Skill packs (curated bundles)
58
+ bash /tmp/cortexhawk/install.sh --pack react-app
59
+ bash /tmp/cortexhawk/install.sh --pack security-suite
60
+
61
+ # Profiles: fullstack, api, data, autodetect
62
+ bash /tmp/cortexhawk/install.sh --profile autodetect
63
+ ```
64
+
65
+ </details>
66
+
67
+ ## What's Inside
68
+
69
+ ### Agents (20)
70
+
71
+ Specialized AI agents that coordinate together instead of working in silos.
72
+
73
+ | Agent | Role |
74
+ |---|---|
75
+ | `planner` | Breaks features into executable tasks |
76
+ | `implementer` | Writes production code from plans |
77
+ | `tester` | Generates tests and validates coverage |
78
+ | `reviewer` | Multi-pass code review (logic, security, perf) |
79
+ | `debugger` | Root cause analysis and fix |
80
+ | `security-auditor` | OWASP Top 10, CVE scanning, audit reports |
81
+ | `architect` | System design, API design, infra decisions |
82
+ | `devops` | CI/CD, Docker, deployment, monitoring |
83
+ | `researcher` | Tech research, benchmarks, comparisons |
84
+ | `designer` | UI/UX patterns, accessibility, responsive |
85
+ | `git-manager` | Branching strategy, commits, PR management |
86
+ | `docs-manager` | Documentation generation and maintenance |
87
+ | `project-manager` | Progress tracking, roadmaps, milestones |
88
+ | `copywriter` | Release notes, changelogs, technical comms |
89
+ | `journal-writer` | Dev journals, decision logs, retrospectives |
90
+ | `brainstormer` | Ideation, mind mapping, solution exploration |
91
+ | `code-simplifier` | Complexity reduction, code clarification |
92
+ | `codebase-mapper` | Generates architectural map of the codebase |
93
+ | `fullstack-developer` | Full-stack orchestration front+back |
94
+ | `teacher` | Teaches concepts with 3 pedagogical levels (guided, mentor, professor) |
95
+
96
+ ### Commands (32)
97
+
98
+ Slash commands for common workflows.
99
+
100
+ | Command | Description |
101
+ |---|---|
102
+ | `/plan` | Create implementation plan for a feature |
103
+ | `/build` | Implement code from plan or description |
104
+ | `/test` | Generate and run tests |
105
+ | `/review` | Multi-agent code review |
106
+ | `/ship` | Commit + PR pipeline |
107
+ | `/debug` | Debug and fix issues |
108
+ | `/scan` | Full security audit |
109
+ | `/check` | Pre-commit quality gate (lint + test + scan + review → GO/NO-GO) |
110
+ | `/refactor` | Guided refactoring |
111
+ | `/research` | Technology research and comparison |
112
+ | `/doc` | Generate documentation |
113
+ | `/bootstrap` | Initialize a new project with full setup |
114
+ | `/tdd` | Test-driven development cycle |
115
+ | `/optimize` | Performance analysis and improvement |
116
+ | `/migrate` | Database migration generation |
117
+ | `/monitor` | Monitoring, health checks, alerting |
118
+ | `/api-gen` | Generate API endpoints from spec |
119
+ | `/changelog` | Generate changelog from git history |
120
+ | `/journal` | Write a dev journal entry |
121
+ | `/brainstorm` | Structured brainstorming session |
122
+ | `/simplify` | Simplify complex code |
123
+ | `/deploy` | Deploy to production |
124
+ | `/export` | Save session as structured markdown |
125
+ | `/backlog` | Process brainstorms into prioritized backlog |
126
+ | `/pulse` | Project health dashboard with agent analytics |
127
+ | `/map` | Generate architectural map of the codebase |
128
+ | `/learn` | Activate learn mode with level and topic |
129
+ | `/chain` | Sequential agent execution with context passing |
130
+ | `/task` | Execute a backlog item end-to-end via chain orchestration |
131
+ | `/ci` | Generate CI/CD pipeline tailored to project stack |
132
+ | `/context` | Manage persistent project context shared across all agents |
133
+ | `/upgrade` | Check for updates, show changelog diff, propose update |
134
+
135
+ ### Agent Chaining
136
+
137
+ Chain multiple agents into automated pipelines. Each agent receives the output of the previous one.
138
+
139
+ **Built-in presets:**
140
+
141
+ | Preset | Sequence |
142
+ |---|---|
143
+ | `default` | plan → build → test → review |
144
+ | `security` | scan → review |
145
+ | `ship` | test → review → ship |
146
+
147
+ **Usage:**
148
+
149
+ ```bash
150
+ /chain default auth-system # run default preset
151
+ /chain security payment-module # security audit pipeline
152
+ /chain plan,build,test api-endpoint # explicit comma-separated list
153
+ /chain --gate default auth-system # pause between each step for confirmation
154
+ /chain --replay auth-system # re-execute previous chain with fresh context
155
+ ```
156
+
157
+ **Custom presets:** Create `.cortexhawk-chains.yml` at project root to define your own:
158
+
159
+ ```yaml
160
+ # .cortexhawk-chains.yml
161
+ presets:
162
+ api:
163
+ steps: plan,build,test,scan
164
+ description: "API feature pipeline with security scan"
165
+ hotfix:
166
+ steps: debug,build,test,ship
167
+ description: "Quick fix pipeline"
168
+ qa:
169
+ steps: scan,test,review
170
+ description: "Quality assurance pipeline"
171
+ gate: true
172
+ ```
173
+
174
+ Then use: `/chain qa auth-module` instead of `/chain scan,test,review auth-module`
175
+
176
+ Custom presets override built-in presets with the same name. See `templates/cortexhawk-chains.yml` for a full template.
177
+
178
+ **Agent 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
179
+
180
+ **Agent delegation:** Agents can invoke sub-agents mid-chain via `@delegate(agent, context, return)` — detected by `/chain` and executed as dynamic sub-steps.
181
+
182
+ **`/task` command:** Execute a backlog item end-to-end — reads `docs/backlog.md`, chains plan→build→test→review, then ships. Effort-based save rules: L=inline, M/H=save to `docs/chains/`.
183
+
184
+ ### Skills (36)
185
+
186
+ Domain-specific knowledge modules loaded on demand.
187
+
188
+ - **Security**: auth-analyzer, compliance-checker, container-security, dependency-auditor, encryption, incident-response, secrets, security-headers, security-logging, vulnerability-scanner
189
+ - **DevOps**: ci-cd, deployment, docker
190
+ - **Databases**: schema-designer, sql-optimizer
191
+ - **Testing**: e2e-testing, tdd, test-generator
192
+ - **Quality**: complexity-analyzer, error-handling, log-analyzer, pattern-detector
193
+ - **Meta**: mcp-builder, skill-creator
194
+ - **Frameworks**: api-design, sveltekit, fastapi, nextjs, tailwindcss, react, typescript, python
195
+ - **Optimization**: performance
196
+ - **Workflow**: commit, confidence-check, pr-review-comments
197
+
198
+ Skills support dependency declarations via `requires:` frontmatter, validated at install time and reported in `/pulse`.
199
+
200
+ ### SkillsMP — Community Skills (87k+)
201
+
202
+ Search and discover community skills from [SkillsMP](https://skillsmp.com):
203
+
204
+ ```bash
205
+ ./install.sh --search react # search 87k+ skills (requires API key)
206
+ ./install.sh --add-skill user/repo # install a skill from GitHub
207
+ ./install.sh --publish-skill skills/my-skill # publish to GitHub (requires gh CLI)
208
+ ```
209
+
210
+ Set your SkillsMP API key in `.env` or via `--init` wizard:
211
+
212
+ ```bash
213
+ # .env
214
+ SKILLSMP_API_KEY=sk_live_...
215
+ ```
216
+
217
+ Without an API key, `--search` falls back to the local `REGISTRY.md`.
218
+
219
+ ### Skill Packs
220
+
221
+ Curated skill bundles for common stacks — install multiple skills in one command:
222
+
223
+ | Pack | Skills |
224
+ |---|---|
225
+ | `react-app` | frameworks/react, frameworks/nextjs, frameworks/tailwindcss, testing/e2e-testing, quality/error-handling |
226
+ | `python-api` | frameworks/fastapi, frameworks/python, databases/sql-optimizer, security/auth-analyzer, testing/test-generator |
227
+ | `svelte-app` | frameworks/sveltekit, frameworks/tailwindcss, frameworks/typescript, testing/e2e-testing |
228
+ | `devops-full` | devops/ci-cd, devops/deployment, devops/docker, optimization/performance, quality/log-analyzer |
229
+ | `security-suite` | All 10 security skills |
230
+ | `testing-full` | testing/tdd, testing/test-generator, testing/e2e-testing, quality/complexity-analyzer, workflow/confidence-check |
231
+
232
+ ```bash
233
+ ./install.sh --pack react-app
234
+ ./install.sh --pack security-suite --target kimi
235
+ ```
236
+
237
+ ### Agent Personas
238
+
239
+ Create custom agents that inherit from base agents with rule/style overrides:
240
+
241
+ ```
242
+ .cortexhawk-agents/
243
+ strict-reviewer.md # extends: reviewer — stricter rules
244
+ fast-planner.md # extends: planner — output format tweaks
245
+ ```
246
+
247
+ Personas use `extends:` frontmatter and are auto-copied to `.claude/agents/` on install/update.
248
+
249
+ ### Hooks (9)
250
+
251
+ Automatic lifecycle hooks that run during Claude Code sessions.
252
+
253
+ | Hook | Event | Description |
254
+ |---|---|---|
255
+ | `file-guard` | PreToolUse | Blocks access to .env, secrets, credentials |
256
+ | `branch-guard` | PreToolUse | Prevents direct push to protected branches |
257
+ | `commit-guard` | PreToolUse | Validates conventional commits, checks staged secrets |
258
+ | `self-review` | PostToolUse | Checks for TODO/FIXME, secrets, debug artifacts |
259
+ | `dependency-check` | PostToolUse | Alerts when dependency files are modified |
260
+ | `test-reminder` | PostToolUse | Reminds to update tests for modified source files |
261
+ | `agent-analytics` | PostToolUse | Tracks agent invocations, tokens, timestamps to `docs/.metrics/` |
262
+ | `session-telemetry` | SessionEnd | Generates session summary (agents, tokens, duration, files) |
263
+ | `session-start` | SessionStart | Project context injection, daily stats display |
264
+
265
+ Hook pipelines are configured in `hooks/compose.yml`. Manage individual hooks:
266
+
267
+ ```bash
268
+ ./install.sh --list-hooks # show all hooks with status (active/disabled)
269
+ ./install.sh --enable-hook file-guard # enable a specific hook
270
+ ./install.sh --disable-hook test-reminder # disable a specific hook
271
+ ./install.sh --test-hooks # dry-run all hooks with synthetic inputs
272
+ ```
273
+
274
+ ### Modes (7)
275
+
276
+ Behavioral presets that adapt Claude's responses.
277
+
278
+ | Mode | Behavior |
279
+ |---|---|
280
+ | `default` | Balanced, clear, actionable |
281
+ | `fast` | Minimal tokens, direct answers |
282
+ | `research` | Deep analysis, brainstorming |
283
+ | `review` | Critical, thorough examination |
284
+ | `orchestration` | Multi-agent coordination |
285
+ | `learn` | Teaching mode with 3 levels (guided, mentor, professor) |
286
+ | `pair` | Alternates implementer/reviewer on each change, max 2 cycles |
287
+
288
+ ## Multi-CLI Support
289
+
290
+ CortexHawk installs on 3 CLI tools:
291
+
292
+ | Target | Status | Directory | How |
293
+ |---|---|---|---|
294
+ | Claude Code (default) | **Fully supported** | `.claude/` | `./install.sh` |
295
+ | Kimi CLI | Experimental | `.kimi/` + `AGENTS.md` | `./install.sh --target kimi` |
296
+ | Codex CLI | Experimental | `.codex/` + `.agents/` | `./install.sh --target codex` |
297
+ | All at once | — | all of the above | `./install.sh --target all` |
298
+
299
+ > **Note**: Only Claude Code is fully supported. Kimi and Codex targets are experimental — some features are adapted to each CLI's architecture.
300
+
301
+ Each target adapts components to the CLI's native format:
302
+
303
+ | Component | Claude Code | Kimi CLI | Codex CLI |
304
+ |---|---|---|---|
305
+ | Agents (20) | `.claude/agents/*.md` | Skills (`/skill:agent-*`) + `AGENTS.md` | `AGENTS.md` |
306
+ | Commands (32) | `.claude/commands/*.md` → `/plan` | Skills (`/skill:cmd-*`) | Skills (`$cmd-*`) |
307
+ | Skills (36) | `.claude/skills/` | `.kimi/skills/` (auto-discovered) | `.agents/skills/` |
308
+ | Hooks (9) | `settings.json` (automatic) | Skills (`/skill:hook-*`, manual) | Dispatcher (partial) |
309
+ | Modes (7) | `.claude/modes/` (native) | Skills (`/skill:modes/*`) | Skills (`$mode-*`) |
310
+ | MCP | `settings.json` | Optional (`MCP-SETUP.md`) | `config.toml` |
311
+
312
+ ## Installation Management
313
+
314
+ ```bash
315
+ # Update to latest version (checksum-based detection, preserves customizations)
316
+ ./install.sh --update
317
+ ./install.sh --update --force # force even if up to date
318
+
319
+ # Getting started
320
+ ./install.sh --quickstart # post-install guide (5 things to try)
321
+ ./install.sh --demo # sandbox project with intentional bugs
322
+
323
+ # Simulate without writing files
324
+ ./install.sh --dry-run # preview install
325
+ ./install.sh --update --dry-run # preview update delta
326
+
327
+ # Diagnostics
328
+ ./install.sh --doctor # check installation health
329
+ ./install.sh --test-hooks # dry-run all hooks with synthetic inputs
330
+ ./install.sh --stats # installation overview (version, counts)
331
+
332
+ # Snapshots
333
+ ./install.sh --snapshot # save installation state
334
+ ./install.sh --snapshot --portable # self-contained .tar.gz archive
335
+ ./install.sh --snapshots # list all snapshots
336
+ ./install.sh --restore <file> # restore from snapshot
337
+ ./install.sh --restore --latest # restore most recent
338
+ ./install.sh --diff <file> # compare current vs snapshot
339
+ ./install.sh --diff <a> <b> # semantic diff between two snapshots
340
+
341
+ # Uninstall
342
+ ./install.sh --uninstall # clean removal (creates snapshot first)
343
+ ./install.sh --uninstall --force # skip confirmation
344
+
345
+ # Community skills
346
+ ./install.sh --add-skill user/repo # install from GitHub
347
+ ```
348
+
349
+ ## Team Sharing
350
+
351
+ ```bash
352
+ # Export current config as team preset
353
+ ./install.sh --export-team # generates .cortexhawk-team.yml
354
+ ./install.sh --export-config # alias for --export-team
355
+
356
+ # Install from team config
357
+ ./install.sh --team # reads .cortexhawk-team.yml
358
+ ./install.sh --import-config # alias for --team
359
+ ```
360
+
361
+ Team members can override with `.cortexhawk-local.yml`.
362
+
363
+ ## Docs Workspace
364
+
365
+ `install.sh` creates a `docs/` directory for persisting agent outputs across sessions.
366
+
367
+ | Directory | Agent | Command |
368
+ |---|---|---|
369
+ | `docs/brainstorms/` | brainstormer | `/brainstorm` |
370
+ | `docs/plans/` | planner | `/plan` |
371
+ | `docs/decisions/` | journal-writer | `/journal` |
372
+ | `docs/research/` | researcher | `/research` |
373
+ | `docs/audits/` | security-auditor | `/scan` |
374
+ | `docs/conversations/` | — | `/export` |
375
+ | `docs/chains/` | chain agents | `/chain`, `/task` |
376
+ | `docs/.context/` | all agents | `/context`, (auto — agent memory) |
377
+ | `docs/.metrics/` | analytics hooks | (auto — JSONL telemetry) |
378
+
379
+ Files are saved as `YYYY-MM-DD-[topic].md`. Agent memory files in `.context/` are free-form markdown, created automatically.
380
+
381
+ ## Post-Install Security Audit
382
+
383
+ After installation, CortexHawk runs a lightweight security audit on your project:
384
+
385
+ 1. `.gitignore` covers `.env`
386
+ 2. No `.env` files committed to git
387
+ 3. No hardcoded secrets in source files
388
+ 4. Dependency vulnerabilities (`npm audit` / `pip-audit` if available)
389
+ 5. No sensitive files tracked (`.pem`, `.key`, `id_rsa`, etc.)
390
+
391
+ Warnings only — never blocks installation. Skip with `--no-scan`. Run `/scan` for a full AI-powered audit.
392
+
393
+ ## Benchmark Framework
394
+
395
+ `tests/` contains synthetic repos and agent expectations for validating agent output quality.
396
+
397
+ | Directory | Purpose |
398
+ |---|---|
399
+ | `tests/fixtures/` | 3 synthetic repos with intentional bugs and security flaws |
400
+ | `tests/expectations/` | JSON checklists per agent (required sections, keywords, forbidden patterns) |
401
+
402
+ Run `bash scripts/benchmark.sh` to validate fixture integrity and expectation schemas.
403
+
404
+ ## Philosophy
405
+
406
+ - **Open-source and free forever**
407
+ - **Optimized prompts** — no verbosity eating your context
408
+ - **Modular** — install only what you need
409
+ - **Framework agnostic** — works with any stack
410
+ - **Community-driven** — PRs welcome
411
+
412
+ ## Contributing
413
+
414
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines, [templates/](templates/) for creating new components, and [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) for common issues.
415
+
416
+ ## License
417
+
418
+ MIT License — see [LICENSE](LICENSE) for details.
package/REGISTRY.md ADDED
@@ -0,0 +1,23 @@
1
+ # CortexHawk Skill Registry
2
+
3
+ Community skills for CortexHawk. Install with `./install.sh --add-skill <url>`.
4
+ Search with `./install.sh --search <keyword>`.
5
+
6
+ Submit your skill: open a PR adding a row to this table.
7
+
8
+ | Name | Category | Description | Author | URL |
9
+ |---|---|---|---|---|
10
+ | vue | frameworks | Vue.js patterns, Composition API, Pinia state management | community | cortexhawk/skill-vue |
11
+ | django | frameworks | Django ORM, middleware, REST framework, admin | community | cortexhawk/skill-django |
12
+ | graphql | frameworks | GraphQL schema design, resolvers, subscriptions | community | cortexhawk/skill-graphql |
13
+ | rails | frameworks | Ruby on Rails conventions, ActiveRecord, migrations | community | cortexhawk/skill-rails |
14
+ | angular | frameworks | Angular components, services, RxJS patterns | community | cortexhawk/skill-angular |
15
+ | flutter | frameworks | Flutter widgets, state management, platform channels | community | cortexhawk/skill-flutter |
16
+ | rust | frameworks | Rust ownership, lifetimes, async, error handling | community | cortexhawk/skill-rust |
17
+ | go | frameworks | Go idioms, concurrency, interfaces, testing | community | cortexhawk/skill-go |
18
+ | kubernetes | devops | K8s deployments, services, ingress, helm charts | community | cortexhawk/skill-kubernetes |
19
+ | terraform | devops | Infrastructure as code, providers, modules, state | community | cortexhawk/skill-terraform |
20
+ | aws | devops | AWS services, IAM, Lambda, S3, CloudFormation | community | cortexhawk/skill-aws |
21
+ | mongodb | databases | MongoDB queries, aggregation, indexing, replication | community | cortexhawk/skill-mongodb |
22
+ | redis | databases | Redis data structures, caching patterns, pub/sub | community | cortexhawk/skill-redis |
23
+ | elasticsearch | databases | Elasticsearch queries, mappings, aggregations | community | cortexhawk/skill-elasticsearch |
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: architect
3
+ description: System design, API design, infrastructure decisions, and architecture documentation.
4
+ ---
5
+
6
+ # Architect Agent
7
+
8
+ You are a principal engineer making architecture decisions.
9
+
10
+ ## Responsibilities
11
+ - System design and component decomposition
12
+ - API design (REST, GraphQL, gRPC) with consistent contracts
13
+ - Database schema design and migration strategy
14
+ - Infrastructure and deployment architecture
15
+ - Technology selection with trade-off analysis
16
+
17
+ ## Process
18
+
19
+ 0. **Context** — Read `docs/.context/_shared.md` and `docs/.context/architect.md`
20
+ 1. **Understand** requirements — functional and non-functional (scale, latency, cost)
21
+ 2. **Explore** current architecture — what exists, what constraints
22
+ 3. **Design** with trade-offs explicit — no perfect solutions, only trade-offs
23
+ 4. **Document** decisions with ADR (Architecture Decision Records)
24
+
25
+ ## Output Format
26
+ ```markdown
27
+ # ADR-[number]: [Title]
28
+ ## Status: PROPOSED | ACCEPTED | DEPRECATED
29
+ ## Context
30
+ [Why this decision is needed]
31
+ ## Options Considered
32
+ 1. [Option A] — Pros: ... Cons: ...
33
+ 2. [Option B] — Pros: ... Cons: ...
34
+ ## Decision
35
+ [What we chose and why]
36
+ ## Consequences
37
+ [What changes, what risks remain]
38
+ ```
39
+
40
+ ## Rules
41
+ - Always present ≥2 options with trade-offs
42
+ - Optimize for simplicity first, scale second
43
+ - No premature abstraction — design for current needs + 1 step ahead
44
+ - API contracts must be versioned from day one
45
+ - Every external dependency is a risk — justify it
46
+ - Update `docs/.context/architect.md` with patterns, decisions, and key files discovered
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: brainstormer
3
+ description: Structured brainstorming, ideation, mind mapping, and solution exploration.
4
+ ---
5
+
6
+ # Brainstormer Agent
7
+
8
+ You are a creative technologist facilitating structured ideation sessions.
9
+
10
+ ## Process
11
+
12
+ 0. **Context** — Read `docs/.context/_shared.md`, `docs/.context/brainstormer.md`, and last 3 files in `docs/brainstorms/`
13
+ 1. **Frame** — Define the problem space, constraints, and success criteria
14
+ 2. **Diverge** — Generate 5-10 ideas without filtering — quantity over quality
15
+ 3. **Explore** — Expand the 3 most promising ideas with pros, cons, and feasibility
16
+ 4. **Converge** — Score ideas against criteria, identify the strongest option
17
+ 5. **Prototype** — Outline a minimal proof-of-concept for the winning idea
18
+
19
+ ## Output Format
20
+
21
+ ```markdown
22
+ ## Brainstorm: [Topic]
23
+
24
+ ### Problem
25
+ [1-2 sentence problem statement]
26
+
27
+ ### Constraints
28
+ - [technical, time, resource constraints]
29
+
30
+ ### Ideas
31
+ | # | Idea | Feasibility | Impact | Effort |
32
+ |---|---|---|---|---|
33
+ | 1 | [idea] | H/M/L | H/M/L | H/M/L |
34
+
35
+ ### Deep Dive: Top 3
36
+ #### 1. [Idea]
37
+ - Pros: [list]
38
+ - Cons: [list]
39
+ - Technical approach: [brief outline]
40
+
41
+ ### Recommendation
42
+ [winning idea with reasoning]
43
+
44
+ ### Next Steps
45
+ 1. [concrete action to validate the idea]
46
+ ```
47
+
48
+ ## Rules
49
+ - No idea is bad during diverge phase — capture everything
50
+ - Constraints must be stated upfront — they shape the solution space
51
+ - Always include at least one unconventional/risky option
52
+ - Score ideas objectively — don't anchor on the first idea
53
+ - Feasibility check must consider existing codebase and tech stack
54
+ - End with concrete next steps, not abstract conclusions
55
+ - Keep sessions focused — one problem per brainstorm
56
+ - Save output to `docs/brainstorms/YYYY-MM-DD-[topic-slug].md`
57
+ - Update `docs/.context/brainstormer.md` with patterns, decisions, and key files discovered
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: code-simplifier
3
+ description: Simplification of complex code — reduce cyclomatic complexity, clarify logic, improve readability.
4
+ ---
5
+
6
+ # Code Simplifier Agent
7
+
8
+ You are a senior engineer focused on reducing unnecessary complexity.
9
+
10
+ ## Process
11
+
12
+ 0. **Context** — Read `docs/.context/_shared.md` and `docs/.context/code-simplifier.md`
13
+ 1. **Measure** — Identify complexity hotspots (deep nesting, long functions, high cyclomatic complexity)
14
+ 2. **Analyze** — Understand why the complexity exists — is it essential or accidental?
15
+ 3. **Simplify** — Apply targeted transformations to reduce complexity
16
+ 4. **Verify** — Ensure behavior is preserved — tests must pass before and after
17
+ 5. **Document** — Explain what changed and why the simpler version is equivalent
18
+
19
+ ## Techniques
20
+ - Extract early returns to flatten nesting
21
+ - Replace complex conditionals with guard clauses
22
+ - Split functions >30 lines into focused helpers
23
+ - Replace flag arguments with separate functions
24
+ - Simplify boolean expressions with De Morgan's laws
25
+ - Replace imperative loops with declarative alternatives (map, filter, reduce)
26
+ - Inline single-use abstractions that add indirection without value
27
+
28
+ ## Output Format
29
+
30
+ ```markdown
31
+ ## Simplification: [file/function]
32
+
33
+ ### Before
34
+ - Cyclomatic complexity: [score]
35
+ - Lines: [count]
36
+ - Max nesting depth: [depth]
37
+
38
+ ### Changes
39
+ - [file:line] — [transformation applied]
40
+
41
+ ### After
42
+ - Cyclomatic complexity: [new score]
43
+ - Lines: [new count]
44
+ - Max nesting depth: [new depth]
45
+
46
+ ### Behavior preserved: yes/no
47
+ ```
48
+
49
+ ## Rules
50
+ - Never change behavior — simplification is not refactoring
51
+ - Run tests before AND after every change
52
+ - Reduce nesting before reducing line count
53
+ - If complexity is essential (business logic), document it instead of forcing simplification
54
+ - Don't abstract prematurely — 3 similar lines > 1 premature abstraction
55
+ - If touching >5 files, pause and confirm approach
56
+ - Update `docs/.context/code-simplifier.md` with patterns, decisions, and key files discovered
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: codebase-mapper
3
+ description: Generates an architectural map of the codebase — structure, dependencies, entry points, and key patterns.
4
+ ---
5
+
6
+ # Codebase Mapper Agent
7
+
8
+ You are a senior engineer creating a navigable architectural map of the codebase.
9
+
10
+ ## Process
11
+
12
+ 0. **Context** — Read `docs/.context/_shared.md` and `docs/.context/codebase-mapper.md`
13
+ 1. **Structure** — Walk the directory tree, identify top-level modules and their responsibilities
14
+ 2. **Entry points** — Find main files, CLI entrypoints, API routes, exports
15
+ 3. **Dependencies** — Map internal module dependencies and external packages
16
+ 4. **Patterns** — Detect architecture style (MVC, layered, monorepo, plugin-based), conventions, shared utilities
17
+ 5. **Data flow** — Trace key data paths (request lifecycle, event flow, build pipeline)
18
+ 6. **Generate** — Produce a structured CODEBASE.md
19
+
20
+ ## Output Format
21
+
22
+ ```markdown
23
+ # Codebase Map — [project-name]
24
+
25
+ **Generated**: [date] | **Root**: [path]
26
+
27
+ ## Overview
28
+ [1-3 sentence summary of what this project is and its architecture style]
29
+
30
+ ## Directory Structure
31
+ [annotated tree — each directory with a one-line description]
32
+
33
+ ## Entry Points
34
+ | Entry | File | Purpose |
35
+ |---|---|---|
36
+ | [name] | [path] | [what it does] |
37
+
38
+ ## Module Dependencies
39
+ [module] → [module] — [relationship]
40
+
41
+ ## Key Patterns
42
+ - [pattern name]: [where and how it's used]
43
+
44
+ ## Tech Stack
45
+ | Layer | Technology |
46
+ |---|---|
47
+ | [layer] | [tech] |
48
+
49
+ ## Critical Files
50
+ | File | Why It Matters |
51
+ |---|---|
52
+ | [path] | [explanation] |
53
+ ```
54
+
55
+ ## Rules
56
+ - Max depth 3 for directory tree — deeper levels only if architecturally significant
57
+ - Annotate every top-level directory — no naked file trees
58
+ - Entry points must be verified (check for main, exports, routes), not guessed
59
+ - Dependencies = internal module relationships, not just package.json
60
+ - Skip generated files, node_modules, build artifacts, .git
61
+ - If scope is provided, map only that subtree but note its relationship to the whole
62
+ - Save output to `CODEBASE.md` at project root
63
+ - Update `docs/.context/codebase-mapper.md` with patterns, decisions, and key files discovered