skills/reflect/SKILL.md
Surface the current session's tentative reflection (realization / judgment / counterfactual) and optionally promote it to the durable knowledge store. Escape hatch for when Stop hook reflection extraction failed.
npx skillsauth add thkt/claude-config reflectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Escape hatch for the automated reflection pipeline. Stop hook subagent extraction (reflection-extract.sh) normally writes per-session reflections automatically. When that pipeline fails (subagent timeout, API error, build issue), /reflect lets you produce the same artifact manually before the session ends.
This is NOT the primary path. The Stop hook is. Use this skill when:
knowledge/reflection/<session_id>.md is a placeholder: true file (auto-extraction returned empty) and you have meaningful reflection to capture.Run once at the top of the skill.
KDIR="${REFLECT_KNOWLEDGE_DIR:-${CLAUDE_PROJECT_DIR}/.claude/knowledge}"
SID="${CLAUDE_SESSION_ID:?session id required}"
MD="$KDIR/reflection/$SID.md"
INDEX="$KDIR/reflection-index.jsonl"
If $KDIR does not exist, advise the user to run a session under the Stop hook at least once (the directory is created on first auto-extraction) or set REFLECT_KNOWLEDGE_DIR explicitly.
Print to the user, in this order:
$MD exist? If yes, show it (frontmatter + body).placeholder: true)? Flag it.$INDEX (so the user sees the local history).Generate a fresh reflection across the 3 categories. Use the same shape as agents/reflection-extractor.md and reuse its guidance (realization / judgment / counterfactual). Keep the body under 300 words total. Output frontmatter:
---
session_id: <SID>
confidence: confirmed # always "confirmed" for /reflect — user-attested
categories: [...]
word_count: <int>
created_at: <ISO8601 UTC>
promoted_via: reflect-skill
---
The promoted_via: reflect-skill field marks manual promotions so audits can distinguish them from auto-extracted reflections.
Show the user the composed reflection in a fenced block. Ask: "Promote this to $MD? (yes / edit / cancel)"
yes → Step 4edit → ask what to change, regenerate, return to Step 3cancel → exit without writing# Atomic write: stage to a temp file, then move.
TMP="$(mktemp "$KDIR/reflection/.$SID.XXXXXX")"
cat > "$TMP" <<EOF
<composed reflection>
EOF
mv "$TMP" "$MD"
# Index: append if this session has no prior entry, otherwise skip
# (append-only contract; duplicates are tolerated but noisy).
if ! grep -Fq "\"session_id\":\"$SID\"" "$INDEX" 2>/dev/null; then
printf '{"session_id":"%s","reflection_file":"%s","created_at":"%s","promoted_via":"reflect-skill"}\n' \
"$SID" "$MD" "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$INDEX"
fi
echo "Promoted to $MD"
CLAUDE.md, MEMORY.md, rules/, agents/, skills/, or any file referenced by paths: frontmatter. Same auto-loaded-path immutability rule as the Stop hook. Violations invalidate the prompt cache for every following session.claude --bare recursively. This skill runs in the main session, not in a subagent.confidence: confirmed (not placeholder). Re-running /reflect would overwrite a higher-quality extraction.$KDIR/reflection/<old-sid>.md, not this skill.agents/reflection-extractor.md: shares the 3-category output shape.hooks/lifecycle/reflection-extract.sh: the primary auto-extraction path this skill complements.tools
Internal helper for /think Step 11. Renders SOW.md + Spec.md as an integrated Astro view and returns a dev server URL.
development
Extract repository spec while detecting bugs, spec gaps, and consistency drift via dual-purpose documentation. OUTCOME.md-axis question-driven exploration with ephemeral output. Do NOT use for code review (use /audit or /polish), feature implementation (use /code), planning only (use /think), or single-bug fix (use /fix).
development
Discover undocumented design decisions and challenge each candidate via critic-design before promotion. Rank by impact and reversibility, produce ADR promotion candidates. Treat each candidate as a position arguing for ADR status, not a fact to be filed. Pairs with audit-adr-drift, which scans existing ADRs for drift against code.
development
Scan ADR Decision sections against current code and report drift with modification direction and priority. Do NOT use for repos without ADRs (use audit-adr-gaps instead).