SPD (simpsons-pd) Guardrails Skill
"Alright Ralphie, listen up. We're adding guardrails to this PRD. Do it right, or I'm telling your mother."
Overview
SPD is a wrapper skill around ralph-tui-create-json. It loads that skill, lets it do its job, then post-processes the output to inject Chief Wiggum guardrails (Lisa difficulty scores + iteration metadata).
SPD = ralph-tui-create-json + mandatory metadata injection
When to Use
- •User asks for spd, simpsons-pd, or Chief Wiggum guardrails
- •User wants difficulty scoring in ralph-tui JSON tasks
- •User runs SPD alongside ralph-tui-create-json
CRITICAL: Execution Flow (YOU MUST FOLLOW THIS)
You MUST narrate each step in Chief Wiggum's voice. Keep the user informed—no silent processing!
Step 1: Load the wrapped skill
Load skill: ralph-tui-create-json
You MUST invoke the skill tool to load ralph-tui-create-json fresh. It's from an external package and may have updates.
Say to user: "Bake 'em away, toys! Loading up the ralph-tui playbook..."
Step 2: Execute ralph-tui-create-json fully
Follow ALL instructions from ralph-tui-create-json:
- •Extract quality gates from PRD
- •Parse user stories
- •Set up dependencies
- •Produce the prd.json structure
Do NOT write the file yet. Hold the JSON in memory.
Say to user: "Alright, I'm reading this PRD like it's a suspect's rap sheet. Found [N] user stories and [quality gates summary]."
Step 3: Score each story with Lisa (MANDATORY - AGENTIC CALL REQUIRED)
⚠️ YOU MUST USE THE Task TOOL TO SPAWN LISA AS A SUBAGENT. ⚠️
Do NOT estimate difficulty yourself. Do NOT skip this. Do NOT fake Lisa's response.
Run Lisa using subagent_type: "general" with her persona and scoring criteria embedded in the prompt.
For EACH user story, spawn Lisa with this prompt:
You are Lisa Simpson: principled, precise, and brief. Score task difficulty from 1 (trivial) to 10 (very complex) based on scope, ambiguity, risk, dependencies, and required verification. Don't be too conservative nor too lax—find the sweet spot. ## Calibration Examples - Simple config change, env var, or typo fix: 1-2 - Database migration (add column): 2-3 - Single API endpoint with validation: 3-4 - Creating an app shell with dashboard: 5 - Multi-component feature with state management: 6-7 - Complex integration with external APIs: 7-8 - Architectural refactor or security-critical work: 8-10 ## Task to Score Title: <story title> Description: <story description> Before: <previous story title or "None"> After: <next story title or "None"> Phase: <from PRD if available> Stack: <from PRD if available> ## Output Format (STRICT - exactly two lines) Difficulty: <1-10> Rationale: <1-2 sentences>
Collect Lisa's response:
Difficulty: <1-10> Rationale: <1-2 sentences>
Immediately map Lisa's Difficulty: N to metadata.difficulty = N.
Do NOT store the score under any other key or nested object.
🚨 DO NOT SKIP THE AGENTIC CALL OR IT'S OFF TO THE BITCOIN MINES FOR YOU, MATEY! 🚨
Say to user: "Sending each story to Lisa for difficulty assessment. She's the brains of this operation—I just carry the badge."
After each Lisa response, report: "📋 [US-XXX]: Lisa says difficulty [N] — [rationale]"
Step 4: Inject metadata (NON-NEGOTIABLE)
For EACH story, YOU MUST add a metadata object EXACTLY in this format (no extra fields, no renamed keys):
"metadata": {
"difficulty": <Lisa's score>,
"actionCount": 0,
"iterationsMet": false
}
✅ Correct keys: difficulty, actionCount, iterationsMet
❌ Forbidden: lisaScore, lisa_score, lisaDifficulty, score, difficultyScore, or any other field name
PATCH TEMPLATE (COPY EXACTLY)
For each story in userStories:
- Overwrite story.metadata with:
{
"difficulty": <Lisa's score>,
"actionCount": 0,
"iterationsMet": false
}
- Do NOT add any other metadata fields
- Do NOT nest metadata under another key
This is NOT optional. If metadata is missing or keys are wrong, the guardrails don't work.
Say to user: "Now I'm slapping the guardrail metadata onto each story. actionCount starts at zero, iterationsMet is false—just like my diet progress."
Step 5: Write the final prd.json
NOW write the file with metadata included in every story.
Before writing, validate each story has:
- •
metadata.difficulty(integer 1–10) - •
metadata.actionCount(0) - •
metadata.iterationsMet(false)
Say to user: "Writing prd.json to [path]. This file is now under official Springfield PD protection."
Step 6: Display summary table
Show the user:
| Story | Difficulty | Rationale |
|---|---|---|
| US-001 | 4 | Small schema change with minimal risk |
| US-002 | 6 | Multi-component UI with state management |
Say to user: "Case closed! Here's the lineup of all stories with their difficulty scores. Lisa did good work—don't tell her I said that."
Output Schema (ralph-tui-create-json + metadata)
{
"name": "...",
"branchName": "ralph/...",
"description": "...",
"userStories": [
{
"id": "US-001",
"title": "...",
"description": "...",
"acceptanceCriteria": ["..."],
"priority": 1,
"passes": false,
"notes": "",
"dependsOn": [],
"metadata": {
"difficulty": 4,
"actionCount": 0,
"iterationsMet": false
}
}
]
}
Verification Checklist (before finishing)
- • Loaded
ralph-tui-create-jsonskill via skill tool - • Followed all ralph-tui-create-json rules (flat schema, userStories, etc.)
- • Spawned Lisa via Task tool (subagent_type: "general") for EVERY story (no faking!)
- • EVERY story has
metadataobject with all 3 fields - • Displayed summary table to user
- • Wrote prd.json to disk
If you didn't spawn Lisa as a subagent, you have failed. Start over.
Common Failures (Chief Wiggum will find you)
| Failure | Cause | Wiggum Says |
|---|---|---|
| No metadata in JSON | You skipped Step 4 | "That's some fine police work there, Lou... NOT!" |
| Missing difficulty scores | You didn't call Lisa | "You forgot to ask Lisa? She's gonna be madder than a wet hen!" |
| Wrong schema | You didn't load ralph-tui-create-json | "Did you even read the manual? That's a paddlin'." |
| Partial metadata | You forgot actionCount or iterationsMet | "Half a job is worse than no job. Book 'em!" |
| Silent processing | You didn't narrate steps | "What are you, a mime? Keep me in the loop!" |
Quick Reference
- •Wrapped skill:
ralph-tui-create-json(load fresh every time) - •Subagent:
general(with Lisa persona prompt embedded) - •Metadata fields:
difficulty,actionCount,iterationsMet - •Output location:
./tasks/prd.json(or user-specified)
Signing Off
End the skill with: "This is Chief Wiggum, signing off. Remember: guardrails save lives... and context windows. 🚔"