Skip to content

specstoryai/getspecstory / lore

SpecStory 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 agent harnesses. Use when the user wants to turn past AI coding sessions into reusable skills, asks "what could I make into a skill", "mine my lore", "forge skills from my history", or points at a .specstory/history directory.

FileKindSize
.claude-plugin/plugin.jsonconfig738 B
.gitattributesother342 B
.gitignoreother36 B
AGENTS.mdmarkdown1.6 KB
AS-BUILT-ARCHITECTURE.mdmarkdown27.6 KB
CHANGELOG.mdmarkdown12.7 KB
CLAUDE.mdmarkdown11 B
CONTRIBUTING.mdmarkdown5.1 KB
HOW-IT-WORKS.mdmarkdown20.7 KB
LICENSEother11.1 KB
README.mdmarkdown9.3 KB
SKILL.mdskill md32.9 KB
fixtures/golden/forge-plan.mdmarkdown1.7 KB
fixtures/projA/.specstory/.project.jsonconfig93 B
fixtures/projA/.specstory/history/2025-07-10_09-00-00Z-fix-the-gitignore.mdmarkdown736 B
fixtures/projA/.specstory/history/2026-05-01_10-00-00Z-can-we-run-a.mdmarkdown1.2 KB
fixtures/projA/.specstory/history/2026-05-02_11-00-00Z-can-we-run-a.mdmarkdown1015 B
fixtures/projA/.specstory/history/2026-05-03_12-00-00Z-can-we-run-a.mdmarkdown994 B
fixtures/projA/.specstory/history/2026-05-04_13-00-00Z-check-the-vet.mdmarkdown1.0 KB
fixtures/projA/tools/subpkg/.specstory/history/2026-05-07_10-00-00Z-tune-the-subpkg.mdmarkdown458 B
fixtures/projB/.specstory/.project.jsonconfig93 B
fixtures/projB/.specstory/history/2026-05-05_14-00-00Z-can-we-run-a.mdmarkdown795 B
fixtures/projC/.specstory/.project.jsonconfig93 B
fixtures/projC/.specstory/history/2026-05-10_09-00-00Z-where-is-save-implemented.mdmarkdown4.0 KB
fixtures/projC/.specstory/history/2026-05-11_10-00-00Z-where-is-token-validation.mdmarkdown1.9 KB
fixtures/provider-antigravity/.specstory/history/2026-05-23_09-00-00Z-run-the-linter.mdmarkdown567 B
fixtures/provider-deepseek/.specstory/history/2026-05-22_09-00-00Z-count-source-lines.mdmarkdown562 B
fixtures/provider-droid/.specstory/history/2026-05-21_09-00-00Z-show-git-status.mdmarkdown612 B
fixtures/provider-gemini/.specstory/history/2026-05-20_09-00-00Z-list-the-workspace.mdmarkdown610 B
package.jsonmanifest337 B
scripts/deep-mine.workflow.jsscript6.3 KB
scripts/hooks/validate-plan.mjsscript2.5 KB
scripts/lib/beats.mjsscript22.2 KB
scripts/lib/db.mjsscript3.8 KB
scripts/lib/discover.mjsscript3.3 KB
scripts/lib/forged.mjsscript6.5 KB
scripts/lib/indexer.mjsscript7.4 KB
scripts/lib/parse.mjsscript10.4 KB
scripts/lib/patterns.mjsscript14.4 KB
scripts/lib/report.mjsscript21.8 KB
scripts/mine-skills.mjsscript16.9 KB
scripts/theme-sweep.workflow.jsscript7.5 KB
tests/engine.test.mjsscript44.9 KB

scripts/hooks/validate-plan.mjs

View on GitHub
#!/usr/bin/env node
// validate-plan.mjs - PreToolUse hook on ExitPlanMode, wired in SKILL.md frontmatter.
//
// This is LAW 1's harness-level enforcement for plan-style curation (failure mode #3: a plan that
// names skills but summarizes the dossier evidence away, so the user approves a forge they never
// saw). Instructions ask; hooks enforce. The plan body must BE the engine's `plan render` artifact:
//   - the PASS-THROUGH FORGE PLAN marker (only the engine emits it)
//   - the "=== dossiers above: N ===" sentinel as the plan's LAST line
//   - at least N "### " card headers backing the sentinel's count
// Anything else is denied with a reason the model can act on. A malformed stdin or a different
// tool exits 0 silently - a broken hook must never block unrelated work.

import { readFileSync } from 'node:fs'

let input
try { input = JSON.parse(readFileSync(0, 'utf8')) } catch { process.exit(0) }
if (input.tool_name !== 'ExitPlanMode') process.exit(0)

const plan = String(input.tool_input?.plan || '')
const problems = []

if (!plan.includes('<!-- PASS-THROUGH FORGE PLAN')) {
  problems.push('the plan is not the engine-rendered forge plan (missing the PASS-THROUGH FORGE PLAN marker)')
}
const sentinel = plan.match(/^=== dossiers above: (\d+) ===\s*$/m)
if (!sentinel) {
  problems.push('missing the "=== dossiers above: N ===" sentinel')
} else {
  const lastLine = plan.trimEnd().split('\n').pop().trim()
  if (!/^=== dossiers above: \d+ ===$/.test(lastLine)) problems.push('the sentinel must be the LAST line of the plan')
  const n = +sentinel[1]
  const cards = (plan.match(/^### /gm) || []).length
  if (n < 1) problems.push('the sentinel must count at least 1 candidate')
  if (cards < n) problems.push(`the sentinel claims ${n} candidate(s) but only ${cards} dossier card header(s) ("### ") are present`)
}

if (problems.length) {
  process.stdout.write(JSON.stringify({
    hookSpecificOutput: {
      hookEventName: 'PreToolUse',
      permissionDecision: 'deny',
      permissionDecisionReason:
        'LAW 1 (lore, failure mode #3): the forge plan must be the engine-rendered curation document, '
        + 'not your own summary. Problems: ' + problems.join('; ') + '. '
        + 'Fix: write the manifest JSON ({proposed:[{cluster|theme, name}], skipped:[{candidate, reason}]}), run '
        + '`node "<skill-dir>/scripts/mine-skills.mjs" plan render --file <manifest>`, and pass its stdout '
        + 'UNEDITED as the plan. If this plan is genuinely not lore curation, tell the user the lore hook blocked it.',
    },
  }))
}
process.exit(0)
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall