@friedbotstudio/create-baseline 0.2.0 → 0.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 (88) hide show
  1. package/README.md +7 -3
  2. package/obj/template/.claude/commands/grant-push.md +19 -0
  3. package/obj/template/.claude/commands/init-project.md +26 -4
  4. package/obj/template/.claude/hooks/consent_gate_grant.mjs +107 -0
  5. package/obj/template/.claude/hooks/git_commit_guard.mjs +224 -0
  6. package/obj/template/.claude/hooks/harness_continuation.sh +101 -34
  7. package/obj/template/.claude/hooks/lib/common.mjs +283 -0
  8. package/obj/template/.claude/hooks/lib/common.sh +1 -1
  9. package/obj/template/.claude/hooks/memory_session_start.sh +20 -6
  10. package/obj/template/.claude/hooks/memory_stop.sh +161 -2
  11. package/obj/template/.claude/hooks/spec_approval_guard.sh +1 -1
  12. package/obj/template/.claude/hooks/swarm_approval_guard.sh +1 -1
  13. package/obj/template/.claude/hooks/tests/fixtures/ac008_byte_equal_reference.txt +7 -7
  14. package/obj/template/.claude/hooks/tests/fixtures/memory_stop_landmark_baseline.txt +21 -0
  15. package/obj/template/.claude/hooks/tests/fixtures/regenerate-ac008.sh +47 -0
  16. package/obj/template/.claude/hooks/tests/memory_session_start_test.sh +7 -3
  17. package/obj/template/.claude/hooks/tests/memory_stop_intent_test.sh +329 -0
  18. package/obj/template/.claude/hooks/tests/regenerate_ac008_test.sh +99 -0
  19. package/obj/template/.claude/memory/README.md +8 -3
  20. package/obj/template/.claude/memory/backlog.md +12 -0
  21. package/obj/template/.claude/project.json +6 -1
  22. package/obj/template/.claude/settings.json +3 -4
  23. package/obj/template/.claude/skills/audit-baseline/audit.sh +39 -21
  24. package/obj/template/.claude/skills/audit-baseline/tests/fixtures/_pending_opener_only.md +3 -0
  25. package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_full_empty_body.md +4 -0
  26. package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_full_with_entries.md +9 -0
  27. package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_no_opener.md +3 -0
  28. package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_opener_only.md +3 -0
  29. package/obj/template/.claude/skills/audit-baseline/tests/preamble_check_test.sh +147 -0
  30. package/obj/template/.claude/skills/chore/SKILL.md +5 -3
  31. package/obj/template/.claude/skills/commit/SKILL.md +5 -4
  32. package/obj/template/.claude/skills/copywriting/LICENSE +21 -0
  33. package/obj/template/.claude/skills/copywriting/NOTICE +23 -0
  34. package/obj/template/.claude/skills/copywriting/SKILL.md +1 -1
  35. package/obj/template/.claude/skills/design-ui/SKILL.md +23 -5
  36. package/obj/template/.claude/skills/design-ui/references/design-vs-development.md +26 -5
  37. package/obj/template/.claude/skills/design-ui/references/orchestration.md +1 -0
  38. package/obj/template/.claude/skills/design-ui/references/state-machine.md +5 -3
  39. package/obj/template/.claude/skills/documentation/LICENSE +202 -0
  40. package/obj/template/.claude/skills/documentation/NOTICE +22 -0
  41. package/obj/template/.claude/skills/google-analytics/SKILL.md +129 -0
  42. package/obj/template/.claude/skills/google-analytics/references/audiences.md +389 -0
  43. package/obj/template/.claude/skills/google-analytics/references/bigquery.md +470 -0
  44. package/obj/template/.claude/skills/google-analytics/references/custom-dimensions.md +355 -0
  45. package/obj/template/.claude/skills/google-analytics/references/custom-events.md +383 -0
  46. package/obj/template/.claude/skills/google-analytics/references/data-management.md +416 -0
  47. package/obj/template/.claude/skills/google-analytics/references/debugview.md +364 -0
  48. package/obj/template/.claude/skills/google-analytics/references/events-fundamentals.md +398 -0
  49. package/obj/template/.claude/skills/google-analytics/references/gtag.md +502 -0
  50. package/obj/template/.claude/skills/google-analytics/references/gtm-integration.md +483 -0
  51. package/obj/template/.claude/skills/google-analytics/references/measurement-protocol.md +519 -0
  52. package/obj/template/.claude/skills/google-analytics/references/privacy.md +441 -0
  53. package/obj/template/.claude/skills/google-analytics/references/recommended-events.md +464 -0
  54. package/obj/template/.claude/skills/google-analytics/references/reporting.md +397 -0
  55. package/obj/template/.claude/skills/google-analytics/references/setup.md +344 -0
  56. package/obj/template/.claude/skills/google-analytics/references/user-tracking.md +417 -0
  57. package/obj/template/.claude/skills/harness/SKILL.md +3 -1
  58. package/obj/template/.claude/skills/humanizer/LICENSE +21 -0
  59. package/obj/template/.claude/skills/humanizer/NOTICE +21 -0
  60. package/obj/template/.claude/skills/impeccable/LICENSE +202 -0
  61. package/obj/template/.claude/skills/impeccable/NOTICE +24 -0
  62. package/obj/template/.claude/skills/memory-flush/SKILL.md +20 -4
  63. package/obj/template/.claude/skills/memory-flush/sweep.py +74 -6
  64. package/obj/template/.claude/skills/memory-flush/tests/run.sh +300 -1
  65. package/obj/template/.claude/skills/optimize-seo/SKILL.md +313 -0
  66. package/obj/template/.claude/skills/optimize-seo/scripts/pagespeed.mjs +197 -0
  67. package/obj/template/.claude/skills/pagespeed-insights/LICENSE.md +37 -0
  68. package/obj/template/.claude/skills/pagespeed-insights/SKILL.md +446 -0
  69. package/obj/template/.claude/skills/pagespeed-insights/reference.md +50 -0
  70. package/obj/template/.claude/skills/tdd/SKILL.md +2 -1
  71. package/obj/template/.claude/skills/tdd/drift_check.py +180 -0
  72. package/obj/template/.claude/skills/tdd/tests/drift_check_test.sh +190 -0
  73. package/obj/template/.claude/skills/tdd/tests/run.sh +21 -0
  74. package/obj/template/.claude/skills/technical-tutorials/LICENSE +21 -0
  75. package/obj/template/.claude/skills/technical-tutorials/NOTICE +23 -0
  76. package/obj/template/.claude/skills/technical-tutorials/SKILL.md +1 -1
  77. package/obj/template/.claude/skills/triage/SKILL.md +8 -3
  78. package/obj/template/CLAUDE.md +37 -26
  79. package/obj/template/docs/init/seed.md +38 -23
  80. package/obj/template/manifest.json +80 -33
  81. package/package.json +1 -1
  82. package/src/CLAUDE.template.md +37 -26
  83. package/src/memory/backlog.template.md +12 -0
  84. package/src/project.template.json +6 -1
  85. package/src/seed.template.md +38 -23
  86. package/src/settings.template.json +3 -4
  87. package/obj/template/.claude/hooks/consent_gate_grant.sh +0 -89
  88. package/obj/template/.claude/hooks/git_commit_guard.sh +0 -93
