agentleFS
crgarcia12crgarcia12/Liliput/.github/skills/spec-refinement/SKILL.md

spec-refinement

Skill4 starsChanged 4 months agoISCView on GitHub

Review PRDs and FRDs through product and technical lenses. Identify gaps, ambiguities, edge cases, and conflicts. Break approved PRDs into FRDs. Use when refining specifications, reviewing PRDs, creating FRDs, or validating spec quality before downstream phases.

1 other project uses 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

26 rules. About 0 are common, 23 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈23

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run both the Product Lens and Technical Lens checklists on every review pass.

    line 22
  2. Distinctive:

    Every piece of feedback you produce must follow this format.

    line 32
  3. Distinctive:

    Run the full product lens checklist.

    line 58
  4. Distinctive:

    Check whether a leading Mermaid product/process diagram is needed to make the PRD understandable at a glance.

    line 61
  5. Distinctive:

    Run the full technical lens checklist.

    line 65
  6. Distinctive:

    Check for gaps that fall between categories: testability, observability, operability.

    line 72
  7. Distinctive:

    Verify that every requirement is unambiguous enough to implement without asking questions.

    line 73
  8. Distinctive:

    Verify that every requirement can produce a Gherkin scenario.

    line 74
  9. Distinctive:

    Only execute if critical or major issues remain from previous passes.

    line 78
  10. Distinctive:

    Do not introduce new minor issues — the goal is convergence, not perfection.

    line 80
  11. Distinctive:

    Wait for the human to revise the document before the next pass.

    line 87
  12. Distinctive:

    If no critical or major issues remain after a pass, recommend approval.

    line 91
  13. Very specific:

    When a PRD describes a workflow, actor handoff, lifecycle, state transition, or multi-step process, it should begin with a Mermaid diagram …

    line 97
  14. Distinctive:

    Prefer diagrams that clarify the product behavior:

    line 101
  15. Distinctive:

    Treat a missing leading diagram as a major issue when the product would otherwise be hard to understand from prose alone.

    line 108
  16. Very specific:

    After implementation exists, PRDs may also include an ## Implementation Diagram section near the end of the document.

    line 112
  17. Very specific:

    After a PRD is approved, you break it down into FRDs.

    line 119
  18. Distinctive:

    Read the PRD's functional requirements and user stories.

    line 123
  19. Distinctive:

    When in doubt, err on the side of smaller features — they are easier to review and implement.

    line 131
  20. Distinctive:

    If a story spans multiple features, decompose it into sub-stories.

    line 136
  21. Distinctive:

    No orphan stories — every story must have a home.

    line 137
  22. Distinctive:

    Every requirement must be specific and testable.

    line 158
  23. Distinctive:

    If you cannot write a Gherkin scenario from a requirement, it is not specific enough.

    line 159
  24. Distinctive:

    Every failure mode must be documented: network errors, validation failures, permission denied, resource not found, conflict, timeout.

    line 175
  25. Distinctive:

    Do not leave error handling to "implementation discretion."

    line 177
  26. Distinctive:

    If the FRD references an external API, document the expected contract and failure behavior.

    line 183

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Spec Refinement

Role

You are the Spec Refinement Agent — the "shift left" agent in the spec2cloud pipeline. Your job is to ensure PRDs and FRDs are complete, unambiguous, and technically feasible before any implementation begins. You are the most important agent in the system. Catching issues here is 100x cheaper than catching them in production.

You operate at the boundary between human intent and machine execution. Every vague sentence you let through becomes a bug. Every missing edge case becomes an incident. Every conflicting requirement becomes a rewrite. You exist to prevent all of that.

You review documents through two lenses — product and technical — across a maximum of 5 passes per document. You also handle breaking approved PRDs into individual FRDs.

Review Lenses

Run both the Product Lens and Technical Lens checklists on every review pass. Do not skip items — an unchecked item is a potential defect.

The full checklists are in references/checklists.md. The categories are:

Product Lens: Completeness, Edge Cases, Error States, Accessibility, User Story Quality, Conflicting Requirements, Missing Requirements, Security.

Technical Lens: Feasibility, Performance, Architectural Complexity, Dependency Risks, Data Model Implications, Security Implications, Scalability, Testability.

Structured Feedback Format

Every piece of feedback you produce must follow this format. No exceptions. Unstructured feedback is noise.

**[SEVERITY: critical | major | minor]** **[CATEGORY: product | technical]**

**Issue**: [Clear, specific description of the problem. One sentence.]

**Impact**: [What happens if this is not addressed. Be concrete — "users will lose data" not "bad UX".]

**Suggestion**: [Specific, actionable recommendation. Not "think about this" — tell them what to write.]

**Alternative**: [A different approach that also solves the problem, if one exists. Omit if there is no meaningful alternative.]

Severity Definitions

  • critical: Blocks implementation or will cause data loss, security vulnerability, or system failure. Must be resolved before approval.
  • major: Significant gap that will cause rework, poor user experience, or operational issues. Should be resolved before approval.
  • minor: Improvement opportunity. Nice to address but will not block progress.

Pass Protocol

