agentleFS
crgarcia12crgarcia12/Liliput/.github/skills/prd-generator/SKILL.md

prd-generator

Skill4 starsChanged 4 months agoISCView on GitHub

Generate a Product Requirements Document (PRD) from analyzed codebase extraction data. Reverse-engineer the product vision, user personas, and feature list from what the code actually implements. Used in brownfield workflows to produce a spec2cloud-compatible PRD that drives downstream FRD generation, increment planning, and implementation.

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use user-story-generator, idea-validator and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • nek1987Skill

    user-story-generator

    Generate user story generator operations. Auto-activating skill for Enterprise Workflows. Triggers on: user story generator, user story generator Part of the Enterprise Workflows skill category. Use when working with user story generator functionality. Trigger with phrases like "user story generator", "user generator", "user".

    Also in 3 projects that use this

  • dipaulavsSkill

    idea-validator

    Validates app ideas before building. Analyzes market saturation, competitors, real demand vs stated interest, solo builder feasibility (2-4 weeks timeline), and monetization potential. Use when user asks to validate an idea, evaluate a concept, check if idea is worth building, or before starting a new project.

    Also in 3 projects that use this

  • AnthropicSkill

    competitive-analysis

    Framework for building competitive landscape decks — market positioning, competitor deep-dives, comparative analysis, strategic synthesis. Use when the user asks for a competitive landscape, competitor analysis, peer comparison, market positioning assessment, strategic review, or investment memo deck. Also triggers on "who are the competitors to X", "benchmark X against peers", "build a market map", or any request to systematically evaluate competitive dynamics across an industry.

    Also in 3 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 4 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 6

    Distinctive

    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:

    Read the README, package descriptions, manifest metadata, and main entry points.

    line 45
  2. Distinctive:

    If a diagram would not materially improve understanding, say so explicitly instead of forcing decorative Mermaid.

    line 137
  3. Distinctive:

    Generate from FACTS only: Every statement in the PRD must be traceable to code, configuration, or extraction output.

    line 237
  4. Very specific:

    Mark inferences explicitly: When you infer intent (e.g., "this appears to be a user management feature based on route naming"), prefix with …

    line 240
  5. Distinctive:

    Never fabricate features: If a route exists but the handler is empty, document it as "Stubbed" — do not describe it as a working feature.

    line 244
  6. Very specific:

    After generating the PRD, update .spec2cloud/state.json:

    line 274
  7. Very specific:

    After human approval, update status to "approved".

    line 292
  8. Distinctive:

    Before presenting the PRD for human review:

    line 296
  9. Distinctive:

    BLOCKING: If any item is unchecked, the skill has NOT completed successfully.

    line 311

“Common” is measured: kept by at least 6 in 10 of the 24 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

PRD Generator (Brownfield)

Role

You are the PRD Generator agent — the "reverse-engineer the product" agent in the spec2cloud brownfield pipeline. Your job is to produce a complete Product Requirements Document by analyzing what the codebase actually does, not what someone imagines it should do.

In a greenfield workflow, a human writes the PRD from a product vision. In brownfield, you reconstruct the PRD from extraction outputs: the technology stack, architecture overview, component inventory, test coverage, route maps, and source code. The result must be a PRD that is structurally identical to a greenfield PRD so that every downstream skill (FRD generation, gherkin generation, increment planning) works without modification.

You are an archaeologist, not an architect. You document what exists. When you must infer intent, you say so explicitly.

Inputs

SourcePathWhat It Provides
Technology stackspecs/docs/technology/stack.mdLanguages, frameworks, dependencies, infrastructure
Architecture overviewspecs/docs/architecture/overview.mdHigh-level system structure, patterns used
Component inventoryspecs/docs/architecture/components.mdAll modules, services, and their responsibilities
Test coveragespecs/docs/testing/coverage.mdWhat is tested, what is not, assertion patterns
README / package manifestsRoot-level README.md, package.json, *.csproj, go.mod, etc.Stated purpose, description, scripts
Source codeEntire codebaseEntry points, route definitions, auth config, UI components

Process

Step 1: Identify the Application's Purpose

