wtf.reflect
WTF Reflect
Capture learnings from this session and route them into the right steering document. Every hard-won insight — especially about where the AI went wrong or where implementation was harder than expected — belongs in a steering doc so it guides future work automatically.
This skill is the producer for the ## Hard-Won Lessons section of the four steering docs — see ../references/steering-doc-process.md for the producer/consumer model and how other skills load these docs.
Intervention tracker: The hooks/track-interventions.sh hook runs automatically on every UserPromptSubmit event and increments /tmp/wtf.interventions-$(whoami)-$(basename "$(git rev-parse --show-toplevel 2>/dev/null)") when it detects correction or frustration language (e.g. "no,", "wrong", "actually", "stop that"). When the counter reaches 3, the hook prints a reminder at the end of the session to run wtf.reflect. Step 6 of this skill resets the counter to zero. No manual tracking is needed — the hook handles it.
Process
1. Check which steering docs exist
ls docs/steering/ 2>/dev/null
Build a map of which of the four docs are present: TECH.md, QA.md, DESIGN.md, VISION.md.
If none exist, apply ../references/questioning-style.md and ask "No steering docs found. Would you like to create them first?" — header No steering docs:
- Create them now → run the
steer-*skills to set up the docs - Skip — just capture notes → save all learnings to
docs/steering/LEARNINGS.mdinstead
If Create them now → invoke wtf.steer-tech. Note that wtf.steer-tech will offer to chain to the other steer-* skills at the end — let the user complete that flow, then return here. When control returns, re-run the ls check to see which docs now exist.
If Skip → set all four doc paths to the fallback: docs/steering/LEARNINGS.md.
If some exist but not all → continue. In step 4, route learnings for a missing doc to docs/steering/LEARNINGS.md as a per-doc fallback (create the file if needed).
2. Orient to the session
Briefly scan context to understand what was worked on:
- Recent git commits:
git log --oneline -10 - Any failing/passing tests, PRs, or issues mentioned in conversation
- Do NOT dump this at the user — use it only to pre-fill questions.
3. Gather learnings
Q1 — What was harder than expected?
Apply ../references/questioning-style.md and ask "What was harder or more painful than it should have been in this session?" — header Session friction:
- 2–3 inferred options based on what was worked on (e.g. "Debugging X took too long", "Claude kept misunderstanding Y")
- Nothing — skip — session went smoothly
If Nothing — skip → skip to step 6 (reset counter) and exit with: "Great session — nothing to capture."
Q2 — Did Claude make a recurring mistake?
Apply ../references/questioning-style.md and ask "Did Claude keep making the same mistake you had to correct?" — header AI mistakes:
- Yes — describe it → tell me what it kept doing
- No recurring mistakes → one-off issues only
If Yes → apply ../references/questioning-style.md and ask "Describe the mistake briefly. What rule would prevent it next time?" — header AI mistake — the rule:
- Skip — hard to articulate right now
Q3 — What is the one rule this session taught you?
Apply ../references/questioning-style.md and ask "If you had to write one rule that would have prevented the most wasted time today, what would it be?" — header The lesson:
- 1–2 rules inferred from the session
- Skip this one — nothing to add
4. Route each learning to the right steering doc
For each learning gathered, determine where it belongs:
| Learning type | Target doc |
|---|---|
| Architecture pattern, implementation gotcha, AI coding mistake | TECH.md |
| Test failure pattern, flaky test cause, QA gap | QA.md |
| Design inconsistency, component misuse, style mistake | DESIGN.md |
| Scope confusion, priority conflict, domain language drift | VISION.md |
| Doesn't clearly fit one doc | TECH.md (default) |
For each target doc, follow the writer-side procedure in ../references/steering-doc-process.md (see "Hard-Won Lessons (writer-side, for wtf.reflect)"):
- If the target doc does not exist (from the map built in step 1) → use
docs/steering/LEARNINGS.mdinstead. Create it with a# Overflow Learningsheading if it doesn't exist yet. - Read the current file.
- Look for a
## Hard-Won Lessonssection. - If it exists → append the new bullet(s) under it.
- If it does not exist → append the section at the end of the file, inserting it before the
<!-- MANUAL ADDITIONS START -->marker if present.
Bullet format:
- **[Short label]** — [Concrete rule or observation]. *Learned [YYYY-MM-DD].*
Example:
- **Don't mock the auth middleware in tests** — Three tests passed with mocks but failed in CI against the real service. Always integrate against real dependencies. *Learned 2026-03-24.*
5. Write the updated steering docs
Write each modified doc. Then commit using today's date:
git add docs/steering/
git commit -m "docs(steering): add hard-won lessons from $(date +%Y-%m-%d) session"
6. Reset the intervention counter
echo "0" > /tmp/wtf.interventions-$(whoami)-$(basename "$(git rev-parse --show-toplevel 2>/dev/null)")
7. Close the loop
Print a brief summary:
- Which docs were updated
- How many learnings were captured
- Remind the user: "These rules will guide every future session automatically."
More from xiduzo/wtf
wtf.write-feature
This skill should be used when a user wants to create a GitHub Feature issue, break down an Epic into user-facing capabilities, write user stories in domain language, or capture what a domain actor can do — for example "create a feature", "write a feature for this epic", "add a feature to an epic", "break this epic into features", "write user stories for this feature", or "describe what this actor can do". Use this skill to write a single Feature; use `wtf.epic-to-features` to generate the full set of Features for an Epic at once. Not applicable to Tasks, Epics, or bug reports.
38wtf.write-task
This skill should be used when a user wants to create a task, write a ticket, decompose a feature into implementable work, break down a story, define a vertical slice for development, or write Gherkin scenarios — for example "create a task", "write a task for this feature", "break this feature into tasks", "define implementation work", or "add a sub-issue to this feature". Guides creation of a GitHub Task issue linked to a parent Feature and Epic, derives Gherkin acceptance scenarios from the Feature's ACs, enforces DDD ubiquitous language in scenarios, and checks for vertical-slice integrity and task dependencies.
38wtf.write-epic
This skill should be used when a user wants to create, draft, or plan a GitHub Epic issue — for example "write an epic", "I want to define a new initiative", "scope out this strategic project", "turn this idea into an epic", "plan work that spans multiple features", or "start from a bounded context". Also use when the user asks to define domain outcomes, capture a large initiative before breaking it into features, or describe work in terms of business goals rather than technical tasks.
38wtf.steer-design
This skill should be used when a team wants to create or refine the design guidelines document — for example "create the design steering doc", "document our design system", "write the design principles", "document our component patterns", "set up the design guidelines", or "update the design doc". Generates docs/steering/DESIGN.md as a living document capturing design principles, the design system, tokens, component patterns, and accessibility standards. Generated once and refined — not regenerated from scratch.
37wtf.verify-task
This skill should be used when a QA engineer wants to test or verify a completed task, run through acceptance criteria, check Gherkin scenarios against the implementation, record pass/fail results, or sign off on a ticket before merge. Triggers on phrases like "verify task #42", "run QA on this issue", "test the acceptance criteria", "sign off on task", "check if this task is ready to merge", "does this task meet its acceptance criteria", "run acceptance tests for task #X", "walk through the Gherkin for task #X", or "I want to test this task".
37wtf.report-bug
This skill should be used when a developer or QA engineer wants to report a bug, create a bug ticket, document a test failure, log a defect, file an issue found during a QA session, or report something that is broken — for example "report a bug", "create a bug ticket", "I found a defect", "something is broken in task #X", or "document this test failure". Files a structured GitHub Bug issue that links the originating Task and Feature, maps failing Gherkin scenarios as reproducible test evidence, and fills every section of the BUG template.
37