From smith
Browse, search, and manage the Smith Ledger knowledge base of patterns, antipatterns, tool preferences, edge cases from past workflows. Review insights, prune outdated entries, inspect evolution.
npx claudepluginhub attckdigital/smithThis skill uses the workspace's default tool permissions.
Browse, search, and manage the Smith Ledger. The Ledger is the persistent knowledge base that captures patterns, antipatterns, tool preferences, edge cases, and project quirks learned from past Smith workflows. It lives at `.smith/vault/ledger/`.
Analyzes completed Smith workflows (build, bugfix, audit) to extract lessons on successes and failures, updating Ledger with patterns, antipatterns, tool preferences, edge cases, and project quirks.
Searches project memory via progressive filtering with MEMORY.md index and grep for task-relevant patterns before non-trivial work; stores structured problem-solution insights after completion.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Share bugs, ideas, or general feedback.
Browse, search, and manage the Smith Ledger. The Ledger is the persistent knowledge base that captures patterns, antipatterns, tool preferences, edge cases, and project quirks learned from past Smith workflows. It lives at .smith/vault/ledger/.
Arguments: $ARGUMENTS
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.
Append entries using this format:
### [HH:MM:SS] /smith-ledger <event>
**User Request:**
> <verbatim user message that triggered this action>
**Subcommand:** <dashboard|list|show|search|prune|promote|demote|export|reset>
**Synthesized Input:** <brief summary of args/filters>
**Outcome:** <what happened — counts, changes made, results found>
**Artifacts:** <files read/modified>
**Systems affected:** <system IDs>
Log at these points:
The Ledger lives at .smith/vault/ledger/ with the following files:
.smith/vault/ledger/
meta.yaml # Overview stats — last reflection date, total counts, config
patterns.md # Validated approaches that work well
antipatterns.md # Approaches that failed or caused problems
tool-preferences.md # Tool/library/API usage preferences and gotchas
edge-cases.md # Non-obvious behaviors, boundary conditions, quirks in tools/APIs
project-quirks.md # Project-specific conventions, workarounds, and constraints
archive/ # Archived Ledger snapshots from resets
Each Ledger file (patterns.md, antipatterns.md, etc.) contains entries in this format:
## <Title>
- **Date:** YYYY-MM-DD
- **Category:** implementation | testing | debugging | specification | audit
- **Confidence:** low | medium | high
- **Observations:** N
- **Source reflections:** <comma-separated list of reflection session dates or spec IDs>
### Context
<When and why this pattern/antipattern/preference/edge-case applies>
### Pattern
<The actual pattern, antipattern, tool preference, edge case, or project quirk — what to do or what to avoid>
### Evidence
<Specific examples from past workflows that support this entry>
### Related
<Links to related entries, specs, or code files>
---
last_reflection: "YYYY-MM-DD"
total_reflections: N
total_entries: N
config:
low_confidence_prune_days: 30
medium_confidence_demote_days: 90
entries_by_file:
patterns: N
antipatterns: N
tool-preferences: N
edge-cases: N
project-quirks: N
/smith-ledger (no args) — DashboardDisplay a summary dashboard:
Check if .smith/vault/ledger/ exists. If not, display the following and stop:
No Ledger found.
Run `/smith-reflect` after a workflow to start building the Ledger,
or run `/smith` to initialize the vault structure.
Read meta.yaml for overview stats (last reflection date, total reflections, total entries, config).
Read each Ledger file and count entries by confidence level. An entry boundary is a line starting with ## (heading level 2). Extract the **Confidence:** value from each entry.
Display the dashboard:
SMITH LEDGER — Dashboard
========================
Last reflection: YYYY-MM-DD
Total reflections: N
Total entries: N
| File | Entries | High | Medium | Low |
|---------------------|---------|------|--------|-----|
| patterns.md | N | N | N | N |
| antipatterns.md | N | N | N | N |
| tool-preferences.md | N | N | N | N |
| edge-cases.md | N | N | N | N |
| project-quirks.md | N | N | N | N |
Top High-Confidence Patterns:
1. [Title] — [Category] ([N] observations)
2. [Title] — [Category] ([N] observations)
3. [Title] — [Category] ([N] observations)
If there are no high-confidence entries, show "No high-confidence entries yet." instead of the Top Patterns section.
Show up to 5 high-confidence entries, sorted by observation count descending. Draw from all Ledger files, not just patterns.md.
/smith-ledger list — List EntriesList all entries, optionally filtered by category, confidence, or file.
Flags:
--category <cat> — Filter by category. Valid values: implementation, testing, debugging, specification, audit--confidence <level> — Filter by confidence. Valid values: low, medium, high--file <filename> — Show only entries from a specific file. Valid values: patterns, antipatterns, tools (alias for tool-preferences), edge-cases, quirks (alias for project-quirks)Flags can be combined. When multiple flags are provided, apply all filters (AND logic).
No flags: List all entries across all files, grouped by file.
Display format per entry:
[confidence] Title — Category (N observations, last: YYYY-MM-DD)
Group entries under their file heading:
--- patterns.md ---
[high] Always rebuild Docker after code changes — implementation (4 observations, last: 2026-04-01)
[medium] Use processing_ledger for pipeline stages — implementation (2 observations, last: 2026-03-28)
--- antipatterns.md ---
[high] Don't mock the database in integration tests — testing (3 observations, last: 2026-04-05)
If no entries match the filters, display: "No entries match the given filters."
/smith-ledger show <title> — Show Full EntrySearch across all Ledger files for an entry whose ## <Title> heading matches the given title. Matching is case-insensitive and supports partial matches (the query is a substring of the title).
Single match: Display the full entry including all fields (title, date, category, confidence, observations, source reflections, context, pattern, evidence, related). Also display the source file name.
Multiple matches: List them with index numbers and ask which one to display:
Multiple entries match "docker":
1. [high] Always rebuild Docker after code changes — patterns.md
2. [medium] Docker Compose ordering matters for healthchecks — edge-cases.md
3. [low] Docker layer caching invalidation — tool-preferences.md
Which entry would you like to see? (1-3)
No matches: Display: No entries found matching "<title>".
/smith-ledger search <query> — SearchSearch across all Ledger files for the query string using case-insensitive matching.
For each match:
## heading)Display format:
--- patterns.md: "Always rebuild Docker after code changes" [high] ---
...
Docker containers cache the build artifacts. When you change source code,
> the running container still has the old code unless you rebuild.
Always run `docker compose up -d --build <service>` after changes.
...
--- edge-cases.md: "Qdrant WAL recovery on unclean shutdown" [medium] ---
...
If Colima is stopped without first running `docker compose down`,
> Qdrant will perform WAL recovery on next start, which can take hours
with large collections (935K+ entries).
...
If no matches found, display: No results for "<query>".
/smith-ledger prune — Interactive PruningScan all Ledger files for prune candidates based on age and confidence:
Identify candidates:
**Date:** is older than config.low_confidence_prune_days days (default: 30)**Date:** is older than config.medium_confidence_demote_days days (default: 90). These will be demoted to low confidence, not removed.Read config values from meta.yaml under config:. If meta.yaml is missing or config values are absent, use defaults (30 days for low, 90 days for medium).
Display candidates grouped by action:
SMITH LEDGER — Prune Candidates
================================
Entries to REMOVE (low confidence, older than 30 days):
1. "Ruff format before commit" — tool-preferences.md (dated 2026-02-15)
2. "Check Neo4j constraints on startup" — patterns.md (dated 2026-02-20)
Entries to DEMOTE to low (medium confidence, older than 90 days):
3. "Qdrant batch size limit" — edge-cases.md (dated 2026-01-10)
Total: 2 removals, 1 demotion
Prompt for confirmation: Remove 2 entries and demote 1 entry? (yes/no)
If confirmed:
## to the next --- separator or end of file)**Confidence:** value from medium to lowmeta.yaml counts accordinglyPruned: 2 removed, 1 demoted. Total entries: NIf declined: Display: Prune cancelled. No changes made.
If no candidates are found, display: No prune candidates found. Ledger is clean.
/smith-ledger prune --auto — Automatic PruningSame logic as interactive prune but without confirmation. Execute immediately and report results.
Display:
Auto-prune complete: N removed, M demoted. Total entries: N
/smith-ledger promote <title> — Promote Confidenceshow.low -> mediummedium -> highhigh -> Display: "<Title>" is already at high confidence. No change.**Confidence:** line.Promoted "<Title>" from <old> to <new> confidence./smith-ledger demote <title> — Demote Confidenceshow.high -> mediummedium -> lowlow -> Display: "<Title>" is already at low confidence. No change.**Confidence:** line.Demoted "<Title>" from <old> to <new> confidence./smith-ledger export — Export Full LedgerConcatenate all Ledger files into a single markdown document and output it to chat.
Format:
meta.yaml wrapped in a YAML code block# <filename>Output the entire document to chat. Do not write it to a file unless the user explicitly asks.
/smith-ledger reset — Reset LedgerPrompt for confirmation:
This will archive the current Ledger and start fresh.
All existing entries will be preserved in the archive.
Are you sure? (yes/no)
If confirmed:
.smith/vault/ledger/archive/YYYY-MM-DD-HHMMSS/meta.yaml, patterns.md, antipatterns.md, tool-preferences.md, edge-cases.md, project-quirks.md) to the archive directorymeta.yaml:
last_reflection: null
total_reflections: 0
total_entries: 0
config:
low_confidence_prune_days: 30
medium_confidence_demote_days: 90
entries_by_file:
patterns: 0
antipatterns: 0
tool-preferences: 0
edge-cases: 0
project-quirks: 0
Each .md file (patterns.md, antipatterns.md, tool-preferences.md, edge-cases.md, project-quirks.md):
# <File Title>
<!-- Entries are added by /smith-reflect. Each entry starts with ## heading. -->
File titles: "Patterns", "Antipatterns", "Tool Preferences", "Edge Cases", "Project Quirks"
Ledger archived to .smith/vault/ledger/archive/YYYY-MM-DD-HHMMSS/
Fresh Ledger initialized with empty templates.
If declined: Display: Reset cancelled. Ledger unchanged.
/smith-ledger reconcile — Ledger Self-MaintenanceMerges duplicate entries, prunes stale patterns, enforces token budgets, and creates timestamped backups. Runs automatically via inline trigger after workflow reflection, or manually on demand.
Subcommands:
/smith-ledger reconcile — Full reconciliation (checks thresholds first)/smith-ledger reconcile --dry-run — Preview what would change without modifying files/smith-ledger reconcile --force — Bypass lock and threshold checks for emergency maintenance/smith-ledger reconcile --status — Show current .meta.json signals and whether reconciliation is needed/smith-ledger reconcile --category <name> — Reconcile only one Ledger file (patterns, antipatterns, tools, edge-cases, quirks).backups/reconcile-YYYY-MM-DD-HHMMSS/lock field in .meta.jsonreconcile_model (default: Haiku); merges require LLM to confirm "these entries cover the same core lesson"reconcile-log.md; never auto-retried--force flag bypasses lock and threshold checks.smith/config.json — check ledger.reconcile.enabled; if false, exit silently--force: check .meta.json lock field
acquired is < 10 minutes ago, exit with "Reconciliation already in progress"acquired is >= 10 minutes ago, treat as stale lock, proceed{"pid": "<session-id>", "acquired": "<ISO-8601>"} to .meta.json lock field.smith/vault/ledger/ does not exist, create it (same scaffold as smith-reflect Phase 0)Unless --force or manual invocation:
.meta.json current values.smith/config.json thresholds (or use defaults: 30K total tokens, 8K single-file, 50/category, 50 reinforcements, 3 violations)estimated_tokens > thresholds.total_tokens_max (default 30000)thresholds.single_file_tokens_max (default 8000)thresholds.patterns_per_category_max (default 50)reinforcements_since_reconcile > thresholds.reinforcements_threshold (default 50)context_budget_violations > thresholds.context_violations_threshold (default 3)last_reconcile is less than minimum_hours_between_reconciles (default 6) hours ago, skipFallback: If .meta.json is missing or stale, compute signals directly from Ledger files:
**Title:** lines for pattern count.smith/vault/ledger/.backups/reconcile-YYYY-MM-DD-HHMMSS/patterns.md, antipatterns.md, tool-preferences.md, edge-cases.md, project-quirks.md, meta.yaml, .meta.jsonreconcile-* directories in .backups/backup.max_count (default 5) OR older than backup.max_age_days (default 30 days)For each Ledger .md file:
--- separator, extract **Title:**, **Context:**, **Pattern:** fields)reconcile_model (default: Haiku):
- YYYY-MM-DD — reconcile merge: absorbed "<other title>"Complexity bound: If N > 100 entries in a file, skip merge phase and log warning.
Same rules as smith-reflect Phase 6:
ledger.pruning.low_max_age_days (default 30), ledger.pruning.medium_max_age_days (default 90)low_max_age_days → REMOVEmedium_max_age_days → DEMOTE to low, set Date to todaysingle_file_tokens_max (default 8000):
total_tokens_max (default 30000):
patterns_per_category_max (default 50):
.meta.json:
last_reconcile: current ISO 8601 timestampestimated_tokens: fresh word count × 1.3total_patterns: fresh count of **Title:** linescontext_budget_violations: reset to 0reinforcements_since_reconcile: reset to 0lock: null (release lock)meta.yaml entry countsreconcile-log.md (newest first, below header):---
## Reconcile: YYYY-MM-DD HH:MM:SS
**Trigger**: <threshold that fired>
**Signal values**: tokens=NNNN, patterns=NN, violations=NN, reinforcements_since=NN
**Backup**: `.backups/reconcile-YYYY-MM-DD-HHMMSS/`
**Actions**:
- Merged N entries
- Pruned N stale entries
- Dropped N lowest-confidence entries for budget
- Budget result: NNNN → NNNN estimated tokens
**Merges**: (if any)
- file.md: "Title A" + "Title B" → "Merged Title"
**Prunes**: (if any)
- file.md: "Title" (low confidence, age: N days)
**Budget drops**: (if any)
- file.md: "Title" (low confidence, N reflections)
**Result**: OK | PARTIAL | FAILED
Ledger reconciliation complete.
- Trigger: <threshold(s)>
- Merged: N entries
- Pruned: N stale entries
- Budget drops: N entries
- Token reduction: NNNN → NNNN
- Backup: .backups/reconcile-YYYY-MM-DD-HHMMSS/
--dry-run ModeWhen --dry-run is specified:
--status ModeWhen --status is specified:
.meta.json and display current signal valuesreset, if .smith/vault/ledger/ does not exist, display the "No Ledger found" message from the dashboard section and stop.(missing: <filename>) in any listings. Do not error out.[???] placeholders and continue. Do not skip it entirely./smith-ledger list to see available entries.