f6b52df613
Establishes a proven rollback mechanism for the LLM-first router overhaul before
any destructive step. Without this, Phase 1-3 work would be irreversible.
What this commit adds:
- Git tag 'brain-pre-llm-bootstrap' on origin/main 9d4a30c3 (pre-overhaul state).
- docs/archive/llm-bootstrap-2026-05/ archive structure with:
- settings-snapshot/ — pre-overhaul ~/.claude/settings.json + project settings
- user-hooks/ — all 14 ~/.claude/hooks/*.py pre-overhaul (incl. §12 ones)
- runtime-flags-snapshot/ — pre-overhaul ~/.claude/runtime/*-mode.json
- nodes-yaml-archive/ — pre-overhaul docs/registry/nodes.yaml
- tools/test-rollback.mjs — rollback planner + executor (--dry-run / --execute)
- tools/test-rollback.test.mjs — TDD: 3 tests for planRollback() contract
- ROLLBACK.md — operator runbook with from->to manifest
E2E smoke proof was run BEFORE this commit (Task 1 step 9):
1. Created TEMP marker commit on top of tag with a dummy file + runtime flag.
2. Ran 'test-rollback.mjs --dry-run' (OK) then '--execute' (user state restored).
3. Reverted git-tracked state and verified marker + flag gone.
4. Verified Task 1 untracked files survived the rollback.
Smoke discovered a bug in the plan's procedure ('git checkout tag -- .' +
'git reset --soft tag' does NOT delete files committed-after-tag — they stay
staged). ROLLBACK.md uses 'git reset --hard <tag>' instead, which correctly
removes overhaul-added tracked files while preserving untracked artefacts
(episodes-*.jsonl, observer notes).
TDD: 3/3 green on test-rollback.test.mjs. Full vitest tools/: 546 passed (was
543 baseline, +3 from this commit), 4 pre-existing 'No test suite' failures
on tools/ruflo-* and tools/subagent-prompt-prefix.test.mjs (out of scope).
Plan: docs/superpowers/plans/2026-05-25-llm-first-router-overhaul.md Task 1.
Spec: docs/superpowers/specs/2026-05-24-llm-first-router-overhaul-design.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
26 lines
710 B
Python
26 lines
710 B
Python
"""PreToolUse hook on matcher 'Skill': writes a per-session flag so the
|
|
skill-check hook knows a Skill was invoked at least once in this session.
|
|
Reads hook input JSON from stdin. Silent on failure - never blocks the tool."""
|
|
import json
|
|
import os
|
|
import sys
|
|
import tempfile
|
|
|
|
|
|
def main() -> None:
|
|
try:
|
|
data = json.load(sys.stdin)
|
|
except Exception:
|
|
return
|
|
sid = data.get("session_id") or "unknown"
|
|
flag = os.path.join(tempfile.gettempdir(), f"claude-skill-{sid}.flag")
|
|
try:
|
|
with open(flag, "w", encoding="utf-8") as f:
|
|
f.write(data.get("tool_input", {}).get("skill", "") or "")
|
|
except Exception:
|
|
return
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|