skills/LearnFrom/SKILL.md
Extract session learnings and apply them as updates to rules, skills, and agents. USE WHEN session produced reusable patterns, corrections, or conventions worth capturing.
npx skillsauth add n4m3z/forge-core LearnFromInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Extract reusable learnings from the current session and apply them as updates to rules, skills, and agents in the current repo.
| Workflow | Trigger | Section | | ------------ | ------------------------------------------------ | -------------------------------- | | Analyze | "learn from this session", "extract learnings" | Analyze | | Targeted | "add a rule for X", "update the agent to note Y" | Apply Changes |
First pass — find the friction points. Identify each area of the session where work cycled more than once: same problem revisited multiple turns, repeated "still doesn't work" exchanges, user pushback on the same theme across several messages, debugging loops that bounced between hypotheses. List the 1-3 biggest friction zones explicitly by topic ("QR code validation", "visual styling", "Python env"). Each friction zone is a learning gold mine — the cycling itself proves a missing rule, skill, or workflow guard would have prevented it. Skipping friction zones in favor of small surface fixes (a typo, a flag) is the most common LearnFrom failure mode. For each friction zone, ask: what specific instruction, if it had existed at session start, would have collapsed the cycle to one turn?
Second pass — scan for user-correction signals. Re-read the conversation specifically looking for: user messages containing "no", "don't", "actually", "wait", "stop", "that's wrong"; follow-up questions that reveal you missed something ("did you X?", "is it still Y?"); user edits or rewrites of your output; requests that imply a prior step should have been done differently. These encode behaviors the user actively wants changed; surface them alongside the friction zones.
Third pass — walk the scan checklist below. Walk through each category and list concrete findings before filtering.
Cross-reference against friction zones — items inside a friction zone matter more than isolated ones.
For each finding, apply the reusability test: will this come up again in a different session? If no, skip it. If uncertain, include it: a skipped learning is lost, an extra proposal can be rejected.
Forge modules are one home for learnings, not the only home. Before scanning a module's rules/skills/agents, decide whether the learning even belongs in a forge module. Many "platform quirks" are actually shell-env exports or install steps that belong in dotfiles or mac-setup, not in a forge rule pile.
| Question | Target | Example |
| ----------------------------------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
| Can a shell-env export, alias, or shell-config change fix this? | dotfiles/ (zshenv, zshrc, zprofile) | export SSH_ASKPASS=/opt/homebrew/bin/ssh-askpass to fix YubiKey commit signing in subprocesses |
| Can a brew install, defaults write, or macOS setup step fix this? | mac-setup/ | "install ssh-askpass via brew", "disable Spotlight indexing of node_modules" |
| Is this a decision about a specific project's identity or architecture? | That project's docs/decisions/ ADR | "we use EUPL-1.2", "single source of truth for default models" |
| Is this a forge-ecosystem convention or workflow? | Appropriate forge module's rules/, skills/, or agents/ | "skill bodies stay under 150 lines", "ADRs use the structured-madr schema" |
| Is this a personal preference about the user the AI should remember? | A personal-overrides module | "user prefers concise responses", "user works in Czech locale" |
| Is this an unfixable platform quirk — workaround only lives in head? | forge-core rules/KnownIssues.md (last resort) | "Obsidian Linter auto-formats frontmatter between read and write" |
KnownIssues.md is the last resort, not the default. If a config change, install step, or env export would actually fix the problem, the learning belongs at the source of that fix — never as a workaround documented in KnownIssues. Adding a fixable quirk to KnownIssues teaches future sessions to tolerate the breakage forever instead of resolving it once.
Before drafting any proposal, list every file in rules/, skills/, and agents/ of the target module. For each candidate learning, search by topic for an existing artifact that already touches the same area. The default outcome is a one-line edit to an existing file, NOT a new file.
Concrete signals you should be editing not creating:
Only create a new rule or short file when the learning is genuinely orthogonal to everything that exists. If you find yourself writing a rule shorter than ~3 sentences, it almost certainly belongs as a paragraph in an existing file.
Exception — when friction reveals a missing domain skill, propose a new skill, not a paragraph in a general one. If the friction zone was about a specific tool, format, protocol, or domain operation that no existing skill covers (Czech SPAYD QR generation, GraphQL schema design, Stripe webhook handling, Apple Numbers automation), the right output is a new skill with reusable scaffolding — templates, validation steps, default config, examples — that prevents the friction next time. A bullet in SystematicDebug about "clarify failure mode" still has value, but it's the secondary capture; the primary one is the missing domain skill itself. Trigger conditions: friction took 5+ turns to resolve, the operation has multi-step structure (build → validate → render → verify), and the next user invocation would benefit from /SkillName rather than from a rule firing on every session. When in doubt, surface this option to the user alongside the edit-existing proposal so they can pick.
Determine the target artifact. The categorization decision matters — rules cost tokens every session; skills cost tokens only when invoked.
| Learning type | Target | Example |
| -------------------------- | ---------------- | -------------------------------------------- |
| Always-relevant constraint | rules/ | "every text file ends with newline" |
| Task-specific guidance | skills/*/SKILL.md with paths: | "shell scripting pitfalls — auto-trigger on **/*.sh" |
| Skill workflow improvement | skills/*/ | "add note about tool limitation" |
| Agent instruction update | agents/ | "add guidance about deployment scope" |
| Existing file refinement | edit in place | "add RACI to required frontmatter list" |
If the guidance only matters when working on certain files (shell scripts, Python, Markdown), make it a skill with paths: frontmatter so it auto-triggers on relevant file edits — don't put it in rules/ where it loads on every session regardless of relevance.
LearnFrom always edits source files in the module root (rules/, skills/, agents/). Never edit deployed copies under .claude/, .codex/, .gemini/, or .opencode/ — those are forge install outputs that get overwritten on every sync.
Start with the source artifact relevant to the current workload, then check its provenance record (.provenance/<file>.yaml sidecar). If resolvedDependencies lists an upstream module (forge-core, forge-dev, etc.), the artifact is inherited content. Propose the change upstream; the local copy refreshes via forge install after the upstream merges. Edit the local copy directly only when the change is genuinely repo-specific (project-only convention, local override).
Skipping this check creates drift: a local edit to inherited content silently shadows future upstream improvements, and a local edit to a deployed copy is overwritten on the next sync.
For each identified learning, draft a concrete proposal in this priority order:
Show the existing-file scan result alongside each proposal so the user can see what was considered and rejected.
Rules must fire on a concrete trigger. Abstract principles ("be careful with X") don't change behavior; concrete signals do ("when you're about to write Y, check Z"). Iterate the wording with the user — first drafts are usually too abstract OR too tied to one specific case. Filename should match the final framing — rename if the concept shifts during iteration.
Present proposals in batches via AskUserQuestion (4 questions max per call).
For each proposal, show the target file and proposed change with a preview field carrying the literal content that would be written. Options: "Capture", "Adjust", "Skip".
For "Adjust": ask what to change, then re-present.
After the first batch, dig deeper before declaring done. Most sessions have 2-3 obvious learnings and several non-obvious ones surfaced only by re-scanning corrections, pushback, and stuck moments. Ask yourself "what else did the user have to correct?" before stopping.
For each confirmed proposal:
rules/ using the Write toolskills/ or agents/ using the Write toolAfter writing, verify the file exists and has correct content.
List what was captured: rules created or updated, skills updated, agents updated, items skipped.
rules/KnownIssues.md for unfixable platform quirks onlyrules/, skills/, and agents/ BEFORE drafting — a new file is the last resort, not the first instinct.claude/, .codex/, .gemini/, or .opencode/.mdschema).mdschema in rules/ if present.mdschema before writingdevelopment
Reactive correction and root-cause fix. USE WHEN something went wrong, user is frustrated, demands a correction, says wtf, what the hell, why did you, that's wrong, this is broken, no not that, stop. Executes the immediate fix, then hunts the upstream artifact that caused it and creates a corrective change.
development
Decompose a research question into sub-queries, spawn parallel WebResearcher agents per angle, synthesize findings with citations and explicit confidence. USE WHEN the user asks to research, investigate, look online, look up, dig into, find sources, gather evidence, or survey what's known about a topic. Single-pass; for multi-round adversarial research use ResearchCouncil in forge-council.
tools
Author project documentation that future humans (and AI sessions) actually read. Covers TLDRs for tools, READMEs, runbooks, journals. USE WHEN write documentation, create tldr, tool one-pager, document a cli, write readme, runbook, journal entry, capture knowledge about a tool, distill a session into reusable notes.
development
Review your own staged changes via a code-review TUI before triggering a commit. USE WHEN about to commit, walking through your own staged diff, self-reviewing before approval, tuicr, revdiff, git diff cached.