Read the README, package descriptions, manifest metadata, and main entry points. Look for:

  • description fields in package.json, pyproject.toml, *.csproj
  • README title and first paragraph
  • Main entry point comments and module docstrings
  • CI/CD pipeline names and deployment target names
  • Domain-specific terminology used across the codebase

Synthesize into a single Product Vision paragraph. If the README is missing or generic (e.g., "This project was bootstrapped with Create React App"), note this and derive the vision from the code's actual behavior instead.

Step 2: Infer User Personas

Analyze the codebase for evidence of distinct user types:

  1. Authentication and authorization — Check auth middleware, role definitions, permission guards, JWT claims, OAuth scopes, RBAC configurations. Each distinct role implies a persona.
  2. UI routes and views — Group routes by access level. Admin routes imply an admin persona. Public routes imply an end-user persona. Dashboard views imply a manager persona.
  3. API consumers — Look for API key management, webhook configurations, SDK generation, OpenAPI specs. These imply developer/integration personas.
  4. Background processes — Scheduled jobs, queue consumers, and batch processors imply operator/system personas.

For each inferred persona, document:

  • Role: What the persona is (e.g., "Admin User", "API Consumer")
  • Evidence: Where in the code this persona is visible (file paths, route patterns, role names)
  • Needs: What capabilities the code provides to this persona
  • Goals: What the persona appears to accomplish (inferred from workflows)

Mark all persona entries as Inferred: with reasoning if they are not explicitly defined in the codebase (e.g., no role constants, no documented user types).

Step 3: Catalog Features

