jira-ticket-prioritizer
SKILL.md
JIRA Ticket Prioritizer
Analyze a set of JIRA tickets to determine optimal execution order based on dependencies, priority, and grouping. Produces grouped layers usable standalone or as a pre-step before implement/forge.
Inputs
Raw arguments: $ARGUMENTS
Infer from the arguments:
- TICKET_INPUT: comma-separated ticket keys OR a JQL query (detected by presence of
=,AND,OR) - EXTRA_CONTEXT: (optional) additional context for prioritization
System Requirements
jiraCLI installed and configured (https://github.com/ankitpokhrel/jira-cli)- Environment variable
JIRA_API_TOKENset with a valid Jira API token. Important: When checking this variable, verify at least 2 times before concluding it is not set. Never expose the value — use existence checks only.
Execution
Step 1 — Parse Input
- Check if
TICKET_INPUTcontains=,AND, orOR(case-insensitive) to detect JQL - If JQL detected: run
jira issue list --jql "TICKET_INPUT" --plain --columns key,status --no-headersto resolve to ticket keys with statuses - If comma-separated: split on
,and trim whitespace - Validate each key matches
[A-Z]+-\d+ - If fewer than 2 valid tickets, report the single ticket and exit
Step 2 — Classify and Fetch All Tickets
- Create temp directory:
mkdir -p .jira-ticket-prioritizer-tmp/tickets - For each ticket key, fetch via jira CLI:
jira issue view {KEY} --raw > .jira-ticket-prioritizer-tmp/tickets/{KEY}.json - Parse each ticket using the jira-ticket-viewer parse script:
node ${CLAUDE_SKILL_DIR}/../jira-ticket-viewer/scripts/parse-ticket.js < .jira-ticket-prioritizer-tmp/tickets/{KEY}.json > .jira-ticket-prioritizer-tmp/tickets/{KEY}-parsed.json - Collect all parsed outputs into a single JSON array and write to
.jira-ticket-prioritizer-tmp/all-tickets.json - Classify tickets by status — fetch and parse ALL tickets, then split into two groups:
pending= tickets with status "To Do" or "Backlog" — these will be scored, grouped, and placed in output layerscontext= tickets with any other status ("In Progress", "In Review", "Done", "Closed", "Resolved") — these are NOT placed in layers but are used for dependency resolution in Steps 3-5
Step 3 — Build Dependency Graph
- Run:
node ${CLAUDE_SKILL_DIR}/scripts/build-dependency-graph.js < .jira-ticket-prioritizer-tmp/all-tickets.json > .jira-ticket-prioritizer-tmp/graph.json - Review graph output for cycles or warnings
- See references/dependency-analysis.md for relationship mapping rules
- The graph includes ALL tickets (pending + context) so dependencies on in-progress/done tickets are visible
Step 4 — Semantic Dependency Analysis & Parent Ticket Evaluation
- Evaluate parent/container tickets and semantic dependencies per references/dependency-analysis.md
- Add soft edges with confidence levels (high/medium/low) to the graph
- Re-run topological sort if new edges were added:
- Update
all-tickets.jsonwith additionalsoftEdgesand re-runbuild-dependency-graph.js
- Update
Step 5 — Priority Scoring & Grouping
- Only score
pendingtickets —contexttickets are not scored or placed in layers - For tickets at the same dependency layer, score using weights from references/priority-weights.md
- Sort within each layer by descending score
- Apply
EXTRA_CONTEXTcontext as a tiebreaker or boost - Group related tickets within the same layer — see references/dependency-analysis.md Grouping Rules. First ticket in each group (highest score) is the primary ticket.
- Determine
repofor each ticket (REQUIRED): read the ticket summary, description, components, labels, and linked issues, then use your judgment to infer which repository from the available repo list (absolute paths provided inEXTRA_CONTEXT) this ticket belongs to. Output the repo basename only (e.g."elements-backend", not the full path). Every ticket MUST have arepo— use the best match based on the ticket context. If the ticket mentions frontend/UI/React/CSS, it likely belongs to the storefront. If it mentions API/backend/database/model, it likely belongs to the backend. If genuinely ambiguous, default to the first repo in the list. - Determine
branchfor each ticket (REQUIRED): slugify the ticket key + summary into a branch name. Format:{ticket-key}-{slugified-title}— lowercase, replace spaces and special characters with hyphens, collapse consecutive hyphens, strip leading/trailing hyphens, truncate to 50 characters (e.g."ec-123-fix-payment-bug"). Every ticket MUST have abranch. - Determine
hasFrontendfor each group: set totrueif any ticket in the group involves frontend/UI work. Infer from ticket summary, description, components, and labels — look for signals like UI, frontend, React, CSS, component, page, layout, design, Figma links,.tsx/.jsxfile mentions, or visual/browser-related keywords. Set tofalseonly when all tickets in the group are clearly backend-only. - Resolve cross-layer dependencies:
- If a pending ticket depends on a
contextticket with status "Done"/"Closed"/"Resolved" → dependency is resolved, ticket proceeds normally - If a pending ticket depends on a
contextticket with any other status (e.g. "In Progress") → mark asskippedwith reason including the dependency key and its status - If a pending ticket depends on another
pendingticket in a different layer → normal layering (layer N+1 depends on layer N)
- If a pending ticket depends on a
- Tickets with status "Done"/"Closed"/"Resolved" →
excluded - Container/parent stories with no implementable work →
excluded
Step 6 — Generate Output
- See references/output-format.md for report schema and JSON structure
- Write
.jira-ticket-prioritizer-tmp/detailed-report.json— full details including scores, justifications, dependency graph, skipped tickets, excluded tickets, and warnings - Write
.jira-ticket-prioritizer-tmp/output.json— the grouped layers object withlayers,skipped, andexcludedarrays - Present only
output.jsonto the user. The detailed report is saved for reference but not displayed.
Reference Files
| Name | When to Read |
|---|---|
| references/priority-weights.md | Step 5 — scoring rules and factor weights |
| references/output-format.md | Step 6 — report template and JSON schema |
| references/dependency-analysis.md | Steps 3-5 — dependency detection and grouping rules |
Weekly Installs
34
Repository
delexw/claude-code-miscGitHub Stars
24
First Seen
13 days ago
Security Audits
Installed on
opencode34
gemini-cli34
claude-code34
github-copilot34
codex34
kimi-cli34