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
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: plan
3
+ description: Create an implementation plan for a feature or task.
4
+ ---
5
+
6
+ # /plan
7
+
8
+ Activate the **planner** agent. Analyze the codebase context and the user's request: `$ARGUMENTS`
9
+
10
+ 1. Scan relevant files to understand current architecture
11
+ 2. Break the work into 2-5 minute tasks
12
+ 3. Output a structured plan with tasks, files, acceptance criteria, test strategy, and rollback steps
13
+ 4. If scope is ambiguous, ask ONE question before proceeding
14
+
15
+ Keep the plan actionable — every task should be something `/build` can execute directly.
16
+
17
+ Save output to `docs/plans/YYYY-MM-DD-[feature].md`
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: pulse
3
+ description: Project health dashboard — code quality metrics at a glance.
4
+ ---
5
+
6
+ # /pulse
7
+
8
+ Activate the **project-manager** agent in health-check mode. Scope: `$ARGUMENTS`
9
+
10
+ **Flags**: `--history Nd` = show metrics trends over N days (e.g., `--history 7d`, `--history 30d`)
11
+
12
+ ## Standard mode (no flag)
13
+
14
+ 1. **Git health** — branch, uncommitted changes, last commit age, unmerged branches
15
+ 2. **Code quality** — count `TODO`, `FIXME`, `HACK` markers across source files
16
+ 3. **Dependencies** — run `npm audit` / `pip-audit` / `cargo audit` if lock file exists; check `requires:` in installed skills and report unsatisfied dependencies
17
+ 4. **Backlog** — read `docs/backlog.md` and summarize active/deferred/done counts
18
+ 5. **Tests** — run test suite if configured, report pass/fail and coverage if available
19
+ 6. **Agent analytics** — read `docs/.metrics/YYYY-MM-DD.jsonl` for today:
20
+ - Count agent invocations (lines without `"type":"session"`)
21
+ - List unique agents with invocation count per agent
22
+ - Sum `estimated_tokens` across all invocations
23
+ - If a `"type":"session"` entry exists, show duration and files modified
24
+ 7. Output single dashboard table
25
+
26
+ ## History mode (`--history Nd`)
27
+
28
+ Read all `docs/.metrics/*.jsonl` files within the requested period. For each day:
29
+ - Count agent invocations and sum `estimated_tokens` from non-session entries
30
+ - Extract `duration_seconds`, `files_modified` from `"type":"session"` entries
31
+
32
+ Output:
33
+
34
+ ```
35
+ # Metrics Trends — [N] days
36
+
37
+ | Day | Invocations | Tokens | Sessions | Avg Duration |
38
+ |------------|-------------|---------|----------|--------------|
39
+ | YYYY-MM-DD | [count] | [total] | [count] | [minutes] |
40
+
41
+ Top agents: [agent1] ×N, [agent2] ×N, ...
42
+ Total: [invocations] invocations, [tokens] tokens, [sessions] sessions
43
+ Avg: [tokens/day] tokens/day, [duration] min/session
44
+ ```
45
+
46
+ If scope is specified, limit checks to those files/directories.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: refactor
3
+ description: Improve code structure without changing behavior.
4
+ ---
5
+
6
+ # /refactor
7
+
8
+ Activate the **reviewer** agent for analysis, then the **implementer** agent for changes. Refactor: `$ARGUMENTS`
9
+
10
+ 1. Analyze current code for: duplication, complexity, coupling, naming, dead code
11
+ 2. Propose specific refactoring steps (extract function, rename, simplify conditional, etc.)
12
+ 3. Confirm approach with user before applying
13
+ 4. Apply changes incrementally — verify tests pass after each step
14
+ 5. Never change behavior — only structure
15
+
16
+ If no tests exist for the target code, generate them FIRST as a safety net.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: research
3
+ description: Research technologies, libraries, or approaches with evidence-based comparison.
4
+ ---
5
+
6
+ # /research
7
+
8
+ Activate the **researcher** agent. Research: `$ARGUMENTS`
9
+
10
+ 1. Define evaluation criteria relevant to the project
11
+ 2. Identify 3-5 candidates (include at least one underdog)
12
+ 3. Compare with evidence — benchmarks, docs, GitHub stats, real-world adoption
13
+ 4. Present comparison matrix
14
+ 5. Make a recommendation with reasoning, or state there's no clear winner
15
+
16
+ Output a structured research report with sources.
17
+
18
+ Save output to `docs/research/YYYY-MM-DD-[topic].md`
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: review
3
+ description: Multi-pass code review covering correctness, security, performance, and maintainability.
4
+ ---
5
+
6
+ # /review
7
+
8
+ Activate the **reviewer** agent. Review target: `$ARGUMENTS`
9
+
10
+ 1. If target is specified, review those files
11
+ 2. If no target, review files modified in current branch vs main
12
+ 3. Run all 4 review passes (correctness, security, performance, maintainability)
13
+ 4. Score each finding by confidence (0-100), only report ≥70
14
+ 5. Output structured report with severity, location, issue, and fix
15
+
16
+ Max 10 findings per pass. Include positive observations too.
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: scan
3
+ description: Full security audit of the project.
4
+ ---
5
+
6
+ # /scan
7
+
8
+ Activate the **security-auditor** agent. Scope: `$ARGUMENTS`
9
+
10
+ 1. If scope specified, audit those files/components
11
+ 2. If no scope, audit the entire project
12
+ 3. Check all OWASP Top 10 categories systematically
13
+ 4. Run dependency audit (npm audit / pip-audit / safety)
14
+ 5. Review security headers, auth, input validation, secrets management
15
+ 6. Generate full audit report with severity, impact, proof, and fix for each finding
16
+
17
+ Output a structured security audit report in markdown.
18
+
19
+ Save output to `docs/audits/YYYY-MM-DD-[scope].md`
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: ship
3
+ description: Commit, create PR, and prepare for deployment.
4
+ ---
5
+
6
+ # /ship
7
+
8
+ Activate the **git-manager** agent, then the **reviewer** agent. Ship: `$ARGUMENTS`
9
+
10
+ 0. Read `## Git Workflow` from CLAUDE.md if present — respect PR preference and auto-push settings
11
+ 1. Stage changes and generate conventional commit message
12
+ 2. Run quick review pass — reviewer runs Pass 1 (Correctness) and Pass 2 (Security) only, reporting Critical findings exclusively
13
+ 3. If review passes, commit and push
14
+ 4. Create PR with description, testing notes, and checklist
15
+ 5. If review finds critical issues, report them and stop — don't ship broken code
16
+
17
+ Format: `feat(scope): description` or `fix(scope): description`
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: simplify
3
+ description: Simplify complex code without changing behavior.
4
+ ---
5
+
6
+ # /simplify
7
+
8
+ Activate the **code-simplifier** agent. Target: `$ARGUMENTS`
9
+
10
+ 1. Measure current complexity (nesting depth, cyclomatic complexity, line count)
11
+ 2. Identify accidental vs essential complexity
12
+ 3. Apply simplification transforms (early returns, guard clauses, extract helpers)
13
+ 4. Verify tests pass after each change
14
+ 5. Report before/after complexity metrics
15
+
16
+ Behavior must be preserved — simplification is not refactoring.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: task
3
+ description: Execute a backlog item end-to-end via chain orchestration.
4
+ ---
5
+
6
+ # /task
7
+
8
+ Activate the **project-manager** agent as orchestrator. Execute backlog item `$ARGUMENTS` through the full development chain.
9
+
10
+ 0. Read `docs/backlog.md` and extract the row matching the given `#N`
11
+ 1. If item not found or already done, report and stop
12
+ 2. Mark item as `active` in backlog
13
+ 3. Display item summary (feature, impact, effort, source)
14
+ 4. Determine save mode from effort level (see Save Rules below)
15
+ 5. Execute chain (plan, build, test, review) with the feature description as topic
16
+ 6. Update `CHANGELOG.md` with a one-line entry under the current version's `### Added` section
17
+ 7. If chain completes without critical blockers, execute `/ship`
18
+ 8. Mark item as `done` in backlog
19
+
20
+ ## Save Rules
21
+
22
+ - **Effort L** — execute chain inline, no `docs/chains/` output (commit is the trace)
23
+ - **Effort M/H** — save each step to `docs/chains/YYYY-MM-DD-{slug}/` + `SUMMARY.md`, link to `docs/plans/` (symlink by default)
24
+ - **`--save` flag** — forces save to `docs/chains/` regardless of effort level
25
+ - **`--copy` flag** — use physical copy with provenance header instead of symlink
26
+ - **Effort H** — also use `--gate` mode (pause between chain steps for confirmation)
27
+
28
+ ## Rules
29
+
30
+ - Argument must be a backlog number (e.g., `/task #36` or `/task 36`)
31
+ - If the item has a linked brainstorm, read it for additional context before planning
32
+ - Do not auto-ship if review found critical issues — report and stop
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: tdd
3
+ description: Test-driven development workflow — red-green-refactor cycle.
4
+ ---
5
+
6
+ # /tdd
7
+
8
+ Activate the **tester** agent, then the **implementer** agent. TDD target: `$ARGUMENTS`
9
+
10
+ 1. **Red** — Write a failing test for the desired behavior
11
+ 2. Run the test — confirm it fails for the right reason
12
+ 3. **Green** — Write the minimum code to make the test pass
13
+ 4. Run the test — confirm it passes
14
+ 5. **Refactor** — Clean up code while keeping tests green
15
+ 6. Repeat for the next behavior
16
+
17
+ Never write production code without a failing test first.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: test
3
+ description: Generate and run tests for a component or recent changes.
4
+ ---
5
+
6
+ # /test
7
+
8
+ Activate the **tester** agent. Test target: `$ARGUMENTS`
9
+
10
+ 1. Detect the test framework in use
11
+ 2. If target is specified, generate tests for it
12
+ 3. If no target, generate tests for recently modified files
13
+ 4. Run the tests and report results
14
+ 5. Identify coverage gaps and suggest additional tests
15
+
16
+ Prioritize: happy path → error paths → edge cases → integration.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: upgrade
3
+ description: Check for CortexHawk updates and show what changed
4
+ agent: project-manager
5
+ ---
6
+
7
+ # /upgrade
8
+
9
+ Check if a newer version of CortexHawk is available and propose updating.
10
+
11
+ ## Process
12
+
13
+ 1. Run `./install.sh --check-update` to detect version delta
14
+ 2. If update available, show the changelog diff
15
+ 3. Ask the user if they want to update
16
+ 4. If yes, run `./install.sh --update`
17
+ 5. After update, run `./install.sh --stats` to confirm
18
+
19
+ ## Output
20
+
21
+ Version comparison + changelog delta + update command.
22
+
23
+ ## Rules
24
+
25
+ - Never auto-update without user confirmation
26
+ - Show `--dry-run` option for preview
27
+ - If already up to date, report and stop