← ClaudeAtlas

fsl-from-codelisted

Reverse-engineer an FSL design-layer spec from existing source code. Scope the stateful subsystem, harvest state/actions/guards/effects with source-line witnesses, surface invariants and forbidden flows as confirmation questions (never fabricated), then verify, mutation-test for hollowness, and prove conformance by replaying the generated harness against the real code. Use when the input is code and the deliverable is a spec. Do not use when starting from a requirements contract (use fsl-design), nor for business/PM requirements discovery.
fuwasegu/fleet · ★ 1 · AI & Automation · score 67
Install: claude install-skill fuwasegu/fleet
# FSL From Code — extracting a design spec from an implementation Use this skill when the input is **existing code** and the deliverable is an FSL **design-layer** spec. The direction is the reverse of `fsl-design`: there is no upper requirements contract to refine to, so the spec is anchored **downward** — its faithfulness is proved by replaying the generated conformance harness against the very code it was read from. That conformance harness is this skill's **seam**: the downward analogue of a refinement seam, a contract checked against real code rather than against an upper spec. If the user later wants an upper requirements contract, building that *upward* refinement seam is `fsl-design`'s job, not this skill's. Before writing syntax, read `../fsl/SKILL.md` and `../fsl/reference.md` for the shared language rules, verifier workflow, and repair protocol. Inside this repository, study the canonical triple **in reverse**: `examples/e2e/impl/expense.py` (plain code) → `examples/e2e/3_design.fsl` (the spec) → `examples/e2e/impl/test_conformance.py` (the generated Adapter + random-walk Monitor). That triple is exactly the artifact this skill produces, read backwards. ## Boundary Produce only: - A design-layer kernel `spec` whose state/actions/guards/effects are read from the code, each tagged with a `// SRC: file:line` witness - Invariants and forbidden flows that the human **confirmed**, tagged with `// ASSUME-n:` ledger comments - The `fslc testgen` conformance harnes