nfr-architect
npx skills add https://github.com/bcook797/agent-skills --skill nfr-architect
Agent 安装分布
Skill 文档
NFR Architect
Overview
NFR Architect guides teams through the full lifecycle of non-functional requirements: writing well-formed NFRs that satisfy the BINT criteria, translating them into SLOs and SLIs, and producing concrete fitness functions that turn requirements into executable tests.
Reference file references/nfr-guide.md for full definitions, translation patterns, template
code, and common pitfalls. Load it into context at the start of any session.
Workflow
Step 1 â Elicit and Validate NFRs (BINT Check)
When a user presents or describes an NFR, evaluate it against all four BINT criteria:
- Bounded â Is it scoped to a specific service, time window, and load condition?
- Independent â Does it stand alone without depending on another NFR?
- Negotiable â Is there an explicit business driver (KPI, SLA, risk) behind it?
- Testable â Does it have a quantified, automatable acceptance criterion?
If any criterion fails, rewrite the NFR using the anatomy pattern from the reference:
[Subject] shall [metric verb] [quantified threshold]
[during/within] [bounded context / time window]
[under] [defined load or condition]
Ask clarifying questions to fill any gaps:
- What service or component does this apply to?
- What is the load condition or time window?
- What business outcome breaks if this is violated?
- What is the measurement source (logs, APM, synthetic probe)?
Step 2 â Translate NFR â SLO + SLI
Once an NFR is valid, produce the corresponding SLO and SLI using the patterns in
references/nfr-guide.md (Performance, Availability, Resilience, Security / Structural).
For each NFR, output a table:
| Element | Value |
|---|---|
| NFR | Original statement |
| SLO | Internal target (stricter than SLA) |
| SLI formula | (good events / total events) Ã 100 or equivalent |
| Measurement source | Tool, query, or probe |
| Error budget | 1 â SLO headroom |
| Measurement window | Rolling 30-day / per-incident / etc. |
SLOs must always be equal to or stricter than the corresponding SLA. Flag any violation.
Step 3 â Generate Fitness Functions
Produce automatable fitness function code that enforces the SLO.
Choose the right tool based on NFR category:
| Category | Recommended Tools |
|---|---|
| Performance (latency/throughput) | k6, Gatling, Locust, JMeter |
| Availability | Synthetic probes, Datadog monitors, Pingdom |
| Architecture / structural | ArchUnit (Java), Dependency Cruiser (JS/TS), py-arch-rule (Python) |
| Resilience / recovery | Chaos engineering scripts, DR drill harnesses |
| Security | Snyk in CI, OWASP ZAP, Trivy |
For each fitness function, specify:
- File path â e.g.,
fitness-function/performance/checkout-slo.js - CI stage â where it runs (PR check, nightly, quarterly drill)
- Failure action â block deploy, alert on-call, fail PR
- Threshold values â wired directly from the SLO
Use the code templates in references/nfr-guide.md as starting points. Always wire thresholds
from the SLO statement â never use placeholder values.
Step 4 â Produce the NFR Document
Use the NFR Documentation Template from references/nfr-guide.md to produce a complete,
structured NFR record per requirement. Include:
- NFR statement
- Bounded context
- Acceptance criteria checklist
- SLO table
- SLI formula and measurement source
- Fitness function file reference
- Trade-off notes tied to the business driver
Core Rules
- Never accept an unbounded NFR (e.g., “shall be fast”). Always quantify.
- SLOs must be stricter than (or equal to) any corresponding SLA.
- Every NFR must have at least one fitness function. “Testable” is the most important BINT criterion.
- Fitness function thresholds must be derived from SLO values â no hardcoded magic numbers.
- Architecture NFRs (dependency constraints, layering rules) must produce ArchUnit / Dependency Cruiser tests committed to the codebase and run in CI.
Quick Reference
| Term | One-line definition |
|---|---|
| NFR | How well the system performs a quality attribute |
| BINT | Bounded, Independent, Negotiable, Testable |
| SLO | Internal measurable target, stricter than SLA |
| SLI | Actual measured value tracked against SLO |
| Error budget | Allowable failure headroom = 1 â SLO |
| Fitness function | Automated test that enforces an NFR/SLO |
For full examples, translation patterns, code templates, and common pitfalls, read
references/nfr-guide.md.