spec-mining-edho-ferdian

Extract behavioral specifications from undocumented codebases into Requirement and Invariant blocks.

2|Updated Sep 6, 2026
One-click install
npx skills add https://github.com/edhoferdian/EEF --skill spec-mining-edho-ferdian-edhoferdian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec-mining-edho-ferdian
Source: https://github.com/edhoferdian/EEF/tree/main/.agents/skills/spec-mining-edho-ferdian
Command: npx skills add https://github.com/edhoferdian/EEF --skill spec-mining-edho-ferdian-edhoferdian

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about spec-mining-edho-ferdian

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a specification from an existing codebase with no documentation?

Run spec mining on the repository: it groups code into capabilities, reads entry points first, then expands one call-chain level to extract Requirements (WHEN/THEN) and Invariants. Each behavior is anchored to the exact file and method that enforces it.

What is the difference between a Requirement and an Invariant in a mined spec?

A Requirement is triggered behavior with at least one WHEN/THEN scenario, such as returning an error when stock is insufficient. An Invariant is always true regardless of triggers, like a balance equaling the sum of transactions, and has no scenarios.

Does spec mining require the Salak dependency graph tool?

No, Salak is optional. The skill detects it at runtime and falls back to manifest and entry-point heuristics plus call-chain inference when absent. Salak-sourced dependency edges are labeled [Salak-verified]; inferred ones are labeled [inferred, unverified].

How does spec mining avoid inventing behavior the code does not have?

It cross-validates docstrings against actual callers before writing any Requirement, and records genuine ambiguity as explicit uncertainty comments instead of confident claims. A mandatory 5-gate reflection checks traceability, provenance, and labeling before handoff.

What are the read limits when mining a large module?

Expansion stops at the first of: an external system boundary, three consecutive files yielding no new behavior, or 15 total files read per capability. Unread files are recorded with reasons in a deferred metadata comment, never silently dropped.

Where does spec mining write its output files?

It writes one Markdown file per capability to /project-memory/mined-specs/<capability>.md, creating only that subdirectory if missing. The format is tool-agnostic and optionally exportable to OpenSpec's openspec/specs layout.