plugins/yx/skills/prepare/SKILL.md
Prepare a yak for implementation by establishing spec, acceptance criteria, and breaking into sub-yaks
npx skillsauth add mattwynne/yaks prepareInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You're helping prepare a yak for implementation. This is the bridge between mapping (lightweight structure) and working (hands-on implementation).
Arguments: $ARGUMENTS — the yak name to prepare, or empty to prompt the user.
Goal: Transform a yak from an idea into a well-specified piece of work ready for zero-context implementation.
Related skills:
/yx:map — for lightweight initial structure and exploration/yx:work — for implementation after preparation is completeWorkflow reference: See ../docs/yak-workflow.dot for the overall yak lifecycle.
Before doing anything else, understand what you're working with:
# Show the yak details
yx show "$ARGUMENTS"
# See the context around it
yx ls
# Check parent and sibling yaks for context
If you need to explore the codebase (understand existing code, find relevant files, assess complexity):
Ask: Does the user want to answer questions now, or should you gather more context first?
If the yak has a @needs-human tag:
yx show "$ARGUMENTS" --format json | jq -r '.tags[]'
Surface it: "This yak has an open question in its context: [question]. Want to answer now, or should I prepare a different yak?"
If answered, remove the tag:
yx untag "$ARGUMENTS" @needs-human
Before making any changes or additions:
yx start "$ARGUMENTS"
This marks the yak as WIP and creates a worktree if you'll be editing code.
Collaborate with the user to establish:
For refactorings: Capture the "why" — what motivated this change? What will it make easier?
Store as yak context:
yx context "$ARGUMENTS" <<'EOF'
# Spec: [yak name]
## Goal
[What we're achieving]
## Scope
- In scope: ...
- Out of scope: ...
## Key Decisions
- [Decision 1 and rationale]
- [Decision 2 and rationale]
## Why
[The problem this solves, the value it creates]
EOF
Confirm with user: "Does this spec capture what you want? Anything to add or change?"
Help the team define how they'll know it's done.
Encourage teams to use their own approach:
Suggest automated tests if appropriate, but don't mandate a specific technique. The goal is clarity on "done", not prescribing implementation practices.
Add to context:
## Acceptance Criteria
- [ ] [Criterion 1]
- [ ] [Criterion 2]
- [ ] [Criterion 3]
Or:
## Definition of Done
- Tests pass for X, Y, Z scenarios
- Documentation updated
- Code review completed
Confirm: "Do these acceptance criteria capture what 'done' looks like?"
When to break down:
When NOT to break down:
If breaking down:
Always run yx ls after every yx add to verify the structure.
# Add sub-yak
yx add "[parent name]" "[sub-yak name]"
# IMMEDIATELY verify
yx ls
# Repeat for each sub-yak
Each sub-yak needs enough detail for zero-context implementation:
# [Sub-yak name]
## Goal
[One sentence: what this sub-yak achieves]
## Files to Change
- `path/to/file.ts` — [what changes]
- `path/to/test.ts` — [what tests to add]
## Acceptance Criteria
- [ ] [Specific criterion 1]
- [ ] [Specific criterion 2]
## Implementation Notes
- [Key detail 1]
- [Key detail 2]
- [Any gotchas or edge cases]
## Dependencies
- [What needs to be done first, if anything]
Write context for each sub-yak:
yx context "[parent name] / [sub-yak name]" <<'EOF'
[Detailed context as above]
EOF
Ordering sub-yaks:
yx reorder "[parent]" [child-id] [position] if neededIf preparation reveals questions only the human can answer:
yx tag "$ARGUMENTS" @needs-human
yx context "$ARGUMENTS" <<'EOF'
[Existing context]
## Open Questions
- [ ] [Question for the human]
EOF
If they answer, update the context and remove the tag.
If they want to defer, that's fine — the tag ensures it won't be forgotten.
Before finishing:
Review with user:
Mark ready if complete:
yx tag "$ARGUMENTS" @ready
User: Prepare "fix password reset email"
You:
1. Read the yak and surrounding context
2. Start the yak: `yx start "fix password reset email"`
3. "Let's brainstorm the spec. What's broken with the email currently?"
4. Discuss with user, write spec to context
5. "How will we know it's fixed? Should we add tests?"
6. Add acceptance criteria to context
7. "This feels like a single piece of work. Ready to implement?"
User: Prepare "add OAuth support"
You:
1. Read the yak: `yx show "add OAuth support"`
2. Delegate codebase exploration to subagent: "Understand current auth implementation"
3. Start: `yx start "add OAuth support"`
4. "Let's spec this out. Which OAuth providers? What's the user experience?"
5. Discuss, write spec to context
6. "This feels big. I'm thinking we break it into:
- Configure OAuth providers
- Add OAuth login UI
- Handle OAuth callbacks
- Link OAuth accounts to existing users
Does that make sense?"
7. User confirms
8. Iron Law: `yx add` then `yx ls` for each sub-yak
9. Write detailed context for each sub-yak
10. "These sub-yaks should be ready for zero-context implementation. Look good?"
User: Prepare "refactor user model"
You:
1. Check: `yx show "refactor user model"`
2. Notice @needs-human tag
3. Read context, find question: "Should we migrate existing data or maintain backwards compatibility?"
4. "This yak has an open question: [question]. Want to answer now, or should I prepare a different yak?"
5. If answered: remove tag, continue preparation
6. If deferred: acknowledge, ask if they want to prepare something else
Bad sub-yak context:
# Update API
- Change the API
Good sub-yak context:
# Add pagination to user listing endpoint
## Goal
Add limit/offset pagination to GET /users endpoint
## Files to Change
- `src/api/users.ts` — add limit/offset params, modify query
- `src/api/users.test.ts` — test pagination behavior
## Acceptance Criteria
- [ ] Endpoint accepts `limit` and `offset` query params
- [ ] Returns paginated results
- [ ] Returns total count in response header
- [ ] Tests cover edge cases (invalid params, empty results)
Always run yx ls after yx add to verify structure.
A well-prepared yak has:
After preparation:
/yx:work to implement/yx:map to explore structure firsttesting
Use when writing or reviewing Gherkin features, especially after discovering examples or edge cases that reveal a new business rule
databases
Use when running yx commands that create, modify, or delete yaks outside of real project work — provides an isolated temp environment
documentation
Use when starting work on a yak - sets up an isolated git worktree, reads yak context, and guides the full cycle from claiming through merge and cleanup
development
Use when planning work by approaching goals and discovering blockers, before creating comprehensive plans