agentleFS
allieraysallierays/agentic-loop/.claude/skills/prd-check/SKILL.md

prd-check

Skill38 starsChanged 9 months agoMITView on GitHub

Run PRD validation to check story quality, test coverage, and structure.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run PRD validation on demand to check story quality, test coverage, and structure before starting the autonomous loop.

    line 7
  2. Very specific:

    When the user runs /prd-check, validate their PRD file.

    line 11
  3. Distinctive:

    If no PRD exists, tell the user:

    line 19
  4. Distinctive:

    STOP: if no PRD found.

    line 22
  5. Distinctive:

    Read the project's accumulated knowledge:

    line 26
  6. Distinctive:

    Read suggested lessons (last 50 lines — file can be huge):

    line 33
  7. Distinctive:

    Read recent progress for failure patterns:

    line 38
  8. Very specific:

    Read .ralph/prd.json and for each story, check if any lesson applies:

    line 53
  9. Distinctive:

    Ask: "Would you like me to fix these issues in the PRD?"

    line 90
  10. Very specific:

    If yes, update .ralph/prd.json:

    line 94
  11. Very specific:

    Add missing lesson patterns to relevant story constraints or acceptanceCriteria

    line 95
  12. Distinctive:

    Write the fixed file back

    line 97
  13. Very specific:

    Run this before ralph run to catch and fix issues interactively

    line 105

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

PRD Check

Run PRD validation on demand to check story quality, test coverage, and structure before starting the autonomous loop. Cross-references against learned lessons and past failure patterns.

Instructions

When the user runs /prd-check, validate their PRD file.

Step 1: Check PRD Exists

ls -la .ralph/prd.json 2>/dev/null || echo "NOT_FOUND"

If no PRD exists, tell the user:

No PRD found at .ralph/prd.json. Generate one first with /prd.

STOP if no PRD found.

Step 2: Load Project Knowledge

Read the project's accumulated knowledge:

  1. Read lessons:
    cat .ralph/lessons.json 2>/dev/null
  2. Read suggested lessons (last 50 lines — file can be huge):
    tail -50 .ralph/suggested-lessons.txt 2>/dev/null
  3. Read recent progress for failure patterns:
    tail -100 .ralph/progress.txt 2>/dev/null

Step 3: Run Structural Validation (dry-run)

npx ralph prd-check --dry-run 2>&1

Present any structural issues found.

Step 4: Cross-Reference Against Lessons

Read .ralph/prd.json and for each story, check if any lesson applies:

  • Backend lessons → check against backend stories
  • Frontend lessons → check against frontend stories
  • General lessons → check against all stories

For each applicable lesson, verify the story's acceptanceCriteria, constraints, notes, or testSteps reflect the pattern. Flag stories that should account for a lesson but don't.

Examples:

  • Lesson: "Always use bcrypt cost 10+ for passwords" → Flag auth stories missing bcrypt in acceptanceCriteria
  • Lesson: "Use date-fns instead of moment.js" → Flag frontend stories that create date utilities without this constraint
  • Lesson: "Add data-testid for Playwright selectors" → Flag frontend stories missing this in constraints

Step 5: Check Against Suggested Learnings

Scan suggested-lessons.txt for patterns relevant to the current PRD's feature area. Flag any recurring failure patterns that the PRD's stories don't address.

Step 6: Present Results

Summarize all findings in categories:

Structural Issues (from prd-check):

  • [list]

Lesson Conflicts (stories that don't account for known patterns):

  • TASK-003: Missing lesson "bcrypt cost 10+" in auth story
  • TASK-005: Missing lesson "data-testid attributes" in frontend story

Suggested Improvements (from past learnings):

  • [relevant patterns from suggested-lessons.txt]

Ask: "Would you like me to fix these issues in the PRD?"

STOP and wait for user response.

If yes, update .ralph/prd.json:

  • Add missing lesson patterns to relevant story constraints or acceptanceCriteria
  • Fix structural issues per PRD best practices
  • Write the fixed file back

Notes

  • This is the same structural validation that runs automatically at ralph run startup
  • --dry-run skips auto-fix so you have control over what changes
  • Custom checks in .ralph/checks/prd/ are also evaluated
  • Lessons cross-referencing catches patterns that structural validation can't
  • Run this before ralph run to catch and fix issues interactively

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.