@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.
- package/README.md +7 -3
- package/obj/template/.claude/commands/grant-push.md +19 -0
- package/obj/template/.claude/commands/init-project.md +26 -4
- package/obj/template/.claude/hooks/consent_gate_grant.mjs +107 -0
- package/obj/template/.claude/hooks/git_commit_guard.mjs +224 -0
- package/obj/template/.claude/hooks/harness_continuation.sh +101 -34
- package/obj/template/.claude/hooks/lib/common.mjs +283 -0
- package/obj/template/.claude/hooks/lib/common.sh +1 -1
- package/obj/template/.claude/hooks/memory_session_start.sh +20 -6
- package/obj/template/.claude/hooks/memory_stop.sh +161 -2
- package/obj/template/.claude/hooks/spec_approval_guard.sh +1 -1
- package/obj/template/.claude/hooks/swarm_approval_guard.sh +1 -1
- package/obj/template/.claude/hooks/tests/fixtures/ac008_byte_equal_reference.txt +7 -7
- package/obj/template/.claude/hooks/tests/fixtures/memory_stop_landmark_baseline.txt +21 -0
- package/obj/template/.claude/hooks/tests/fixtures/regenerate-ac008.sh +47 -0
- package/obj/template/.claude/hooks/tests/memory_session_start_test.sh +7 -3
- package/obj/template/.claude/hooks/tests/memory_stop_intent_test.sh +329 -0
- package/obj/template/.claude/hooks/tests/regenerate_ac008_test.sh +99 -0
- package/obj/template/.claude/memory/README.md +8 -3
- package/obj/template/.claude/memory/backlog.md +12 -0
- package/obj/template/.claude/project.json +6 -1
- package/obj/template/.claude/settings.json +3 -4
- package/obj/template/.claude/skills/audit-baseline/audit.sh +39 -21
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/_pending_opener_only.md +3 -0
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_full_empty_body.md +4 -0
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_full_with_entries.md +9 -0
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_no_opener.md +3 -0
- package/obj/template/.claude/skills/audit-baseline/tests/fixtures/preamble_opener_only.md +3 -0
- package/obj/template/.claude/skills/audit-baseline/tests/preamble_check_test.sh +147 -0
- package/obj/template/.claude/skills/chore/SKILL.md +5 -3
- package/obj/template/.claude/skills/commit/SKILL.md +5 -4
- package/obj/template/.claude/skills/copywriting/LICENSE +21 -0
- package/obj/template/.claude/skills/copywriting/NOTICE +23 -0
- package/obj/template/.claude/skills/copywriting/SKILL.md +1 -1
- package/obj/template/.claude/skills/design-ui/SKILL.md +23 -5
- package/obj/template/.claude/skills/design-ui/references/design-vs-development.md +26 -5
- package/obj/template/.claude/skills/design-ui/references/orchestration.md +1 -0
- package/obj/template/.claude/skills/design-ui/references/state-machine.md +5 -3
- package/obj/template/.claude/skills/documentation/LICENSE +202 -0
- package/obj/template/.claude/skills/documentation/NOTICE +22 -0
- package/obj/template/.claude/skills/google-analytics/SKILL.md +129 -0
- package/obj/template/.claude/skills/google-analytics/references/audiences.md +389 -0
- package/obj/template/.claude/skills/google-analytics/references/bigquery.md +470 -0
- package/obj/template/.claude/skills/google-analytics/references/custom-dimensions.md +355 -0
- package/obj/template/.claude/skills/google-analytics/references/custom-events.md +383 -0
- package/obj/template/.claude/skills/google-analytics/references/data-management.md +416 -0
- package/obj/template/.claude/skills/google-analytics/references/debugview.md +364 -0
- package/obj/template/.claude/skills/google-analytics/references/events-fundamentals.md +398 -0
- package/obj/template/.claude/skills/google-analytics/references/gtag.md +502 -0
- package/obj/template/.claude/skills/google-analytics/references/gtm-integration.md +483 -0
- package/obj/template/.claude/skills/google-analytics/references/measurement-protocol.md +519 -0
- package/obj/template/.claude/skills/google-analytics/references/privacy.md +441 -0
- package/obj/template/.claude/skills/google-analytics/references/recommended-events.md +464 -0
- package/obj/template/.claude/skills/google-analytics/references/reporting.md +397 -0
- package/obj/template/.claude/skills/google-analytics/references/setup.md +344 -0
- package/obj/template/.claude/skills/google-analytics/references/user-tracking.md +417 -0
- package/obj/template/.claude/skills/harness/SKILL.md +3 -1
- package/obj/template/.claude/skills/humanizer/LICENSE +21 -0
- package/obj/template/.claude/skills/humanizer/NOTICE +21 -0
- package/obj/template/.claude/skills/impeccable/LICENSE +202 -0
- package/obj/template/.claude/skills/impeccable/NOTICE +24 -0
- package/obj/template/.claude/skills/memory-flush/SKILL.md +20 -4
- package/obj/template/.claude/skills/memory-flush/sweep.py +74 -6
- package/obj/template/.claude/skills/memory-flush/tests/run.sh +300 -1
- package/obj/template/.claude/skills/optimize-seo/SKILL.md +313 -0
- package/obj/template/.claude/skills/optimize-seo/scripts/pagespeed.mjs +197 -0
- package/obj/template/.claude/skills/pagespeed-insights/LICENSE.md +37 -0
- package/obj/template/.claude/skills/pagespeed-insights/SKILL.md +446 -0
- package/obj/template/.claude/skills/pagespeed-insights/reference.md +50 -0
- package/obj/template/.claude/skills/tdd/SKILL.md +2 -1
- package/obj/template/.claude/skills/tdd/drift_check.py +180 -0
- package/obj/template/.claude/skills/tdd/tests/drift_check_test.sh +190 -0
- package/obj/template/.claude/skills/tdd/tests/run.sh +21 -0
- package/obj/template/.claude/skills/technical-tutorials/LICENSE +21 -0
- package/obj/template/.claude/skills/technical-tutorials/NOTICE +23 -0
- package/obj/template/.claude/skills/technical-tutorials/SKILL.md +1 -1
- package/obj/template/.claude/skills/triage/SKILL.md +8 -3
- package/obj/template/CLAUDE.md +37 -26
- package/obj/template/docs/init/seed.md +38 -23
- package/obj/template/manifest.json +80 -33
- package/package.json +1 -1
- package/src/CLAUDE.template.md +37 -26
- package/src/memory/backlog.template.md +12 -0
- package/src/project.template.json +6 -1
- package/src/seed.template.md +38 -23
- package/src/settings.template.json +3 -4
- package/obj/template/.claude/hooks/consent_gate_grant.sh +0 -89
- 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
|