What problem does it solve? Brownfield repositories often contain years of behavior encoded in code but never written down, forcing engineers to guess intent or trust stale docstrings. This Skill reverse-engineers an existing codebase into a flat, machine-readable spec of Requirements (WHEN/THEN) and Invariants, each anchored to the exact code location that enforces it. ## Core Features & Use Cases - Capability-scoped mining: Groups the repo into capabilities (e.g. orders, payments, user-auth), asks the user which to mine, and writes one spec file per capability to /project-memory/mined-specs/. - Bounded sample-and-expand reads: Reads entry points first, expands one call-chain level, and stops at external boundaries, 3 barren files, or 15 files — deferring the rest explicitly instead of dropping it. - Anti-invention guardrails: Cross-validates docstrings against real callers, records ambiguity as explicit uncertainty comments, labels dependency edges as [Salak-verified] or [inferred, unverified], and runs a 5-gate reflection before handoff. - Use Case: You inherit a legacy service with no documentation. Run this Skill to produce a mined spec of the payments capability, with every rule traceable to the enforcing function and the current commit hash. ## Quick Start Ask the assistant to extract a behavioral spec from this repository's payments capability using the spec mining skill.