@erclx/canon 4.113.0 → 4.115.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 (63) hide show
  1. package/claude/.claude-plugin/plugin.json +1 -1
  2. package/claude/skills/codebase-layout/SKILL.md +1 -1
  3. package/claude/skills/document-health/references/axes.md +1 -1
  4. package/claude/skills/target-setup/SKILL.md +3 -1
  5. package/claude/skills/target-setup/references/detect.md +43 -9
  6. package/claude/skills/target-setup/references/verify.md +26 -10
  7. package/claude/skills/teach-workspace/SKILL.md +5 -3
  8. package/claude/skills/test-craft/SKILL.md +1 -1
  9. package/docs/agents/audits.md +4 -2
  10. package/docs/agents/commands.md +2 -2
  11. package/docs/agents/context-audit-checks.md +6 -6
  12. package/docs/agents/context-audit.md +1 -1
  13. package/docs/agents/context-classify.md +1 -1
  14. package/docs/agents/counts.md +3 -3
  15. package/docs/agents/install-and-sync.md +2 -0
  16. package/docs/agents/records.md +22 -15
  17. package/docs/agents/teach.md +12 -4
  18. package/docs/target-projects.md +11 -2
  19. package/docs/workflow/ai-workflow.md +1 -1
  20. package/governance/rules/lang/130-go.md +40 -0
  21. package/governance/rules/lang/140-php.md +31 -0
  22. package/governance/rules/lib/335-testing-go.md +35 -0
  23. package/governance/rules/lib/336-testing-php.md +30 -0
  24. package/governance/rules/lib/360-security-server.md +2 -0
  25. package/governance/rules/lib/370-database.md +2 -0
  26. package/governance/rules/ui/410-a11y.md +1 -0
  27. package/governance/rules/ui/440-surface-capture.md +2 -0
  28. package/governance/stacks/nextjs.toml +2 -0
  29. package/governance/stacks/react.toml +1 -1
  30. package/package.json +1 -1
  31. package/src/audits/catalog.ts +52 -0
  32. package/src/commands/context.ts +30 -10
  33. package/src/commands/records.ts +18 -1
  34. package/src/commands/teach.ts +4 -1
  35. package/src/commands/tooling.ts +25 -2
  36. package/src/context/audit.ts +54 -18
  37. package/src/design/components.ts +17 -0
  38. package/src/design/tokens.ts +1 -1
  39. package/src/gate/measures.ts +13 -2
  40. package/src/records/backup.ts +197 -27
  41. package/src/records/push-guard.ts +71 -0
  42. package/src/teach/nav.ts +278 -34
  43. package/src/tooling/inject.ts +43 -4
  44. package/src/tooling/scan.ts +35 -0
  45. package/src/tooling/subfolder.ts +110 -0
  46. package/standards/teach.md +13 -12
  47. package/tooling/base/configs/.husky/post-merge +5 -1
  48. package/tooling/go/configs/.golangci.yml +25 -0
  49. package/tooling/go/configs/scripts/verify.sh +95 -0
  50. package/tooling/go/manifest.toml +13 -0
  51. package/tooling/go/reference.md +60 -0
  52. package/tooling/go/seeds/.cspell/tech-stack.txt +16 -0
  53. package/tooling/go/seeds/smoke_test.go +9 -0
  54. package/tooling/php/configs/.php-cs-fixer.dist.php +18 -0
  55. package/tooling/php/configs/phpstan.neon +5 -0
  56. package/tooling/php/configs/phpunit.xml +18 -0
  57. package/tooling/php/configs/scripts/verify.sh +100 -0
  58. package/tooling/php/manifest.toml +15 -0
  59. package/tooling/php/reference.md +74 -0
  60. package/tooling/php/seeds/.cspell/tech-stack.txt +5 -0
  61. package/tooling/php/seeds/tests/SmokeTest.php +13 -0
  62. package/tooling/python/configs/scripts/verify.sh +32 -15
  63. package/tooling/web/configs/scripts/verify.sh +32 -15
@@ -16,6 +16,7 @@ log_error() {
16
16
  exit 1
17
17
  }
18
18
  log_step() { echo -e "${GREY}│${NC}\n${GREY}├${NC} ${WHITE}$1${NC}"; }
19
+ log_skip() { echo -e "${GREY}│ - $1${NC}"; }
19
20
 
20
21
  pipe_output() { while IFS= read -r line; do echo -e "${GREY}│${NC} $line"; done; }
21
22
 
@@ -24,6 +25,32 @@ check_dependencies() {
24
25
  command -v uv >/dev/null 2>&1 || log_error "uv is not installed"
25
26
  }
26
27
 
