Smining

The nightly retrospective: finished sessions become typed records, records become change commits, and you pick the ones you want onto main.

Every stage is a skill, chained by the smine dispatcher and run by the smine-nightly routine (Routines). Its output waits on the config server's Proposals page (Config server). The planning skills it hands work to are on the Skill map.

The feedback loop

Sessions produce evidence, nightly mining turns it into commits, you accept a commit by picking it.

  1. Sessions do the work

    Local Claude Code and Codex sessions work in the project repos, accumulating plans, diffs and transcripts.

  2. peek-mcp exposes them

    Over MCP (Model Context Protocol) to other agents: agent–user conversation, plan, diff, metadata such as touched files and used skills (skills/orchestration/peek).

  3. Session mining

    /smine mines idle sessions newest first, one JSON record each, checked by make sessions. The memory, context, permissions and ACDSL miners read the records directly; smine-problems synthesizes cross-session problems against design intent (context, docs, plans, backlog) for the skills and routines planners. Each finding becomes a change task, one /fimplement commit on the night's branch.

  4. You pick on the Proposals page

    The config server's Proposals page lists change commits: skill rules, context-doc entries (a typed entry in context/actions/), ACDSL rules, allow rules, whole skills (fexplore came from a retrospective). Picking one onto main accepts it; nothing is voted on.

  5. Sync deploys

    Skills and context deploy; the next session runs under the improved rules.

  6. Repeat

    The next sessions feed the next run.

The pipeline

The nightly run mines sessions into change tasks, implements each as one commit, judges the commits.

StepSkillArtifact out
0smine-style~/.claude/context/global/style-profile.md: the user's voice (transcripts) plus a ## Design taste block (plan Decisions tables, rejection reasons). Injected into every session; smine-problems reads it for solution directions. The nightly runs it when a taste source changed.
1sminePipeline dispatcher: runs the requested stages (--stages) inline in one session via the Skill tool, owns the implement stage, ends on the run summary.
2smine-batchsessions/<repo>/<YYYY-Www>/<id>.json with a cost object from peek, checked and canonically rewritten by make sessions ARGS="check …". make sessions ARGS="pending" picks sessions newest first; the smine-mine workflow runs one smine-miner per session.
3msmine-memoryChange tasks draining the auto-memory dir into context facts; ends no auto-memory without one.
3csmine-contextChange tasks for context entries and acdsl-context declarations, from the records' context-use signals.
3psmine-permissionsChange tasks adding the gate's candidate allow rules; intended denials dropped.
3asmine-acdslChange tasks for ACDSL rules (rule line, verifier, fixtures) for prose rules sessions kept violating.
4smine-problemsCross-session problems, checked against design intent (intended costs dropped), solved as change tasks by the smine-skills and smine-routines planners. One neither solves becomes a backlog Icebox row marked mined, or enriches a matching item's mined marker. Reads the records make sessions ARGS="unsynthesized" lists, marks them mark --synthesized.
4csmine-consolidate carryCherry-picks every unsettled older change onto this night's proposals branch before the implement stage.
5smine implement/fimplement per change task; each change one commit with trailers Smine-Change: <kind>/<slug> and Smine-Sessions: <ids>.
6smine-consolidaterun: every change commit picks onto main alone; changes sharing a file fold into one commit.
7smine-orchestraterun: judges every change commit (ready, or rejected with a reason) and the run. bootstrap: finalizes an initial-setup run.

Data flow

FromToKindNote
smine-stylesmine-problemsfeedsvoice + design taste
smine-batchsession record JSONwritescost from peek
session record JSONsmine-memory, smine-context, smine-permissions, smine-acdsl, smine-problemsread by
smine-problemssmine-skills, smine-routines plannershands off
smine-problemsbacklog rowwritesmarked mined
the four miners and the plannerschange taskswrite.smine-run/changes/
change taskssmine-consolidate carrynextolder unsettled changes onto this night
smine-consolidate carryimplementnext/fimplement per task, one commit per change
implementsmine-consolidatenexteach commit picks alone
smine-consolidatesmine-orchestrate runnextverdict per change
smine-orchestrate runProposals pagenextpick onto main

Store and caps

TermMeaning
<store>~/GolandProjects/agent-plans/<repo>/ (<repo> = the main checkout's directory name): the one live backlog store, committed by the routine runner after each run. Skills resolve it via make rules ARGS="store-root", never spelling the path. A smoke or eval run gets its own (store/ in its throwaway worktree), out of the live one's reach.
--capChange tasks per mining stage per run. Default 5.
/smine-batchThe raw miner alone.
/smine-problemsThe synthesis alone.

Cost

The nightly is one claude-opus-5-5[1m] dispatcher cell, effort high, $300 budget (routines/smine-nightly/). Measured spend: the usage store behind the config server's /usage page, filled hourly by the smine-budget routine from peek and ccusage, and Token usage. One Team Premium 5-hour window held $262.04 of API-equivalent spend.

Tip

Schedule the routine when interactive usage is low: it shares the plan's window.