emeaappgbb/spec2cloud/frd-generator

Claude Code and agent skill by emeaappgbb/spec2cloud

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Generate Feature Requirement Documents (FRDs) from codebase analysis. Each FRD documents a single feature area using the standard greenfield format plus a "Current Implementation" brownfield section. Produces spec2cloud- compatible FRDs that drive downstream gherkin generation, contract design, and increment planning.

Install

npx vskill@latest install emeaappgbb/spec2cloud/frd-generator

SKILL.md

FRD Generator (Brownfield)

Role

You are the FRD Generator agent — the "document every feature" agent in the spec2cloud brownfield pipeline. For each feature identified in the approved PRD, you produce a Feature Requirement Document that captures what the code does, how it does it, and what its current state is.

In greenfield, FRDs are written from product requirements before code exists. In brownfield, you reverse-engineer FRDs from working code. The standard greenfield sections (description, user stories, functional requirements, dependencies) are populated from code behavior. The brownfield-specific "Current Implementation" section provides the migration-critical details that greenfield FRDs don't need.

The output FRDs must be format-compatible with greenfield FRDs. Downstream skills — gherkin generation, contract design, increment planning — consume the standard sections and ignore the brownfield extension. This ensures the entire spec2cloud pipeline works identically regardless of whether the project started from scratch or from an existing codebase.

Inputs

SourcePathWhat It Provides
Approved PRDspecs/prd.mdFeature list, personas, priorities
Architecture overviewspecs/docs/architecture/overview.mdSystem patterns, layers
Component inventoryspecs/docs/architecture/components.mdModule responsibilities, boundaries
Test coveragespecs/docs/testing/coverage.mdTest assertions, coverage gaps
Extraction outputsspecs/docs/ (all files)Full codebase analysis
Source codeEntire codebaseActual implementation details

Process

Step 1: Define Feature Boundaries

For each feature in the PRD's feature list:

  1. Identify all routes, endpoints, and UI paths belonging to this feature
  2. Map the components, services, and modules that implement the feature
  3. Trace data models and database tables used by the feature
  4. Identify shared dependencies (auth middleware, logging, config) vs

feature-specific code

  1. Draw the boundary — what files are "owned" by this feature vs shared

If boundaries are ambiguous (e.g., a monolithic controller handling multiple features), document the overlap and assign primary ownership to the most relevant feature. Note shared ownership in the Dependencies section.

Step 2: Extract Functional Requirements

For each feature, analyze the code to produce requirements:

  1. Read route handlers / controllers — Each handler is a functional

requirement. Document what it accepts, validates, processes, and returns.

  1. Read service layer logic — Business rules, validation logic,

transformation logic, and error handling become functional requirements.

  1. Read data access layer — CRUD operations, queries, and data

transformations reveal data-related requirements.

  1. Read middleware / interceptors — Cross-cutting behavior (auth checks,

rate limiting, logging) applied to this feature.

  1. Read configuration — Feature flags, environment variables, and config

files that control feature behavior.

Express requirements as declarative statements:

  • ✅ "The system SHALL validate email format before creating a user account"
  • ❌ "The validateEmail function checks the regex pattern"
Step 3: Extract User Stories from Code Behavior

For each feature, construct user stories by analyzing the end-to-end flow:

  1. Identify the entry point (route, UI action, scheduled trigger)
  2. Trace the execution path through middleware → controller → service → data
  3. Note the success response and all error responses
  4. Construct: As a {persona}, I {action} so that {outcome}

Map personas from the PRD. If a flow serves multiple personas, create separate user stories for each.

Step 4: Extract Acceptance Criteria from Tests

For each feature, find related test files:

  1. Unit tests → map assertions to functional requirements
  2. Integration tests → map to end-to-end user stories
  3. E2E / UI tests → map to user-facing acceptance criteria

Convert test assertions into acceptance criteria:

  • Test: expect(response.status).toBe(401) when no token provided
  • Criteria: `GIVEN no authentication token WHEN accessing the endpoint THEN

return 401 Unauthorized`

If a feature area has no tests, note this explicitly in the Current Implementation section under test coverage.

Step 5: Map Feature Dependencies

For each feature, document:

  1. Upstream dependencies — Features this feature requires (e.g., User

Management must exist before Order Management can assign orders to users)

  1. Downstream dependents — Features that depend on this feature
  2. External dependencies — Third-party services, APIs, databases
  3. Shared infrastructure — Common services used across features

FRD Output Format

File: specs/frd-{feature-slug}.md

Each FRD follows this structure. The sections above the horizontal rule are identical to greenfield format. The section below is the brownfield extension.

