Spec Generation — Single-Session spec.md from intent.md
Spec generation is the process of translating an accepted intent.md into a formal technical requirements and design document (spec.md). In the AI-native SDLC, requirements and design collapse into a single prompted session where the AI agent is strictly constrained by organizational policy skills (security, brand, compliance, and UX) to surface conflicting constraints before any code is written.
Scorecard question: How do you turn intent into technical specifications and requirements (spec.md)? Max‑score answer (3 pts): Single-session spec.md generated under brand/security/UX skills; flagged concerns resolved before build starts.
Why this matters in 2026
Section titled “Why this matters in 2026”In traditional organizations, requirements elicitation and architecture design are handled by separate teams in sequential handoffs. Analysts produce requirement specifications over weeks, and architects or designers spend weeks translating them into technical designs. This handoff introduces delay, loses original intent, and postpones security or compliance discovery to late review stages.
In an AI-native workflow, a product owner or tech lead runs a single prompted session that ingests intent.md and applies institutional policies encoded as skills (.claude/skills/, .cursor/skills/, .agents/skills/). The model drafts spec.md and highlights policy conflicts immediately, allowing teams to resolve tradeoffs before engineering implementation begins.
What “max score” actually looks like
Section titled “What “max score” actually looks like”A max-score Q5 setup demonstrates four key capabilities:
- Direct derivation: Every
spec.mdexplicitly traces back to a committedintent.md. - Policy enforcement via skills: The agent evaluates the feature against active security, UX, and compliance skills during drafting.
- Flagged concerns section: The agent isolates contradictions or unaddressed edge cases under a dedicated section for policy owners.
- Human sign-off: The product owner and a technical lead approve
spec.mdbefore plan mode or code generation starts.
Step-by-step implementation
Section titled “Step-by-step implementation”-
Verify policy skills are present.
Confirm your repository or global agent environment contains versioned skills for core policies:
- Security standards (e.g., authentication, data sanitization)
- UX and brand guidelines (e.g., design system tokens, responsive rules)
- Architectural standards (e.g., API schemas, database access rules)
-
Generate spec.md from intent.md.
Launch an agent session with your policy skills loaded. Provide
intent.mdand instruct the model to producespec.md:Switch to Plan mode (
Shift+Tab) and run:Read intent/FEATURE_SLUG.md. Apply our skills for security, brand, and UX.Generate spec/FEATURE_SLUG.md documenting functional requirements, APIcontracts, data models, and edge cases. Flag any policy contradictionsunder a Flagged Concerns section. Do not modify application code.Stay in Ask or Plan mode with
.cursor/skills/active:Analyze intent/FEATURE_SLUG.md against the rules and skills in our repo.Create spec/FEATURE_SLUG.md specifying endpoints, data models, and UI flows.Highlight any architectural or security conflicts for team review.Run in the Codex CLI using
/plan:/plan Read intent/FEATURE_SLUG.md and generate a comprehensive spec.md.Apply all policies from .agents/skills/. List unresolved tradeoffs underFlagged Concerns. -
Resolve flagged concerns.
Review the flagged concerns with relevant stakeholders (e.g., security engineer or design lead). Update constraints in
spec.mdbased on their decisions. -
Commit the completed spec.
Commit
spec/FEATURE_SLUG.mdalongside the correspondingintent.md:Terminal window git add spec/FEATURE_SLUG.mdgit commit -m "docs(spec): technical specification for FEATURE_SLUG" -
Approve before implementation.
Obtain explicit sign-off from the technical lead or product owner. This approval serves as the gateway to Stage 3: Build (
plan.md).
Common pitfalls
Section titled “Common pitfalls”- Skipping policy skills: Allowing the agent to draft a specification based on generic knowledge rather than project-specific security and brand constraints.
- Burying tradeoffs: Letting the agent make silent architectural choices without surfacing contradictions in a dedicated concerns section.
- Editing code during specification: Writing unit tests or scaffolding code before
spec.mdis approved, which wastes engineering time when requirements shift.
How to verify you’re there
Section titled “How to verify you’re there”spec.mdis committed and explicitly references its parentintent.md.- Flagged concerns are explicitly addressed with written rationale before the build phase starts.
- Elapsed time from
intent.mdcommit tospec.mdcommit is measured in hours. - Engineers implement from an approved specification without discovering missing architectural decisions.