@@ -1,93 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Git Commit Guard — PreToolUse(Bash) and PreToolUse(Write|Edit|MultiEdit)
3
- #
4
- # Two roles:
5
- #
6
- # 1. Bash matcher (run-boundary) — gates `git commit` invocations on a
7
- # fresh consent token at .claude/state/commit_consent (default TTL 5
8
- # min). Hard-blocks forbidden git operations regardless of consent.
9
- #
10
- # 2. Write matcher (write-boundary) — gates Claude's writes to the consent
11
- # files themselves:
12
- # - .claude/state/.commit_consent_grant — the marker. Written only by
13
- # consent_gate_grant.sh (UserPromptSubmit) on /grant-commit.
14
- # - .claude/state/commit_consent — the consent token. Writable by
15
- # Claude only when a fresh marker is on disk (consumed on success).
16
- #
17
- # This makes gate C structurally symmetric with gates A and B.
18
-
19
- # shellcheck source=./lib/common.sh
20
- . "${BASH_SOURCE[0]%/*}/lib/common.sh"
21
- read_payload
22
-
23
- TOOL="$(payload_get .tool_name)"
24
- case "$TOOL" in
25
- Bash)
26
- : # fall through to run-boundary logic below
27
- ;;
28
- Write|Edit|MultiEdit)
29
- FILE="$(payload_get .tool_input.file_path)"
30
- [ -n "$FILE" ] || emit_allow
31
- rel="$(canonical_rel "$FILE")"
32
- [ -n "$rel" ] || emit_allow
33
-
34
- block_marker_self_write "$rel" "$CONSENT_MARKER_COMMIT_REL" "Git Commit Guard" "/grant-commit"
35
-
36
- case "$rel" in
37
- .claude/state/commit_consent)
38
- validate_consent_marker "$CONSENT_MARKER_COMMIT" "Git Commit Guard" "/grant-commit"
39
- emit_allow
40
- ;;
41
- *)
42
- emit_allow
43
- ;;
44
- esac
45
- ;;
46
- *)
47
- emit_allow
48
- ;;
49
- esac
50
-
51
- CMD="$(payload_get .tool_input.command)"
52
- [ -n "$CMD" ] || emit_allow
53
-
54
- case "$CMD" in
55
- *git\ *|git) ;;
56
- *) emit_allow ;;
57
- esac
58
-
59
- # Hard-blocks (apply always, consent cannot override).
60
- FORBIDDEN_RE='(\bgit\s+push\b|\bgit\s+commit\b[^|&;]*--amend|--no-verify|--no-gpg-sign|\bgit\s+reset\s+--hard\b|\bgit\s+clean\s+-[a-zA-Z]*f\b|\bgit\s+checkout\s+--\s|\bgit\s+branch\s+-D\b|\bgit\s+config\b|\bgit\s+rebase\s+-i\b|\bgit\s+add\s+-i\b|\bgit\s+add\s+(-A|\.)(?![A-Za-z0-9_/.\-]))'
61
- if python3 -c "import re,sys; sys.exit(0 if re.search(r'''$FORBIDDEN_RE''', sys.argv[1]) else 1)" "$CMD"; then
62
- log_line git_commit_guard "BLOCKED forbidden git op: $CMD"
63
- emit_block "Git Commit Guard: forbidden git operation detected. seed.md forbids git push / --amend / --no-verify / reset --hard / clean -f / checkout -- / branch -D / config / rebase -i / add -A|. unless the user explicitly names the operation. Ask the user to approve by stating the exact command."
64
- fi
65
-
66
- if ! python3 -c "import re,sys; sys.exit(0 if re.search(r'\bgit\s+commit\b', sys.argv[1]) else 1)" "$CMD"; then
67
- emit_allow
68
- fi
69
-
70
- CONSENT_FILE="$STATE_DIR/commit_consent"
71
- COMMIT_TTL="$(project_get .consent.commit_ttl_seconds)"
72
- [ -z "$COMMIT_TTL" ] && COMMIT_TTL=300
73
-
74
- if [ ! -f "$CONSENT_FILE" ]; then
75
- log_line git_commit_guard "BLOCKED no consent file: $CMD"
76
- emit_block "Git Commit Guard: no consent granted. The user must run \`/grant-commit\` before a commit is allowed. Consent is valid for ${COMMIT_TTL}s."
77
- fi
78
-
79
- read -r granted_at < "$CONSENT_FILE" 2>/dev/null
80
- now="$(date +%s)"
81
- if ! [[ "$granted_at" =~ ^[0-9]+$ ]]; then
82
- log_line git_commit_guard "BLOCKED malformed consent file"
83
- emit_block "Git Commit Guard: consent file is malformed. Ask the user to re-run \`/grant-commit\`."
84
- fi
85
-
86
- age=$(( now - granted_at ))
87
- if [ "$age" -gt "$COMMIT_TTL" ]; then
88
- log_line git_commit_guard "BLOCKED consent expired age=${age}s ttl=${COMMIT_TTL}s"
89
- emit_block "Git Commit Guard: consent expired (${age}s old, TTL ${COMMIT_TTL}s). Ask the user to re-run \`/grant-commit\`."
90
- fi
91
-
92
- log_line git_commit_guard "ALLOWED age=${age}s cmd=$CMD"
93
- emit_allow