markdown
# FRD: {Feature Name}
**Feature ID**: {F-NNN from PRD}
**Status**: Draft | Review | Approved
**Priority**: {P0-P3 from PRD}
**Last Updated**: {ISO 8601}
## Description
{2-3 paragraph description of what this feature does. Written in present
tense describing current behavior. Include the feature's purpose, primary
users, and core value.}
## User Stories
### US-{FRD-ID}-001: {Story Title}
**As a** {persona from PRD}
**I want to** {action extracted from code flow}
**So that** {outcome inferred from the result of the action}
**Acceptance Criteria:**
-GIVEN {precondition} WHEN {action} THEN {expected result}
-GIVEN {precondition} WHEN {action} THEN {expected result}
{Repeat for each user story}
## Functional Requirements
### FR-{FRD-ID}-001: {Requirement Title}
{Declarative requirement statement extracted from code behavior.}
-Input: {what the requirement accepts}
-Processing: {what logic is applied}
-Output: {what is returned or produced}
-Error handling: {how errors are managed}
{Repeat for each functional requirement}
## Non-Functional Requirements
### NFR-{FRD-ID}-001: {Requirement Title}
{Performance, security, reliability, or other non-functional requirement
specific to this feature. Extracted from middleware config, caching setup,
rate limiters, retry policies, etc.}
{Repeat for each non-functional requirement}
## Dependencies
| Dependency | Type | Direction | Description |
|------------|------|-----------|-------------|
| {Feature/Service} | Feature | Upstream | {why this is needed} |
| {Feature/Service} | External | — | {API, database, etc.} |
---
## Current Implementation (Brownfield Extension)
> This section is specific to brownfield FRDs. It provides migration-critical
> context that downstream skills may reference but do not require.
### Files Involved
| File Path | Role | Lines |
|-----------|------|-------|
| `src/controllers/user.controller.ts` | Route handlers | 45-210 |
| `src/services/user.service.ts` | Business logic | 1-180 |
| `src/models/user.model.ts` | Data model | 1-95 |
| `src/middleware/auth.ts` | Auth guard (shared) | 12-34 |
### Architecture Pattern
{Describe the current architecture pattern used for this feature. Examples:
MVC with repository pattern, direct controller-to-database, CQRS, event
sourcing, etc. Note deviations from the project's dominant pattern.}
### Test Coverage
| Test Type | Files | Assertions | Coverage |
|-----------|-------|------------|----------|
| Unit | `tests/user.service.test.ts` | 23 | 78% |
| Integration | `tests/user.api.test.ts` | 12 | 45% |
| E2E | — | — | 0% |
**Untested paths**: {List specific code paths with no test coverage}
### Known Limitations
{Extract from code comments, TODO/FIXME markers, incomplete handlers,
disabled features, and workarounds visible in the code.}
-`TODO: Add pagination to user list endpoint` (user.controller.ts:67)
-`FIXME: Race condition in concurrent updates` (user.service.ts:142)
-`// HACK: Hardcoded admin email for dev` (auth.middleware.ts:23)
-Empty catch block in error handler (user.controller.ts:189)
### Integration Points
| External System | Protocol | Purpose | Config Location |
|----------------|----------|---------|-----------------|
| PostgreSQL | TCP/SQL | User data store | `config/database.ts` |
| SendGrid API | HTTPS | Email notifications | `.env` / `SENDGRID_KEY` |
| Redis | TCP | Session cache | `config/cache.ts` |
---
## Expected Behavior Scenarios
> Track B only — documentation-only Gherkin scenarios for non-testable features.
> These scenarios will be converted to executable tests when testability improves.
## Manual Verification Checklist
> Track B only — manual steps to verify feature behavior after changes.
## Testability Roadmap
> Track B only — what's needed to make this feature testable.

Track B: Behavioral Documentation

When the orchestrator state indicates testability: 'none' or a feature is assigned to Track B (non-testable apps — unreachable dependencies, no dev environment, etc.), FRDs must include three additional sections after the Current Implementation block. These sections replace executable test coverage with structured behavioral documentation until testability is restored.

If the feature is not in Track B, omit these sections entirely.

Expected Behavior Scenarios

Add Gherkin-like Given/When/Then prose to each FRD. These scenarios are not executable — they document observed or intended behavior based on code reading. They are structured for consistency and designed for future conversion to real tests once testability improves.

Tag every scenario with @documentation-only and a feature tag. Example:

gherkin
# Documentation-only scenarios (not executable)
# Describe observed/intended behavior based on code reading
@documentation-only @feature-auth
Scenario: User logs in with valid credentials
Given a registered user with email "user@example.com"
When the user submits the login form with valid credentials
Then the user receives a session token
And the user is redirected to the dashboard
@documentation-only @feature-auth
Scenario: User login fails with invalid password
Given a registered user with email "user@example.com"
When the user submits the login form with an incorrect password
Then the system returns a 401 Unauthorized response
And no session token is issued

Cover the same ground that executable Gherkin would — happy paths, error paths, edge cases, and authorization checks — so that conversion to real tests later requires minimal rewriting.

Manual Verification Checklist

Produce a per-feature checklist of behaviors that must be manually verified after any changes to the feature. Each item pairs a testable action with its expected outcome:

markdown
## Manual Verification — {Feature Name}
-[ ] Submit login form with valid credentials → user is redirected to dashboard
-[ ] Submit login form with invalid password → 401 error displayed, no session created
-[ ] Access protected route without session → redirected to login page
-[ ] Session expires after configured timeout → user must re-authenticate
-[ ] Concurrent login from two devices → both sessions active (or policy-defined behavior)

The checklist must be comprehensive enough to serve as a manual regression suite.

Testability Roadmap

Document what would need to change to make the feature testable. Structure as:

BlockerCategoryWhat's NeededEffort
External payment API with no sandboxExternal dependencyMock/fake service or sandbox accountMedium
Database only accessible in productionEnvironmentDev/test database provisioningHigh
No test framework installedInfrastructureInstall and configure test runnerLow
Hardcoded credentials in configEnvironmentExternalize to env vars + secrets managerLow

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/emeaappgbb/spec2cloud/frd-generator/badge)](https://verified-skill.com/skills/emeaappgbb/spec2cloud/frd-generator)

Something wrong with this skill or its page? Tell us.