Humanize Generate Plan
Transforme un document brouillon en plan d'implémentation bien structuré avec des objectifs clairs, des critères d'acceptation (format AC-X), des limites de portée et des suggestions de faisabilité.
L'installateur hydrate cette compétence avec un chemin racine runtime absolu :
{{HUMANIZE_RUNTIME_ROOT}}
flowchart TD
BEGIN([BEGIN]) --> VALIDATE[Validate input/output paths<br/>Run: {{HUMANIZE_RUNTIME_ROOT}}/scripts/validate-gen-plan-io.sh --input <draft> --output <plan>]
VALIDATE --> CHECK{Validation passed?}
CHECK -->|No| REPORT_ERROR[Report validation error<br/>Stop]
REPORT_ERROR --> END_FAIL([END])
CHECK -->|Yes| READ_DRAFT[Read input draft file]
READ_DRAFT --> CHECK_RELEVANCE{Is draft relevant to<br/>this repository?}
CHECK_RELEVANCE -->|No| REPORT_IRRELEVANT[Report: Draft not related to repo<br/>Stop]
REPORT_IRRELEVANT --> END_FAIL
CHECK_RELEVANCE -->|Yes| ANALYZE[Analyze draft for:<br/>- Clarity<br/>- Consistency<br/>- Completeness<br/>- Functionality]
ANALYZE --> HAS_ISSUES{Issues found?}
HAS_ISSUES -->|Yes| RESOLVE[Engage user to resolve issues<br/>via AskUserQuestion]
RESOLVE --> ANALYZE
HAS_ISSUES -->|No| CHECK_METRICS{Has quantitative<br/>metrics?}
CHECK_METRICS -->|Yes| CONFIRM_METRICS[Confirm metrics with user:<br/>Hard requirement or trend?]
CONFIRM_METRICS --> GEN_PLAN
CHECK_METRICS -->|No| GEN_PLAN[Generate structured plan:<br/>- Goal Description<br/>- Acceptance Criteria with TDD tests<br/>- Path Boundaries<br/>- Feasibility Hints<br/>- Dependencies & Milestones]
GEN_PLAN --> WRITE[Write plan to output file<br/>using Edit tool to preserve draft]
WRITE --> REVIEW[Review complete plan<br/>Check for inconsistencies]
REVIEW --> INCONSISTENT{Inconsistencies?}
INCONSISTENT -->|Yes| FIX[Fix inconsistencies]
FIX --> REVIEW
INCONSISTENT -->|No| CHECK_LANG{Multiple languages?}
CHECK_LANG -->|Yes| UNIFY[Ask user to unify language]
UNIFY --> REPORT_SUCCESS
CHECK_LANG -->|No| REPORT_SUCCESS[Report success:<br/>- Plan path<br/>- AC count<br/>- Language unified?]
REPORT_SUCCESS --> END_SUCCESS([END])
Exigences d'entrée
Arguments obligatoires :
--input <path/to/draft.md>- Le document brouillon--output <path/to/plan.md>- Où écrire le plan
Structure du plan produit
Le plan généré inclut :
# Plan Title
## Goal Description
Clear description of what needs to be accomplished
## Acceptance Criteria
- AC-1: First criterion
- Positive Tests (expected to PASS):
- Test case that should succeed
- Negative Tests (expected to FAIL):
- Test case that should fail
## Path Boundaries
### Upper Bound (Maximum Scope)
Most comprehensive acceptable implementation
### Lower Bound (Minimum Scope)
Minimum viable implementation
### Allowed Choices
- Can use: allowed technologies
- Cannot use: prohibited technologies
## Dependencies and Sequence
### Milestones
1. Milestone 1: Description
- Phase A: ...
- Phase B: ...
## Implementation Notes
- Code should NOT contain plan terminology
Codes de sortie de validation
| Code de sortie | Signification |
|---|---|
| 0 | Succès - continuer |
| 1 | Fichier d'entrée non trouvé |
| 2 | Fichier d'entrée vide |
| 3 | Répertoire de sortie n'existe pas |
| 4 | Fichier de sortie existe déjà |
| 5 | Pas de permission d'écriture |
| 6 | Arguments invalides |
| 7 | Fichier modèle de plan non trouvé |
Utilisation
# Démarrer le flux
/flow:humanize-gen-plan
# Le flux demandera :
# - Chemin du fichier brouillon d'entrée
# - Chemin du fichier plan de sortie
Ou avec la compétence uniquement (sans exécution automatique) :
/skill:humanize-gen-plan