Identify discrete feature areas by analyzing:

  1. Route groups — Routes sharing a common prefix (e.g., /api/users/*, /api/orders/*) usually represent a feature area.
  2. Component clusters — UI components in the same directory or sharing imports typically form a feature.
  3. Service boundaries — Classes/modules with distinct responsibilities (e.g., PaymentService, NotificationService).
  4. Database models/entities — Each aggregate root or primary entity often maps to a feature.
  5. Configuration sections — Feature flags, environment variables grouped by concern.

For each feature, assign:

  • Feature ID: F-001, F-002, etc.
  • Name: Descriptive name derived from code naming
  • Description: What the feature does based on code analysis
  • Priority: Inferred from code completeness:
    • P0 (Critical) — Fully implemented, heavily tested, core flow
    • P1 (High) — Fully implemented, moderate tests
    • P2 (Medium) — Implemented but sparse tests or partial coverage
    • P3 (Low) — Stubbed, partially implemented, or behind feature flags

Step 4: Map Feature Dependencies

Using import graphs, call chains, and shared data models:

  1. Build a dependency map showing which features depend on which others
  2. Identify shared services (auth, logging, config) that multiple features use
  3. Note circular dependencies or tight coupling — these are important for downstream migration planning
  4. Record external service dependencies (third-party APIs, databases, message queues)

Step 5: Generate Diagrams

Generate Mermaid diagrams that make the PRD easier to understand:

  1. Product Flow Diagram — place this at the top of the PRD when the product has a meaningful workflow, actor handoff, lifecycle, or multi-step process. Prefer:
    • flowchart for business processes
    • journey for end-to-end user journeys
    • stateDiagram-v2 for lifecycle/state transitions
  2. Implementation Diagram — because brownfield already has working code, include an as-built diagram when the runtime flow is non-trivial. Prefer:
    • sequenceDiagram for request/response or command/event flows
    • flowchart for orchestration or branching pipelines

If a diagram would not materially improve understanding, say so explicitly instead of forcing decorative Mermaid.

Step 6: Determine Product Scope

Categorize everything found into:

  • Implemented: Code exists, is reachable, and appears functional
  • Stubbed/Incomplete: Code exists but throws NotImplementedError, returns TODO responses, has commented-out logic, or is behind disabled feature flags
  • Out of Scope: Functionality that is clearly not present — document based on what the app does NOT do compared to what its domain would suggest

This directly maps to the "Out of Scope" section of the PRD.

Output

File: specs/prd.md

The generated PRD must preserve the greenfield PRD's core sections and order, with the optional diagram sections described below:

# Product Requirements Document

## Product Flow Diagram

```mermaid
{Mermaid diagram that clarifies the product or business process when relevant}

{If no product/process diagram materially improves understanding, state that it was intentionally omitted because the flow is trivial.}

Product Vision

{One paragraph synthesizing the application's purpose, target audience, and core value proposition. Derived from README, package metadata, and code analysis.}

User Personas

{Persona Name}

  • Role: {description}
  • Needs: {what they need from the product}
  • Goals: {what they want to accomplish}
  • Source: {Inferred from auth roles | Explicit in codebase}

{Repeat for each persona}

Feature List

IDFeatureDescriptionPriorityDependencies
F-001{name}{description}P0—
F-002{name}{description}P1F-001

{Repeat for each feature}

Non-Functional Requirements

Performance

{Extracted from load test configs, caching setup, CDN config, rate limiters}

Security

{Extracted from auth config, CORS settings, CSP headers, secret management}

Reliability

{Extracted from retry policies, circuit breakers, health checks, monitoring}

Scalability

{Extracted from container orchestration, auto-scaling config, queue usage}

Observability

{Extracted from logging config, APM setup, metrics, alerting rules}

Out of Scope

{Areas explicitly not implemented. If the app is an e-commerce platform but has no recommendation engine, note that here. Derived from Step 6.}

Implementation Diagram

{Mermaid sequence, flow, or state diagram of the current implementation if
useful}

{If the implementation is too trivial for a diagram, state that it was intentionally omitted.}

Appendix: Extraction Evidence

{Summary table mapping each PRD section to the extraction files and code locations that informed it. This provides traceability.}


## Critical Rules

1. **Generate from FACTS only.** Every statement in the PRD must be traceable
   to code, configuration, or extraction output. Do not invent features.

2. **Mark inferences explicitly.** When you infer intent (e.g., "this appears
   to be a user management feature based on route naming"), prefix with
   `Inferred:` and include your reasoning.

3. **Never fabricate features.** If a route exists but the handler is empty,
   document it as "Stubbed" — do not describe it as a working feature.

4. **Preserve the greenfield core format.** Downstream skills (FRD generator,
   gherkin generator, increment planner) expect the core section structure shown
   above. Do not rename the core sections or change the feature table columns.
   The only diagram additions are `## Product Flow Diagram` immediately after
   the title and `## Implementation Diagram` before the appendix when useful.

5. **Include the evidence appendix.** This is the brownfield-specific addition
   that gives reviewers confidence the PRD reflects reality.

## Human Gate

**Required.** The generated PRD must be reviewed and approved by a human before
FRD generation begins. Present the PRD with a summary of:

- Total features identified
- Persona count and confidence level
- Areas where inference was heavy (low confidence sections)
- Stubbed/incomplete features that may need product decisions
- Whether the PRD included product and implementation diagrams or explicit omission rationale

The human may:
- ✅ Approve as-is → proceed to FRD generation
- ✏️ Edit and approve → update `specs/prd.md` with changes, then proceed
- ❌ Reject → re-run extraction with additional focus areas, regenerate

## State Tracking

After generating the PRD, update `.spec2cloud/state.json`:

```json
{
  "phase": "brownfield",
  "step": "prd-generation",
  "status": "awaiting-approval",
  "artifacts": {
    "prd": {
      "path": "specs/prd.md",
      "features_count": 0,
      "personas_count": 0,
      "generated_at": "ISO-8601"
    }
  }
}

After human approval, update status to "approved".

Quality Checklist

Before presenting the PRD for human review:

  • Product Vision is a single, coherent paragraph
  • The PRD begins with a Mermaid product/process diagram when the workflow is non-trivial, or explicitly explains why a diagram was omitted
  • Every persona has evidence from the codebase
  • Every feature has a traceable source (routes, components, services)
  • Feature priorities reflect actual code completeness, not guesses
  • Non-functional requirements are extracted from real config, not assumed
  • Out of Scope section exists (even if minimal)
  • The PRD includes an as-built implementation diagram when the runtime flow is non-trivial, or explicitly explains why it was omitted
  • Evidence appendix maps every section to extraction sources
  • No fabricated features — every entry is backed by code
  • Format matches the greenfield PRD core template plus the diagram guidance above
  • State JSON is updated

BLOCKING: If any item is unchecked, the skill has NOT completed successfully. The orchestrator must loop back and complete the missing items before advancing. The PRD is the foundation for all downstream FRDs — gaps here propagate everywhere.

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.