From draft
Generates timestamped Markdown previews of Jira issues from track plans, mapping tracks to epics, phases to stories, tasks to sub-tasks, with git metadata for review before creation.
npx claudepluginhub mayurpise/draft --plugin draftThis skill uses the workspace's default tool permissions.
Generate a timestamped `jira-export-<timestamp>.md` (with `jira-export-latest.md` symlink) from the track's plan for review and editing before creating actual Jira issues.
Creates Jira epics, stories, and sub-tasks from jira-export-latest.md using MCP-Jira. Auto-generates export if missing. For converting drafts to tracked issues.
Fetches JIRA issue by key or search, distills title/description/acceptance criteria/comments into structured task, analyzes codebase for gaps/risks, optionally enriches JIRA.
Generates business-friendly Jira ticket reports by summarizing git commits against issue context using Atlassian MCP and saves as dated markdown file in docs/jira-reports.
Share bugs, ideas, or general feedback.
Generate a timestamped jira-export-<timestamp>.md (with jira-export-latest.md symlink) from the track's plan for review and editing before creating actual Jira issues.
Plan first, then preview. Accuracy over speed.
The generated jira-export-<timestamp>.md MUST include the standard YAML frontmatter. This enables traceability and sync verification.
Before generating the export file, run these commands to gather metadata:
# Project name (from manifest or directory)
basename "$(pwd)"
# Git branch
git branch --show-current
# Git remote tracking branch
git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null || echo "none"
# Git commit SHA (full)
git rev-parse HEAD
# Git commit SHA (short)
git rev-parse --short HEAD
# Git commit date
git log -1 --format="%ci"
# Git commit message (first line)
git log -1 --format="%s"
# Check for uncommitted changes
git status --porcelain | head -1
Insert this YAML frontmatter block at the top of the timestamped jira-export-<timestamp>.md:
---
project: "{PROJECT_NAME}"
module: "root"
track_id: "{TRACK_ID}"
generated_by: "draft:jira-preview"
generated_at: "{ISO_TIMESTAMP}"
git:
branch: "{LOCAL_BRANCH}"
remote: "{REMOTE/BRANCH or 'none'}"
commit: "{FULL_SHA}"
commit_short: "{SHORT_SHA}"
commit_date: "{COMMIT_DATE}"
commit_message: "{FIRST_LINE_OF_COMMIT_MESSAGE}"
dirty: {true|false}
synced_to_commit: "{FULL_SHA}"
---
Note:
generated_byusesdraft:commandformat (not/draft:command) for cross-platform compatibility.
| Draft Concept | Jira Entity |
|---|---|
| Track | Epic |
| Phase | Story |
| Task | Sub-task (under story) |
git branch --show-current # Current branch name
git rev-parse --short HEAD # Current commit hash
draft/tracks.md (look for [~] In Progress or first [ ] track)plan.md for phases and tasksmetadata.json for title and typespec.md for epic descriptiondraft/tracks/<id>/review-report-latest.md — review findings (from /draft:review)draft/tracks/<id>/bughunt-report-latest.md — defect findingsIf no track found:
/draft:new-track to create one, or specify track ID."Extract from plan.md:
# Plan: headingFor each ## Phase N: [Name] section:
**Goal:** line**Verification:** lineFor each - [ ] **Task N.M:** within a phase:
**Task N.M:**)[ ] → To Do, [x] → Done, [~] → In Progress, [!] → BlockedCount tasks per phase and assign points to the story:
| Task Count | Story Points |
|---|---|
| 1-2 tasks | 1 point |
| 3-4 tasks | 2 points |
| 5-6 tasks | 3 points |
| 7+ tasks | 5 points |
If review-report-latest.md or bughunt-report-latest.md exists in the track directory:
bughunt-report-latest.mdreview-report-latest.mdCritical/High findings should be highlighted — consider suggesting additional stories or tasks to address them before the track is complete.
Generate the timestamped filename and create the export file with symlink:
TIMESTAMP=$(date +%Y-%m-%dT%H%M)
EXPORT_FILE="draft/tracks/<track_id>/jira-export-${TIMESTAMP}.md"
SYMLINK="draft/tracks/<track_id>/jira-export-latest.md"
Create ${EXPORT_FILE} and then create/update the symlink:
ln -sf "jira-export-${TIMESTAMP}.md" "${SYMLINK}"
File contents for ${EXPORT_FILE}:
---
project: "{PROJECT_NAME}"
module: "root"
track_id: "{TRACK_ID}"
generated_by: "draft:jira-preview"
generated_at: "{ISO_TIMESTAMP}"
git:
branch: "{LOCAL_BRANCH}"
remote: "{REMOTE/BRANCH}"
commit: "{FULL_SHA}"
commit_short: "{SHORT_SHA}"
commit_date: "{COMMIT_DATE}"
commit_message: "{COMMIT_MESSAGE}"
dirty: {true|false}
synced_to_commit: "{FULL_SHA}"
---
# Jira Export: [Track Title]
| Field | Value |
|-------|-------|
| Generated | {ISO_TIMESTAMP} |
| Track ID | {TRACK_ID} |
| Branch | {LOCAL_BRANCH} |
| Commit | {SHORT_SHA} |
| Status | Ready for review |
> Edit this file to adjust story points, descriptions, or sub-tasks before running `/draft:jira-create`.
---
## Epic
**Summary:** [Track Title]
**Issue Type:** Epic
**Labels:** draft
**Description:**
{noformat}
[Spec overview - first 2-3 paragraphs]
---
🤖 Generated by Draft
Branch: [branch-name] | Commit: [short-hash]
{noformat}
---
## Story 1: [Phase 1 Name]
**Summary:** Phase 1: [Phase Name]
**Issue Type:** Story
**Story Points:** [calculated based on task count]
**Labels:** draft
**Epic Link:** (will be set on creation)
**Description:**
{noformat}
h3. Goal
[Phase goal]
h3. Verification
[Phase verification criteria]
---
🤖 Generated by Draft
Branch: [branch-name] | Commit: [short-hash]
{noformat}
### Sub-tasks
| # | Summary | Status |
|---|---------|--------|
| 1.1 | [Task 1.1 description] | To Do |
| 1.2 | [Task 1.2 description] | Done |
| 1.3 | [Task 1.3 description] | To Do |
---
## Story 2: [Phase 2 Name]
**Summary:** Phase 2: [Phase Name]
**Issue Type:** Story
**Story Points:** [calculated]
**Labels:** draft
**Epic Link:** (will be set on creation)
**Description:**
{noformat}
h3. Goal
[Phase goal]
h3. Verification
[Phase verification criteria]
---
🤖 Generated by Draft
Branch: [branch-name] | Commit: [short-hash]
{noformat}
### Sub-tasks
| # | Summary | Status |
|---|---------|--------|
| 2.1 | [Task 2.1 description] | To Do |
| 2.2 | [Task 2.2 description] | To Do |
---
[Continue for all phases...]
---
## Quality Reports
### Review Findings (informational)
| Severity | Category | Location | Issue | Risk/Impact | Fix |
|----------|----------|----------|-------|-------------|-----|
| Critical | Security | src/auth.ts:45 | Hardcoded API key | Secret exposed in version control | Move to environment variable |
| Warning | Architecture | src/utils.ts:12 | Layer boundary violation | UI importing from database layer | Use API service layer instead |
> Review findings are from `/draft:review` and `/draft:bughunt`. Include in Epic description for awareness.
> Critical findings should also be created as Bug issues (same as bughunt bugs) to ensure they are tracked and resolved.
---
## Bug Issues (from Bug Hunt Report)
Each bug from `bughunt-report-latest.md` becomes a separate **Bug** issue linked to the Epic.
### Bug 1: [CRITICAL] Off-by-one error in pagination
**Summary:** [Correctness] Off-by-one error in pagination
**Issue Type:** Bug
**Priority:** Highest
**Labels:** draft
**Epic Link:** (will be set on creation)
**Description:**
{noformat}
h3. Location
src/calc.ts:78
h3. Confidence
CONFIRMED
h3. Code Evidence
{code}
// The actual problematic code from bughunt-report-latest.md
{code}
h3. Data Flow Trace
[How data reaches this point: caller → caller → this function]
h3. Issue
[Full description from bughunt-report-latest.md]
h3. Impact
[User-visible or system failure mode]
h3. Verification Done
[Checklist of verification steps completed, e.g.:]
- Traced code path from entry point
- Checked .ai-context.md — not intentional
- Verified framework doesn't handle this
- No upstream guards found
h3. Why Not a False Positive
[Explicit reasoning from bughunt-report-latest.md]
h3. Fix
[Minimal code change or mitigation from report]
h3. Regression Test
[Test case from bughunt-report-latest.md, or "N/A" with reason]
---
🤖 Generated by Draft (Bug Hunt)
Branch: [branch-name] | Commit: [short-hash]
{noformat}
---
### Bug 2: [HIGH] Race condition in cache update
**Summary:** [Concurrency] Race condition in cache update
**Issue Type:** Bug
**Priority:** High
**Labels:** draft
**Epic Link:** (will be set on creation)
**Description:**
{noformat}
h3. Location
src/api.ts:92
h3. Confidence
HIGH
h3. Code Evidence
{code}
// The actual problematic code from bughunt-report-latest.md
{code}
h3. Data Flow Trace
[How data reaches this point: caller → caller → this function]
h3. Issue
[Full description from bughunt-report-latest.md]
h3. Impact
[User-visible or system failure mode]
h3. Verification Done
[Checklist of verification steps completed]
h3. Why Not a False Positive
[Explicit reasoning from bughunt-report-latest.md]
h3. Fix
[Fix recommendation from report]
h3. Regression Test
[Test case from bughunt-report-latest.md, or "N/A" with reason]
---
🤖 Generated by Draft (Bug Hunt)
Branch: [branch-name] | Commit: [short-hash]
{noformat}
---
[Continue for all bugs from bughunt-report-latest.md...]
> **Priority Mapping:** Critical → Highest, High → High, Medium → Medium, Low → Low
> All bugs are linked to the Epic but are separate from Stories (phases).
Jira Preview Generated
Track: [track_id] - [title]
Export: draft/tracks/<id>/jira-export-<timestamp>.md
Symlink: draft/tracks/<id>/jira-export-latest.md
Summary:
- 1 epic
- N stories (phases)
- M sub-tasks (tasks)
- P total story points
- B bugs (from bughunt-report-latest.md)
Breakdown:
- Phase 1: [name] - X pts, Y tasks
- Phase 2: [name] - X pts, Y tasks
- Phase 3: [name] - X pts, Y tasks
Bugs (if bughunt-report-latest.md exists):
- X critical bugs
- Y high bugs
- Z medium/low bugs
Next steps:
1. Review and edit the export file via jira-export-latest.md (adjust points, descriptions, sub-tasks, bug priorities)
2. Run `/draft:jira-create` to create issues in Jira
If plan.md has no phases:
/draft:new-track to generate a proper plan."If spec.md missing:
If jira-export-latest.md already exists:
If phase has no tasks: