diff --git a/.humancov b/.humancov
index 0de90ad..407d850 100644
--- a/.humancov
+++ b/.humancov
@@ -14,6 +14,7 @@ test/badge.test.js ai false false claude-code -
test/cli.test.js ai false false claude-code -
test/comments.test.js ai false false claude-code -
test/ignore.test.js ai false false claude-code -
+test/init.test.js ai false false claude-code -
test/manifest.test.js ai false false claude-code -
test/parser.test.js ai false false claude-code -
test/report.test.js ai false false claude-code -
diff --git a/CLAUDE.md b/CLAUDE.md
index dafd289..c0cd29d 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1,3 +1,76 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## Build and Run
+
+```bash
+npm install # install deps (single dep: `ignore`)
+npm test # run all tests (node:test, no framework)
+node --test test/parser.test.js # run a single test file
+node bench/perf.js # run benchmarks
+npx humancov scan # run the CLI locally
+npm run ci # run CI locally via `act` (requires act installed)
+```
+
+No build step - pure ESM (`"type": "module"` in package.json), runs directly with Node >= 18.
+
+## Architecture
+
+The CLI entry point is `bin/humancov.js` - a thin dispatcher that parses args and delegates to modules in `src/`:
+
+- `scanner.js` - core scan logic. Lists files via `git ls-files` (falls back to recursive walk), filters through ignore patterns, calls parser on each file, aggregates summary stats.
+- `parser.js` - reads first 20 lines of a file, extracts `AI-Provenance-*` headers using comment-syntax-aware parsing.
+- `comments.js` - maps file extensions to comment prefixes (`//`, `#`, `
-```
-```css
-/* AI-Provenance-Origin: ai */ /* CSS, SCSS, Less */
-```
-```sql
--- AI-Provenance-Origin: ai -- SQL, Lua
-```
+| Key | Required | Values |
+|---|---|---|
+| `Origin` | yes | `ai`, `human`, `mixed` |
+| `Generator` | no | tool name (`claude-code`, `copilot`, `codex`...) |
+| `Reviewed` | yes | `true`, `false`, `partial` |
+| `Tested` | no | `true`, `false`, `partial` |
+| `Confidence` | no | `high`, `medium`, `low` |
+| `Notes` | no | free-text |
---
## Ignore Files
-Create `.humancov-ignore` at repo root (gitignore syntax) to exclude files from scanning:
+humancov automatically respects your **`.gitignore`** - no extra setup needed. Anything ignored by git is ignored by humancov.
+
+For humancov-specific ignores on top of `.gitignore`, create `.humancov-ignore` at repo root (same gitignore syntax):
```gitignore
*.md
@@ -153,7 +162,9 @@ dist/
coverage/
```
-Default ignores: `node_modules/`, `.git/`, `.humancov`, `.humancov-ignore`, `*.md`, `*.lock`, `LICENSE`, `.gitignore`, `.github/`.
+**Resolution order:** built-in defaults → `.gitignore` → `.humancov-ignore`.
+
+Built-in defaults: `node_modules/`, `.git/`, `.humancov`, `.humancov-ignore`, `*.md`, `*.lock`, `LICENSE`, `.gitignore`, `.github/`.
---
@@ -192,11 +203,10 @@ Exits with code 1 if the reviewed percentage is below the threshold.
A pre-commit hook keeps the badge and `.humancov` manifest up to date automatically on every commit.
-**Option A - via `humancov init`:**
-
Run `humancov init` and your AI tool will propose installing the hook for you.
-**Option B - manual setup:**
+
+Manual setup
Create `.git/hooks/pre-commit` with this content:
@@ -233,6 +243,8 @@ chmod +x .git/hooks/pre-commit
> **Note:** `.git/hooks/` is local and not shared via git. Each contributor needs to set up the hook on their machine. If your team uses [husky](https://typicode.github.io/husky/) or a similar tool, add the hook content to your shared hooks directory instead.
+
+
---
## Manifest
@@ -275,30 +287,6 @@ Aggregate stats and output report
---
-## Performance
-
-Benchmarked on a standard machine with Node >= 18. Run `node bench/perf.js` to reproduce.
-
-| Operation | Scope | Avg |
-|---|---|---|
-| Comment prefix lookup | 10,000 lookups | ~12ms |
-| Ignore pattern loading | single load | ~0.1ms |
-| Badge URL generation | 1,000 generations | ~0.1ms |
-| Header parsing | 7 files | ~3ms |
-| Full repo scan | 8 tracked files | ~90ms |
-
-**Scaling (scanFiles):**
-
-| Files | Avg | Min | Max |
-|---|---|---|---|
-| 100 | ~120ms | ~80ms | ~220ms |
-| 500 | ~175ms | ~145ms | ~295ms |
-| 1,000 | ~265ms | ~220ms | ~340ms |
-
-Scales near-linearly. The main cost is `git ls-files` + file I/O in the scanner - utility modules add negligible overhead.
-
----
-
## Spec
See the [AI-Provenance Spec v0.1](https://github.com/enixCode/humancov/blob/main/CLAUDE.md) for the full specification.
diff --git a/docs/index.html b/docs/index.html
index 98fd79d..a9a6214 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -497,7 +497,7 @@
Review and track
Teach your AI to tag its code.
-
Run humancov init to detect your AI tool config files and inject provenance instructions automatically.
+
Run humancov init to detect your AI tool config files (or modern rule directories) and inject provenance instructions automatically.
- Requires Node >= 18. Zero config. Single dependency.
+ Install as a dev dependency. Requires Node >= 18. Zero config. Single dependency.
+
+
+
+
+ Automation
+
Pre-commit hook.
+
+
+
A local git hook that auto-updates the badge and .humancov manifest before every commit. Zero manual work to keep your README and manifest in sync.
+
+
+
+
1
+
+
Runs on every git commit
+
Regenerates .humancov from your file headers and stages it.
+
+
+
+
2
+
+
Updates the README badge
+
Replaces the human-reviewed shields.io URL with the fresh percentage.
+
+
+
+
3
+
+
Stages the changes
+
Both .humancov and README.md updates land in the same commit.
+
+
+
+
+
Run humancov init and your AI tool will propose installing the hook for you. Manual setup: create .git/hooks/pre-commit, paste the snippet from the README, and chmod +x it.
+
Note: .git/hooks/ is local and not shared via git. Each contributor installs it once on their machine (or uses husky to share it).
+
+
+
+
@@ -666,6 +716,39 @@
30+ file types supported.
+
+
+
+
+ Ignore
+
Skip files from scans.
+
+
+
humancov auto-respects your .gitignore - zero setup. For humancov-specific exclusions on top, create .humancov-ignore at the repo root (same gitignore syntax).
humancov manifest generates a TSV summary of all files with provenance headers. File headers are the source of truth - if both exist and conflict, headers win.