agentleFS
aloiloraloilor/lean-coding-agent/skills/feature-specification/SKILL.md

feature-specification

Skill7 starsChanged 48 days agoMITView on GitHub

Write a client-reviewable FEAT-NNN Feature Specification for one software feature: user stories, scope, functional requirements, business rules, edge cases, Given/When/Then acceptance criteria, and open questions.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 15 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not force every requirement into "As a [user], I want…".

    line 20
  2. Distinctive:

    Read references/template.md before writing.

    line 24
  3. Distinctive:

    Read at least one example in references/examples/ that matches the variant you are writing:

    line 25
  4. Very specific:

    Look for existing FEAT-NNN IDs in the repository so the next ID is unique.

    line 36
  5. Very specific:

    Read docs/conventions/GLOSSARY.md or an equivalent glossary when present, and use the project's own names for roles, entities, and screens.

    line 37
  6. Distinctive:

    Otherwise, assess the feature: Write the full variant if any of these is true, because each one creates rules, permissions, or failure …

    line 47
  7. Distinctive:

    Still unsure?: Write the full variant; empty-feeling sections are a signal that something has not been thought through.

    line 57
  8. Distinctive:

    If the codebase or provided material answers it, use that answer.

    line 67
  9. Distinctive:

    If it blocks writing a coherent spec (who the actors are, what the core behavior is, what is in scope), ask the user.

    line 68
  10. Distinctive:

    Follow the template exactly.

    line 75
  11. Distinctive:

    Name things the way users see them: Use exact action labels, screen names, and role names.

    line 80
  12. Distinctive:

    Stay implementation-agnostic: No database tables, class names, or libraries unless the client explicitly requires a technology.

    line 84
  13. Distinctive:

    Every user story is realized by at least one FR.

    line 89
  14. Distinctive:

    Every FR is verified by at least one AC, or is explicitly covered by an NFR with a measurable target.

    line 90
  15. Distinctive:

    Every permission boundary and failure mode in the FRs, BRs, and ECs has a matching AC.

    line 91
  16. Distinctive:

    No vague adjectives remain without a measurable definition.

    line 92
  17. Distinctive:

    Every open question has a recommendation, a reason, and the affected IDs, and those IDs are written to match the recommendation.

    line 94

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Feature Specification

Produce one Feature Specification per feature: a document a client can review, developers can build against, and QA can test against. It defines what the feature must do, not how to implement it.

Concepts To Keep Distinct

  • A PRD explains why a product exists and covers many features. A Feature Specification covers exactly one feature and defines its behavior precisely. If the user hands you a PRD, split it and spec one feature at a time.
  • User Story — the need, from the user's perspective. Context for non-technical readers; too vague to build against alone.
  • Functional Requirement — exactly what the system must do.
  • Acceptance Criterion — how to prove the behavior works.

The chain User Stories → Functional Requirements → Acceptance Criteria is the spine of the document. Preserve it rigorously: the client understands the stories, developers build the requirements, QA verifies the criteria.

Do not force every requirement into "As a [user], I want…". Permissions, validation, audit logging, idempotency, concurrency, integrations, performance, and security read badly as stories; write them directly as FRs, business rules, or NFRs.

References

  • Read references/template.md before writing. It is the fixed template: section names, order, ID prefixes, and formatting are not negotiable.
  • Read at least one example in references/examples/ that matches the variant you are writing:
    • feat-004-export-invoice-pdf.md — full variant, UI feature with permissions and file output.
    • feat-001-user-registration.md — full variant, security-sensitive feature with requirements that are not user stories.
    • feat-012-order-shipped-push-notification.md — lean variant, small feature.

Process

1. Gather what exists

Collect the feature request, any PRD, ticket, mockup, or prior spec the user provides. When working inside a repository, also:

  • Look for existing FEAT-NNN IDs in the repository so the next ID is unique.
  • Read docs/conventions/GLOSSARY.md or an equivalent glossary when present, and use the project's own names for roles, entities, and screens.
  • Inspect relevant code only to ground terminology, existing permissions, and current behavior. Do not let implementation details leak into the spec.

2. Pick the variant

The lean variant keeps only Feature, Objective, User Stories, Scope, Out of Scope, Functional Requirements, Acceptance Criteria, and Open Questions. The full variant keeps every section.

