| name | infer-nfr-spec-from-code |
| description | Infer the NFR spec from scan-index.json during /codify by reading framework idioms, dependency manifests, deploy configs, and CI signals to reconstruct what non-functional requirements the shipped code already enforces — per-NFR target, delivery mechanism (named library / middleware / layer), and verification method — with every entry traced to concrete evidence paths. Used exclusively by tech-architect in the /codify play. |
| version | 0.1.0 |
| user-invocable | false |
| model | sonnet |
| allowed-tools | Read, Write, Grep, Glob |
| deprecated | true |
| deprecated_note | #434 ProductOS realignment — superseded by the command model; retained for Phase E reference, not installed |
infer-nfr-spec-from-code
Called by tech-architect during /codify AFTER infer-physical-architecture-from-code and infer-quality-profile-from-code (or the equivalent quality-profile proposal) have produced their artifacts. Produces architecture/nfr-spec.yaml at {stm_base}/{issue}/evidence/codify/proposals/architecture/nfr-spec.yaml.
Purpose
In greenfield /arch, derive-nfr-spec translates intake quality targets into a per-NFR contract — "what SHOULD the NFRs be". In brownfield /codify, the NFRs have already been implemented (partially or fully) as rate limiters, retries, health checks, auth middlewares, caches, tracing SDKs, and CI gates. This skill inverts the semantics: it reconstructs "what ARE the enforced NFRs" from the code that delivers them.
Every NFR entry in the output MUST name a specific mechanism delivering it (a library pin, a middleware at a named layer, a deploy-time configuration block) and a specific verification method (a test file pattern, a CI job, a monitor endpoint). NFR entries without both fields are not emitted as primary — they land as knowledge_gaps. Invented targets are forbidden: if no evidence signals a concrete target, the NFR class is recorded as a gap for the /codify checkpoint, never fabricated.
Grounding: every primary NFR traces to at least one scan-index path (dependency manifest, framework idiom match, deploy config, CI file, rg hit). Grounding is the boundary between inference and invention.
Input
Receive from tech-architect via JSON contract.
scan_index_path (path, required) — scan-index.json produced by scan-codebase.
related_proposal_paths (block, required):
quality_profile_path — prior architecture/quality-profile.yaml proposal from test-engineer in /codify.
physical_architecture_path — prior architecture/physical-architecture.yaml proposal.
logical_architecture_path — prior architecture/logical-architecture.yaml proposal.
stm_base (path, required) — STM root resolved from .garura/core/config.yaml stm.base-path.
issue (str, required) — issue number driving /codify.
output_path (path, required) — {stm_base}/{issue}/evidence/codify/proposals/architecture/nfr-spec.yaml.