@rmyndharis/aimhooman 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 (54) hide show
  1. package/.agents/rules/aimhooman.md +53 -0
  2. package/.claude-plugin/marketplace.json +23 -0
  3. package/.claude-plugin/plugin.json +9 -0
  4. package/.clinerules/aimhooman.md +53 -0
  5. package/.codex-plugin/plugin.json +37 -0
  6. package/.cursor/rules/aimhooman.mdc +59 -0
  7. package/.gemini/settings.json +7 -0
  8. package/.github/copilot-instructions.md +53 -0
  9. package/.github/hooks/aimhooman.json +22 -0
  10. package/.kiro/steering/aimhooman.md +53 -0
  11. package/.windsurf/rules/aimhooman.md +57 -0
  12. package/AGENTS.md +53 -0
  13. package/CHANGELOG.md +153 -0
  14. package/CODE_OF_CONDUCT.md +128 -0
  15. package/CONTRIBUTING.md +144 -0
  16. package/GEMINI.md +53 -0
  17. package/LICENSE +21 -0
  18. package/README.md +472 -0
  19. package/SECURITY.md +74 -0
  20. package/bin/aimhooman.mjs +1589 -0
  21. package/docs/design/agent-portability.md +73 -0
  22. package/docs/design/frictionless-enforcement.md +135 -0
  23. package/docs/hosts.json +164 -0
  24. package/docs/logo/aimhooman-logo.png +0 -0
  25. package/docs/logo/aimhooman.png +0 -0
  26. package/hooks/hooks.json +29 -0
  27. package/package.json +77 -0
  28. package/rules/attribution.json +142 -0
  29. package/rules/markers.json +88 -0
  30. package/rules/paths.json +407 -0
  31. package/rules/secrets.json +90 -0
  32. package/schemas/overrides.schema.json +134 -0
  33. package/schemas/project-policy.schema.json +12 -0
  34. package/schemas/rule-pack.schema.json +126 -0
  35. package/schemas/scan-report.schema.json +165 -0
  36. package/skills/aimhooman/SKILL.md +65 -0
  37. package/src/args.mjs +72 -0
  38. package/src/atomic-write.mjs +285 -0
  39. package/src/codex-manifest.mjs +65 -0
  40. package/src/exclude.mjs +125 -0
  41. package/src/git-environment.mjs +5 -0
  42. package/src/git-path.mjs +5 -0
  43. package/src/githooks.mjs +813 -0
  44. package/src/gitx.mjs +721 -0
  45. package/src/history-scan.mjs +295 -0
  46. package/src/hook.mjs +2602 -0
  47. package/src/policy-resolver.mjs +200 -0
  48. package/src/report.mjs +63 -0
  49. package/src/rules.mjs +509 -0
  50. package/src/ruleset-text.mjs +29 -0
  51. package/src/scan-session.mjs +152 -0
  52. package/src/scan-target.mjs +697 -0
  53. package/src/scan.mjs +325 -0
  54. package/src/state.mjs +360 -0
