attckdigital/smith/smith-reflect
Claude Code and agent skill by attckdigital/smith
- community
Checking that the SKILL.md file is still in the repository.
Analyzes a completed Smith workflow (build, bugfix, audit) and extracts lessons about what worked and what didn't. Updates the Ledger with new patterns and antipatterns. Use after a workflow completes or fails, or manually to review recent work.
Install
npx vskill@latest install attckdigital/smith/smith-reflectSKILL.md
Smith Reflect -- Ledger Learning Extraction
Analyzes completed Smith workflows and extracts lessons into the project's Ledger.
Arguments: $ARGUMENTS
Vault Logging
Throughout this action, log significant events to the vault session log. Read the session log path from .smith/vault/.current-session. If the file is missing or the vault is not initialized, skip all logging silently.
Timestamps are UTC. HH:MM:SS comes from date -u +%H:%M:%S — never a local clock, never a time from memory. The append already runs through a shell, so read the clock in that same command (TS=$(date -u +%H:%M:%S)) and spend no extra tool call. Substitute the resulting value: an unexpanded $(...) reaching the log is a known regression and will not parse. Every hook-written stamp in this log is date -u, so a local-clock entry lands hours away from its neighbours and skews the workflow window hooks/workflow_summary_lib.py derives from them.
Append entries using this format:
Log at these points:
- On invocation -- which sessions are being analyzed, mode (recent/specific/failure)
- After session analysis -- how many candidate lessons extracted per session
- After deduplication -- how many new vs reinforced entries
- After pruning -- how many entries pruned or demoted
- On completion -- full reflection summary
Phase 0: Guard -- Ensure Ledger Exists
If .smith/vault/ledger/ is missing, create the full directory scaffold before proceeding.
Create these files with initial content:
patterns.md:
antipatterns.md:
tool-preferences.md:
edge-cases.md:
project-quirks.md:
meta.yaml:
This lazy-creation guard ensures reflection works even if /smith init was never run.
Phase 1: Configuration Check
- Read
.smith/config.json-- look for theledgernamespace - If config is missing or
ledger.enabledis not explicitlyfalse, proceed (defaults to enabled) - For automatic invocation (called by another smith command, not the user directly): also check
ledger.auto_reflect-- iffalse, skip silently and log "Auto-reflect disabled, skipping" - Read
ledger.reflection_modelto determine which model to use for semantic comparison (default: haiku)
Config schema (all fields optional):
Phase 2: Session Selection
Determine which sessions to analyze based on arguments:
/smith-reflect(no args) -- analyze the most recent completed workflow session/smith-reflect --last N-- analyze the last N sessions/smith-reflect --session <id>-- analyze a specific session by filename (e.g.,2026-04-08_151158)/smith-reflect --failure-- analyze only sessions that contain failed workflows
Finding sessions: List .smith/vault/sessions/ sorted by date descending. Each session file is named with a timestamp prefix (e.g., 2026-04-08_151158.md).
Detecting completed workflows: Grep session logs for invocation markers:
/smith-build-- full build workflows/smith-bugfix-- bugfix workflows/smith-audit-- audit workflows/smith-implement-- implementation workflows
Only analyze sessions that contain at least one of these workflow markers. Sessions that are purely Q&A, planning, or specification work are skipped (no execution to learn from).
Detecting failures: Grep for ERROR, FAILED, failed, error, exception, traceback in session logs, OR look for workflows that have an invocation marker but no corresponding completion marker (e.g., /smith-build started but no "Build complete" or "PR merged" entry).
If no qualifying sessions are found, output "No completed workflow sessions found to analyze." and exit.
Phase 3: Session Analysis
For each selected session:
- Read the full session log from
.smith/vault/sessions/<session-file> - Extract the execution trace by scanning for these signals:
Success indicators:
- Tasks completed without retries
- Tests passing on first run
- Docker rebuilds succeeding
- PR created and merged cleanly
- Specs updated without conflicts
Failure/retry indicators:
- Commands that were run multiple times
- Error messages followed by different approaches
- Test failures followed by code changes
- Docker build failures
- Merge conflicts
- Spec drift (plan said X, implementation did Y)
- Rollbacks or reverts
Tool usage patterns:
- Which tools (Read, Write, Edit, Grep, Glob, Bash) were used most
- Which tools produced errors or unexpected results
- Effective tool chains (e.g., Grep then Read for targeted investigation)
- Identify 0-5 candidate lessons per session. Not every session produces a lesson -- if everything went smoothly with no surprises, that is fine. Do not manufacture lessons.
A good candidate lesson meets at least one criterion:
- Something failed and the resolution was non-obvious
- An approach worked significantly better than expected
- A tool was used in an effective way that should be repeated
- A project-specific constraint was discovered
- A workaround was needed for an edge case
Lesson Categories
Map each candidate lesson to the appropriate Ledger file:
| File | What goes here | Example | |
|---|---|---|---|
| patterns.md | Approaches that worked well | "Running pnpm build before Docker rebuild catches TS errors earlier" | |
| antipatterns.md | Approaches that failed or caused problems | "Editing migration files without checking existing data caused constraint violations" | |
| tool-preferences.md | Effective tool usage in context | "Use Grep with output_mode: content and -C 3 for understanding error context, not just finding files" | |
| edge-cases.md | Rare/unexpected scenarios | "Qdrant returns 400 if payload filter references a field that was never indexed" | |
| project-quirks.md | Project-specific surprises | "Neo4j Cypher queries fail silently on missing properties -- always use COALESCE" |
Each lesson also gets a category tag:
implementation-- code writing, architecture decisionstesting-- test strategy, test failures, coverage gapsdebugging-- error investigation, root cause analysisspecification-- spec accuracy, plan-to-implementation driftaudit-- review findings, compliance checks
Phase 4: Deduplication (LLM Semantic Comparison)
For each candidate lesson:
- Read the target Ledger file (e.g.,
patterns.md) - Parse all existing entries (split on
---separator between entries) - Compare the candidate against ALL existing entries using semantic judgment:
- Do NOT rely on exact string matching
- Ask: "Does any existing entry cover the same core lesson, even if worded differently or applied to a different specific case?"
- Consider: same root cause, same resolution strategy, same tool insight, same project constraint
- Decision:
If duplicate found -- Reinforce the existing entry:
- Increment
Source reflectionscount by 1 - Add a new evidence line with today's date and session reference
- Upgrade confidence if threshold crossed:
- 1 reflection =
low - 2-5 reflections =
medium - 6+ reflections =
high - Do NOT change the Title, Context, or Pattern text unless the new evidence reveals a meaningfully broader scope
If no duplicate -- Mark as new entry (will be written in Phase 5)
Phase 5: Write Entries
For each lesson (new or reinforced), write to the appropriate Ledger file.
New Entry Format
Append to the appropriate file, separated from previous entries by ---:
Reinforcement
Update existing entry in-place:
- Increment
Source reflectionscount - Add new evidence line at the end of the Evidence list
- Update
Confidenceif threshold crossed (2 = medium, 6 = high) - Update
Dateto today (date of most recent reinforcement) - Do NOT change Title, Context, or Pattern unless scope has meaningfully broadened
Ordering
After all writes are complete, re-sort entries within each modified file:
- High confidence first, then medium, then low
- Within same confidence level, most recent
Datefirst
Phase 6: Pruning Pass
Run automatic pruning on ALL Ledger files (not just the ones modified in this reflection):
- Read pruning thresholds from
.smith/config.json:
ledger.pruning.low_max_age_days(default: 30)ledger.pruning.medium_max_age_days(default: 90)
- For each entry in each Ledger file:
| Confidence | Age threshold | Action | |
|---|---|---|---|
low | Older than low_max_age_days | REMOVE the entry entirely | |
medium | Older than medium_max_age_days | DEMOTE to low, set Date to today (resets the clock) | |
high | N/A | NEVER touch, regardless of age |
- "Age" is calculated from the entry's
Datefield (which is updated on reinforcement), not the original creation date. - Track pruning actions for the summary:
- Count of removed entries
- Count of demoted entries
- Log each removal/demotion: "Pruned low-confidence '{Title}' from {file} (age: {N} days)" or "Demoted '{Title}' in {file} from medium to low (age: {N} days)"
Phase 7: Update Metadata
Update .smith/vault/ledger/meta.yaml with current counts:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/smith-reflect/SKILL.md
Popularity
- Repository stars
- 41
- Repository forks
- 6
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/attckdigital/smith/smith-reflect)