Decide in this order:

  1. The user said. A request for a short, quick, lightweight, or one-page spec, or calling the feature small, means lean. A request for a detailed or complete spec means full. The user's word wins over your own assessment.
  2. Otherwise, assess the feature. Write the full variant if any of these is true, because each one creates rules, permissions, or failure modes that the omitted sections exist to capture:

    • different roles get different abilities, or the feature changes who can do what;
    • money is involved: payments, billing, pricing, refunds, seats;
    • authentication, account security, or an action that cannot be undone (deletion, cancellation, sending to a third party);
    • personal, health, or financial data is collected, exposed, or moved somewhere new, or a legal or compliance obligation applies;
    • an external system or another team's service must be integrated;
    • there is a lifecycle with states, scheduling or availability, or two people can act on the same thing at once;
    • you expect more than about 8 functional requirements.

    Otherwise write the lean variant: a single self-contained behavior on an existing screen or flow, reusing existing permissions and data.

  3. Still unsure? Write the full variant; empty-feeling sections are a signal that something has not been thought through.

Lean applies to the content as well as the section list: merge closely related requirements, cover each distinct behavior with one acceptance criterion rather than one per requirement, and aim for a spec that fits on one or two pages. When the user asked for lean but the feature trips one of the full-variant triggers, keep it lean anyway and raise the risk as an open question.

State the variant and the one-line reason in your report so the user can override it.

3. Resolve blocking unknowns

A specification is only valuable if it removes ambiguity, so do not invent business decisions and present them as agreed. For each unknown:

  • If the codebase or provided material answers it, use that answer.
  • If it blocks writing a coherent spec (who the actors are, what the core behavior is, what is in scope), ask the user. Batch these into one short message with your recommended answer for each.
  • Otherwise, make a reasonable choice and record it under Dependencies and Assumptions (in the lean variant, which lacks that section, list it in your report), or raise it under Open Questions when the client must decide.

Every open question carries a recommended answer, the reason for it, and the IDs it affects. Write the rest of the spec as if the recommendation is accepted, so the document is complete and buildable: the client either confirms the recommendation or picks something else, and only the listed IDs change. A bare question forces the client to design the answer themselves and leaves holes in the requirements.

4. Write the spec

Follow the template exactly. Writing rules:

  • One behavior per requirement. Split compound FRs so each can be accepted or rejected on its own.
  • Use normative language consistently. shall for mandatory behavior; should only for targets that may be missed without failing acceptance (typically NFRs); may for permitted but optional behavior.
  • Be concrete and measurable. Replace "fast", "user-friendly", "secure", "large" with numbers, formats, limits, and examples (e.g. invoice-{invoiceNumber}.pdf, "up to 1,000 line items", "within 3 seconds").
  • Name things the way users see them. Use exact action labels, screen names, and role names.
  • Make Out of Scope explicit. List what a reasonable reader might assume is included but is not. This is what prevents scope disputes later.
  • Write acceptance criteria in Given / When / Then. Cover the main success path, every permission boundary, each business-relevant edge case, and failure behavior. Reference FRs by ID when a criterion verifies a list or rule defined there.
  • Keep user stories to 1–5, near the top, for the people who matter most.
  • Stay implementation-agnostic. No database tables, class names, or libraries unless the client explicitly requires a technology; those belong in a technical plan.
  • Number IDs sequentially within each prefix (US-1, FR-1, BR-1, EC-1, AC-1, NFR-1, OQ-1) and never reuse or renumber IDs in a later version; mark removed items as (Removed in vX.Y) so version history stays traceable.

5. Self-check before delivering

  • Every user story is realized by at least one FR.
  • Every FR is verified by at least one AC, or is explicitly covered by an NFR with a measurable target.
  • Every permission boundary and failure mode in the FRs, BRs, and ECs has a matching AC.
  • No vague adjectives remain without a measurable definition.
  • Nothing in Scope contradicts Out of Scope.
  • Every open question has a recommendation, a reason, and the affected IDs, and those IDs are written to match the recommendation.
  • Status is Draft when Open Questions remain; Proposed only when the spec is ready for client review with no open questions.

6. Save and report

In a repository, save the specification at docs/specs/FEAT-NNN-<kebab-case-name>/FEAT-NNN-<kebab-case-name>.md, creating the feature directory as needed. Choose the next free FEAT-NNN unless the user supplies an ID. If you are not working in a repository, return the spec in the response.

Report the file path, the variant used and why, the assumptions you made, and any open questions the client should resolve, with your recommendation for each.

Updating An Existing Spec

Bump the version (1.0 → 1.1 for clarifications, 2.0 for scope changes), keep existing IDs stable, and reset Status to Draft or Proposed to reflect the current state of the updated specification.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.