ticket-workflow
Ticket Workflow Skill
This skill provides the state machine and coordination logic for the complete ticket resolution workflow.
State Machine
┌─────────┐ ┌─────────┐ ┌──────────┐ ┌─────────┐
│ pending │───►│ fetched │───►│ analyzed │───►│ planned │
└─────────┘ └─────────┘ └──────────┘ └─────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────┐
│ failed │
└─────────────────────────────────────────┘
│
│ (resume)
▼
┌─────────────────┐ ┌───────────────┐ ┌───────────┐
│ plan_validated │───►│ implementing │───►│ completed │
└─────────────────┘ └───────────────┘ └───────────┘
States
| State | Description | Next States |
|---|---|---|
pending |
Workflow just started | fetched, failed |
fetched |
Ticket data retrieved | analyzed, failed |
analyzed |
Complexity determined | planned, failed |
planned |
Implementation plan ready | plan_validated, failed |
plan_validated |
Plan approved by user | implementing, failed |
implementing |
Auto-implementation in progress | completed, failed |
completed |
All phases finished | (terminal) |
failed |
Error occurred | (can resume) |
Phase Mapping
| State Transition | Phase | Skill Used |
|---|---|---|
| pending → fetched | fetch | fetch-ticket |
| fetched → analyzed | analyze | analyze-ticket |
| analyzed → analyzed | explore | (AEP agents) |
| analyzed → planned | plan | (Architect) |
| planned → plan_validated | validation | plan-validation |
| plan_validated → implementing | implement | /resolve --continue |
Status File Management
Location
.claude_resolve/{ticket-id}/status.json
Initialize Status
{
"ticket_id": "PROJ-123",
"source": "youtrack",
"started_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"state": "pending",
"phases": {
"fetch": "pending",
"analyze": "pending",
"explore": "pending",
"plan": "pending",
"implement": "pending"
},
"options": {}
}
Update Status
After each phase completion:
{
"state": "fetched",
"updated_at": "2024-01-15T10:31:00Z",
"phases": {
"fetch": "completed",
"analyze": "pending",
...
}
}
Mark Failed
On error:
{
"state": "failed",
"updated_at": "2024-01-15T10:32:00Z",
"phases": {
"fetch": "completed",
"analyze": "failed",
...
},
"error": {
"phase": "analyze",
"message": "Could not determine complexity",
"timestamp": "2024-01-15T10:32:00Z"
}
}
Resume Logic
Check for Existing Status
if [ -f ".claude_resolve/{ticket-id}/status.json" ]; then
# Load and check state
fi
Resume from State
def get_resume_point(status):
# Find last completed phase
phase_order = ['fetch', 'analyze', 'explore', 'plan', 'implement']
for phase in phase_order:
if status['phases'][phase] in ['pending', 'failed']:
return phase
return None # All completed
Display Resume Info
# Reprise du Workflow
**Ticket**: {ticket-id}
**Etat precedent**: {state}
**Derniere mise a jour**: {updated_at}
## Phases
| Phase | Statut |
|-------|--------|
| Fetch | completed |
| Analyze | completed |
| Explore | skipped |
| Plan | pending |
| Implement | pending |
## Point de Reprise
Reprise depuis: **plan**
Erreur precedente: {error.message}
Continuer ? [O/n]
Workflow Orchestration
Phase: Fetch
- Check if status exists and fetch completed → skip
- Invoke fetch-ticket skill
- Save ticket.md
- Update status:
state = "fetched",phases.fetch = "completed"
Phase: Analyze
- Check if status exists and analyze completed → skip
- Invoke analyze-ticket skill
- Determine complexity
- Save analysis.md
- Update status:
state = "analyzed",phases.analyze = "completed",complexity = ...
Phase: Explore
- Check complexity level
- If SIMPLE: skip, mark
phases.explore = "skipped" - If MEDIUM: launch 1 explore agent
- If COMPLEX: launch 3 explore agents in parallel
- Append findings to analysis.md
- Update status:
phases.explore = "completed"
Phase: Plan
- If COMPLEX and not --skip-architect: invoke Architect skill
- Generate implementation plan
- Save plan.md
- Update status:
state = "planned",phases.plan = "completed"
Phase: Plan Validation
AUTO mode: Auto-validate, continue to implement INTERACTIVE mode: Validation loop (Valider et implémenter / Valider et arrêter / Modifier / Régénérer)
- Update status:
state = "plan_validated",plan_validated_at = "{timestamp}"
Phase: Implement
AUTO mode: Always executed after plan validation
INTERACTIVE mode: Via "Valider et implémenter" choice or --continue flag
- Execute
/compactto clear context - Delegate implementation to subagent
- Update status:
state = "implementing"→phases.implement = "completed"
Configuration Integration
Read from project's .claude/ticket-config.json:
- Merge with default config from references/default-config.json
- Override with command-line options
Priority order:
- Command-line options
- Project config
- Default config
Error Recovery
Transient Errors
- Network timeout → retry with backoff
- MCP unavailable → fallback or prompt user
Persistent Errors
- Ticket not found → mark failed, clear instructions
- Permission denied → mark failed, suggest resolution
Recovery Actions
## Erreur Recuperable
L'erreur "{error.message}" peut etre resolue.
**Actions suggerees**:
1. {action 1}
2. {action 2}
**Pour reprendre**:
```bash
/resolve {ticket-id} # Reprend automatiquement
## Files Generated
.claude_resolve/{ticket-id}/ ├── status.json # Workflow state ├── ticket.md # Original ticket content ├── analysis.md # Complexity analysis + exploration findings └── plan.md # Implementation plan
## Integration Points
### With AEP Skill
- Used for COMPLEX tickets during explore phase
- Applies ANALYSE-EXPLORE-PLAN methodology
### With Architect Skill
- Used for COMPLEX tickets during plan phase
- Ensures plan follows best practices
### With /resolve --continue
- Plans saved in standard format
- Resumes implementation from validated plan
## Language
- Status file: English (machine-readable)
- User messages: French
- Technical output: English
More from nicolas-codemate/claudecodeconfig
architect
Software architecture skill for designing high-quality implementation plans. Provides universal patterns, quality checklists, and architectural guidelines. Use during planning phase to ensure plans are well-structured, atomic, and follow best practices.
25pr-info
>-
1aep
Analyse-Explore-Plan methodology for thorough analysis and planning before development. Use when starting a new feature, investigating a problem, or needing to understand a codebase before making changes. Provides structured workflow with parallel exploration agents and clarification questions. Integrates with Architect skill for high-quality implementation plans.
1mentor-workflow
Coaching workflow orchestrator. Guides the developer through implementation without writing code.
1create-pr
>-
1analyze-ticket
Skill for analyzing ticket complexity and determining required workflow phases. Uses scoring system to classify tickets as SIMPLE, MEDIUM, or COMPLEX, which determines exploration depth and planning approach.
1