@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,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ **yudhi@rmyndharis.com**. All complaints will be reviewed and investigated
64
+ promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary ban
96
+
97
+ **Community impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the ban, is allowed during this period. Violating these
104
+ terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent ban
107
+
108
+ **Community impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ <https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ <https://www.contributor-covenant.org/faq>. Translations are available at
128
+ <https://www.contributor-covenant.org/translations>.
@@ -0,0 +1,144 @@
1
+ # Contributing to aimhooman
2
+
3
+ Thanks for considering a contribution. aimhooman is a small,
4
+ zero-runtime-dependency Node ESM tool, so most changes are approachable.
5
+
6
+ ## Prerequisites
7
+
8
+ - **Node.js 22.8 or newer**
9
+ - **Git 2.28 or newer**
10
+ - **Go 1.25.x** for the pinned `actionlint` release gate
11
+
12
+ The published runtime has no dependencies. Development tools are locked in
13
+ `package-lock.json`.
14
+
15
+ ## Getting started
16
+
17
+ ```sh
18
+ git clone https://github.com/rmyndharis/aimhooman.git
19
+ cd aimhooman
20
+ node --version # needs >= 22.8
21
+ npm ci --ignore-scripts
22
+ npm run verify # schemas, workflows, dead code, coverage, package, installed hooks
23
+ ```
24
+
25
+ ## Ways to contribute
26
+
27
+ - **New detection rules** for an AI tool aimhooman doesn't cover yet.
28
+ - **New host adapters** for an AI coding tool not in the support matrix.
29
+ - **Bug fixes** and **documentation** improvements.
30
+
31
+ ## Adding a rule
32
+
33
+ Rules live in `rules/` as JSON arrays: `paths.json` (staged paths),
34
+ `attribution.json` (commit-message lines), `markers.json` (staged content),
35
+ `secrets.json` (high-confidence secret patterns). Each
36
+ rule has the shape:
37
+
38
+ ```json
39
+ {
40
+ "id": "provider.state",
41
+ "version": 1,
42
+ "provider": "provider",
43
+ "category": "ephemeral-state",
44
+ "confidence": "high",
45
+ "kind": "path",
46
+ "match": { "paths": ["**/.provider/**"] },
47
+ "actions": { "clean": "block", "strict": "block", "compliance": "block" },
48
+ "reason": "Provider artifacts are local, not repository content.",
49
+ "remediation": ["git restore --staged <path>"]
50
+ }
51
+ ```
52
+
53
+ Notes:
54
+
55
+ - `kind`: `"path"`, `"message"`, or `"code"`.
56
+ - `match.paths` use glob syntax (`*`, `**`, `?`, `[class]`). In a pattern such as
57
+ `**/.x/**`, the leading globstar matches zero or more directories, so one pattern
58
+ covers both `.x/file` and `nested/.x/file`. An explicit `.x/**` companion is
59
+ allowed for readability but is not required.
60
+ - `match.content` are regular expressions; prefix `(?i)` for case-insensitive.
61
+ Local packs use the safe flat subset documented in the README; built-in packs are
62
+ package-reviewed and may use the wider JavaScript syntax.
63
+ - Path matching is case-sensitive unless `match.path_case` is `"insensitive"`.
64
+ Use that per rule only when the security name itself is case-insensitive; Git path
65
+ and override identities remain unchanged.
66
+ - `actions` per profile (`clean` / `strict` / `compliance`). Residue should
67
+ `block` on all three. Exact high-confidence AI attribution may `block` on
68
+ clean/strict and `allow` on compliance; ambiguous identities should remain review-only.
69
+ - Add positive and near-miss fixtures in `tests/rule-contracts.test.mjs`. The
70
+ contract test fails when a catalog rule has no fixture.
71
+
72
+ ## Adding a host adapter
73
+
74
+ - **Plugin-tier** (live `PreToolUse` guard): see `.claude-plugin/`,
75
+ `.codex-plugin/`, `.github/hooks/`. Claude and Codex load the packaged hook
76
+ manifest. The Copilot repository hook calls `aimhooman` from `PATH`.
77
+ - **Instruction-tier** (ruleset text): copy `AGENTS.md` verbatim into the host's
78
+ rule file, register it in `docs/hosts.json`, then run
79
+ `npm run sync:ruleset` and `npm run sync:hosts`. The copy
80
+ and package gates derive required adapter paths from that registry, check exact
81
+ ordered ruleset regions, and reject unregistered copies.
82
+
83
+ See `docs/design/agent-portability.md` for the full host matrix.
84
+
85
+ ### Local rules (don't commit these)
86
+
87
+ Personal, per-clone detection belongs in `<git-common-dir>/aimhooman/rules/*.json`
88
+ (local, never committed). Linked worktrees share it. Contribute general-purpose
89
+ rules to `rules/` instead.
90
+
91
+ ## Commit policy (important)
92
+
93
+ This project keeps AI tooling residue out of history — **including its own**.
94
+ Commits must read as if a human wrote them:
95
+
96
+ - **No AI attribution** in commit messages: no `Co-authored-by:` naming an AI,
97
+ no "Generated with/by …", no AI-service noreply emails. (Yes, aimhooman
98
+ enforces this on itself.)
99
+ - Keep commits focused — one logical change per commit.
100
+
101
+ ## Pull requests
102
+
103
+ 1. Open a PR against `main`.
104
+ 2. Include tests for any new behavior and run `npm run verify`.
105
+ 3. Update `CHANGELOG.md` and `docs/` where relevant.
106
+ 4. Make sure the PR follows the commit policy above.
107
+
108
+ By participating, you agree to abide by the [Code of Conduct](CODE_OF_CONDUCT.md).
109
+
110
+ This is a personal, owner-only repository. GitHub branch rules require the `tests`
111
+ workflow but no pull-request approval, code-owner review, last-push approval, or
112
+ other reviewer. The repository has no `CODEOWNERS` fallback.
113
+
114
+ Changes to agent instructions or `.aimhooman.json` are protected-path changes. CI
115
+ verifies the pinned repository and owner login plus numeric IDs through the GitHub
116
+ API, then fetches the exact workflow-run attempt. GitHub must attribute the
117
+ attempt's `actor` and `triggering_actor` to that owner's login and numeric ID. CI
118
+ binds that authorization to the exact
119
+ head, transition commit, path, resulting blob and regular-file mode, or deletion
120
+ tombstone. Policy migrations additionally bind the old and new policy objects.
121
+ Another commit, attempt, path result, mode, or migration needs fresh authorization.
122
+ A protected-path change by any non-owner fails closed.
123
+
124
+ The owner account and its credentials are the repository trust root. These checks
125
+ verify GitHub's actor attribution and bind the resulting objects; they do not prove
126
+ an interactive human action, provide independent review, or protect against a
127
+ compromised owner credential.
128
+
129
+ Releases publish to npm automatically when a `v*` tag is pushed. The workflow
130
+ installs dependencies, runs the test suite, and publishes with npm build provenance,
131
+ authenticated by the `NPM_TOKEN` secret. To cut a release: bump the version (keep
132
+ `package.json`, `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, and
133
+ `.claude-plugin/marketplace.json` in sync), add the `## [version]` CHANGELOG entry
134
+ and the matching README version badge, then tag and push:
135
+
136
+ ```sh
137
+ git tag -a v0.1.0 -m v0.1.0
138
+ git push origin v0.1.0
139
+ ```
140
+
141
+ Protect `v*` tags so only the owner can create them and tag update or deletion is
142
+ blocked. Use a granular, publish-only, package-scoped npm token with 2FA enabled
143
+ and rotate it regularly. Do not run `npm publish` or move dist-tags manually while
144
+ a release job is pending or running.
package/GEMINI.md ADDED
@@ -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 -->
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yudhi Armyndharis & aimhooman contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.