원클릭으로
pb-writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation. Contains the reusable grilling loop and domain-modeling discipline.
Execute spec-driven implementation using Generator/Evaluator dual-agent loop with BDD+TDD double-loop verification. Use when implementing features from a design spec, running tasks from tasks.md, or building code with structured testing.
Use when you need to resolve an in-progress git merge/rebase conflict. Guides systematic resolution preserving both intents where possible.
Generate a complete feature design specification (design.md, tasks.md) and Gherkin scenarios from natural language requirements. Use when planning, designing, or scoping new features, refactors, or bug fixes for AI-driven implementation.
Build a throwaway prototype to answer a design question — a terminal app for state/logic questions, or several UI variations toggleable from one route. Use when the user wants to sanity-check whether a state model feels right, or explore what a UI should look like.
Two-axis review of the diff since a fixed point — Standards (does the code follow this repo's coding standards?) and Spec (does the code match what the originating issue/PRD asked for?). Runs both reviews in parallel subagents. Use when completing tasks, implementing major features, or before merging.
| name | pb-writing-skills |
| description | Use when creating new skills, editing existing skills, or verifying skills work before deployment |
Writing skills IS Test-Driven Development applied to process documentation.
You write test cases (pressure scenarios with subagents), watch them fail (baseline behavior), write the skill (documentation), watch tests pass (agents comply), and refactor (close loopholes).
Core principle: If you didn't watch an agent fail without the skill, you don't know if the skill teaches the right thing.
REQUIRED BACKGROUND: You MUST understand pb-test-driven-development before using this skill. That skill defines the fundamental RED-GREEN-REFACTOR cycle. This skill adapts TDD to documentation.
A skill is a reference guide for proven techniques, patterns, or tools. Skills help future agents find and apply effective approaches.
Skills are: Reusable techniques, patterns, tools, reference guides
Skills are NOT: Narratives about how you solved a problem once
Concrete method with steps to follow (condition-based-waiting, root-cause-tracing)
Way of thinking about problems (flatten-with-flags, test-invariants)
API docs, syntax guides, tool documentation (office docs)
| TDD Concept | Skill Creation |
|---|---|
| Test case | Pressure scenario with subagent |
| Production code | Skill document (SKILL.md) |
| Test fails (RED) | Agent violates rule without skill (baseline) |
| Test passes (GREEN) | Agent complies with skill present |
| Refactor | Close loopholes while maintaining compliance |
| Write test first | Run baseline scenario BEFORE writing skill |
| Watch it fail | Document exact rationalizations agent uses |
| Minimal code | Write skill addressing those specific violations |
| Watch it pass | Verify agent now complies |
| Refactor cycle | Find new rationalizations → plug → re-verify |
Create when:
Don't create for:
Frontmatter (YAML):
name and descriptionname: Use letters, numbers, and hyphens onlydescription: Third-person, describes ONLY when to use (NOT what it does)
---
name: Skill-Name-With-Hyphens
description: Use when [specific triggering conditions and symptoms]
---
# Skill Name
## Overview
What is this? Core principle in 1-2 sentences.
## When to Use
Bullet list with SYMPTOMS and use cases
When NOT to use
## Core Pattern (for techniques/patterns)
Before/after code comparison
## Quick Reference
Table or bullets for scanning common operations
## Implementation
Inline code for simple patterns
## Common Mistakes
What goes wrong + fixes
Critical for discovery: Future agents need to FIND your skill
Your agent reads the description to decide which skills to load. Make it answer: "Should I read this skill right now?"
Format: Start with "Use when..." to focus on triggering conditions
CRITICAL: Description = When to Use, NOT What the Skill Does
Testing revealed that when a description summarizes the skill's workflow, an agent may follow the description instead of reading the full skill content. A description saying "code review between tasks" caused an agent to do ONE review, even though the skill's flowchart clearly showed TWO reviews.
# BAD: Summarizes workflow - agents may follow this instead of reading skill
description: Use when executing plans - dispatches subagent per task with code review between tasks
# GOOD: Just triggering conditions, no workflow summary
description: Use when executing implementation plans with independent tasks in the current session
Content:
Use words an agent would search for:
Use active voice, verb-first:
creating-skills not skill-creationcondition-based-waiting not async-test-helpersProblem: Frequently-referenced skills load into EVERY conversation. Every token counts.
Target word counts:
Techniques:
Move details to tool help:
# BAD: Document all flags in SKILL.md
search-conversations supports --text, --both, --after DATE, --before DATE, --limit N
# GOOD: Reference --help
search-conversations supports multiple modes and filters. Run --help for details.
Use cross-references:
# BAD: Repeat workflow details
When searching, dispatch subagent with template...
[20 lines of repeated instructions]
## GOOD: Reference other skill
Always use subagents (50-100x context savings). REQUIRED: Use [other-skill-name] for workflow.
Eliminate redundancy:
Before writing guidance, classify the baseline failure. The form that bulletproofs one failure type measurably backfires on another.
| Baseline failure | Right form | Wrong form |
|---|---|---|
| Skips/violates a rule under pressure | Prohibition + rationalization table + red flags | Soft guidance ("prefer...", "consider...") |
| Complies, but output has the wrong shape | Positive recipe or contract: state what the output IS | Prohibition list ("don't restate", "never narrate") |
| Omits a required element from something they already produce | Structural: REQUIRED field or slot in the template | Prose reminders near the template |
| Behavior should depend on a condition | Conditional keyed to an observable predicate | Unconditional rule + exemption clauses |
Rules for whichever form you pick:
Skills that enforce discipline need to resist rationalization. Agents are smart and will find loopholes when under pressure.
Don't just state the rule - forbid specific workarounds:
Write code before test? Delete it. Start over.
**No exceptions:**
- Don't keep it as "reference"
- Don't "adapt" it while writing tests
- Don't look at it
- Delete means delete
Add foundational principle early:
**Violating the letter of the rules is violating the spirit of the rules.**
Capture rationalizations from baseline testing. Every excuse agents make goes in the table:
| Excuse | Reality |
|--------|---------|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "I'll test after" | Tests passing immediately prove nothing. |
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
Make it easy for agents to self-check when rationalizing:
## Red Flags - STOP and Start Over
- Code before test
- "I already manually tested it"
- "Tests after achieve the same purpose"
- "It's about spirit not ritual"
- "This is different because..."
**All of these mean: Delete code. Start over with TDD.**
Follow the TDD cycle:
Run pressure scenario with subagent WITHOUT the skill. Document exact behavior:
Write skill that addresses those specific rationalizations. Don't add extra content for hypothetical cases.
Run same scenarios WITH skill. Agent should now comply.
Agent found new rationalization? Add explicit counter. Re-test until bulletproof.
Full pressure-scenario runs are the final gate, but they are slow and expensive per iteration. Verify the wording itself first with micro-tests:
Micro-tests verify wording; they do not replace pressure scenarios for discipline skills.
Test with:
Success criteria: Agent follows rule under maximum pressure
Test with:
Success criteria: Agent successfully applies technique to new scenario
Test with:
Success criteria: Agent correctly identifies when/how to apply pattern
"In session 2025-10-03, we found empty projectDir caused..." Why bad: Too specific, not reusable
example-js.js, example-py.py, example-go.go Why bad: Mediocre quality, maintenance burden
step1 [label="import fs"];
step2 [label="read file"];
Why bad: Can't copy-paste, hard to read
helper1, helper2, step3, pattern4 Why bad: Labels should have semantic meaning
IMPORTANT: Create a todo for EACH checklist item. Deploy each skill before starting the next.
RED Phase - Write Failing Test:
GREEN Phase - Write Minimal Skill:
name and description fieldsREFACTOR Phase - Close Loopholes:
Quality Checks: