haac-aikit 0.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 (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -0
  3. package/catalog/agents/backend.md +49 -0
  4. package/catalog/agents/devops.md +74 -0
  5. package/catalog/agents/frontend.md +49 -0
  6. package/catalog/agents/implementer.md +55 -0
  7. package/catalog/agents/mobile.md +48 -0
  8. package/catalog/agents/orchestrator.md +53 -0
  9. package/catalog/agents/planner.md +59 -0
  10. package/catalog/agents/researcher.md +62 -0
  11. package/catalog/agents/reviewer.md +70 -0
  12. package/catalog/agents/security-auditor.md +73 -0
  13. package/catalog/agents/tester.md +63 -0
  14. package/catalog/ci/agents-md-sync.yml +42 -0
  15. package/catalog/ci/ci.yml +24 -0
  16. package/catalog/ci/claude.yml +20 -0
  17. package/catalog/ci/secret-scan.yml +20 -0
  18. package/catalog/commands/commit-push-pr.md +21 -0
  19. package/catalog/commands/commit.md +17 -0
  20. package/catalog/commands/debug.md +17 -0
  21. package/catalog/commands/execute.md +13 -0
  22. package/catalog/commands/explore.md +26 -0
  23. package/catalog/commands/plan.md +19 -0
  24. package/catalog/commands/review.md +17 -0
  25. package/catalog/commands/security-review.md +33 -0
  26. package/catalog/commands/ship.md +21 -0
  27. package/catalog/commands/tdd.md +21 -0
  28. package/catalog/devcontainer/devcontainer.json +24 -0
  29. package/catalog/hooks/block-dangerous-bash.sh +30 -0
  30. package/catalog/hooks/block-force-push-main.sh +22 -0
  31. package/catalog/hooks/block-secrets-in-commits.sh +37 -0
  32. package/catalog/hooks/compaction-preservation.sh +29 -0
  33. package/catalog/hooks/file-guard.sh +30 -0
  34. package/catalog/hooks/format-on-save.sh +43 -0
  35. package/catalog/hooks/hooks.json +70 -0
  36. package/catalog/hooks/session-start-prime.sh +31 -0
  37. package/catalog/husky/commit-msg +4 -0
  38. package/catalog/husky/commitlint.config.js +8 -0
  39. package/catalog/husky/gitleaks.toml +10 -0
  40. package/catalog/husky/lintstagedrc.json +5 -0
  41. package/catalog/husky/pre-commit +4 -0
  42. package/catalog/husky/pre-push +18 -0
  43. package/catalog/mcp/mcp.json +19 -0
  44. package/catalog/plugin/plugin.json +10 -0
  45. package/catalog/rules/AGENTS.md.tmpl +46 -0
  46. package/catalog/rules/CLAUDE.md.shim +5 -0
  47. package/catalog/rules/GEMINI.md.shim +5 -0
  48. package/catalog/rules/aider-conventions.md +5 -0
  49. package/catalog/rules/aider.conf.yml +5 -0
  50. package/catalog/rules/copilot-instructions.md +6 -0
  51. package/catalog/rules/cursor-base.mdc +13 -0
  52. package/catalog/rules/windsurf-rules.md +7 -0
  53. package/catalog/settings/env.example +7 -0
  54. package/catalog/settings/settings.json +45 -0
  55. package/catalog/skills/tier1/brainstorming.md +39 -0
  56. package/catalog/skills/tier1/codebase-exploration.md +55 -0
  57. package/catalog/skills/tier1/executing-plans.md +34 -0
  58. package/catalog/skills/tier1/requesting-code-review.md +37 -0
  59. package/catalog/skills/tier1/systematic-debugging.md +50 -0
  60. package/catalog/skills/tier1/test-driven-development.md +44 -0
  61. package/catalog/skills/tier1/using-git-worktrees.md +43 -0
  62. package/catalog/skills/tier1/verification-before-completion.md +46 -0
  63. package/catalog/skills/tier1/writing-commits.md +52 -0
  64. package/catalog/skills/tier1/writing-plans.md +42 -0
  65. package/catalog/skills/tier2/claude-md-improver.md +42 -0
  66. package/catalog/skills/tier2/dependency-hygiene.md +52 -0
  67. package/catalog/skills/tier2/dispatching-parallel-agents.md +43 -0
  68. package/catalog/skills/tier2/finishing-a-development-branch.md +48 -0
  69. package/catalog/skills/tier2/receiving-code-review.md +49 -0
  70. package/catalog/skills/tier2/refactoring-simplify.md +40 -0
  71. package/catalog/skills/tier2/security-review.md +48 -0
  72. package/catalog/skills/tier2/writing-pull-requests.md +47 -0
  73. package/dist/cli.mjs +2161 -0
  74. package/dist/cli.mjs.map +1 -0
  75. package/package.json +64 -0
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: using-git-worktrees
3
+ description: Use when starting work on a new feature, experiment, or large refactor that should be isolated from the current working tree. Prevents clobbering in-progress work and enables parallel development across multiple branches simultaneously.
4
+ version: "1.0.0"
5
+ source: obra/superpowers
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - Starting a feature that will take multiple sessions
11
+ - Running a risky refactor you might want to abandon
12
+ - Exploring an approach in parallel with the current code
13
+ - When the human says "try this in isolation" or "don't touch the main branch"
14
+
15
+ ## Setup
16
+
17
+ ```bash
18
+ # Create a new worktree for a feature branch
19
+ git worktree add ../my-repo-feature feature/my-feature
20
+
21
+ # Work in the isolated tree
22
+ cd ../my-repo-feature
23
+
24
+ # When done, remove the worktree
25
+ cd ../my-repo
26
+ git worktree remove ../my-repo-feature
27
+ ```
28
+
29
+ ## Rules
30
+
31
+ 1. **Name worktrees clearly**: `<repo>-<branch-slug>` in a sibling directory, not a subdirectory of the main repo.
32
+
33
+ 2. **One branch per worktree**: git enforces this — the same branch cannot be checked out in two worktrees simultaneously.
34
+
35
+ 3. **Don't commit from the wrong tree**: confirm `git branch` shows the expected branch before committing.
36
+
37
+ 4. **Clean up after merging**: `git worktree list` shows dangling worktrees; remove them with `git worktree remove`.
38
+
39
+ 5. **Shared objects, separate index**: changes in a worktree do not affect the main tree's index or stash. You can run tests, build, and experiment without touching the main tree's state.
40
+
41
+ ## When NOT to use
42
+ - Small, low-risk changes — a worktree adds overhead for a 5-minute fix
43
+ - When you need the full IDE toolchain to be pointed at the worktree (some tools don't follow worktrees well)
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: verification-before-completion
3
+ description: Use before reporting any task as complete. Ensures claims of success are backed by evidence, not assumption. Prevents marking work done when it compiles but doesn't actually do what was asked.
4
+ version: "1.0.0"
5
+ source: obra/superpowers
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - Before saying "done", "complete", "implemented", "fixed"
11
+ - After any code change that was meant to achieve a specific outcome
12
+ - Before handing off to the human for review
13
+
14
+ ## Verification checklist
15
+
16
+ Before claiming completion, provide evidence for each applicable item:
17
+
18
+ **1. The change does what was requested**
19
+ - Run the affected test(s) — paste the output
20
+ - Or run the specific command / endpoint that demonstrates the behaviour
21
+ - Do not assert "this should work" — show that it does
22
+
23
+ **2. Nothing else broke**
24
+ - Run the full test suite (or the relevant subset) — paste the pass/fail count
25
+ - If tests are slow, run at minimum: the directly affected tests + integration tests
26
+
27
+ **3. Type safety is maintained**
28
+ - `tsc --noEmit` passes without error
29
+ - No `@ts-ignore` was added without a documented justification
30
+
31
+ **4. The code is in the right shape**
32
+ - Dead code removed from the path you modified
33
+ - No debug logging (`console.log`) left in
34
+ - No TODO comments introduced without a corresponding issue
35
+
36
+ ## Reporting completion
37
+
38
+ Structure:
39
+ ```
40
+ Done. Evidence:
41
+ - [test name]: PASS (output: ...)
42
+ - Full suite: X passed, 0 failed
43
+ - TypeScript: clean
44
+ ```
45
+
46
+ Do not say "this should work" or "I believe this is correct." Show the output.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: writing-commits
3
+ description: Use when creating a git commit. Enforces Conventional Commits format, prevents committing secrets or debug artifacts, and ensures the commit message explains why rather than what. Never use --no-verify or --amend on published commits.
4
+ version: "1.0.0"
5
+ source: haac-aikit
6
+ license: MIT
7
+ ---
8
+
9
+ ## Commit format
10
+
11
+ ```
12
+ type(scope): description
13
+
14
+ [optional body: one paragraph explaining WHY, not WHAT]
15
+
16
+ Co-Authored-By: Claude <noreply@anthropic.com>
17
+ ```
18
+
19
+ **Types**: `feat` `fix` `refactor` `test` `docs` `chore` `perf`
20
+ **Scope**: the module, file group, or feature area (e.g. `auth`, `api`, `cli`)
21
+ **Description**: imperative mood, ≤72 chars, no period
22
+
23
+ ## Pre-commit checklist
24
+
25
+ Before staging:
26
+ 1. `git diff --staged` — confirm no `.env*`, `secrets/`, `*.pem`, `id_rsa*` files
27
+ 2. No `console.log` / debug output left in
28
+ 3. No `// @ts-ignore` added without a comment explaining why
29
+ 4. No TODO comments pointing at unresolved issues introduced in this commit
30
+
31
+ ## Creating the commit
32
+
33
+ Always use HEREDOC to preserve newlines:
34
+ ```bash
35
+ git commit -m "$(cat <<'EOF'
36
+ feat(auth): add refresh token rotation
37
+
38
+ Refresh tokens are now single-use; each use issues a new token pair.
39
+ This prevents replay attacks from stolen refresh tokens while keeping
40
+ sessions alive without re-authentication.
41
+
42
+ Co-Authored-By: Claude <noreply@anthropic.com>
43
+ EOF
44
+ )"
45
+ ```
46
+
47
+ ## Safety rules
48
+
49
+ - **Never** `git push --force` to `main`/`master`/`develop`
50
+ - **Never** `git commit --no-verify`
51
+ - **Never** `git commit --amend` on a commit that has been pushed
52
+ - If a pre-commit hook fails: fix the underlying issue, re-stage, create a NEW commit
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: writing-plans
3
+ description: Use when starting a multi-step implementation task, before entering plan mode, or when the human asks you to plan. Turns an approved approach into a sequenced, bite-sized plan that a second agent could execute without further clarification.
4
+ version: "1.0.0"
5
+ source: obra/superpowers
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - Any task that touches more than 2 files or has more than 3 steps
11
+ - Before running /execute or dispatching an implementer agent
12
+ - When the human says "plan this" or "let's plan before we build"
13
+
14
+ ## Plan structure
15
+
16
+ ```
17
+ PLAN:
18
+ 1. [concrete action] — [why: what it enables]
19
+ 2. [concrete action] — [why: dependency or risk managed]
20
+ ...
21
+ N. [concrete action] — [why]
22
+ → Executing unless you redirect.
23
+ ```
24
+
25
+ ## Rules for a good plan
26
+
27
+ **Each step must be**:
28
+ - An action that produces a verifiable artifact (file created, test passes, function deleted)
29
+ - Independently reversible without undoing prior steps
30
+ - Executable by someone who hasn't read the previous steps
31
+
32
+ **Order steps by dependency**: if step N needs step N-1 to be done first, they are sequential. Steps with no dependency on each other can be done in parallel (mark them explicitly).
33
+
34
+ **Include a verification step** at the end: "Run tests; confirm no regressions."
35
+
36
+ ## What not to include
37
+ - Vague steps like "refactor the auth module" — decompose until atomic
38
+ - Steps that say "figure out how X works" — that's exploration, not a plan step
39
+ - More than 10 steps — if the plan is longer, split into phases
40
+
41
+ ## Before executing
42
+ Present the full plan to the human. Confirm they approve before taking any action. If they redirect, revise the plan before executing.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: claude-md-improver
3
+ description: Use when CLAUDE.md (or AGENTS.md) has grown stale, too long, or needs reorganisation. Audits the file against the ≤200 line budget, removes noise, promotes high-signal rules, and restructures to put critical rules at the front and back (primacy + recency bias).
4
+ version: "1.0.0"
5
+ source: anthropics/skills
6
+ license: Apache-2.0
7
+ ---
8
+
9
+ ## When to use
10
+ - CLAUDE.md is over 150 lines and growing
11
+ - Rules are being ignored by the agent despite being written down
12
+ - After a significant architectural change makes old rules stale
13
+ - When the human says "clean up CLAUDE.md" or "update AGENTS.md"
14
+
15
+ ## Audit checklist
16
+
17
+ ### Size gate (≤200 lines per Anthropic guidance)
18
+ - Count lines: `wc -l CLAUDE.md`
19
+ - If over 200: identify candidates for removal or migration to skills
20
+
21
+ ### Content that should be removed
22
+ - [ ] Rules the agent never violates (no-ops — remove them)
23
+ - [ ] Rules duplicating linter/formatter enforcement (let tooling own it)
24
+ - [ ] Historical context that belongs in the PR description, not here
25
+ - [ ] Vague rules like "write good code" — if it can't be violated, it's not a rule
26
+ - [ ] Stack-specific details that belong in a skill, not global context
27
+
28
+ ### Content that should stay
29
+ - [ ] Non-negotiable project-specific rules (things the agent gets wrong repeatedly)
30
+ - [ ] Security constraints that must fire every session
31
+ - [ ] Domain vocabulary the agent needs to understand
32
+
33
+ ### Structure
34
+ Reorder rules so:
35
+ 1. **First 5 lines**: the single most critical constraint
36
+ 2. **Middle**: supporting rules
37
+ 3. **Last 5 lines**: the second most critical constraint (recency bias)
38
+
39
+ ## After editing
40
+ - Confirm: `wc -l CLAUDE.md` ≤200
41
+ - Run a test session to confirm critical rules are still followed
42
+ - Commit with `docs(claude): trim CLAUDE.md to [N] lines`
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: dependency-hygiene
3
+ description: Use before installing any new package. Evaluates whether the dependency is necessary, checks for existing alternatives in the codebase, assesses license compatibility and maintenance health. Prevents dependency bloat and security surface expansion.
4
+ version: "1.0.0"
5
+ source: haac-aikit
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - Before `npm install`, `pip install`, `go get`, `cargo add`
11
+ - When the human says "we need a library for X"
12
+ - When refactoring and wondering if a dep can be removed
13
+
14
+ ## Pre-install checklist
15
+
16
+ ### 1. Is it already covered?
17
+ ```bash
18
+ # Check if the functionality is already available
19
+ grep -r "require\|import" src/ | grep -i "<keyword>"
20
+ cat package.json | grep -i "<keyword>"
21
+ ```
22
+ Check built-in language APIs first — `node:crypto`, `node:fs`, standard library.
23
+
24
+ ### 2. What does this dep cost?
25
+ ```bash
26
+ npx cost-of-modules <package> # or bundlephobia.com
27
+ npm info <package> | head -20 # version, maintainers, last publish
28
+ ```
29
+ - Bundle size impact (for browser code)
30
+ - Transitive dependency count
31
+ - Last published date (>2 years without activity is a yellow flag)
32
+
33
+ ### 3. License check
34
+ - MIT, Apache 2.0, BSD: generally safe
35
+ - GPL, AGPL: may require open-sourcing your code — confirm with policy
36
+ - Proprietary: requires explicit approval
37
+ - Check: `npm info <package> license`
38
+
39
+ ### 4. Maintenance health
40
+ - Stars + recent activity on GitHub (not a hard requirement, but signals)
41
+ - Open CVEs: `npm audit` after install, or check Snyk/OSV
42
+
43
+ ## Decision output
44
+ ```
45
+ Dependency assessment: <package>
46
+ - Existing coverage: [none / partial via X]
47
+ - Bundle size: [Xkb / not applicable]
48
+ - License: [MIT / ...]
49
+ - Last release: [date]
50
+ - Verdict: [INSTALL / USE_BUILTIN(X) / DEFER / REJECT]
51
+ - Reason: [one sentence]
52
+ ```
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: dispatching-parallel-agents
3
+ description: Use when a task can be decomposed into independent sub-tasks that don't share state. Fan out to fresh subagents to work in parallel, then synthesise results. Prevents serialising work that could run concurrently and wastes wall-clock time.
4
+ version: "1.0.0"
5
+ source: obra/superpowers
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - Research across multiple files/modules that don't depend on each other
11
+ - Running the same operation on several independent targets (e.g. reviewing 4 services)
12
+ - Gathering information from multiple sources simultaneously
13
+
14
+ ## Decomposition rules
15
+
16
+ A sub-task is safe to parallelise if:
17
+ 1. It requires no output from another concurrent sub-task
18
+ 2. It does not write to shared state (files, databases, branches)
19
+ 3. Its result is a summary or report, not a mutation
20
+
21
+ If any sub-task writes files: do not parallelise — writing conflicts produce unpredictable results.
22
+
23
+ ## Dispatch format
24
+
25
+ ```
26
+ Dispatching [N] parallel agents:
27
+ - Agent 1: [role] — [specific task] — returns: [expected output format]
28
+ - Agent 2: [role] — [specific task] — returns: [expected output format]
29
+ - Agent N: [role] — [specific task] — returns: [expected output format]
30
+ ```
31
+
32
+ Each agent brief must be self-contained — include file paths, relevant context, and the exact question to answer. The agent has no memory of this conversation.
33
+
34
+ ## Synthesis
35
+
36
+ After all agents return:
37
+ 1. Identify agreements and conflicts across their outputs
38
+ 2. Resolve conflicts explicitly (don't average or ignore them)
39
+ 3. Produce a unified summary with sources attributed
40
+
41
+ ## Tool
42
+
43
+ Use the `Agent` tool with `run_in_background: true` for genuinely parallel tasks. Send multiple tool calls in a single message.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: finishing-a-development-branch
3
+ description: Use when a feature or fix is complete and needs to be merged. Guides the merge/PR/cleanup decision tree to ensure branches land cleanly, CI passes, and the branch is removed after merging.
4
+ version: "1.0.0"
5
+ source: obra/superpowers
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - "I think this is ready to merge"
11
+ - "How do I finish this branch?"
12
+ - After verification-before-completion confirms the implementation is correct
13
+
14
+ ## Decision tree
15
+
16
+ ### 1. Is the branch up to date with the base?
17
+ ```bash
18
+ git fetch origin
19
+ git log HEAD..origin/main --oneline
20
+ ```
21
+ If behind: `git rebase origin/main` (preferred over merge for feature branches).
22
+
23
+ ### 2. Are all tests passing?
24
+ Run the full suite. If not: fix before merging.
25
+
26
+ ### 3. Is the diff clean?
27
+ ```bash
28
+ git diff main...HEAD --stat
29
+ ```
30
+ - No unintended files (build artifacts, `.env*`, debug code)
31
+ - Commit messages are conventional and meaningful
32
+
33
+ ### 4. Create or update the PR
34
+ If no PR exists: use the `writing-pull-requests` skill.
35
+ If PR exists: push, confirm CI is green before requesting review.
36
+
37
+ ### 5. After merge
38
+ ```bash
39
+ git checkout main
40
+ git pull
41
+ git branch -d feature/my-feature # local cleanup
42
+ git push origin --delete feature/my-feature # remote cleanup (if not auto-deleted)
43
+ ```
44
+
45
+ ## Protected branch rules
46
+ - Never merge directly to `main`/`master` without a PR unless the repo explicitly allows it
47
+ - Never `git push --force` to a protected branch
48
+ - If a PR is squash-merged, the feature branch commits disappear — that's expected
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: receiving-code-review
3
+ description: Use when processing code review feedback. Ensures each finding is genuinely addressed with verification, not performatively acknowledged. Prevents the pattern of saying "good point, fixed!" without actually making the change or thinking through its implications.
4
+ version: "1.0.0"
5
+ source: obra/superpowers
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - After receiving review comments on a PR
11
+ - After a code-reviewer agent returns findings
12
+ - When the human gives feedback on code you wrote
13
+
14
+ ## Processing protocol
15
+
16
+ ### 1. Triage each finding
17
+
18
+ For each finding, classify:
19
+ - **Must fix**: correctness issue, security vulnerability, broken contract
20
+ - **Should fix**: code quality, maintainability, convention violation
21
+ - **Consider**: style preference, subjective tradeoff, nice-to-have
22
+
23
+ ### 2. For each finding you're addressing
24
+
25
+ 1. Understand *why* the reviewer flagged it (not just what they said)
26
+ 2. Make the change
27
+ 3. Verify: run the affected tests, confirm the finding is resolved
28
+ 4. Note what you changed in a brief summary
29
+
30
+ ### 3. For each finding you're declining
31
+
32
+ 1. State your reasoning clearly (one sentence)
33
+ 2. If you disagree with a Must fix, defer to the human — do not override
34
+ 3. If it's a style preference and you have a documented reason, explain once
35
+
36
+ ### 4. Report back
37
+
38
+ ```
39
+ Review addressed:
40
+ ✓ [finding 1]: [what changed]
41
+ ✓ [finding 2]: [what changed]
42
+ → [finding 3]: declined — [reason]
43
+ ```
44
+
45
+ ## Anti-patterns to avoid
46
+ - "Good catch, fixed!" without showing the fix
47
+ - Addressing the symptom the reviewer mentioned without fixing the underlying issue
48
+ - Defensive explanations that don't lead to a resolution
49
+ - Marking all findings as acknowledged without changing anything
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: refactoring-simplify
3
+ description: Use when reviewing code for over-engineering, duplication, or dead code. Identifies unnecessary abstractions, premature generalisations, and code that should be deleted. Three similar lines is better than a premature abstraction — this skill enforces that principle.
4
+ version: "1.0.0"
5
+ source: anthropics/skills
6
+ license: Apache-2.0
7
+ ---
8
+
9
+ ## When to use
10
+ - After a feature is complete and tests are green
11
+ - When the human says "clean this up" or "simplify this"
12
+ - When code review finds the abstraction is unclear
13
+
14
+ ## Simplification checklist
15
+
16
+ ### Duplication
17
+ - [ ] Is the same logic copy-pasted in ≥3 places? → extract a function
18
+ - [ ] Is the same logic copy-pasted in 2 places? → leave it; wait for a third before abstracting
19
+ - [ ] Are there near-identical functions that differ by one variable? → parameterise
20
+
21
+ ### Over-abstraction
22
+ - [ ] Does the abstraction have only one caller? → inline it
23
+ - [ ] Does the abstraction require understanding 3+ files to use? → likely too abstract
24
+ - [ ] Is there an interface with only one implementation? → remove the interface
25
+
26
+ ### Dead code
27
+ - [ ] Functions that are never called (check with grep + TypeScript `noUnusedLocals`)
28
+ - [ ] Branches that can never be reached (check for impossible conditions)
29
+ - [ ] Feature flags that are always true or always false
30
+ - [ ] Commented-out code blocks → delete (git history preserves history)
31
+
32
+ ### Naming
33
+ - [ ] Misleading names: a function named `getUser` that also creates a user
34
+ - [ ] Generic names (`data`, `result`, `temp`, `obj`) that could be more descriptive
35
+ - [ ] Abbreviations that aren't universally understood in this domain
36
+
37
+ ## Rules
38
+ - Do not refactor without green tests first
39
+ - Do not mix refactoring commits with behaviour changes
40
+ - Do not extract an abstraction "for future use" — YAGNI
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: security-review
3
+ description: Use before committing code that handles user input, authentication, file operations, external API calls, or environment variables. Performs an OWASP-aligned sweep to catch injection, auth, secrets, and access-control vulnerabilities before they reach main.
4
+ version: "1.0.0"
5
+ source: haac-aikit
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - Before creating a PR that touches auth, API endpoints, file I/O, or env handling
11
+ - When the human asks for a security review
12
+ - After adding any new external-facing surface
13
+
14
+ ## Review checklist
15
+
16
+ ### Injection (A03)
17
+ - [ ] All SQL queries use parameterised statements / ORM — no string concatenation
18
+ - [ ] Shell commands use `execFile`/`spawnFile` with arg arrays — never pass user data to shell-form exec
19
+ - [ ] Template rendering sanitises HTML — no direct `innerHTML = userInput`
20
+ - [ ] File paths constructed from user input are canonicalised and bounded
21
+
22
+ ### Authentication & session (A07)
23
+ - [ ] Tokens are not logged or included in error responses
24
+ - [ ] Session IDs are regenerated on privilege escalation
25
+ - [ ] Password resets use time-limited, single-use tokens
26
+
27
+ ### Sensitive data (A02)
28
+ - [ ] No secrets, API keys, or credentials in source code
29
+ - [ ] No secrets in log output
30
+ - [ ] Env vars are validated at startup — missing required secrets fail fast
31
+ - [ ] `console.log(req)` or `console.log(user)` that might expose sensitive fields
32
+
33
+ ### Access control (A01)
34
+ - [ ] Every endpoint/route checks authorisation — not just authentication
35
+ - [ ] Resource ownership is verified (user can only access their own resources)
36
+ - [ ] Admin/privileged routes are explicitly gated
37
+
38
+ ### Supply chain (A06)
39
+ - [ ] No new dependencies installed without `dependency-hygiene` review
40
+ - [ ] `npm audit` / `pip-audit` passes
41
+
42
+ ## Output format
43
+ ```
44
+ Security sweep: [scope]
45
+ ✓ No issues found in [category]
46
+ ⚠ [category]: [finding] at [file:line] — [recommended fix]
47
+ ✗ [critical finding] — MUST fix before merge
48
+ ```
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: writing-pull-requests
3
+ description: Use when creating a pull request. Produces a PR title under 70 characters and a body with Summary and Test Plan sections that give reviewers everything they need without having to read the full diff.
4
+ version: "1.0.0"
5
+ source: haac-aikit
6
+ license: MIT
7
+ ---
8
+
9
+ ## When to use
10
+ - After finishing a branch and all tests pass
11
+ - When the human says "create a PR" or "open a PR"
12
+
13
+ ## PR format
14
+
15
+ ```bash
16
+ gh pr create --title "<type>(scope): short description" --body "$(cat <<'EOF'
17
+ ## Summary
18
+ - [What changed — bullet per logical unit]
19
+ - [Why it was needed]
20
+ - [Any breaking changes or migration steps]
21
+
22
+ ## Test plan
23
+ - [ ] [How to verify behaviour 1]
24
+ - [ ] [How to verify behaviour 2]
25
+ - [ ] Full suite: `npm test` passes
26
+
27
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
28
+ EOF
29
+ )"
30
+ ```
31
+
32
+ ## Title rules
33
+ - ≤70 characters
34
+ - Conventional Commits format: `type(scope): description`
35
+ - Imperative mood: "add auth middleware", not "added" or "adds"
36
+ - Describes the change, not the solution: "fix session expiry bug", not "fix tokenStore.refresh logic"
37
+
38
+ ## Body rules
39
+ - Summary is bullets — not prose paragraphs
40
+ - Test plan is a checklist the reviewer can actually run
41
+ - Include migration steps if there are schema changes, config changes, or required env vars
42
+ - Do not include the full commit history or a timeline of how you got here
43
+
44
+ ## Pre-create checklist
45
+ 1. `git log main...HEAD --oneline` — confirm commits are clean
46
+ 2. `gh pr list --head $(git branch --show-current)` — confirm no duplicate PR
47
+ 3. CI is green on the branch (check with `gh pr checks`)