code-warden 3.3.0 → 3.3.1

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 (40) hide show
  1. package/CONFIGURE.md +39 -39
  2. package/DECISIONS.md +107 -107
  3. package/README.md +6 -0
  4. package/SKILL.md +169 -169
  5. package/bin/code-warden.js +82 -82
  6. package/codewarden.json +14 -14
  7. package/examples/governed-session.md +132 -132
  8. package/install.js +399 -399
  9. package/install.ps1 +32 -32
  10. package/install.sh +33 -33
  11. package/package.json +62 -62
  12. package/references/anti-drift.md +55 -55
  13. package/references/architecture.md +26 -26
  14. package/references/cleanup.md +30 -30
  15. package/references/cognition.md +36 -36
  16. package/references/operations.md +45 -45
  17. package/references/planning-gates.md +83 -83
  18. package/references/research-and-fit.md +51 -51
  19. package/references/safety.md +31 -31
  20. package/tools/auto-detect.js +91 -91
  21. package/tools/auto-targets.js +104 -104
  22. package/tools/auto-windsurf-adapter.js +75 -75
  23. package/tools/get-context.js +50 -50
  24. package/tools/governance-report.js +302 -302
  25. package/tools/hooks/claude/install-hooks.js +112 -112
  26. package/tools/hooks/claude/uninstall-hooks.js +75 -75
  27. package/tools/hooks/claude/warden-lint-hook.js +106 -106
  28. package/tools/hooks/claude/warden-secrets-hook.js +73 -73
  29. package/tools/hooks/codex/install-hooks.js +100 -100
  30. package/tools/hooks/codex/uninstall-hooks.js +53 -53
  31. package/tools/hooks/codex/warden-apply-patch-hook.js +113 -113
  32. package/tools/hooks/codex/warden-bash-hook.js +51 -51
  33. package/tools/lib/config.js +49 -49
  34. package/tools/lib/file-collection.js +5 -2
  35. package/tools/lib/line-count.js +28 -28
  36. package/tools/lib/secret-patterns.js +57 -57
  37. package/tools/tests/fixtures/clean.js +9 -9
  38. package/tools/tests/run-tests.js +210 -210
  39. package/tools/verify-secrets.js +26 -26
  40. package/tools/warden-lint.js +27 -27