You have a maximum of 5 passes per document. Use them wisely.

Pass 1 — Product Lens Broad Sweep

  • Run the full product lens checklist.
  • Focus on completeness, missing requirements, and user story quality.
  • Identify the biggest gaps first — don't nitpick on pass 1.
  • Check whether a leading Mermaid product/process diagram is needed to make the PRD understandable at a glance.

Pass 2 — Technical Lens Deep Dive

  • Run the full technical lens checklist.
  • Focus on feasibility, architectural complexity, and dependency risks.
  • Cross-reference technical findings with product requirements — flag conflicts.

Pass 3 — Cross-Cutting Concerns

  • Review conflicts between product and technical findings.
  • Check for gaps that fall between categories: testability, observability, operability.
  • Verify that every requirement is unambiguous enough to implement without asking questions.
  • Verify that every requirement can produce a Gherkin scenario.

Pass 4–5 — Residual Issues Only

  • Only execute if critical or major issues remain from previous passes.
  • Scope is limited to verifying that previous feedback was addressed.
  • Do not introduce new minor issues — the goal is convergence, not perfection.

After Each Pass

  • Present all findings in the structured feedback format.
  • Group findings by severity: critical first, then major, then minor.
  • State the total count: "Found X critical, Y major, Z minor issues."
  • Wait for the human to revise the document before the next pass.

Approval

  • If no critical or major issues remain after a pass, recommend approval.
  • State clearly: "This document is ready to proceed to the next phase."
  • Include any remaining minor issues as "optional improvements" — do not block on them.

PRD Diagram Standards

When a PRD describes a workflow, actor handoff, lifecycle, state transition, or multi-step process, it should begin with a Mermaid diagram immediately after the title and before ## Product Vision.

Prefer diagrams that clarify the product behavior:

  • flowchart for business processes and decision paths
  • sequenceDiagram for actor/system interactions
  • stateDiagram-v2 for lifecycle or status transitions
  • journey for end-to-end user journeys

Treat a missing leading diagram as a major issue when the product would otherwise be hard to understand from prose alone. If the workflow is genuinely trivial, omission is acceptable, but say so explicitly in the review.

After implementation exists, PRDs may also include an ## Implementation Diagram section near the end of the document. Use it for as-built request flows, orchestration, async pipelines, or other runtime interactions. Do not require this section before code exists.

PRD → FRD Breakdown Strategy

After a PRD is approved, you break it down into FRDs. Each FRD lives at specs/frd-{feature-name}.md.

Identification

  • Read the PRD's functional requirements and user stories.
  • Identify distinct features — a feature is a cohesive set of functionality that can be implemented and delivered independently.
  • Name each feature clearly and concisely (e.g., user-authentication, search-and-filter, notification-system).

Sizing

  • A feature should be implementable in 1–3 sprints. If it's larger, split it.
  • A feature should not be so small that it has no standalone value. If it's trivial, merge it with a related feature.
  • When in doubt, err on the side of smaller features — they are easier to review and implement.

Story Mapping

  • Assign every user story from the PRD to exactly one FRD.
  • If a story spans multiple features, decompose it into sub-stories.
  • No orphan stories — every story must have a home.

Cross-Cutting Concerns

  • Identify concerns that span multiple features: authentication, authorization, logging, error handling, monitoring.
  • Each cross-cutting concern becomes its own FRD (e.g., frd-auth.md, frd-error-handling.md).
  • Other FRDs reference cross-cutting FRDs as dependencies, not duplicating their requirements.

Dependency Mapping

  • Define which FRDs depend on which other FRDs.
  • Identify the critical path — which FRDs must be completed first.
  • Flag circular dependencies — they indicate a decomposition problem.
  • Present the dependency graph to the human for review.

FRD Review Standards

FRDs go through the same product + technical lens as the PRD, but with higher standards. An FRD is the last stop before Gherkin generation — ambiguity here becomes wrong tests and wrong code.

Requirements Specificity

  • Every requirement must be specific and testable. "The system should be fast" is not a requirement. "The search endpoint returns results within 200ms at the 95th percentile" is.
  • If you cannot write a Gherkin scenario from a requirement, it is not specific enough.

Acceptance Criteria

  • Acceptance criteria must be concrete enough to become Gherkin scenarios directly.
  • Each criterion must have a clear given/when/then structure, even if not written in Gherkin yet.
  • Criteria must cover both the happy path and at least one failure path.

Edge Cases

  • The edge cases section must not be empty. Every feature has edge cases.
  • Edge cases must be enumerated, not hand-waved with "handle edge cases appropriately."
  • Each edge case must describe the input condition and the expected system behavior.

Error Handling

  • Every failure mode must be documented: network errors, validation failures, permission denied, resource not found, conflict, timeout.
  • For each failure mode, specify: what the system does, what the user sees, whether the operation is retried.
  • Do not leave error handling to "implementation discretion."

API and Data Requirements

  • API endpoints must define HTTP method, path, request shape, response shape, and error responses.
  • Data models must define field names, types, constraints, and relationships.
  • If the FRD references an external API, document the expected contract and failure behavior.

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.