@@ -0,0 +1,73 @@
1
+ # Agent portability
2
+
3
+ aimhooman is a vendor-neutral guard: one rule set, shipped as Node source, with a thin
4
+ adapter per host. An activated plugin-tier adapter runs the live `PreToolUse` guard;
5
+ instruction-tier hosts load the ruleset. The Git-boundary guard comes from
6
+ `aimhooman init`, independent of the host.
7
+
8
+ ## Prerequisite
9
+
10
+ Install once so hooks can call it (Node 22.8+ and Git 2.28+):
11
+
12
+ ```sh
13
+ npm install -g @rmyndharis/aimhooman
14
+ ```
15
+
16
+ Claude Code and Codex plugin bundles ship the `.mjs` source and run it with the
17
+ `node` already on your machine. The Copilot repository hook calls the installed
18
+ `aimhooman` binary and otherwise fails open with no live guard.
19
+
20
+ ## Supported hosts
21
+
22
+ The registry in `docs/hosts.json` records the adapter, activation contract,
23
+ official specification, and last verification date. The table below is generated
24
+ from that registry.
25
+
26
+ <!-- aimhooman:host-table-start -->
27
+ | Host | Tier | Files | Activation | Version checked | Evidence |
28
+ | --- | --- | --- | --- | --- | --- |
29
+ | Claude Code | plugin | `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json`, `hooks/hooks.json`, `skills/aimhooman/SKILL.md` | Install the marketplace plugin; Git hooks still require aimhooman init. | web spec (unversioned) | static (2026-07-15) |
30
+ | OpenAI Codex | plugin | `.codex-plugin/plugin.json`, `hooks/hooks.json`, `skills/aimhooman/SKILL.md` | Install the plugin, start a new session, then review and trust its hooks with /hooks. | 0.144.3 minimum contract | static (2026-07-15) |
31
+ | GitHub Copilot CLI | plugin | `.github/hooks/aimhooman.json` | The repository hook calls aimhooman from PATH and is advisory until Git hooks are installed. | web spec (unversioned) | static (2026-07-15) |
32
+ | GitHub Copilot editor | instruction | `.github/copilot-instructions.md` | Loaded from the repository by supported Copilot editors. | web spec (unversioned) | static (2026-07-15) |
33
+ | Cursor | instruction | `.cursor/rules/aimhooman.mdc` | Loaded as an always-on project rule. | web spec (unversioned) | static (2026-07-15) |
34
+ | Cline | instruction | `.clinerules/aimhooman.md` | Loaded from the project clinerules directory. | web spec (unversioned) | static (2026-07-15) |
35
+ | Windsurf | instruction | `.windsurf/rules/aimhooman.md` | Loaded through the supported legacy .windsurf/rules workspace fallback; current hosts prefer .devin/rules. | web spec (unversioned) | static (2026-07-15) |
36
+ | Kiro | instruction | `.kiro/steering/aimhooman.md` | Loaded as always-included steering by default. | web spec (unversioned) | static (2026-07-15) |
37
+ | Gemini CLI | instruction | `.gemini/settings.json`, `GEMINI.md` | The repository setting loads AGENTS.md; GEMINI.md is also shipped as default context. | 0.50.0 source contract | static (2026-07-15) |
38
+ | Gemini Code Assist | instruction | `GEMINI.md` | Loaded as agent-mode context in supported editors. | web spec (unversioned) | static (2026-07-15) |
39
+ | Google Antigravity | instruction | `.agents/rules/aimhooman.md` | Add the workspace rule in Antigravity and set it to Always On. | web spec (unversioned) | static (2026-07-15) |
40
+ <!-- aimhooman:host-table-end -->
41
+
42
+ ## Adapter rule
43
+
44
+ Keep adapters thin. Claude and Codex share `hooks/hooks.json`; the Copilot CLI uses
45
+ `.github/hooks/aimhooman.json`. Both hook formats call `aimhooman hook ...`.
46
+ Instruction-tier adapters carry the ruleset text verbatim from `AGENTS.md`; the test
47
+ `tests/copies.test.mjs` fails if any copy drifts.
48
+
49
+ ## Enforcement matrix
50
+
51
+ | Host kind | Agent ruleset | Agent PreToolUse guard | Git commit / reference guards |
52
+ | --- | --- | --- | --- |
53
+ | Plugin-tier (after host activation) | yes | yes | yes (after `aimhooman init`) |
54
+ | Instruction-tier | yes | no | yes (after `aimhooman init`) |
55
+ | No host / CI | no | no | yes (git hooks, or `aimhooman check` in CI) |
56
+
57
+ ## Hook output
58
+
59
+ aimhooman emits one JSON object that satisfies every host: Claude and Codex read
60
+ `hookSpecificOutput.permissionDecision`, Copilot reads the top-level
61
+ `permissionDecision`. No host detection is needed.
62
+
63
+ ## The `--no-verify` gap
64
+
65
+ `git commit --no-verify` skips the ordinary `pre-commit` and `commit-msg` hooks.
66
+ On `strict`, the agent-tier `PreToolUse` guard rejects that flag before Git runs
67
+ for supported plugin hosts. The prepared `reference-transaction` hook is not a
68
+ verify hook and checks the resulting commit before the branch ref changes, but
69
+ it cannot provide clean-profile auto-repair after the earlier hooks were skipped.
70
+ Local tooling is still not a server boundary; for team-wide enforcement, scan
71
+ the actual PR range in CI rather than the normally empty CI index:
72
+ `aimhooman check --range origin/main...HEAD --profile strict`. A shallow checkout
73
+ may not contain the merge base; use `fetch-depth: 0` or deepen it first.
@@ -0,0 +1,135 @@
1
+ # aimhooman: Repair-First, Layered Enforcement
2
+
3
+ This document describes aimhooman's enforcement model. aimhooman is designed to
4
+ prevent known AI-tool residue from leaking into Git history **without editing
5
+ `.gitignore`, and with repair before rejection on the default ordinary commit path.**
6
+ Plugin startup provides best-effort prevention without `init`; complete Git-boundary
7
+ enforcement requires local or global hook setup.
8
+
9
+ ## Goals
10
+
11
+ - **Zero-activation for Claude Code:** the plugin is active every session
12
+ (SessionStart), no `init`.
13
+ - **No `.gitignore` burden:** known AI artifacts are auto-excluded via
14
+ `.git/info/exclude` (local, never committed, never the user's `.gitignore`).
15
+ - **Repair-first for hygiene by default:** AI artifacts are excluded before
16
+ staging or unstaged at commit. If a block cannot be repaired, remains in the
17
+ pinned tree, or cannot be scanned completely, the operation stops.
18
+ - **Broad, community-updatable rule catalog:** covers many AI tools; extendable
19
+ via PR (core) and local rules (personal).
20
+ - **Block remains available as opt-in** (`strict` profile) for teams that want
21
+ hard enforcement.
22
+
23
+ ## Non-goals
24
+
25
+ - Rewriting existing git history (out of scope; this prevents future leaks only).
26
+ - Catching truly novel AI tools that have no rule yet (coverage is
27
+ rule-dependent; cannot be 100%).
28
+ - A live community registry fetched over the network (rejected: breaks offline /
29
+ zero-dependency ethos, introduces supply-chain risk).
30
+
31
+ ## Constraints (honest)
32
+
33
+ 1. **Git has no universal "guard every repo" hook.** `npm install -g` only places a
34
+ binary on PATH. Auto-activation is achieved via (a) the Claude Code plugin
35
+ (SessionStart, zero-init) and (b) an optional one-time `aimhooman init --global`
36
+ that sets `core.hooksPath` for eligible non-bare repositories without a local
37
+ or worktree-scoped override.
38
+ 2. **"Prevent leak without blocking" requires exclusion, not just warning.**
39
+ Either exclude before staging (`.git/info/exclude`) or unstage at commit
40
+ (`pre-commit` hook). Pure warnings do not prevent leaks.
41
+ 3. **PreToolUse cannot unstage.** It runs before the tool executes; at `git add X`,
42
+ X is not staged yet. So unstage is a git-tier (`pre-commit`) capability; the
43
+ plugin tier does prevention (excludes) plus advisory (warn).
44
+ 4. **`.gitignore` stays clean** because aimhooman writes `.git/info/exclude`
45
+ (local, not committed, not `.gitignore`).
46
+
47
+ ## Design
48
+
49
+ ### Layered enforcement (default ordinary path = repair-first)
50
+
51
+ | Layer | Mechanism | Tier | Blocking? |
52
+ | --- | --- | --- | --- |
53
+ | 0. Prevention | Auto-write `.git/info/exclude` from unambiguous residue rules | plugin SessionStart + init/agent hook refresh | none (best effort) |
54
+ | 1. Catch-all | `pre-commit` hook unstages AI artifacts from the index | git hook | proceeds after repair; stops if repair fails |
55
+ | 2. Agent guard | PreToolUse reports paths and rejects unprovable protected Git mutations | plugin | advisory for paths; fail-closed for boundary bypass |
56
+ | 3. Strict policy | `strict` profile blocks instead of repairing (exit 10) | both | block |
57
+ | 4. Pinned tree | `commit-msg` checks the exact would-be tree and message | git hook | blocks a remaining violation or incomplete scan |
58
+ | 5. Final ref check | prepared `reference-transaction` full-scans every commit introduced to `HEAD` or a branch | git hook | blocks a violation or incomplete scan |
59
+
60
+ Default profile `clean` uses layers 0, 1, 2, 4, and 5. Successful repair keeps the
61
+ ordinary path low-friction. The pinned-tree and final-ref scans deliberately stop if
62
+ a block remains, including a pre-existing tracked block that was not part of the
63
+ current diff, or if any scan is incomplete.
64
+ Git 2.54 also emits an earlier `preparing` reference-transaction callback. The
65
+ hook checks dispatcher integrity there without scanning unresolved references,
66
+ then keeps the full-scan veto at `prepared`, after Git has locked them.
67
+
68
+ ### Components
69
+
70
+ 1. **Rule catalog** — `rules/paths.json`, `rules/attribution.json`,
71
+ `rules/markers.json`, `rules/secrets.json`. Covers Claude, Codex, Copilot, Cursor, Aider, SpecStory,
72
+ Continue, Playwright MCP, Remember, Superpowers, and a generic agent dir.
73
+ Community extends via PR (core); personal extensions via
74
+ `<common-git-dir>/aimhooman/rules/*.json` (local, shared by linked worktrees,
75
+ loaded after core, and only able to add restrictions).
76
+ 2. **Auto-exclude** — `applyExclude` writes patterns derived from unambiguous
77
+ `ephemeral-state` and `local-settings` rules to `.git/info/exclude` from
78
+ SessionStart, init, and the agent guard. Secrets and review paths remain visible.
79
+ 3. **Git boundary** — the `pre-commit` hook scans staged paths; for any AI
80
+ artifact it removes it from the index, then lets the commit proceed only when
81
+ that repair succeeds. `commit-msg` removes complete exact high-confidence attribution lines
82
+ (on `clean`), keeps them (on `compliance`), or blocks (on `strict`). An unterminated
83
+ exact final line stops unchanged; broader attribution candidates remain review notices.
84
+ `commit-msg` evaluates the message and full snapshot against a pinned would-be
85
+ tree. The `reference-transaction` hook checks guard integrity during Git
86
+ 2.54's early `preparing` callback, then independently scans every introduced
87
+ commit at `prepared` before Git changes `HEAD` or a branch ref; it does not trust
88
+ an attestation from an earlier hook. This covers ordinary commits, sequencers,
89
+ fetch/worktree branch creation, and direct ref commands.
90
+ 4. **Auto-activation** — the plugin's SessionStart ensures excludes + injects the
91
+ ruleset (no `init`). `aimhooman init --global` sets `core.hooksPath` once for
92
+ terminal git.
93
+ 5. **Strict policy** — the `strict` profile blocks findings instead of attempting
94
+ the clean/compliance repairs.
95
+ 6. **Team baseline** — an optional, versioned `.aimhooman.json` selects the
96
+ repository profile and takes precedence over per-clone defaults. Invalid
97
+ project policy fails closed; local exceptions remain in Git state.
98
+
99
+ ### Local rule loading
100
+
101
+ `loadRules(stateDir?)` reads `<stateDir>/rules/*.json` using the published local-pack
102
+ schema, the stricter regex subset, and a bounded path-glob matcher when a repo context
103
+ exists, merged after core packs. Core-first ordering
104
+ means local rules only add restrictions and can never override a core block.
105
+
106
+ ## Implementation notes
107
+
108
+ - **Category-aware failure.** On `clean`, a malformed local rule pack is skipped
109
+ with a warning because built-in rules remain active. Corrupt override state,
110
+ unreadable Git inputs, and incomplete staged-content scans stop every profile.
111
+ Any automatic unstage failure stops; allowing it through would only defer the
112
+ same block to the pinned-tree or final-ref scan. `strict` also vetoes policy
113
+ findings and reviews.
114
+ - **`init --global` refuses to clobber.** It will not overwrite a pre-existing
115
+ global `core.hooksPath`, and `aimhooman uninstall --global` reverses it. A
116
+ repository-local/worktree override takes precedence; local `init` refuses a
117
+ shared or external effective hook directory. Global reference dispatchers are
118
+ transparent in unsupported bare repositories.
119
+ - **HEAD-safe unstage.** `git restore --staged` needs HEAD; on a repository's
120
+ initial commit it falls back to `git rm --cached --ignore-unmatch`.
121
+ - **Anchored attribution rules.** The AI-noreply rule is anchored to trailer
122
+ lines (`*-by:`) so it never strips a prose line that merely mentions the email.
123
+ - **`compliance` keeps disclosure.** AI-attribution rules resolve to `allow`
124
+ under `compliance`, so nothing is stripped and the disclosure is preserved.
125
+
126
+ ## Testing
127
+
128
+ `npm run verify` is the release-equivalent local gate. It validates generated
129
+ artifacts and JSON, compiles every published schema, lints workflows, checks for
130
+ dead code, runs coverage (including release-critical scripts), verifies the
131
+ packed manifest, and exercises installed hooks. The tests cover profiles,
132
+ overrides, commit-message repair, strict `--no-verify` rejection, local rules,
133
+ rename/type-change detection, staged/commit/range/tracked targets, linked
134
+ worktrees, hook ownership and chaining, sequencer/direct-ref flows, and initial
135
+ commits.
@@ -0,0 +1,164 @@
1
+ {
2
+ "schema_version": 1,
3
+ "last_checked": "2026-07-15",
4
+ "hosts": [
5
+ {
6
+ "id": "claude-code",
7
+ "name": "Claude Code",
8
+ "tier": "plugin",
9
+ "version_checked": "web spec (unversioned)",
10
+ "check_level": "static",
11
+ "last_checked": "2026-07-15",
12
+ "files": [
13
+ ".claude-plugin/plugin.json",
14
+ ".claude-plugin/marketplace.json",
15
+ "hooks/hooks.json",
16
+ "skills/aimhooman/SKILL.md"
17
+ ],
18
+ "canonical_copy": "skills/aimhooman/SKILL.md",
19
+ "activation": "Install the marketplace plugin; Git hooks still require aimhooman init.",
20
+ "spec": "https://code.claude.com/docs/en/plugins-reference"
21
+ },
22
+ {
23
+ "id": "codex",
24
+ "name": "OpenAI Codex",
25
+ "tier": "plugin",
26
+ "minimum_version": "0.144.3",
27
+ "version_checked": "0.144.3 minimum contract",
28
+ "check_level": "static",
29
+ "last_checked": "2026-07-15",
30
+ "files": [
31
+ ".codex-plugin/plugin.json",
32
+ "hooks/hooks.json",
33
+ "skills/aimhooman/SKILL.md"
34
+ ],
35
+ "activation": "Install the plugin, start a new session, then review and trust its hooks with /hooks.",
36
+ "spec": "https://developers.openai.com/codex/plugins/build"
37
+ },
38
+ {
39
+ "id": "copilot-cli",
40
+ "name": "GitHub Copilot CLI",
41
+ "tier": "plugin",
42
+ "version_checked": "web spec (unversioned)",
43
+ "check_level": "static",
44
+ "last_checked": "2026-07-15",
45
+ "files": [
46
+ ".github/hooks/aimhooman.json"
47
+ ],
48
+ "activation": "The repository hook calls aimhooman from PATH and is advisory until Git hooks are installed.",
49
+ "spec": "https://docs.github.com/en/copilot/reference/hooks-reference"
50
+ },
51
+ {
52
+ "id": "copilot-editor",
53
+ "name": "GitHub Copilot editor",
54
+ "tier": "instruction",
55
+ "version_checked": "web spec (unversioned)",
56
+ "check_level": "static",
57
+ "last_checked": "2026-07-15",
58
+ "files": [
59
+ ".github/copilot-instructions.md"
60
+ ],
61
+ "canonical_copy": ".github/copilot-instructions.md",
62
+ "activation": "Loaded from the repository by supported Copilot editors.",
63
+ "spec": "https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot"
64
+ },
65
+ {
66
+ "id": "cursor",
67
+ "name": "Cursor",
68
+ "tier": "instruction",
69
+ "version_checked": "web spec (unversioned)",
70
+ "check_level": "static",
71
+ "last_checked": "2026-07-15",
72
+ "files": [
73
+ ".cursor/rules/aimhooman.mdc"
74
+ ],
75
+ "canonical_copy": ".cursor/rules/aimhooman.mdc",
76
+ "activation": "Loaded as an always-on project rule.",
77
+ "spec": "https://cursor.com/docs/context/rules"
78
+ },
79
+ {
80
+ "id": "cline",
81
+ "name": "Cline",
82
+ "tier": "instruction",
83
+ "version_checked": "web spec (unversioned)",
84
+ "check_level": "static",
85
+ "last_checked": "2026-07-15",
86
+ "files": [
87
+ ".clinerules/aimhooman.md"
88
+ ],
89
+ "canonical_copy": ".clinerules/aimhooman.md",
90
+ "activation": "Loaded from the project clinerules directory.",
91
+ "spec": "https://docs.cline.bot/features/cline-rules"
92
+ },
93
+ {
94
+ "id": "windsurf",
95
+ "name": "Windsurf",
96
+ "tier": "instruction",
97
+ "version_checked": "web spec (unversioned)",
98
+ "check_level": "static",
99
+ "last_checked": "2026-07-15",
100
+ "files": [
101
+ ".windsurf/rules/aimhooman.md"
102
+ ],
103
+ "canonical_copy": ".windsurf/rules/aimhooman.md",
104
+ "activation": "Loaded through the supported legacy .windsurf/rules workspace fallback; current hosts prefer .devin/rules.",
105
+ "spec": "https://docs.windsurf.com/windsurf/cascade/memories"
106
+ },
107
+ {
108
+ "id": "kiro",
109
+ "name": "Kiro",
110
+ "tier": "instruction",
111
+ "version_checked": "web spec (unversioned)",
112
+ "check_level": "static",
113
+ "last_checked": "2026-07-15",
114
+ "files": [
115
+ ".kiro/steering/aimhooman.md"
116
+ ],
117
+ "canonical_copy": ".kiro/steering/aimhooman.md",
118
+ "activation": "Loaded as always-included steering by default.",
119
+ "spec": "https://kiro.dev/docs/steering/"
120
+ },
121
+ {
122
+ "id": "gemini-cli",
123
+ "name": "Gemini CLI",
124
+ "tier": "instruction",
125
+ "version_checked": "0.50.0 source contract",
126
+ "check_level": "static",
127
+ "last_checked": "2026-07-15",
128
+ "files": [
129
+ ".gemini/settings.json",
130
+ "GEMINI.md"
131
+ ],
132
+ "canonical_copy": "GEMINI.md",
133
+ "activation": "The repository setting loads AGENTS.md; GEMINI.md is also shipped as default context.",
134
+ "spec": "https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/gemini-md.md"
135
+ },
136
+ {
137
+ "id": "gemini-code-assist",
138
+ "name": "Gemini Code Assist",
139
+ "tier": "instruction",
140
+ "version_checked": "web spec (unversioned)",
141
+ "check_level": "static",
142
+ "last_checked": "2026-07-15",
143
+ "files": [
144
+ "GEMINI.md"
145
+ ],
146
+ "activation": "Loaded as agent-mode context in supported editors.",
147
+ "spec": "https://developers.google.com/gemini-code-assist/docs/use-agentic-chat-pair-programmer"
148
+ },
149
+ {
150
+ "id": "antigravity",
151
+ "name": "Google Antigravity",
152
+ "tier": "instruction",
153
+ "version_checked": "web spec (unversioned)",
154
+ "check_level": "static",
155
+ "last_checked": "2026-07-15",
156
+ "files": [
157
+ ".agents/rules/aimhooman.md"
158
+ ],
159
+ "canonical_copy": ".agents/rules/aimhooman.md",
160
+ "activation": "Add the workspace rule in Antigravity and set it to Always On.",
161
+ "spec": "https://antigravity.google/docs/ide-rules"
162
+ }
163
+ ]
164
+ }
Binary file
Binary file
@@ -0,0 +1,29 @@
1
+ {
2
+ "description": "aimhooman: keep AI session files, secrets, and attribution out of commits",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "matcher": "startup|resume|clear|compact",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/bin/aimhooman.mjs\" hook session-start",
11
+ "timeout": 60
12
+ }
13
+ ]
14
+ }
15
+ ],
16
+ "PreToolUse": [
17
+ {
18
+ "matcher": "*",
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/bin/aimhooman.mjs\" hook pre-tool-use",
23
+ "timeout": 60
24
+ }
25
+ ]
26
+ }
27
+ ]
28
+ }
29
+ }
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@rmyndharis/aimhooman",
3
+ "version": "0.1.0",
4
+ "description": "AI works. Hoomans ship. Keep AI session files, secrets, and attribution out of your commits.",
5
+ "homepage": "https://github.com/rmyndharis/aimhooman#readme",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/rmyndharis/aimhooman.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/rmyndharis/aimhooman/issues"
12
+ },
13
+ "type": "module",
14
+ "bin": {
15
+ "aimhooman": "bin/aimhooman.mjs"
16
+ },
17
+ "files": [
18
+ "bin/",
19
+ "src/",
20
+ "rules/",
21
+ "hooks/",
22
+ "schemas/",
23
+ "docs/hosts.json",
24
+ "docs/design/",
25
+ "docs/logo/",
26
+ ".claude-plugin/",
27
+ ".codex-plugin/",
28
+ ".cursor/rules/",
29
+ ".clinerules/",
30
+ ".windsurf/",
31
+ ".kiro/",
32
+ ".agents/",
33
+ ".gemini/",
34
+ ".github/hooks/",
35
+ ".github/copilot-instructions.md",
36
+ "AGENTS.md",
37
+ "GEMINI.md",
38
+ "skills/",
39
+ "CHANGELOG.md",
40
+ "CODE_OF_CONDUCT.md",
41
+ "CONTRIBUTING.md",
42
+ "LICENSE",
43
+ "README.md",
44
+ "SECURITY.md"
45
+ ],
46
+ "scripts": {
47
+ "check": "node scripts/validate.mjs",
48
+ "sync:hosts": "node scripts/sync-hosts.mjs",
49
+ "sync:ruleset": "node scripts/sync-ruleset.mjs",
50
+ "test": "node --import ./tests/test-env.mjs --test",
51
+ "test:coverage": "node --import ./tests/test-env.mjs --experimental-test-coverage --test-coverage-include=\"src/**\" --test-coverage-include=\"bin/**\" --test-coverage-include=\"scripts/authorize-owner-paths.mjs\" --test-coverage-include=\"scripts/github-owner-authority.mjs\" --test-coverage-include=\"scripts/package-manifest.mjs\" --test-coverage-include=\"scripts/scan-ci-history.mjs\" --test-coverage-exclude=\"tests/**\" --test-coverage-lines=75 --test-coverage-branches=60 --test-coverage-functions=85 --test-reporter=spec --test-reporter=./scripts/coverage-threshold.mjs --test-reporter-destination=stdout --test-reporter-destination=stderr --test",
52
+ "check:static": "node scripts/static-gates.mjs",
53
+ "verify": "node scripts/verify.mjs"
54
+ },
55
+ "devDependencies": {
56
+ "ajv": "8.20.0",
57
+ "ajv-formats": "3.0.1",
58
+ "knip": "5.88.1"
59
+ },
60
+ "engines": {
61
+ "node": ">=22.8.0"
62
+ },
63
+ "publishConfig": {
64
+ "access": "public",
65
+ "registry": "https://registry.npmjs.org/"
66
+ },
67
+ "license": "MIT",
68
+ "keywords": [
69
+ "ai-agents",
70
+ "git-hooks",
71
+ "claude-code",
72
+ "codex",
73
+ "copilot",
74
+ "developer-tools",
75
+ "pre-commit"
76
+ ]
77
+ }
@@ -0,0 +1,142 @@
1
+ [
2
+ {
3
+ "id": "attribution.claude-coauthor",
4
+ "version": 1,
5
+ "provider": "claude-code",
6
+ "category": "ai-attribution",
7
+ "confidence": "high",
8
+ "kind": "message",
9
+ "match": {
10
+ "content": [
11
+ "(?i)^\\s*co-authored-by:\\s*(?:claude|claude code)\\s*<noreply@anthropic\\.com>\\s*$"
12
+ ]
13
+ },
14
+ "actions": {
15
+ "clean": "block",
16
+ "strict": "block",
17
+ "compliance": "allow"
18
+ },
19
+ "reason": "Unwanted AI co-author attribution (Claude).",
20
+ "autofix": "remove-whole-line",
21
+ "remediation": [
22
+ "remove the Co-authored-by line",
23
+ "or run: aimhooman fix --message <file>"
24
+ ]
25
+ },
26
+ {
27
+ "id": "attribution.copilot-coauthor",
28
+ "version": 1,
29
+ "provider": "copilot",
30
+ "category": "ai-attribution",
31
+ "confidence": "high",
32
+ "kind": "message",
33
+ "match": {
34
+ "content": [
35
+ "(?i)^\\s*co-authored-by:\\s*(?:github\\s+)?copilot(?:\\[bot\\])?\\s*<(?:(?:[0-9]+\\+)?copilot(?:\\[bot\\])?@users\\.noreply\\.github\\.com|copilot@github\\.com)>\\s*$"
36
+ ]
37
+ },
38
+ "actions": {
39
+ "clean": "block",
40
+ "strict": "block",
41
+ "compliance": "allow"
42
+ },
43
+ "reason": "Unwanted AI co-author attribution (Copilot).",
44
+ "autofix": "remove-whole-line",
45
+ "remediation": [
46
+ "remove the Co-authored-by line",
47
+ "or run: aimhooman fix --message <file>"
48
+ ]
49
+ },
50
+ {
51
+ "id": "attribution.codex-coauthor",
52
+ "version": 1,
53
+ "provider": "codex",
54
+ "category": "ai-attribution",
55
+ "confidence": "high",
56
+ "kind": "message",
57
+ "match": {
58
+ "content": [
59
+ "(?i)^\\s*co-authored-by:\\s*(?:openai\\s+)?codex\\s*<noreply@openai\\.com>\\s*$"
60
+ ]
61
+ },
62
+ "actions": {
63
+ "clean": "block",
64
+ "strict": "block",
65
+ "compliance": "allow"
66
+ },
67
+ "reason": "Unwanted AI co-author attribution (Codex).",
68
+ "autofix": "remove-whole-line",
69
+ "remediation": [
70
+ "remove the Co-authored-by line",
71
+ "or run: aimhooman fix --message <file>"
72
+ ]
73
+ },
74
+ {
75
+ "id": "attribution.bot-coauthor",
76
+ "version": 1,
77
+ "provider": "generic",
78
+ "category": "ai-attribution",
79
+ "confidence": "medium",
80
+ "kind": "message",
81
+ "match": {
82
+ "content": [
83
+ "(?i)^\\s*co-authored-by:.*(\\[bot\\]|bot@users\\.noreply).*$"
84
+ ]
85
+ },
86
+ "actions": {
87
+ "clean": "review",
88
+ "strict": "review",
89
+ "compliance": "allow"
90
+ },
91
+ "reason": "Unwanted bot co-author attribution.",
92
+ "remediation": [
93
+ "remove the Co-authored-by line"
94
+ ]
95
+ },
96
+ {
97
+ "id": "attribution.generated-with",
98
+ "version": 1,
99
+ "provider": "generic",
100
+ "category": "ai-attribution",
101
+ "confidence": "high",
102
+ "kind": "message",
103
+ "match": {
104
+ "content": [
105
+ "(?i)^\\s*generated\\s+(?:with|by)\\s+(?:claude(?:\\s+code)?|(?:github\\s+)?copilot|chatgpt|gpt(?:-[0-9]+(?:\\.[0-9]+)?)?|(?:openai\\s+)?codex|cursor)[.!]?\\s*$",
106
+ "(?i)^\\s*(?:🤖\\s*)?generated\\s+with\\s+\\[claude code\\]\\(https://claude\\.ai/code\\)\\s*$"
107
+ ]
108
+ },
109
+ "actions": {
110
+ "clean": "block",
111
+ "strict": "block",
112
+ "compliance": "allow"
113
+ },
114
+ "reason": "Unwanted AI generation attribution in the message.",
115
+ "autofix": "remove-whole-line",
116
+ "remediation": [
117
+ "remove the generated-with line"
118
+ ]
119
+ },
120
+ {
121
+ "id": "attribution.ai-noreply",
122
+ "version": 1,
123
+ "provider": "generic",
124
+ "category": "ai-attribution",
125
+ "confidence": "high",
126
+ "kind": "message",
127
+ "match": {
128
+ "content": [
129
+ "(?i)^\\s*[a-z-]+-by:\\s*[^<>]+\\s*<noreply@(anthropic|openai)\\.com>\\s*$"
130
+ ]
131
+ },
132
+ "actions": {
133
+ "clean": "review",
134
+ "strict": "review",
135
+ "compliance": "allow"
136
+ },
137
+ "reason": "AI service noreply email in the message.",
138
+ "remediation": [
139
+ "remove the line referencing the AI service email"
140
+ ]
141
+ }
142
+ ]