code-warden 3.1.1 → 3.3.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 (41) hide show
  1. package/CONFIGURE.md +39 -39
  2. package/DECISIONS.md +107 -107
  3. package/README.md +199 -137
  4. package/SKILL.md +169 -169
  5. package/bin/code-warden.js +82 -0
  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 +45 -2
  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/templates/ci/github-actions.yml +83 -66
  21. package/tools/auto-detect.js +91 -91
  22. package/tools/auto-targets.js +104 -104
  23. package/tools/auto-windsurf-adapter.js +75 -75
  24. package/tools/get-context.js +50 -50
  25. package/tools/governance-report.js +302 -0
  26. package/tools/hooks/claude/install-hooks.js +112 -112
  27. package/tools/hooks/claude/uninstall-hooks.js +75 -75
  28. package/tools/hooks/claude/warden-lint-hook.js +106 -106
  29. package/tools/hooks/claude/warden-secrets-hook.js +73 -73
  30. package/tools/hooks/codex/install-hooks.js +100 -100
  31. package/tools/hooks/codex/uninstall-hooks.js +53 -53
  32. package/tools/hooks/codex/warden-apply-patch-hook.js +113 -113
  33. package/tools/hooks/codex/warden-bash-hook.js +51 -51
  34. package/tools/lib/config.js +49 -49
  35. package/tools/lib/file-collection.js +72 -72
  36. package/tools/lib/line-count.js +28 -28
  37. package/tools/lib/secret-patterns.js +57 -57
  38. package/tools/tests/fixtures/clean.js +9 -9
  39. package/tools/tests/run-tests.js +210 -210
  40. package/tools/verify-secrets.js +26 -26
  41. package/tools/warden-lint.js +27 -27
@@ -1,27 +1,27 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const fs = require('fs');
5
- const { countLines } = require('./lib/line-count');
6
- const { expandPaths } = require('./lib/file-collection');
7
- const { loadConfig } = require('./lib/config');
8
-
9
- const { maxFileLength } = loadConfig();
10
- const filePaths = expandPaths(process.argv.slice(2), 'warden-lint.js');
11
- let hasErrors = false;
12
-
13
- for (const filePath of filePaths) {
14
- const content = fs.readFileSync(filePath, 'utf8');
15
- const lines = countLines(content);
16
-
17
- if (lines > maxFileLength) {
18
- console.error(`[FAIL] [CodeWarden] File ${filePath} exceeds the maximum length of ${maxFileLength} lines (${lines} lines). Please refactor into smaller modules.`);
19
- hasErrors = true;
20
- } else {
21
- console.log(`[PASS] [CodeWarden] ${filePath} (${lines} lines) complies with the length restriction.`);
22
- }
23
- }
24
-
25
- if (hasErrors) {
26
- process.exit(1);
27
- }
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const fs = require('fs');
5
+ const { countLines } = require('./lib/line-count');
6
+ const { expandPaths } = require('./lib/file-collection');
7
+ const { loadConfig } = require('./lib/config');
8
+
9
+ const { maxFileLength } = loadConfig();
10
+ const filePaths = expandPaths(process.argv.slice(2), 'warden-lint.js');
11
+ let hasErrors = false;
12
+
13
+ for (const filePath of filePaths) {
14
+ const content = fs.readFileSync(filePath, 'utf8');
15
+ const lines = countLines(content);
16
+
17
+ if (lines > maxFileLength) {
18
+ console.error(`[FAIL] [CodeWarden] File ${filePath} exceeds the maximum length of ${maxFileLength} lines (${lines} lines). Please refactor into smaller modules.`);
19
+ hasErrors = true;
20
+ } else {
21
+ console.log(`[PASS] [CodeWarden] ${filePath} (${lines} lines) complies with the length restriction.`);
22
+ }
23
+ }
24
+
25
+ if (hasErrors) {
26
+ process.exit(1);
27
+ }