AGENT SKILL

learn

Retro on a run (or a week of runs): turns what happened into dev-graph Learning and Principle nodes, repo playbooks, personal second-brain notes, and proposed reviewer-rule tweaks. Use when the user says "retro", "what did we learn?", "make a playbook", or after a merge.

License 许可
MIT
所属仓库
varun-singhh/lfg
最近更新
2026-10-26
Stars
★ 10
Forks
3

01 前言 Front Matter

name
learn
lanes
[ "express", "standard", "full", "hotfix" ]
phase
learn
reads
[ "run folder", "06-review.json", "feedback store", "usage.db", "audit.log" ]
author
Varun Singh
writes
[ "08-learn.md", "dev-graph Learning/Principle", "~/.lfg/playbooks/<repo-id>/", "second-brain" ]
preflight
graphs
description
Retro on a run (or a week of runs): turns what happened into dev-graph Learning and Principle nodes, repo playbooks, personal second-brain notes, and proposed reviewer-rule tweaks. Use when the user says "retro", "what did we learn?", "make a playbook", or after a merge.
adapted-from
mattpocock/skills/retro + writing-for-agents (MIT, © 2026 Matt Pocock)
auto-trigger
false

03 SKILL.md 正文

/learn: make the next run better

Step 0: preflight

  1. lfg graphs ensure. Non-zero exit: stop and show its output. Continue on a stale graph only if the user typed --allow-stale.
  2. lfg run path. Exit 1: lfg run list and ask which run (or "the week") to look back on.
  3. lfg rule agent-writing: every rule, playbook or note you draft follows it.

Steps

  1. Read the primary sources for the run (or each run this week): 01-brief.md … 07-shipcheck.json, progress.md, tasks.json; lfg usage --json (tokens and time per stage); ~/.lfg/audit.log entries for the run (blocked actions); the accept/reject verdicts in ~/.lfg/feedback/ for its findings. Note what went wrong, what was slow, and what was expensive.
  2. Find candidates in each category; a category with nothing real stays empty.
    • Navigation: the agent searched long for something the graph should have pointed to → a graphify rationale gap, a missing Component link, or a playbook entry.
    • Automated checks: a mistake a check could have caught. Read the repo's own lint/test/CI wiring first; an existing check left unwired is the finding. A repo with no guardrail at all is a finding.
    • Reviewer rules: from the feedback store. Rejected findings → loosen or drop the rule that produced them. Bugs /review-coach missed → a new rule. Classify first: mechanical (banned API, import shape, file location) → a linter rule or CI job; judgement → a Principle or a CODING_STANDARDS.md line.
    • Steering no-ops: lines in rule modules, skills or CLAUDE.md that changed nothing this run.
    • Tool economy: stages that burned tokens or time out of line with their job (from usage.db).
    • Information access: something the agent needed but could not see (logs, read-only service access).
    • Guard blocks: repeated blocks in audit.log mean a prompt or skill is steering toward a forbidden action; name it.
  3. Present candidates by severity, each with the evidence (file, stage, finding id) and the proposed change. Wait for the user to pick.
  4. Write what was agreed:
    • dev-graph Learning per lesson, linked to the Component (and Incident for Hotfix). Write Learnings directly.
    • dev-graph Principle for each agreed judgement rule; only after the user's yes, since /review-coach enforces Principles.
    • Playbooks in ~/.lfg/playbooks/<repo-id>/<slug>.md ("how to add X here", landmines): only from a pattern with 3+ instances found via graphify query, citing the reference files.
    • Second-brain notes for personal insights and preferences the user chooses to keep.
    • Skill candidates: a repeated, error-prone procedure → propose it as a skill; create nothing unless the user confirms.
    • Repo changes (a lint rule, a CI job) are proposed as a ticket or a follow-up /build, never edited in from here. Linear writes only after a yes on the exact text.

Output

08-learn.md in the run folder:

# Learn: <run-id or week>
| # | Category | Evidence | Change | Status (written / proposed / declined) |
## Written: Learning ids, Principle ids, playbook paths, second-brain notes
## Proposed reviewer-rule tweaks (rule, from → to, evidence)

Reply with the top three lessons, what was written where, and the open proposals.

Rules

  • Evidence over impressions: every candidate cites where it came from.
  • Lessons describe the system and the process, not the person.
  • No secrets, code blocks with credentials, or exploit details in any node, playbook or note.

04 同仓库更多 Skills

varun-singhh
varun-singhh/lfg

wizard

Guided start-to-finish run of the whole pipeline on an idea or a Linear issue. Runs every stage (grill, plan, build, check, secure, pentest, review, ship check, ship packet, learn), explains each one in plain words before and after, and loops failures through /fix until all 8 gates are green (max 3 loops per gate). Use when the user types "/wizard <idea>", "/wizard LIN-123", "/wizard resume", "walk me through everything", "do every step and explain it". Explicit only; never auto-triggered.

★ 10
varun-singhh
varun-singhh/lfg

why

Explains why code looks the way it does: the commits that shaped a file, a function or a few lines, what each one changed and why, and the issues, tickets and pull requests they mention. Use when the user asks "why is this here?", "why was this changed?", "who added this and what for?", "what's the story behind X?", or is about to change code they don't understand.

★ 10
varun-singhh
varun-singhh/lfg

which

Looks at graph status, the current run folder, git status and Linear, then tells you the single next skill to run and why. Use when the user says "which skill do I use?", "what now?", "what next?", "where was I?", "I'm lost", or starts a session without saying what they want.

★ 10
varun-singhh
varun-singhh/lfg

suggest-tests

Suggest tests you should write based on your code. Uses AST parsing to find functions and suggests tests based on code patterns. Use when writing new code or modifying existing code.

★ 10
varun-singhh
varun-singhh/lfg

spike

Builds a throwaway prototype to answer one design question, in a scratch folder inside the run folder, then deletes it and keeps only the conclusion. Use when the user says "try a quick prototype", "would this approach work?", "spike this", "let me feel this state model", "show me a few UI options", or when a plan has an open question that a cheap working artifact would settle.

★ 10
varun-singhh
varun-singhh/lfg

ship

Proves the change is shippable and hands it to you: re-runs the green gate, runs the ship check (Docker build, scan, run, smoke test, delete, verify cleanup) and the shipping checklist, then writes COMMIT_MSG.md and PR_BODY.md. Never commits, pushes or deploys. Use when the user says "ship it", "ready for a PR", "prep the commit", "is it shippable?".

★ 10