From bh-agile
Create Epic, Stories, and Tasks in the issue tracker from feature documentation or structured input. Triggers: "create tickets", "create issues from docs", "plan tickets", "/create-tickets".
How this skill is triggered — by the user, by Claude, or both
Slash command
/bh-agile:create-ticketsopusThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Creates a complete ticket hierarchy (Epic → Stories → Tasks) in the issue tracker from feature documentation or structured input.
Creates a complete ticket hierarchy (Epic → Stories → Tasks) in the issue tracker from feature documentation or structured input.
$ARGUMENTS — Path to feature docs directory or feature description/create-tickets @docs/features/user-auth//create-tickets "notification system"date +%Y-%m-%dgit branch --show-current 2>/dev/null || echo "not a git repo"PHASE 1: READ INPUT → Parse docs or gather description
PHASE 2: ANALYZE → Identify scope, vertical slices, dependencies
PHASE 3: DRAFT TICKETS → Write Epic, Stories, Tasks using story-writer
PHASE 4: USER APPROVAL → Present plan, get confirmation
PHASE 5: CREATE TICKETS → Create in issue tracker via ticket-manager
PHASE 6: VERIFY & REPORT → Verify hierarchy, output links
@ path)Read all files in the specified directory:
Read @docs/features/<feature>/
- README.md — overview, goals, scope
- Architecture docs — system design, data models
- UX/UI specs — wireframes, user flows
- Any structured task lists or implementation notes
Extract:
Record the documentation path — it will be referenced in every ticket (see Phase 3).
If no documentation path provided:
AskUserQuestion({
question: "Can you describe the feature in more detail?",
options: [
{ label: "I'll describe it", description: "Provide a detailed feature description" },
{ label: "Point to docs", description: "I have documentation to reference" }
]
})
Gather enough context to define the Epic scope.
Verify that the planned work follows vertical slice principles:
CORRECT (Vertical): WRONG (Horizontal):
- "User can create account" - "Backend implementation"
- "User can reset password" - "Frontend implementation"
- "Admin can manage users" - "Database schema"
Each Story must be:
If documentation is NOT vertical slice based, propose restructuring and get user approval.
Identify which Stories depend on others:
#1 (Foundation — no dependencies)
├──> #2 (depends on #1)
│ └──> #4 (depends on #1, #2)
└──> #3 (depends on #1)
If the feature relates to existing code:
Task({
subagent_type: "feature-dev:code-explorer",
prompt: "Find existing code related to this feature. Look for:
- Similar patterns already implemented
- Reusable components and utilities
- Integration points and conventions"
})
CRITICAL: This phase is where ALL ticket content is written. You (running on opus) write every ticket body here using the story-writer skill's templates and quality standards. The ticket-manager agent in Phase 5 receives finished text — it does NOT write content.
Apply /bh-agile:story-writer templates, AC format (Given/When/Then), INVEST criteria, and vertical slice principles to write the complete markdown body for every ticket.
When working from documentation (@ path), the docs are the source of truth for requirements, architecture, and design decisions. But implementation always starts from the ticket — a developer picks up a ticket and works from there.
This means every ticket must be self-contained enough to start work, while pointing back to docs for full details. The ticket body must:
Each ticket must contain:
## Source Documentation
> **Before starting implementation, read the referenced documents below.** The ticket summarizes key requirements, but the docs contain full architectural decisions, data models, and design rationale that are essential for correct implementation.
> Feature docs: `docs/features/<feature>/`
| Document | Path | Relevant sections |
|----------|------|-------------------|
| Overview | `docs/features/<feature>/README.md` | Goals, Scope, User Roles |
| Architecture | `docs/features/<feature>/architecture.md` | [specific sections for this ticket] |
| UX Spec | `docs/features/<feature>/ux-spec.md` | [specific sections for this ticket] |
Rules:
docs/features/auth/README.md)Write the complete markdown body for the Epic:
Store the finished Epic body — it will be passed verbatim to the ticket-manager in Phase 5.
For each vertical slice, write the complete markdown body:
Store each finished Story body — they will be passed verbatim to the ticket-manager in Phase 5.
For each Story, optionally write complete markdown bodies for Tasks:
Typical Task types: schema/data, backend logic, UI components, tests, integration.
Before moving to Phase 4, verify every drafted body against the story-writer quality bar:
| Check | Requirement |
|---|---|
| User Story format | "As a [role], I want..., so that..." present on every Story |
| Acceptance Criteria | 3-5 Given/When/Then ACs per Story |
| Source Documentation | Every ticket references relevant docs with specific sections |
| "Before starting" instruction | Every ticket with doc refs includes the read-docs-first instruction |
| Key details inlined | Technical notes contain actual data models, API shapes, not just "see docs" |
| Vertical slice | Each Story delivers user-facing value end-to-end |
| Task granularity | Each Task completable in 1-4 hours |
Present the complete plan before creating any tickets:
## Draft Plan: [Feature Name]
### Epic Overview
[Brief description]
### Proposed Stories
| # | Story | Points | Depends On |
|---|-------|--------|------------|
| 1 | [Story 1] | 3 | - |
| 2 | [Story 2] | 5 | Story 1 |
### Implementation Order
1. Story 1 — [description]
2. Story 2 — [description]
### Dependency Graph
[visual graph]
AskUserQuestion({
question: "Does this plan look correct? Should I create the tickets?",
options: [
{ label: "Yes, create tickets", description: "Proceed with ticket creation" },
{ label: "Modify plan", description: "I want to change something first" },
{ label: "Cancel", description: "Don't create tickets" }
]
})
Only proceed to Phase 5 after explicit user approval.
The ticket-manager agent is a CRUD tool. Pass it finished content — do not ask it to write, rephrase, or generate anything. Every Body: below must contain the exact markdown written in Phase 3.
Create tasks with dependencies to enforce the correct order:
TaskCreate({ subject: "Create Epic in issue tracker",
description: "Create the Epic issue with the body drafted in Phase 3.",
activeForm: "Creating Epic issue" }) → task A
TaskCreate({ subject: "Create Stories and link to Epic",
description: "Create all Story issues, link each as sub-issue to Epic.",
activeForm: "Creating Story issues" }) → task B
TaskUpdate({ taskId: B, addBlockedBy: [A] })
TaskCreate({ subject: "Create Tasks and link to Stories",
description: "Create all Task issues, link each as sub-issue to its Story.",
activeForm: "Creating Task issues" }) → task C
TaskUpdate({ taskId: C, addBlockedBy: [B] })
TaskCreate({ subject: "Update Epic with final issue numbers",
description: "Replace placeholder numbers in Epic body with actual issue numbers.",
activeForm: "Updating Epic with final numbers" }) → task D
TaskUpdate({ taskId: D, addBlockedBy: [C] })
TaskCreate({ subject: "Verify hierarchy and links",
description: "Verify all sub-issue links exist and labels are correct.",
activeForm: "Verifying ticket hierarchy" }) → task E
TaskUpdate({ taskId: E, addBlockedBy: [D] })
Task({ subagent_type: "agile-ticket-manager",
prompt: "Create issue with EXACTLY this content. Do not modify the body.
Title: [Epic Title]
Labels: type:epic, status:backlog
Body:
---
[paste the complete Epic markdown from Phase 3 verbatim]
---
Return the issue number." })
Save the returned Epic number — needed for Story linking.
For each Story, create the issue and immediately link it to the Epic:
Task({ subagent_type: "agile-ticket-manager",
prompt: "Do these two steps:
1. Create issue with EXACTLY this content. Do not modify the body.
Title: [Story Title]
Labels: type:story, status:backlog, points:X
Body:
---
[paste the complete Story markdown from Phase 3 verbatim]
---
2. Link the created issue as sub-issue to Epic #XX.
Return the issue number." })
For each Task, create the issue and immediately link it to its Story:
Task({ subagent_type: "agile-ticket-manager",
prompt: "Do these two steps:
1. Create issue with EXACTLY this content. Do not modify the body.
Title: [Task Title]
Labels: type:task, status:backlog, estimate:X
Body:
---
[paste the complete Task markdown from Phase 3 verbatim]
---
2. Link the created issue as sub-issue to Story #YY.
Return the issue number." })
After all tickets are created, update the Epic body with actual issue numbers:
Task({ subagent_type: "agile-ticket-manager",
prompt: "Update Epic #XX body:
- Replace placeholder Story numbers with actual issue numbers
- Update Implementation Order with correct references
- Update Dependency Graph with actual numbers" })
Task({ subagent_type: "agile-ticket-manager",
prompt: "Verify the ticket hierarchy for Epic #XX. Run these checks:
1. EPIC SUB-ISSUES: Run gh api repos/OWNER/REPO/issues/XX/sub_issues --jq '.[].number'
Expected Story numbers: #AA, #BB, #CC, ...
Report: found N of M expected.
2. STORY SUB-ISSUES: For each Story, run gh api repos/OWNER/REPO/issues/STORY/sub_issues --jq '.[].number'
Report found vs expected Task count per Story.
3. LABELS: For each issue, verify type:* and status:backlog labels exist.
4. FIX MISSING LINKS: If any sub-issue link is missing, link it now.
Return a verification report with pass/fail per check." })
Do not skip this step. The ticket-manager must run the actual API calls and report concrete numbers — not just confirm from memory.
## Tickets Created: [Feature Name]
### Epic
#XX [Title] — [link]
### Stories (X total, Y story points)
| Issue | Story | Points | Depends On |
|-------|-------|--------|------------|
| #AA | [Title] | 3 | - |
| #BB | [Title] | 5 | #AA |
### Suggested Implementation Order
1. **#AA** — [description] (no dependencies)
2. **#BB** — [description] (after #AA)
### Next Steps
- Run `/implement #AA` to start the first Story
- Implement Stories in order (respect dependencies)
| Scenario | Action |
|---|---|
| Empty input | Ask for feature description or docs path |
| Documentation incomplete | Note gaps, ask user to fill in |
| Feature too large | Propose splitting into multiple Epics |
| Issue tracker unavailable | Output ticket content for manual creation |
| Non-vertical slices in docs | Propose restructuring, get approval |
/bh-agile:story-writer for ticket content templatesagile-ticket-manager agent for issue tracker operations/bh-agile:plan-feature for discovery + documentation generation (upstream)/bh-agile:implement for feature implementation (downstream)npx claudepluginhub brighthills/brighthills-cc-plugins --plugin bh-agileGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.