package/CONFIGURE.md CHANGED
@@ -1,39 +1,39 @@
1
- # Configuration Guide
2
-
3
- CodeWarden now uses a machine-readable configuration file: `codewarden.json`.
4
- Every threshold is tunable through this file, making it easy to share settings across your team.
5
-
6
- ---
7
-
8
- ## The `codewarden.json` File
9
-
10
- Located at the root of the skill folder. Default configuration:
11
-
12
- ```json
13
- {
14
- "thresholds": {
15
- "max_file_length": 400,
16
- "pre_flight_trigger_lines": 150,
17
- "human_checkpoint_files": 2
18
- },
19
- "safety": {
20
- "exempt_from_blast_radius": ["tests/", "docs/", "scripts/"]
21
- }
22
- }
23
- ```
24
-
25
- | Setting | Default | Rationale |
26
- |---------|---------|-----------|
27
- | `max_file_length` | 400 | Keeps files reviewable in a single pass. The `warden-lint.js` script enforces this. |
28
- | `pre_flight_trigger_lines` | 150 | Forces a JSON manifest before large outputs. |
29
- | `human_checkpoint_files` | 2 | Requires human `[AWAITING CONFIRMATION]` before modifying this many files simultaneously. |
30
- | `exempt_from_blast_radius` | (list) | Skips strict rewriting rollback plans on these file directories. |
31
-
32
- ---
33
-
34
- ## How to Customize
35
-
36
- 1. **Open** `codewarden.json` in your `.claude/skills/code-warden/` directory.
37
- 2. **Modify** the specific rule or threshold inside the JSON structural fields.
38
- 3. The executable tools (`tools/warden-lint.js`, etc.) read these limits dynamically so no Markdown files need to be edited to enforce limits.
39
- 4. **Log the change** in `DECISIONS.md` so your team knows why the default was overridden.
1
+ # Configuration Guide
2
+
3
+ CodeWarden now uses a machine-readable configuration file: `codewarden.json`.
4
+ Every threshold is tunable through this file, making it easy to share settings across your team.
5
+
6
+ ---
7
+
8
+ ## The `codewarden.json` File
9
+
10
+ Located at the root of the skill folder. Default configuration:
11
+
12
+ ```json
13
+ {
14
+ "thresholds": {
15
+ "max_file_length": 400,
16
+ "pre_flight_trigger_lines": 150,
17
+ "human_checkpoint_files": 2
18
+ },
19
+ "safety": {
20
+ "exempt_from_blast_radius": ["tests/", "docs/", "scripts/"]
21
+ }
22
+ }
23
+ ```
24
+
25
+ | Setting | Default | Rationale |
26
+ |---------|---------|-----------|
27
+ | `max_file_length` | 400 | Keeps files reviewable in a single pass. The `warden-lint.js` script enforces this. |
28
+ | `pre_flight_trigger_lines` | 150 | Forces a JSON manifest before large outputs. |
29
+ | `human_checkpoint_files` | 2 | Requires human `[AWAITING CONFIRMATION]` before modifying this many files simultaneously. |
30
+ | `exempt_from_blast_radius` | (list) | Skips strict rewriting rollback plans on these file directories. |
31
+
32
+ ---
33
+
34
+ ## How to Customize
35
+
36
+ 1. **Open** `codewarden.json` in your `.claude/skills/code-warden/` directory.
37
+ 2. **Modify** the specific rule or threshold inside the JSON structural fields.
38
+ 3. The executable tools (`tools/warden-lint.js`, etc.) read these limits dynamically so no Markdown files need to be edited to enforce limits.
39
+ 4. **Log the change** in `DECISIONS.md` so your team knows why the default was overridden.
package/DECISIONS.md CHANGED
@@ -1,107 +1,107 @@
1
- # DECISIONS.md
2
-
3
- Decision log for this project. Maintained per the code-warden cleanup protocol.
4
-
5
- ## Format
6
-
7
- Each entry:
8
- - **Date**: YYYY-MM-DD
9
- - **Decision**: What was decided
10
- - **Alternatives**: What else was considered
11
- - **Reasoning**: Why this choice was made, with links where applicable
12
- - **Files Affected**: List of files changed
13
-
14
- ---
15
-
16
- <!-- Append new decisions below this line -->
17
-
18
- ---
19
-
20
- ## 2026-05-15 - Codex partial hook enforcement — apply_patch and Bash (ADR)
21
-
22
- - **Decision**: Ship Codex hook support as "partial hard enforcement" covering `apply_patch` and `Bash` tool calls. Claude hooks are moved to `tools/hooks/claude/`. Codex hooks live at `tools/hooks/codex/`. Each runtime gets its own installer/uninstaller. `install.js` dispatches dynamically via `require('./tools/hooks/${id}/install-hooks')`.
23
- - **Alternatives considered**:
24
- - Full Codex parity with Claude (Write/Edit blocking). Rejected: Codex does not expose Write/Edit as hookable tool calls. `apply_patch` and `Bash` are the only available hook surfaces.
25
- - Single hooks/ directory without runtime subdirs. Rejected: creates naming collisions and makes the difference in behavior invisible.
26
- - TOML config for Codex. Rejected: `~/.codex/hooks.json` (JSON) avoids a TOML parser dependency and matches the installer pattern already proven with `settings.json`.
27
- - **Reasoning**: Codex exposes two tool surfaces at PreToolUse — `apply_patch` (for file writes) and `Bash` (for shell execution). Both are realistic vectors for hardcoded secrets. The `apply_patch` hook also estimates resulting file size where a target path is extractable. This covers the most dangerous Codex operations without claiming full parity with the Claude hook surface.
28
- - **Consequence**: Codex cannot block oversized line counts for net-new files created via `cat >>` or `tee` in Bash. This gap is documented in the README compatibility matrix. CI enforcement (`npm run lint`) closes it at the pipeline level.
29
- - **Files affected**: `tools/hooks/claude/` (renamed from `tools/hooks/`), `tools/hooks/codex/warden-apply-patch-hook.js`, `tools/hooks/codex/warden-bash-hook.js`, `tools/hooks/codex/install-hooks.js`, `tools/hooks/codex/uninstall-hooks.js`, `install.js`, `package.json`, `SKILL.md`, `DECISIONS.md`
30
-
31
- ---
32
-
33
- ## 2026-05-15 - Claude hooks live inside the installed skill path (ADR)
34
-
35
- - **Decision**: Code-warden Claude hooks (`warden-lint-hook.js`, `warden-secrets-hook.js`) are installed from and referenced at `~/.claude/skills/code-warden/tools/hooks/`. Hook scripts are not copied to a neutral directory (e.g. `~/.claude/hooks/code-warden/`). The absolute path to the skill directory is written into `~/.claude/settings.json` at hook install time.
36
- - **Alternatives considered**:
37
- - Neutral directory (`~/.claude/hooks/code-warden/`). Rejected: requires copying hook scripts to a second location on install, syncing them on update, and maintaining a separate removal path. Creates a split-brain problem with two artifact trees.
38
- - Relative path via `${CLAUDE_PROJECT_DIR}`. Rejected: hooks are user-level (global), not project-level. No stable relative root exists at user scope.
39
- - **Reasoning**: Hooks are part of the code-warden skill distribution. They version with the skill and are updated by the same installer (`node install.js --hooks=claude`). One source of truth, one update path, one health-check target.
40
- - **Consequence**: If the skill directory is deleted manually, `~/.claude/settings.json` may contain dangling hook entries pointing at missing scripts. `--doctor`, `--verify-target=claude`, and `--uninstall-hooks=claude` all detect and repair this condition. The risk is visible and recoverable.
41
- - **Files affected**: `tools/hooks/warden-lint-hook.js`, `tools/hooks/warden-secrets-hook.js`, `tools/hooks/install-hooks.js`, `tools/hooks/uninstall-hooks.js`, `install.js`, `DECISIONS.md`
42
-
43
- ---
44
-
45
- ## 2026-05-14 - Research and fit governance
46
-
47
- - **Decision**: Added `references/research-and-fit.md` and wired it into the core skill, cognitive routing, drift signals, README files, and governed-session example. The layer forces live research for current/version-specific facts and requires a fit check before defaulting to familiar stacks or product shapes.
48
- - **Alternatives considered**:
49
- - Expand only the existing "Don't Guess Syntax" rule. Rejected because syntax accuracy is narrower than the failure mode; the agent can know syntax and still choose the wrong stack or app shape.
50
- - Put all research rules in `operations.md`. Rejected because operational evidence governs completion and source control, while research/fit governs choice formation before implementation.
51
- - **Reasoning**: AI coding agents often over-index on familiar defaults like Node, React, SaaS dashboards, CRUD admins, or auth-first scaffolds. The skill now makes project fit and current-source research explicit gates instead of relying on generic uncertainty language.
52
- - **Files affected**: `SKILL.md`, `references/research-and-fit.md`, `references/cognition.md`, `references/anti-drift.md`, `README.md`, root `README.md`, `examples/governed-session.md`, `package.json`
53
-
54
- ---
55
-
56
- ## 2026-05-14 - Operational governance layer
57
-
58
- - **Decision**: Added `references/operations.md` and wired it into the core skill, drift signals, README files, and governed-session example. The layer covers verification-before-completion, source-control hygiene, dependency and supply-chain control, and evidence standards for technical claims.
59
- - **Alternatives considered**:
60
- - Fold these rules into `references/safety.md`. Rejected because safety already covers execution risk, secrets, patch-first editing, and dependency freeze; adding verification, git hygiene, and citations there would blur the file's responsibility.
61
- - Add separate files for verification, source control, dependencies, and evidence. Rejected for now because each layer is short and operationally coupled; one focused operational reference avoids unnecessary reference sprawl.
62
- - **Reasoning**: The existing skill prevented many bad coding moves, but it did not make final verification evidence, dirty-worktree ownership, dependency changes, or sourced technical claims explicit stop conditions. These are common failure modes in AI coding sessions and deserve first-class governance.
63
- - **Files affected**: `SKILL.md`, `references/operations.md`, `references/anti-drift.md`, `README.md`, root `README.md`, `examples/governed-session.md`, `package.json`
64
-
65
- ---
66
-
67
- ## 2026-05-14 - Codex setup and shared-agent install path
68
-
69
- - **Decision**: Treat `~/.agents/skills/code-warden` as the default install target while preserving `codex` and `claude` installer options. Added `AGENTS.md` context discovery, refreshed README setup paths, normalized tool output to ASCII status tags, and bumped package metadata to `2.3.1`.
70
- - **Alternatives considered**:
71
- - Keep `~/.claude/skills/code-warden` as the only install path. Rejected because the active local environment loads user skills from `~/.agents/skills`.
72
- - Add a separate Codex-only fork. Rejected because one portable skill with target-specific installers is easier to maintain and audit.
73
- - **Reasoning**: The skill should be usable by Codex now without breaking Claude Code users. `AGENTS.md` is the local instruction surface for Codex-style repositories, and ASCII tool output avoids terminal encoding failures in Windows PowerShell.
74
- - **Files affected**: `AGENTS.md`, `README.md`, `SKILL.md`, `package.json`, `install.ps1`, `install.sh`, `tools/get-context.js`, `tools/warden-lint.js`, `tools/verify-secrets.js`
75
-
76
- ---
77
-
78
- ## 2026-03-26 - Polish pass: secret patterns, Windows installer, README, version sync
79
-
80
- - **Decision**: Strengthened `verify-secrets.js` with 13 named patterns: OpenAI `sk-`, GitHub `ghp_`/`gho_`/`ghs_`/`ghx_`, AWS `AKIA`, Stripe `sk_live_`/`sk_test_`, bearer tokens, and generic key/password assignments. Added `README.md`. Added `install.ps1` for Windows. Bumped metadata `version` to `2.3.0`. Added `CLAUDE.md` and `.claude/CLAUDE.md` to `get-context.js` candidate list.
81
- - **Alternatives considered**:
82
- - Build additional enforcement tools such as a pre-flight counter, blast-radius reporter, and human checkpoint enforcer. Rejected after ROI analysis: these rules are enforced more reliably by the existing prompt governance layer; tool output can only shape context if the agent runs the tool and reads the result.
83
- - Keep `install.sh` only. Rejected because the project owner is on Windows and `install.sh` is not enough for the platform.
84
- - **Reasoning**: The changes were low-debt and high-value. Secret pattern expansion directly improved the only tool that scans third-party code. The Windows installer removed a real friction point for the author. The README provided an onboarding path that was absent. The version sync eliminated a confusing discrepancy. `CLAUDE.md` support aligned with Claude Code project conventions.
85
- - **Files affected**: `tools/verify-secrets.js`, `install.ps1`, `README.md`, `SKILL.md`, `tools/get-context.js`
86
-
87
- ---
88
-
89
- ## 2026-03-25 - Align Human Checkpoint threshold with Think Before Coding rule
90
-
91
- - **Decision**: Changed `[AWAITING CONFIRMATION]` trigger from >3 files to >2 files across `cognition.md` and the Drift Signals table in `SKILL.md`.
92
- - **Alternatives considered**:
93
- - Raise Think Before Coding to >3 files. Rejected because it was too permissive and allowed unconfirmed 3-file changes.
94
- - Keep both thresholds as-is and document the gap as intentional. Rejected because the gap created ambiguous behavior: a plan was required at 2 files but no pause was enforced until 3.
95
- - **Reasoning**: The safer boundary is to require explicit confirmation at the same point planning is required. A user reading both rules would expect them to be consistent. Stricter wins.
96
- - **Files affected**: `references/cognition.md`, `SKILL.md`
97
-
98
- ---
99
-
100
- ## 2026-03-25 - Modular references split introduced in v2.1.0
101
-
102
- - **Decision**: Separated governance rules into five domain files under `references/` instead of a single monolithic `SKILL.md`.
103
- - **Alternatives considered**:
104
- - Single flat `SKILL.md` with all rules inline. Rejected because it is token-heavy and loads irrelevant rules every session.
105
- - Two files: core rules and extended rules. Rejected because it was not granular enough for targeted loading.
106
- - **Reasoning**: Lazy-loading reference files keeps session token cost low. The model only reads the files relevant to the current task type. Each file has a single stated domain, which mirrors the one-concern-per-file rule the skill itself enforces.
107
- - **Files affected**: `references/architecture.md`, `references/safety.md`, `references/cognition.md`, `references/cleanup.md`, `references/anti-drift.md`, `SKILL.md`
1
+ # DECISIONS.md
2
+
3
+ Decision log for this project. Maintained per the code-warden cleanup protocol.
4
+
5
+ ## Format
6
+
7
+ Each entry:
8
+ - **Date**: YYYY-MM-DD
9
+ - **Decision**: What was decided
10
+ - **Alternatives**: What else was considered
11
+ - **Reasoning**: Why this choice was made, with links where applicable
12
+ - **Files Affected**: List of files changed
13
+
14
+ ---
15
+
16
+ <!-- Append new decisions below this line -->
17
+
18
+ ---
19
+
20
+ ## 2026-05-15 - Codex partial hook enforcement — apply_patch and Bash (ADR)
21
+
22
+ - **Decision**: Ship Codex hook support as "partial hard enforcement" covering `apply_patch` and `Bash` tool calls. Claude hooks are moved to `tools/hooks/claude/`. Codex hooks live at `tools/hooks/codex/`. Each runtime gets its own installer/uninstaller. `install.js` dispatches dynamically via `require('./tools/hooks/${id}/install-hooks')`.
23
+ - **Alternatives considered**:
24
+ - Full Codex parity with Claude (Write/Edit blocking). Rejected: Codex does not expose Write/Edit as hookable tool calls. `apply_patch` and `Bash` are the only available hook surfaces.
25
+ - Single hooks/ directory without runtime subdirs. Rejected: creates naming collisions and makes the difference in behavior invisible.
26
+ - TOML config for Codex. Rejected: `~/.codex/hooks.json` (JSON) avoids a TOML parser dependency and matches the installer pattern already proven with `settings.json`.
27
+ - **Reasoning**: Codex exposes two tool surfaces at PreToolUse — `apply_patch` (for file writes) and `Bash` (for shell execution). Both are realistic vectors for hardcoded secrets. The `apply_patch` hook also estimates resulting file size where a target path is extractable. This covers the most dangerous Codex operations without claiming full parity with the Claude hook surface.
28
+ - **Consequence**: Codex cannot block oversized line counts for net-new files created via `cat >>` or `tee` in Bash. This gap is documented in the README compatibility matrix. CI enforcement (`npm run lint`) closes it at the pipeline level.
29
+ - **Files affected**: `tools/hooks/claude/` (renamed from `tools/hooks/`), `tools/hooks/codex/warden-apply-patch-hook.js`, `tools/hooks/codex/warden-bash-hook.js`, `tools/hooks/codex/install-hooks.js`, `tools/hooks/codex/uninstall-hooks.js`, `install.js`, `package.json`, `SKILL.md`, `DECISIONS.md`
30
+
31
+ ---
32
+
33
+ ## 2026-05-15 - Claude hooks live inside the installed skill path (ADR)
34
+
35
+ - **Decision**: Code-warden Claude hooks (`warden-lint-hook.js`, `warden-secrets-hook.js`) are installed from and referenced at `~/.claude/skills/code-warden/tools/hooks/`. Hook scripts are not copied to a neutral directory (e.g. `~/.claude/hooks/code-warden/`). The absolute path to the skill directory is written into `~/.claude/settings.json` at hook install time.
36
+ - **Alternatives considered**:
37
+ - Neutral directory (`~/.claude/hooks/code-warden/`). Rejected: requires copying hook scripts to a second location on install, syncing them on update, and maintaining a separate removal path. Creates a split-brain problem with two artifact trees.
38
+ - Relative path via `${CLAUDE_PROJECT_DIR}`. Rejected: hooks are user-level (global), not project-level. No stable relative root exists at user scope.
39
+ - **Reasoning**: Hooks are part of the code-warden skill distribution. They version with the skill and are updated by the same installer (`node install.js --hooks=claude`). One source of truth, one update path, one health-check target.
40
+ - **Consequence**: If the skill directory is deleted manually, `~/.claude/settings.json` may contain dangling hook entries pointing at missing scripts. `--doctor`, `--verify-target=claude`, and `--uninstall-hooks=claude` all detect and repair this condition. The risk is visible and recoverable.
41
+ - **Files affected**: `tools/hooks/warden-lint-hook.js`, `tools/hooks/warden-secrets-hook.js`, `tools/hooks/install-hooks.js`, `tools/hooks/uninstall-hooks.js`, `install.js`, `DECISIONS.md`
42
+
43
+ ---
44
+
45
+ ## 2026-05-14 - Research and fit governance
46
+
47
+ - **Decision**: Added `references/research-and-fit.md` and wired it into the core skill, cognitive routing, drift signals, README files, and governed-session example. The layer forces live research for current/version-specific facts and requires a fit check before defaulting to familiar stacks or product shapes.
48
+ - **Alternatives considered**:
49
+ - Expand only the existing "Don't Guess Syntax" rule. Rejected because syntax accuracy is narrower than the failure mode; the agent can know syntax and still choose the wrong stack or app shape.
50
+ - Put all research rules in `operations.md`. Rejected because operational evidence governs completion and source control, while research/fit governs choice formation before implementation.
51
+ - **Reasoning**: AI coding agents often over-index on familiar defaults like Node, React, SaaS dashboards, CRUD admins, or auth-first scaffolds. The skill now makes project fit and current-source research explicit gates instead of relying on generic uncertainty language.
52
+ - **Files affected**: `SKILL.md`, `references/research-and-fit.md`, `references/cognition.md`, `references/anti-drift.md`, `README.md`, root `README.md`, `examples/governed-session.md`, `package.json`
53
+
54
+ ---
55
+
56
+ ## 2026-05-14 - Operational governance layer
57
+
58
+ - **Decision**: Added `references/operations.md` and wired it into the core skill, drift signals, README files, and governed-session example. The layer covers verification-before-completion, source-control hygiene, dependency and supply-chain control, and evidence standards for technical claims.
59
+ - **Alternatives considered**:
60
+ - Fold these rules into `references/safety.md`. Rejected because safety already covers execution risk, secrets, patch-first editing, and dependency freeze; adding verification, git hygiene, and citations there would blur the file's responsibility.
61
+ - Add separate files for verification, source control, dependencies, and evidence. Rejected for now because each layer is short and operationally coupled; one focused operational reference avoids unnecessary reference sprawl.
62
+ - **Reasoning**: The existing skill prevented many bad coding moves, but it did not make final verification evidence, dirty-worktree ownership, dependency changes, or sourced technical claims explicit stop conditions. These are common failure modes in AI coding sessions and deserve first-class governance.
63
+ - **Files affected**: `SKILL.md`, `references/operations.md`, `references/anti-drift.md`, `README.md`, root `README.md`, `examples/governed-session.md`, `package.json`
64
+
65
+ ---
66
+
67
+ ## 2026-05-14 - Codex setup and shared-agent install path
68
+
69
+ - **Decision**: Treat `~/.agents/skills/code-warden` as the default install target while preserving `codex` and `claude` installer options. Added `AGENTS.md` context discovery, refreshed README setup paths, normalized tool output to ASCII status tags, and bumped package metadata to `2.3.1`.
70
+ - **Alternatives considered**:
71
+ - Keep `~/.claude/skills/code-warden` as the only install path. Rejected because the active local environment loads user skills from `~/.agents/skills`.
72
+ - Add a separate Codex-only fork. Rejected because one portable skill with target-specific installers is easier to maintain and audit.
73
+ - **Reasoning**: The skill should be usable by Codex now without breaking Claude Code users. `AGENTS.md` is the local instruction surface for Codex-style repositories, and ASCII tool output avoids terminal encoding failures in Windows PowerShell.
74
+ - **Files affected**: `AGENTS.md`, `README.md`, `SKILL.md`, `package.json`, `install.ps1`, `install.sh`, `tools/get-context.js`, `tools/warden-lint.js`, `tools/verify-secrets.js`
75
+
76
+ ---
77
+
78
+ ## 2026-03-26 - Polish pass: secret patterns, Windows installer, README, version sync
79
+
80
+ - **Decision**: Strengthened `verify-secrets.js` with 13 named patterns: OpenAI `sk-`, GitHub `ghp_`/`gho_`/`ghs_`/`ghx_`, AWS `AKIA`, Stripe `sk_live_`/`sk_test_`, bearer tokens, and generic key/password assignments. Added `README.md`. Added `install.ps1` for Windows. Bumped metadata `version` to `2.3.0`. Added `CLAUDE.md` and `.claude/CLAUDE.md` to `get-context.js` candidate list.
81
+ - **Alternatives considered**:
82
+ - Build additional enforcement tools such as a pre-flight counter, blast-radius reporter, and human checkpoint enforcer. Rejected after ROI analysis: these rules are enforced more reliably by the existing prompt governance layer; tool output can only shape context if the agent runs the tool and reads the result.
83
+ - Keep `install.sh` only. Rejected because the project owner is on Windows and `install.sh` is not enough for the platform.
84
+ - **Reasoning**: The changes were low-debt and high-value. Secret pattern expansion directly improved the only tool that scans third-party code. The Windows installer removed a real friction point for the author. The README provided an onboarding path that was absent. The version sync eliminated a confusing discrepancy. `CLAUDE.md` support aligned with Claude Code project conventions.
85
+ - **Files affected**: `tools/verify-secrets.js`, `install.ps1`, `README.md`, `SKILL.md`, `tools/get-context.js`
86
+
87
+ ---
88
+
89
+ ## 2026-03-25 - Align Human Checkpoint threshold with Think Before Coding rule
90
+
91
+ - **Decision**: Changed `[AWAITING CONFIRMATION]` trigger from >3 files to >2 files across `cognition.md` and the Drift Signals table in `SKILL.md`.
92
+ - **Alternatives considered**:
93
+ - Raise Think Before Coding to >3 files. Rejected because it was too permissive and allowed unconfirmed 3-file changes.
94
+ - Keep both thresholds as-is and document the gap as intentional. Rejected because the gap created ambiguous behavior: a plan was required at 2 files but no pause was enforced until 3.
95
+ - **Reasoning**: The safer boundary is to require explicit confirmation at the same point planning is required. A user reading both rules would expect them to be consistent. Stricter wins.
96
+ - **Files affected**: `references/cognition.md`, `SKILL.md`
97
+
98
+ ---
99
+
100
+ ## 2026-03-25 - Modular references split introduced in v2.1.0
101
+
102
+ - **Decision**: Separated governance rules into five domain files under `references/` instead of a single monolithic `SKILL.md`.
103
+ - **Alternatives considered**:
104
+ - Single flat `SKILL.md` with all rules inline. Rejected because it is token-heavy and loads irrelevant rules every session.
105
+ - Two files: core rules and extended rules. Rejected because it was not granular enough for targeted loading.
106
+ - **Reasoning**: Lazy-loading reference files keeps session token cost low. The model only reads the files relevant to the current task type. Each file has a single stated domain, which mirrors the one-concern-per-file rule the skill itself enforces.
107
+ - **Files affected**: `references/architecture.md`, `references/safety.md`, `references/cognition.md`, `references/cleanup.md`, `references/anti-drift.md`, `SKILL.md`
package/README.md CHANGED
@@ -194,6 +194,12 @@ See [`CONFIGURE.md`](CONFIGURE.md) for team-size profiles and tuning rationale.
194
194
  | `references/operations.md` | Verification, source-control hygiene, dependency control |
195
195
  | `references/research-and-fit.md` | Live research gate, stack fit, product-shape guardrails |
196
196
 
197
+ ## Note for contributors
198
+
199
+ > If testing `npx code-warden` from inside the Code-Warden source checkout,
200
+ > npm may prefer the local package context. Test from a separate directory for
201
+ > the same behavior users will see.
202
+
197
203
  ## Author
198
204
 
199
205
  Justin Davis — MIT License