@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,53 @@
1
+ # aimhooman
2
+
3
+ <!-- aimhooman:ruleset-start -->
4
+ This repository uses aimhooman to keep AI tooling artifacts out of Git history.
5
+ Its policy:
6
+
7
+ - Never stage or commit local AI session/state files. Examples include
8
+ `.claude.json`, `.claude/.credentials.json`, `.claude/session*.json`,
9
+ `.claude/history*`, `.claude/todos/*`, `.claude/shell-snapshots/*`,
10
+ `.claude/statsig/*`, `.claude/projects/*`, `.claude/logs/*`,
11
+ `.codex/sessions/*`, `.codex/history*`, `.codex/log/*`, `.codex/logs/*`,
12
+ `.copilot/*`, `.cursor/session*`, `.cursor/chats/*`, `.cursor/logs/*`,
13
+ `.aider.*`, `.specstory/*`, `.continue/sessions/*`, `.playwright-mcp/*`,
14
+ `.remember/*`, `.superpowers/*`, and `.agent/*`. The examples are not
15
+ exhaustive; the packaged `rules/paths.json` is the detection source of truth.
16
+ If one is staged, unstage it and keep it out of Git instead.
17
+ - Never commit secrets: a real `.env` (not `.env.example`), private keys
18
+ (`id_rsa` and files containing a private-key header), `.aws/credentials`, or
19
+ service-account keys. Public certificates are allowed.
20
+ - Never add AI attribution to commit messages: no `Co-authored-by` trailer naming
21
+ an AI (Claude, Copilot, Codex), no "Generated with/by <AI>" lines, no AI-service
22
+ noreply emails. A commit message reads as if a human wrote it.
23
+ - Write in a human voice, not an AI voice. No `delve`, `leverage`, `utilize`,
24
+ `seamless`, `robust`, `comprehensive`, `underscore`, `foster`, `pivotal`, `myriad`,
25
+ `tapestry`, `landscape`; no "This PR addresses…", "adversarial self-review",
26
+ "live-verified", "thoroughly tested with comprehensive examples", "in today's",
27
+ "let's dive in", "in conclusion"; no bold lead-in on every bullet and no paired
28
+ em-dash asides. Say what broke or what changed, pick the plain short verb, name the
29
+ number, and vary sentence length. If the first line could open any PR on any repo,
30
+ delete it.
31
+ - Treat `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.github/copilot-instructions.md`
32
+ as review-required: they may be intentional team config, so confirm before
33
+ committing them.
34
+
35
+ Project map:
36
+
37
+ - `src/scan.mjs` and `src/rules.mjs` load rules and make policy decisions.
38
+ - `src/hook.mjs` and `src/githooks.mjs` enforce them in agent and Git hooks.
39
+ - `src/state.mjs` owns local policy state. `bin/aimhooman.mjs` is the CLI.
40
+ - `tests/` mirrors the production paths and includes real temporary Git repos.
41
+
42
+ Use Node.js 22.8 or newer. Before finishing a change, run:
43
+
44
+ ```sh
45
+ npm run check
46
+ npm test
47
+ npm run test:coverage
48
+ ```
49
+
50
+ aimhooman also enforces this at commit time, so a blocked commit means a real
51
+ violation to fix, not a check to bypass. The rule is simple: AI works, hoomans
52
+ ship.
53
+ <!-- aimhooman:ruleset-end -->
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "aimhooman",
3
+ "owner": {
4
+ "name": "aimhooman"
5
+ },
6
+ "description": "AI works. Hoomans ship. Keep AI session files, secrets, and attribution out of your commits.",
7
+ "plugins": [
8
+ {
9
+ "name": "aimhooman",
10
+ "source": "./",
11
+ "description": "Keeps AI session files, secrets, and unwanted attribution out at the agent and Git boundary.",
12
+ "version": "0.1.0",
13
+ "license": "MIT",
14
+ "keywords": [
15
+ "git",
16
+ "hooks",
17
+ "ai-agents",
18
+ "security",
19
+ "developer-tools"
20
+ ]
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "aimhooman",
3
+ "version": "0.1.0",
4
+ "description": "AI works. Hoomans ship. Keeps AI session files, secrets, and unwanted attribution out at the agent and Git boundary.",
5
+ "author": {
6
+ "name": "aimhooman"
7
+ },
8
+ "hooks": "./hooks/hooks.json"
9
+ }
@@ -0,0 +1,53 @@
1
+ # aimhooman
2
+
3
+ <!-- aimhooman:ruleset-start -->
4
+ This repository uses aimhooman to keep AI tooling artifacts out of Git history.
5
+ Its policy:
6
+
7
+ - Never stage or commit local AI session/state files. Examples include
8
+ `.claude.json`, `.claude/.credentials.json`, `.claude/session*.json`,
9
+ `.claude/history*`, `.claude/todos/*`, `.claude/shell-snapshots/*`,
10
+ `.claude/statsig/*`, `.claude/projects/*`, `.claude/logs/*`,
11
+ `.codex/sessions/*`, `.codex/history*`, `.codex/log/*`, `.codex/logs/*`,
12
+ `.copilot/*`, `.cursor/session*`, `.cursor/chats/*`, `.cursor/logs/*`,
13
+ `.aider.*`, `.specstory/*`, `.continue/sessions/*`, `.playwright-mcp/*`,
14
+ `.remember/*`, `.superpowers/*`, and `.agent/*`. The examples are not
15
+ exhaustive; the packaged `rules/paths.json` is the detection source of truth.
16
+ If one is staged, unstage it and keep it out of Git instead.
17
+ - Never commit secrets: a real `.env` (not `.env.example`), private keys
18
+ (`id_rsa` and files containing a private-key header), `.aws/credentials`, or
19
+ service-account keys. Public certificates are allowed.
20
+ - Never add AI attribution to commit messages: no `Co-authored-by` trailer naming
21
+ an AI (Claude, Copilot, Codex), no "Generated with/by <AI>" lines, no AI-service
22
+ noreply emails. A commit message reads as if a human wrote it.
23
+ - Write in a human voice, not an AI voice. No `delve`, `leverage`, `utilize`,
24
+ `seamless`, `robust`, `comprehensive`, `underscore`, `foster`, `pivotal`, `myriad`,
25
+ `tapestry`, `landscape`; no "This PR addresses…", "adversarial self-review",
26
+ "live-verified", "thoroughly tested with comprehensive examples", "in today's",
27
+ "let's dive in", "in conclusion"; no bold lead-in on every bullet and no paired
28
+ em-dash asides. Say what broke or what changed, pick the plain short verb, name the
29
+ number, and vary sentence length. If the first line could open any PR on any repo,
30
+ delete it.
31
+ - Treat `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.github/copilot-instructions.md`
32
+ as review-required: they may be intentional team config, so confirm before
33
+ committing them.
34
+
35
+ Project map:
36
+
37
+ - `src/scan.mjs` and `src/rules.mjs` load rules and make policy decisions.
38
+ - `src/hook.mjs` and `src/githooks.mjs` enforce them in agent and Git hooks.
39
+ - `src/state.mjs` owns local policy state. `bin/aimhooman.mjs` is the CLI.
40
+ - `tests/` mirrors the production paths and includes real temporary Git repos.
41
+
42
+ Use Node.js 22.8 or newer. Before finishing a change, run:
43
+
44
+ ```sh
45
+ npm run check
46
+ npm test
47
+ npm run test:coverage
48
+ ```
49
+
50
+ aimhooman also enforces this at commit time, so a blocked commit means a real
51
+ violation to fix, not a check to bypass. The rule is simple: AI works, hoomans
52
+ ship.
53
+ <!-- aimhooman:ruleset-end -->
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "aimhooman",
3
+ "version": "0.1.0",
4
+ "description": "AI works. Hoomans ship. Keeps AI session files, secrets, and unwanted attribution out at the agent and Git boundary.",
5
+ "author": {
6
+ "name": "aimhooman maintainers",
7
+ "email": "yudhi@rmyndharis.com",
8
+ "url": "https://github.com/rmyndharis"
9
+ },
10
+ "homepage": "https://github.com/rmyndharis/aimhooman#readme",
11
+ "repository": "https://github.com/rmyndharis/aimhooman",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "ai-agents",
15
+ "git-hooks",
16
+ "repository-hygiene"
17
+ ],
18
+ "skills": "./skills/",
19
+ "interface": {
20
+ "displayName": "aimhooman",
21
+ "shortDescription": "Keep AI tooling residue out of Git",
22
+ "longDescription": "Detects AI session files, secrets, and unwanted attribution before they enter Git history.",
23
+ "developerName": "aimhooman maintainers",
24
+ "category": "Developer Tools",
25
+ "capabilities": [
26
+ "Interactive",
27
+ "Write"
28
+ ],
29
+ "websiteURL": "https://github.com/rmyndharis/aimhooman",
30
+ "defaultPrompt": [
31
+ "Check this repository for AI tooling artifacts.",
32
+ "Explain the aimhooman policy for this repository.",
33
+ "Audit the current Git range with aimhooman."
34
+ ],
35
+ "brandColor": "#111827"
36
+ }
37
+ }
@@ -0,0 +1,59 @@
1
+ ---
2
+ description: aimhooman - keep AI session files, secrets, and unwanted AI attribution out of Git.
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # aimhooman
8
+
9
+ <!-- aimhooman:ruleset-start -->
10
+ This repository uses aimhooman to keep AI tooling artifacts out of Git history.
11
+ Its policy:
12
+
13
+ - Never stage or commit local AI session/state files. Examples include
14
+ `.claude.json`, `.claude/.credentials.json`, `.claude/session*.json`,
15
+ `.claude/history*`, `.claude/todos/*`, `.claude/shell-snapshots/*`,
16
+ `.claude/statsig/*`, `.claude/projects/*`, `.claude/logs/*`,
17
+ `.codex/sessions/*`, `.codex/history*`, `.codex/log/*`, `.codex/logs/*`,
18
+ `.copilot/*`, `.cursor/session*`, `.cursor/chats/*`, `.cursor/logs/*`,
19
+ `.aider.*`, `.specstory/*`, `.continue/sessions/*`, `.playwright-mcp/*`,
20
+ `.remember/*`, `.superpowers/*`, and `.agent/*`. The examples are not
21
+ exhaustive; the packaged `rules/paths.json` is the detection source of truth.
22
+ If one is staged, unstage it and keep it out of Git instead.
23
+ - Never commit secrets: a real `.env` (not `.env.example`), private keys
24
+ (`id_rsa` and files containing a private-key header), `.aws/credentials`, or
25
+ service-account keys. Public certificates are allowed.
26
+ - Never add AI attribution to commit messages: no `Co-authored-by` trailer naming
27
+ an AI (Claude, Copilot, Codex), no "Generated with/by <AI>" lines, no AI-service
28
+ noreply emails. A commit message reads as if a human wrote it.
29
+ - Write in a human voice, not an AI voice. No `delve`, `leverage`, `utilize`,
30
+ `seamless`, `robust`, `comprehensive`, `underscore`, `foster`, `pivotal`, `myriad`,
31
+ `tapestry`, `landscape`; no "This PR addresses…", "adversarial self-review",
32
+ "live-verified", "thoroughly tested with comprehensive examples", "in today's",
33
+ "let's dive in", "in conclusion"; no bold lead-in on every bullet and no paired
34
+ em-dash asides. Say what broke or what changed, pick the plain short verb, name the
35
+ number, and vary sentence length. If the first line could open any PR on any repo,
36
+ delete it.
37
+ - Treat `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.github/copilot-instructions.md`
38
+ as review-required: they may be intentional team config, so confirm before
39
+ committing them.
40
+
41
+ Project map:
42
+
43
+ - `src/scan.mjs` and `src/rules.mjs` load rules and make policy decisions.
44
+ - `src/hook.mjs` and `src/githooks.mjs` enforce them in agent and Git hooks.
45
+ - `src/state.mjs` owns local policy state. `bin/aimhooman.mjs` is the CLI.
46
+ - `tests/` mirrors the production paths and includes real temporary Git repos.
47
+
48
+ Use Node.js 22.8 or newer. Before finishing a change, run:
49
+
50
+ ```sh
51
+ npm run check
52
+ npm test
53
+ npm run test:coverage
54
+ ```
55
+
56
+ aimhooman also enforces this at commit time, so a blocked commit means a real
57
+ violation to fix, not a check to bypass. The rule is simple: AI works, hoomans
58
+ ship.
59
+ <!-- aimhooman:ruleset-end -->
@@ -0,0 +1,7 @@
1
+ {
2
+ "context": {
3
+ "fileName": [
4
+ "AGENTS.md"
5
+ ]
6
+ }
7
+ }
@@ -0,0 +1,53 @@
1
+ # aimhooman
2
+
3
+ <!-- aimhooman:ruleset-start -->
4
+ This repository uses aimhooman to keep AI tooling artifacts out of Git history.
5
+ Its policy:
6
+
7
+ - Never stage or commit local AI session/state files. Examples include
8
+ `.claude.json`, `.claude/.credentials.json`, `.claude/session*.json`,
9
+ `.claude/history*`, `.claude/todos/*`, `.claude/shell-snapshots/*`,
10
+ `.claude/statsig/*`, `.claude/projects/*`, `.claude/logs/*`,
11
+ `.codex/sessions/*`, `.codex/history*`, `.codex/log/*`, `.codex/logs/*`,
12
+ `.copilot/*`, `.cursor/session*`, `.cursor/chats/*`, `.cursor/logs/*`,
13
+ `.aider.*`, `.specstory/*`, `.continue/sessions/*`, `.playwright-mcp/*`,
14
+ `.remember/*`, `.superpowers/*`, and `.agent/*`. The examples are not
15
+ exhaustive; the packaged `rules/paths.json` is the detection source of truth.
16
+ If one is staged, unstage it and keep it out of Git instead.
17
+ - Never commit secrets: a real `.env` (not `.env.example`), private keys
18
+ (`id_rsa` and files containing a private-key header), `.aws/credentials`, or
19
+ service-account keys. Public certificates are allowed.
20
+ - Never add AI attribution to commit messages: no `Co-authored-by` trailer naming
21
+ an AI (Claude, Copilot, Codex), no "Generated with/by <AI>" lines, no AI-service
22
+ noreply emails. A commit message reads as if a human wrote it.
23
+ - Write in a human voice, not an AI voice. No `delve`, `leverage`, `utilize`,
24
+ `seamless`, `robust`, `comprehensive`, `underscore`, `foster`, `pivotal`, `myriad`,
25
+ `tapestry`, `landscape`; no "This PR addresses…", "adversarial self-review",
26
+ "live-verified", "thoroughly tested with comprehensive examples", "in today's",
27
+ "let's dive in", "in conclusion"; no bold lead-in on every bullet and no paired
28
+ em-dash asides. Say what broke or what changed, pick the plain short verb, name the
29
+ number, and vary sentence length. If the first line could open any PR on any repo,
30
+ delete it.
31
+ - Treat `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.github/copilot-instructions.md`
32
+ as review-required: they may be intentional team config, so confirm before
33
+ committing them.
34
+
35
+ Project map:
36
+
37
+ - `src/scan.mjs` and `src/rules.mjs` load rules and make policy decisions.
38
+ - `src/hook.mjs` and `src/githooks.mjs` enforce them in agent and Git hooks.
39
+ - `src/state.mjs` owns local policy state. `bin/aimhooman.mjs` is the CLI.
40
+ - `tests/` mirrors the production paths and includes real temporary Git repos.
41
+
42
+ Use Node.js 22.8 or newer. Before finishing a change, run:
43
+
44
+ ```sh
45
+ npm run check
46
+ npm test
47
+ npm run test:coverage
48
+ ```
49
+
50
+ aimhooman also enforces this at commit time, so a blocked commit means a real
51
+ violation to fix, not a check to bypass. The rule is simple: AI works, hoomans
52
+ ship.
53
+ <!-- aimhooman:ruleset-end -->
@@ -0,0 +1,22 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "sessionStart": [
5
+ {
6
+ "type": "command",
7
+ "bash": "if command -v aimhooman >/dev/null 2>&1; then aimhooman hook session-start; else exit 0; fi",
8
+ "powershell": "if (Get-Command aimhooman -ErrorAction SilentlyContinue) { & aimhooman hook session-start; exit $LASTEXITCODE } else { exit 0 }",
9
+ "timeoutSec": 5
10
+ }
11
+ ],
12
+ "preToolUse": [
13
+ {
14
+ "type": "command",
15
+ "matcher": ".*",
16
+ "bash": "if command -v aimhooman >/dev/null 2>&1; then aimhooman hook pre-tool-use; else exit 0; fi",
17
+ "powershell": "if (Get-Command aimhooman -ErrorAction SilentlyContinue) { & aimhooman hook pre-tool-use; exit $LASTEXITCODE } else { exit 0 }",
18
+ "timeoutSec": 5
19
+ }
20
+ ]
21
+ }
22
+ }
@@ -0,0 +1,53 @@
1
+ # aimhooman
2
+
3
+ <!-- aimhooman:ruleset-start -->
4
+ This repository uses aimhooman to keep AI tooling artifacts out of Git history.
5
+ Its policy:
6
+
7
+ - Never stage or commit local AI session/state files. Examples include
8
+ `.claude.json`, `.claude/.credentials.json`, `.claude/session*.json`,
9
+ `.claude/history*`, `.claude/todos/*`, `.claude/shell-snapshots/*`,
10
+ `.claude/statsig/*`, `.claude/projects/*`, `.claude/logs/*`,
11
+ `.codex/sessions/*`, `.codex/history*`, `.codex/log/*`, `.codex/logs/*`,
12
+ `.copilot/*`, `.cursor/session*`, `.cursor/chats/*`, `.cursor/logs/*`,
13
+ `.aider.*`, `.specstory/*`, `.continue/sessions/*`, `.playwright-mcp/*`,
14
+ `.remember/*`, `.superpowers/*`, and `.agent/*`. The examples are not
15
+ exhaustive; the packaged `rules/paths.json` is the detection source of truth.
16
+ If one is staged, unstage it and keep it out of Git instead.
17
+ - Never commit secrets: a real `.env` (not `.env.example`), private keys
18
+ (`id_rsa` and files containing a private-key header), `.aws/credentials`, or
19
+ service-account keys. Public certificates are allowed.
20
+ - Never add AI attribution to commit messages: no `Co-authored-by` trailer naming
21
+ an AI (Claude, Copilot, Codex), no "Generated with/by <AI>" lines, no AI-service
22
+ noreply emails. A commit message reads as if a human wrote it.
23
+ - Write in a human voice, not an AI voice. No `delve`, `leverage`, `utilize`,
24
+ `seamless`, `robust`, `comprehensive`, `underscore`, `foster`, `pivotal`, `myriad`,
25
+ `tapestry`, `landscape`; no "This PR addresses…", "adversarial self-review",
26
+ "live-verified", "thoroughly tested with comprehensive examples", "in today's",
27
+ "let's dive in", "in conclusion"; no bold lead-in on every bullet and no paired
28
+ em-dash asides. Say what broke or what changed, pick the plain short verb, name the
29
+ number, and vary sentence length. If the first line could open any PR on any repo,
30
+ delete it.
31
+ - Treat `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.github/copilot-instructions.md`
32
+ as review-required: they may be intentional team config, so confirm before
33
+ committing them.
34
+
35
+ Project map:
36
+
37
+ - `src/scan.mjs` and `src/rules.mjs` load rules and make policy decisions.
38
+ - `src/hook.mjs` and `src/githooks.mjs` enforce them in agent and Git hooks.
39
+ - `src/state.mjs` owns local policy state. `bin/aimhooman.mjs` is the CLI.
40
+ - `tests/` mirrors the production paths and includes real temporary Git repos.
41
+
42
+ Use Node.js 22.8 or newer. Before finishing a change, run:
43
+
44
+ ```sh
45
+ npm run check
46
+ npm test
47
+ npm run test:coverage
48
+ ```
49
+
50
+ aimhooman also enforces this at commit time, so a blocked commit means a real
51
+ violation to fix, not a check to bypass. The rule is simple: AI works, hoomans
52
+ ship.
53
+ <!-- aimhooman:ruleset-end -->
@@ -0,0 +1,57 @@
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
5
+ # aimhooman
6
+
7
+ <!-- aimhooman:ruleset-start -->
8
+ This repository uses aimhooman to keep AI tooling artifacts out of Git history.
9
+ Its policy:
10
+
11
+ - Never stage or commit local AI session/state files. Examples include
12
+ `.claude.json`, `.claude/.credentials.json`, `.claude/session*.json`,
13
+ `.claude/history*`, `.claude/todos/*`, `.claude/shell-snapshots/*`,
14
+ `.claude/statsig/*`, `.claude/projects/*`, `.claude/logs/*`,
15
+ `.codex/sessions/*`, `.codex/history*`, `.codex/log/*`, `.codex/logs/*`,
16
+ `.copilot/*`, `.cursor/session*`, `.cursor/chats/*`, `.cursor/logs/*`,
17
+ `.aider.*`, `.specstory/*`, `.continue/sessions/*`, `.playwright-mcp/*`,
18
+ `.remember/*`, `.superpowers/*`, and `.agent/*`. The examples are not
19
+ exhaustive; the packaged `rules/paths.json` is the detection source of truth.
20
+ If one is staged, unstage it and keep it out of Git instead.
21
+ - Never commit secrets: a real `.env` (not `.env.example`), private keys
22
+ (`id_rsa` and files containing a private-key header), `.aws/credentials`, or
23
+ service-account keys. Public certificates are allowed.
24
+ - Never add AI attribution to commit messages: no `Co-authored-by` trailer naming
25
+ an AI (Claude, Copilot, Codex), no "Generated with/by <AI>" lines, no AI-service
26
+ noreply emails. A commit message reads as if a human wrote it.
27
+ - Write in a human voice, not an AI voice. No `delve`, `leverage`, `utilize`,
28
+ `seamless`, `robust`, `comprehensive`, `underscore`, `foster`, `pivotal`, `myriad`,
29
+ `tapestry`, `landscape`; no "This PR addresses…", "adversarial self-review",
30
+ "live-verified", "thoroughly tested with comprehensive examples", "in today's",
31
+ "let's dive in", "in conclusion"; no bold lead-in on every bullet and no paired
32
+ em-dash asides. Say what broke or what changed, pick the plain short verb, name the
33
+ number, and vary sentence length. If the first line could open any PR on any repo,
34
+ delete it.
35
+ - Treat `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.github/copilot-instructions.md`
36
+ as review-required: they may be intentional team config, so confirm before
37
+ committing them.
38
+
39
+ Project map:
40
+
41
+ - `src/scan.mjs` and `src/rules.mjs` load rules and make policy decisions.
42
+ - `src/hook.mjs` and `src/githooks.mjs` enforce them in agent and Git hooks.
43
+ - `src/state.mjs` owns local policy state. `bin/aimhooman.mjs` is the CLI.
44
+ - `tests/` mirrors the production paths and includes real temporary Git repos.
45
+
46
+ Use Node.js 22.8 or newer. Before finishing a change, run:
47
+
48
+ ```sh
49
+ npm run check
50
+ npm test
51
+ npm run test:coverage
52
+ ```
53
+
54
+ aimhooman also enforces this at commit time, so a blocked commit means a real
55
+ violation to fix, not a check to bypass. The rule is simple: AI works, hoomans
56
+ ship.
57
+ <!-- aimhooman:ruleset-end -->
package/AGENTS.md ADDED
@@ -0,0 +1,53 @@
1
+ # aimhooman: ship it like a hooman
2
+
3
+ <!-- aimhooman:ruleset-start -->
4
+ This repository uses aimhooman to keep AI tooling artifacts out of Git history.
5
+ Its policy:
6
+
7
+ - Never stage or commit local AI session/state files. Examples include
8
+ `.claude.json`, `.claude/.credentials.json`, `.claude/session*.json`,
9
+ `.claude/history*`, `.claude/todos/*`, `.claude/shell-snapshots/*`,
10
+ `.claude/statsig/*`, `.claude/projects/*`, `.claude/logs/*`,
11
+ `.codex/sessions/*`, `.codex/history*`, `.codex/log/*`, `.codex/logs/*`,
12
+ `.copilot/*`, `.cursor/session*`, `.cursor/chats/*`, `.cursor/logs/*`,
13
+ `.aider.*`, `.specstory/*`, `.continue/sessions/*`, `.playwright-mcp/*`,
14
+ `.remember/*`, `.superpowers/*`, and `.agent/*`. The examples are not
15
+ exhaustive; the packaged `rules/paths.json` is the detection source of truth.
16
+ If one is staged, unstage it and keep it out of Git instead.
17
+ - Never commit secrets: a real `.env` (not `.env.example`), private keys
18
+ (`id_rsa` and files containing a private-key header), `.aws/credentials`, or
19
+ service-account keys. Public certificates are allowed.
20
+ - Never add AI attribution to commit messages: no `Co-authored-by` trailer naming
21
+ an AI (Claude, Copilot, Codex), no "Generated with/by <AI>" lines, no AI-service
22
+ noreply emails. A commit message reads as if a human wrote it.
23
+ - Write in a human voice, not an AI voice. No `delve`, `leverage`, `utilize`,
24
+ `seamless`, `robust`, `comprehensive`, `underscore`, `foster`, `pivotal`, `myriad`,
25
+ `tapestry`, `landscape`; no "This PR addresses…", "adversarial self-review",
26
+ "live-verified", "thoroughly tested with comprehensive examples", "in today's",
27
+ "let's dive in", "in conclusion"; no bold lead-in on every bullet and no paired
28
+ em-dash asides. Say what broke or what changed, pick the plain short verb, name the
29
+ number, and vary sentence length. If the first line could open any PR on any repo,
30
+ delete it.
31
+ - Treat `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, and `.github/copilot-instructions.md`
32
+ as review-required: they may be intentional team config, so confirm before
33
+ committing them.
34
+
35
+ Project map:
36
+
37
+ - `src/scan.mjs` and `src/rules.mjs` load rules and make policy decisions.
38
+ - `src/hook.mjs` and `src/githooks.mjs` enforce them in agent and Git hooks.
39
+ - `src/state.mjs` owns local policy state. `bin/aimhooman.mjs` is the CLI.
40
+ - `tests/` mirrors the production paths and includes real temporary Git repos.
41
+
42
+ Use Node.js 22.8 or newer. Before finishing a change, run:
43
+
44
+ ```sh
45
+ npm run check
46
+ npm test
47
+ npm run test:coverage
48
+ ```
49
+
50
+ aimhooman also enforces this at commit time, so a blocked commit means a real
51
+ violation to fix, not a check to bypass. The rule is simple: AI works, hoomans
52
+ ship.
53
+ <!-- aimhooman:ruleset-end -->
package/CHANGELOG.md ADDED
@@ -0,0 +1,153 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-07-15
11
+
12
+ First public release. aimhooman keeps AI coding-agent residue out of Git history
13
+ without getting in your way: AI session/state files, secrets, AI attribution in
14
+ commit messages, and AI markers left in code.
15
+
16
+ ### Fixed
17
+
18
+ - Scan staged blob content when an agent tries to bypass `pre-commit` under the
19
+ clean or compliance profile.
20
+ - Treat earlier repository or hook mutations as a possible guard bypass, track
21
+ index changes such as `git mv`, and preserve policy-transition risk through
22
+ Git aliases before a compound commit.
23
+ - Treat branch-writing `fetch`, `worktree`, `stash`, `bisect`, `remote`, and local
24
+ `push` receiver flows as protected ref mutations; reject explicit or configured
25
+ receive-pack indirection before it can bypass the final hook.
26
+ - Require the managed final guards to be present for protected agent Git
27
+ operations on every profile, not only `strict`.
28
+ - Ignore local Git replacement refs in policy, history, authorization, and audit
29
+ reads; treat `git replace` as a policy transition in compound commands.
30
+ - Scan every index stage during unresolved conflicts so a secret on either side
31
+ cannot be missed.
32
+ - Authorize protected-path CI only when the exact workflow-run attempt's actor and
33
+ triggering actor, including their IDs, match the current personal-repository
34
+ owner returned by GitHub. Bind that authorization to exact commits, paths,
35
+ blobs, modes, deletion tombstones, and policy migrations; non-owner changes fail
36
+ closed with no reviewer fallback.
37
+ - Keep the published local rule-pack schema compatible with strict JSON Schema
38
+ validators.
39
+ - Prove npm version absence and forward dist-tag movement with bounded retries
40
+ before publish; retry integrity, dist-tag, and provenance reads afterward,
41
+ including idempotent reruns.
42
+ - Classify SemVer build metadata correctly when creating GitHub releases.
43
+ - Run GitHub Copilot hooks on PowerShell as well as Bash without swallowing
44
+ aimhooman's exit status.
45
+ - Render native Windows `PATH` entries in Git Bash syntax inside managed hooks,
46
+ and read reference updates with shell builtins so the hooks do not depend on
47
+ semicolon path parsing or external core utilities.
48
+ - Reject shell-expanded and split-worktree targets before alias or policy lookup.
49
+ Leading-tilde forms fail closed on every platform, exactly-two-slash targets
50
+ fail closed on POSIX, and guarded Windows changes reject POSIX-root,
51
+ drive-relative, and incomplete UNC targets.
52
+ - Treat non-POSIX executor payloads as uncertain and reject their repository-
53
+ selection syntax before a protected operation can inspect the wrong policy.
54
+ - Preserve outer runtime and Git-target environment risks inside nested shell
55
+ payloads, including Bash, POSIX-shell, and Zsh startup-file variables.
56
+ - Reject guarded Git operations wrapped by commands that can select another cwd
57
+ or filesystem namespace, such as `sudo`, `chroot`, WSL, and sandbox launchers.
58
+ - Reject nested non-POSIX shells and explicit login, interactive, or startup-file
59
+ shell launches before they can redirect repository policy lookup.
60
+ - Keep concurrent lifecycle commands queued long enough for the earlier command
61
+ to finish, including the case where that command fails and its successor retries.
62
+ - Leave unsupported bare repositories unchanged when they inherit the optional
63
+ global hook directory.
64
+ - Accept Git 2.54's early `preparing` reference-transaction callback while
65
+ checking guard integrity there and keeping the full scan in the locked
66
+ `prepared` phase.
67
+ - Provision pinned Go 1.25 in test and release workflows so actionlint runs on
68
+ macOS runner images that do not preinstall Go.
69
+ - Build the package-manifest private-key fixture at test runtime so a fresh
70
+ strict history scan does not mistake the test source for credential material.
71
+ - Scan from empty history when a force-push event names an old commit that is no
72
+ longer fetchable, covering every commit reachable from the replacement head.
73
+ - Allow public PEM certificates in the package manifest while rejecting PEM
74
+ files that contain a private-key header.
75
+ - Publish to npm from a `v*` tag push: the release workflow installs dependencies,
76
+ runs the test suite, and publishes with npm build provenance authenticated by the
77
+ `NPM_TOKEN` secret. Use Node 24 and SHA-pinned actions.
78
+
79
+ ### Overview
80
+
81
+ - Vendor-neutral guard with one detection core and a thin adapter per host.
82
+ - Repair-first ordinary commits by default: session-start auto-exclude writes known AI
83
+ artifacts to `.git/info/exclude`; `pre-commit` unstages any that slip through;
84
+ `commit-msg` removes complete exact high-confidence attribution lines and reports
85
+ broader candidates without editing them. An unterminated exact final line stops
86
+ unchanged because a byte-safe repair cannot be proved.
87
+ - 29 built-in rules across paths, attribution, markers, and secrets.
88
+ - Three policy profiles: `clean` (default — repair-first on the ordinary commit path),
89
+ `strict` (opt-in hard enforcement that cancels the commit), and `compliance`
90
+ (repair-first but keeps any AI disclosure a regulated policy requires).
91
+ - Any block that cannot be unstaged or repaired stops the commit; a pinned-tree
92
+ and final full-snapshot scan prevent a pre-existing tracked block from riding
93
+ through an unrelated change.
94
+
95
+ ### Enforcement surfaces
96
+
97
+ - SessionStart auto-exclude for known AI artifacts (local, never `.gitignore`).
98
+ - `pre-commit` and `pre-merge-commit` unstage of AI session/state files and
99
+ secrets from the index.
100
+ - `commit-msg` removal of complete exact AI attribution lines.
101
+ - Prepared `reference-transaction` full-scan of every commit introduced by an
102
+ ordinary commit, cherry-pick, revert, rebase, `git am`, fetch/worktree branch
103
+ creation, or direct ref update.
104
+ - `PreToolUse` path advisory plus fail-closed checks on every profile for empty,
105
+ invalid, or non-object hook JSON, missing managed guards, unresolved Git
106
+ commands/aliases, and hook or receive-pack indirection around protected ref
107
+ mutations. Unknown executor argument shapes fail closed on `strict`, which also
108
+ rejects uncertain commit execution and `git commit --no-verify`.
109
+ - CLI targets: `--staged`, `--tracked`, `--commit <rev>`, `--range <base>...<head>`,
110
+ `--message <file>`, plus `audit` and its `scan` alias as shorthand for a full
111
+ tracked-index scan.
112
+ - Optional `aimhooman init --global --yes` guards terminal Git in eligible non-bare
113
+ repositories that do not override `core.hooksPath` locally.
114
+
115
+ ### Host adapters
116
+
117
+ - Plugin-tier (live `PreToolUse` guard): Claude Code, Codex, GitHub Copilot CLI.
118
+ - Instruction-tier (ruleset text): Cursor, Cline, Windsurf, Kiro, Gemini CLI,
119
+ Gemini Code Assist, Google Antigravity, plus `AGENTS.md` as a universal fallback.
120
+ - Host registry in `docs/hosts.json` records adapter, activation contract, and
121
+ verification status for each host.
122
+
123
+ ### Configuration
124
+
125
+ - Versioned `.aimhooman.json` project profiles with precedence over per-clone
126
+ defaults; an individual `check` may escalate but cannot weaken the team profile.
127
+ - Per-clone local rule packs in `<git-common-dir>/aimhooman/rules/*.json`
128
+ (core-first; local rules only add detection, never weaken a built-in block).
129
+ - Per-decision overrides (`allow` / `deny`) in
130
+ `<git-common-dir>/aimhooman/overrides.json` (local, never committed).
131
+ - Malformed project policy fails closed with an actionable error.
132
+
133
+ ### Engineering
134
+
135
+ - Zero-runtime-dependency Node ESM (Node 22.8+ and Git 2.28+), shipped as source.
136
+ - State lives in the git dir. Init normally adds no worktree file; when a
137
+ repository already uses a worktree-relative `core.hooksPath`, that configured
138
+ directory remains the hook location. Foreign Git hooks are chained and
139
+ restored on uninstall.
140
+ - Published JSON schemas; machine reports include target policy identity,
141
+ completeness, scan statistics, and commit/object metadata.
142
+ - Release pipeline publishes to npm on a `v*` tag push with SHA-pinned actions and
143
+ npm build provenance.
144
+
145
+ ### Security
146
+
147
+ - Malformed local rule packs are skipped with a warning on `clean`; `strict` fails
148
+ closed. Corrupt enforcement state and unreadable Git targets return an error.
149
+ - `init --global` refuses to clobber a pre-existing `core.hooksPath`.
150
+ - The `PreToolUse` guard intercepts `git commit --no-verify` upstream of git, which
151
+ a git hook cannot.
152
+ - Hardened command parser (quoted verbs, newline separators, pathed git binaries),
153
+ bounded path-glob matching with character classes, and hook input validation.