28
+ check_package() {
29
+ [ -f package.json ] || log_error "No package.json here. Run 'bun init', then sync the stack again"
30
+ }
31
+
32
+ has_script() {
33
+ bun -e 'process.exit(require(process.cwd() + "/package.json").scripts?.[process.argv[1]] ? 0 : 1)' "$1"
34
+ }
35
+
36
+ # A subfolder synced with --skip base declares none of base's scripts, since
37
+ # the repository root owns them. Each base phase runs only where its script is
38
+ # declared, so this script passes on its own in that subfolder.
39
+ run_base_phase() {
40
+ local title=$1
41
+ local script=$2
42
+ local err_msg=$3
43
+ local pass_msg=$4
44
+
45
+ log_step "$title"
46
+ if ! has_script "$script"; then
47
+ log_skip "Skipped: $script is not declared here, so the repository root runs it"
48
+ return
49
+ fi
50
+ run_check "bun run $script" "$err_msg"
51
+ log_info "$pass_msg"
52
+ }
53
+
27
54
  run_check() {
28
55
  local cmd=$1
29
56
  local err_msg=$2
@@ -37,6 +64,7 @@ run_check() {
37
64
 
38
65
  main() {
39
66
  check_dependencies
67
+ check_package
40
68
 
41
69
  if [ "$NESTED" = false ]; then echo -e "${GREY}┌${NC}"; fi
42
70
 
@@ -48,21 +76,10 @@ main() {
48
76
  run_check "bun run lint" "Lint failed"
49
77
  log_info "Lint passed"
50
78
 
51
- log_step "Formatting"
52
- run_check "bun run format" "Format failed"
53
- log_info "Format applied"
54
-
55
- log_step "Format check"
56
- run_check "bun run check:format" "Format check failed"
57
- log_info "Format check passed"
58
-
59
- log_step "Spelling"
60
- run_check "bun run check:spell" "Spell check failed"
61
- log_info "Spell check passed"
62
-
63
- log_step "Shell"
64
- run_check "bun run check:shell" "Shell check failed"
65
- log_info "Shell check passed"
79
+ run_base_phase "Formatting" "format" "Format failed" "Format applied"
80
+ run_base_phase "Format check" "check:format" "Format check failed" "Format check passed"
81
+ run_base_phase "Spelling" "check:spell" "Spell check failed" "Spell check passed"
82
+ run_base_phase "Shell" "check:shell" "Shell check failed" "Shell check passed"
66
83
 
67
84
  log_step "Unit tests"
68
85
  run_check "bun run test:run" "Unit tests failed"
@@ -16,6 +16,7 @@ log_error() {
16
16
  exit 1
17
17
  }
18
18
  log_step() { echo -e "${GREY}│${NC}\n${GREY}├${NC} ${WHITE}$1${NC}"; }
19
+ log_skip() { echo -e "${GREY}│ - $1${NC}"; }
19
20
 
20
21
  pipe_output() { while IFS= read -r line; do echo -e "${GREY}│${NC} $line"; done; }
21
22
 
@@ -23,6 +24,32 @@ check_dependencies() {
23
24
  command -v bun >/dev/null 2>&1 || log_error "bun is not installed"
24
25
  }
25
26
 
27
+ check_package() {
28
+ [ -f package.json ] || log_error "No package.json here. Run 'bun init', then sync the stack again"
29
+ }
30
+
31
+ has_script() {
32
+ bun -e 'process.exit(require(process.cwd() + "/package.json").scripts?.[process.argv[1]] ? 0 : 1)' "$1"
33
+ }
34
+
35
+ # A subfolder synced with --skip base declares none of base's scripts, since
36
+ # the repository root owns them. Each base phase runs only where its script is
37
+ # declared, so this script passes on its own in that subfolder.
38
+ run_base_phase() {
39
+ local title=$1
40
+ local script=$2
41
+ local err_msg=$3
42
+ local pass_msg=$4
43
+
44
+ log_step "$title"
45
+ if ! has_script "$script"; then
46
+ log_skip "Skipped: $script is not declared here, so the repository root runs it"
47
+ return
48
+ fi
49
+ run_check "bun run $script" "$err_msg"
50
+ log_info "$pass_msg"
51
+ }
52
+
26
53
  run_check() {
27
54
  local cmd=$1
28
55
  local err_msg=$2
@@ -36,6 +63,7 @@ run_check() {
36
63
 
37
64
  main() {
38
65
  check_dependencies
66
+ check_package
39
67
 
40
68
  if [ "$NESTED" = false ]; then echo -e "${GREY}┌${NC}"; fi
41
69
 
@@ -47,21 +75,10 @@ main() {
47
75
  run_check "bun run lint" "Lint failed"
48
76
  log_info "Lint passed"
49
77
 
50
- log_step "Formatting"
51
- run_check "bun run format" "Format failed"
52
- log_info "Format applied"
53
-
54
- log_step "Format check"
55
- run_check "bun run check:format" "Format check failed"
56
- log_info "Format check passed"
57
-
58
- log_step "Spelling"
59
- run_check "bun run check:spell" "Spell check failed"
60
- log_info "Spell check passed"
61
-
62
- log_step "Shell"
63
- run_check "bun run check:shell" "Shell check failed"
64
- log_info "Shell check passed"
78
+ run_base_phase "Formatting" "format" "Format failed" "Format applied"
79
+ run_base_phase "Format check" "check:format" "Format check failed" "Format check passed"
80
+ run_base_phase "Spelling" "check:spell" "Spell check failed" "Spell check passed"
81
+ run_base_phase "Shell" "check:shell" "Shell check failed" "Shell check passed"
65
82
 
66
83
  log_step "Unit tests"
67
84
  run_check "bun run test:run" "Unit tests failed"