$npx -y skills add specstoryai/getspecstory --skill loreSpecStory Lore - mine your SpecStory coding histories (any agent - Claude Code, Codex, Cursor, Gemini, and more) into a persistent corpus, surface your reproducible workflows with corroborated evidence, and interactively forge the chosen ones into skills installed across all your
| 1 | # Lore |
| 2 | |
| 3 | Your sessions are your lore. This skill turns a user's real coding history into installed skills. |
| 4 | A deterministic engine (`scripts/mine-skills.mjs`) parses their SpecStory transcripts - from **every |
| 5 | agent** SpecStory captures (Claude Code, Codex CLI, Cursor CLI, Gemini CLI, Factory Droid, DeepSeek, |
| 6 | Antigravity, ...) - into a persistent corpus of **beats**, and returns corroborated candidates. |
| 7 | You - the calling agent, whichever harness you are - supply all judgment: name them, discard the |
| 8 | generic ones, and interactively forge the good ones into `SKILL.md` packages grounded in the user's |
| 9 | own commands. |
| 10 | |
| 11 | The engine does the retrieval and counting; **you do the synthesis.** Do not try to read raw |
| 12 | transcripts yourself - they can be hundreds of thousands of lines. Run the engine and work from |
| 13 | its output. |
| 14 | |
| 15 | This skill is **harness-portable** (agentskills.io format). Where it names a specific tool |
| 16 | (e.g. `AskUserQuestion`), treat that as "use your harness's equivalent; fall back to plain chat." |
| 17 | |
| 18 | **Voice:** when narrating to the user, talk about *mining their lore* and *skill candidates* - |
| 19 | e.g. "I'll mine your lore here in <project> for skill candidates." Reserve the word **forge** for |
| 20 | the final act only: creating the skills the user selected (Step 4). Never describe mining, judging, |
| 21 | or candidates as "forge-…" anything. |
| 22 | |
| 23 | ## OUTPUT CONTRACT - three LAWS, read before emitting anything to the user |
| 24 | |
| 25 | **Named failure mode #1 (2026-06-09, BearClaude run):** the agent indexed, deep-mined four skills, |
| 26 | then jumped straight to AskUserQuestion with bare option labels - ZERO dossiers rendered in chat. The |
| 27 | user declined every question because they had nothing to judge by. The entire mining run was wasted. |
| 28 | |
| 29 | **Named failure mode #2 (2026-06-09, BearClaude run, SAME DAY, fresh session, LAWs in effect):** the |
| 30 | agent narrated phases correctly, did verification reads, then asked again with NO dossier message - |
| 31 | its last message before the question was process narration ("CodeMirrorBundle is alive in today's |
| 32 | repo…") - and the question text falsely claimed "dossiers above". Lesson: a *felt* self-check is not |
| 33 | a check. Compliance must be MECHANICAL: the sentinel line below is the check, not your impression. |
| 34 | |
| 35 | **Named failure mode #3 (2026-06-10, teammate's machine, Opus 4.8, plan-mode path):** the agent DID |
| 36 | use plan-mode curation but presented a THIN plan - skill names and skip reasons with the dossiers |
| 37 | summarized away - so the user approved a forge they never saw the evidence for. The plan UI makes |
| 38 | skipping the *display step* impossible, not skipping the *content*. Lesson: the plan body must BE |
| 39 | the engine's `plan render` artifact (Step 3), which embeds every card verbatim and ends with the |
| 40 | LAW 1 sentinel. In Claude Code this is now HOOK-ENFORCED: a PreToolUse hook in this skill's |
| 41 | frontmatter denies any `ExitPlanMode` whose plan is not that artifact. |
| 42 | |
| 43 | **LAW 1 - DOSSIERS BEFORE CANDIDATE QUESTIONS, PROVEN BY SENTINEL.** This law governs **candidate |
| 44 | decisions** - any prompt where the user chooses which skills to forge, skip, or update. (Navigation |
| 45 | questions like the Step 0.25 guided start, or scope confirmations, are exempt - they decide nothing |
| 46 | about candidates.) Before any candidate prompt you must emit one chat message that contains a full |
| 47 | dossier block (`### <name> …`, per Step 3) for EVERY candidate, and that message must END with this |
| 48 | exact line: |
| 49 | |
| 50 | ``` |
| 51 | === dossiers above: N === |
| 52 | ``` |
| 53 | |
| 54 | where N equals the number of candidates you are about to offer. At the moment of asking, the check is |
| 55 | mechanical: *"Does a prior message of mine end with `=== dossiers above: N ===` and does N match my |
| 56 | option count?"* No sentinel → you have not rendered dossiers, whatever you remember - STOP and write |
| 57 | them. Process narration between tool calls does NOT count; interim notes do NOT count. |
| 58 | |
| 59 | **The strongest form of LAW 1 is plan-style curation (Claude Code, see Step 3): present the dossiers |
| 60 | AS the plan via `ExitPlanMode` - then showing the evidence and asking for the decision are the same |
| 61 | act, and skipping the display is structurally impossib |