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/dotclaude 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 in any of these cases.
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 the following 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. Use this 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, then ask "Promote this to $MD? (yes / edit / cancel)".
yes → Phase 4edit → ask what to change, regenerate, return to Phase 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.| File | Relation |
| --------------------------------------- | ------------------------------------------------------- |
| agents/reflection-extractor.md | Shares the 3-category output shape |
| hooks/lifecycle/reflection-extract.sh | The primary auto-extraction path this skill complements |
tools
Delegate implementation to codex (coder) via the herdr-agentchat plugin and drive a two-pane conversation to completion.
development
Extract recurring patterns from past closed PRs/issues and the research findings in workspace/research/, verify them against the latest code, and propose them to docs/wiki/ via PR.
development
Create Decision Records (DR) in MADR v4 format with auto-numbering.
development
Detect flaky tests by shaking them — repeated runs under varied order, parallelism, and seed — plus a static smell scan that flags latent flakiness in tests that currently pass. Classify each target as confirmed-flaky, latent-flaky, or stable and fix the root cause without weakening the test. Do NOT use to fix a confirmed single bug (use /fix) or for static-only code review (use /audit).