|
| 1 | +--- |
| 2 | +description: Generate a custom checklist for the current feature based on user requirements. |
| 3 | +scripts: |
| 4 | + sh: scripts/bash/check-prerequisites.sh --json |
| 5 | + ps: scripts/powershell/check-prerequisites.ps1 -Json |
| 6 | +--- |
| 7 | + |
| 8 | +The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty). |
| 9 | + |
| 10 | +User input: |
| 11 | + |
| 12 | +`$ARGUMENTS |
| 13 | +` |
| 14 | +## Execution Steps |
| 15 | + |
| 16 | +1. **Setup**: Run `{SCRIPT}` from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS list. |
| 17 | + - All file paths must be absolute. |
| 18 | + |
| 19 | +2. **Clarify intent (dynamic)**: Derive THREE contextual clarifying questions (no pre-baked catalog). They MUST: |
| 20 | + - Be generated from the user's phrasing + extracted signals from spec/plan/tasks |
| 21 | + - Only ask about information that materially changes checklist content |
| 22 | + - Be skipped individually if already unambiguous in `$ARGUMENTS` |
| 23 | + - Prefer precision over breadth |
| 24 | + |
| 25 | + Generation algorithm: |
| 26 | + 1. Extract signals: feature domain keywords (e.g., auth, latency, UX, API), risk indicators ("critical", "must", "compliance"), stakeholder hints ("QA", "review", "security team"), and explicit deliverables ("a11y", "rollback", "contracts"). |
| 27 | + 2. Cluster signals into candidate focus areas (max 4) ranked by relevance. |
| 28 | + 3. Identify probable audience & timing (author, reviewer, QA, release) if not explicit. |
| 29 | + 4. Detect missing dimensions: scope breadth, depth/rigor, risk emphasis, exclusion boundaries, measurable acceptance criteria. |
| 30 | + 5. Formulate up to three questions chosen from these archetypes: |
| 31 | + - Scope refinement (e.g., "Should this include integration touchpoints with X and Y or stay limited to local module correctness?") |
| 32 | + - Risk prioritization (e.g., "Which of these potential risk areas should receive mandatory gating checks?") |
| 33 | + - Depth calibration (e.g., "Is this a lightweight pre-commit sanity list or a formal release gate?") |
| 34 | + - Audience framing (e.g., "Will this be used by the author only or peers during PR review?") |
| 35 | + - Boundary exclusion (e.g., "Should we explicitly exclude performance tuning items this round?") |
| 36 | + |
| 37 | + Question formatting rules: |
| 38 | + - If presenting options, generate a compact table with columns: Option | Candidate | Why It Matters |
| 39 | + - Limit to A–E options maximum; omit table if a free-form answer is clearer |
| 40 | + - Never ask the user to restate what they already said |
| 41 | + - Avoid speculative categories (no hallucination). If uncertain, ask explicitly: "Confirm whether X belongs in scope." |
| 42 | + |
| 43 | + Defaults when interaction impossible: |
| 44 | + - Depth: Standard |
| 45 | + - Audience: Reviewer (PR) if code-related; Author otherwise |
| 46 | + - Focus: Top 2 relevance clusters |
| 47 | + |
| 48 | + Output the three questions (or fewer if not needed) and wait for answers before continuing. Clearly label each as Q1/Q2/Q3. |
| 49 | + |
| 50 | +3. **Understand user request**: Combine `$ARGUMENTS` + clarifying answers: |
| 51 | + - Derive checklist theme (e.g., security, review, deploy, ux) |
| 52 | + - Consolidate explicit must-have items mentioned by user |
| 53 | + - Map focus selections to category scaffolding |
| 54 | + - Infer any missing context from spec/plan/tasks (do NOT hallucinate) |
| 55 | + |
| 56 | +4. **Load feature context**: Read from FEATURE_DIR: |
| 57 | + - spec.md: Feature requirements and scope |
| 58 | + - plan.md (if exists): Technical details, dependencies |
| 59 | + - tasks.md (if exists): Implementation tasks |
| 60 | + - Use context to enrich or validate checklist items (omit irrelevant categories) |
| 61 | + |
| 62 | +5. **Generate checklist**: |
| 63 | + - Create `FEATURE_DIR/checklists/` directory if it doesn't exist |
| 64 | + - Generate unique checklist filename: |
| 65 | + * Use short, descriptive name based on checklist type |
| 66 | + * Format: `[type].md` (e.g., `ux.md`, `test.md`, `security.md`, `deploy.md`) |
| 67 | + * If file exists, append counter: `[type]-2.md`, `[type]-3.md`, etc. |
| 68 | + * Examples: `ux.md`, `test.md`, `security.md`, `deploy.md`, `review-2.md` |
| 69 | + - Use format: `[ ] CHK001 Item description here` |
| 70 | + - Number items sequentially starting from CHK001 |
| 71 | + - Group items by category/section if applicable |
| 72 | + - Include brief explanations or links where helpful |
| 73 | + - Each `/checklist` run creates a NEW file (never overwrites existing checklists) |
| 74 | + |
| 75 | +6. **Checklist structure**: |
| 76 | + ```markdown |
| 77 | + # [Checklist Type] Checklist: [Feature Name] |
| 78 | + |
| 79 | + **Purpose**: [Brief description of what this checklist covers] |
| 80 | + **Created**: [Date] |
| 81 | + |
| 82 | + ## [Category 1] |
| 83 | + - [ ] CHK001 First item |
| 84 | + - [ ] CHK002 Second item |
| 85 | + |
| 86 | + ## [Category 2] |
| 87 | + - [ ] CHK003 Third item |
| 88 | + ``` |
| 89 | + |
| 90 | +7. **Report**: Output full path to created checklist, item count, and remind user that each run creates a new file. Summarize: |
| 91 | + - Focus areas selected |
| 92 | + - Depth level |
| 93 | + - Actor/timing |
| 94 | + - Any explicit user-specified must-have items incorporated |
| 95 | + |
| 96 | +**Important**: Each `/checklist` command invocation creates a NEW checklist file using short, descriptive names. This allows: |
| 97 | +- Multiple checklists of different types (e.g., `ux.md`, `test.md`, `security.md`) |
| 98 | +- Simple, memorable filenames that indicate checklist purpose |
| 99 | +- Counter-based uniqueness for duplicate types (e.g., `review-2.md`) |
| 100 | +- Easy identification and navigation in the checklists/ folder |
| 101 | + |
| 102 | +To avoid clutter, use descriptive types and clean up obsolete checklists when done. |
| 103 | + |
| 104 | +## Example Checklist Types |
| 105 | + |
| 106 | +**Code Review:** `review.md` |
| 107 | +- Code quality checks |
| 108 | +- Documentation requirements |
| 109 | +- Test coverage verification |
| 110 | +- Security considerations |
| 111 | + |
| 112 | +**Pre-Deployment:** `deploy.md` |
| 113 | +- Build verification |
| 114 | +- Test execution |
| 115 | +- Configuration validation |
| 116 | +- Rollback plan |
| 117 | + |
| 118 | +**Accessibility:** `ux.md` or `a11y.md` |
| 119 | +- WCAG compliance |
| 120 | +- Keyboard navigation |
| 121 | +- Screen reader compatibility |
| 122 | +- Color contrast |
| 123 | + |
| 124 | +**Security:** `security.md` |
| 125 | +- Input validation |
| 126 | +- Authentication/authorization |
| 127 | +- Data encryption |
| 128 | +- Dependency vulnerabilities |
| 129 | + |
| 130 | +Generate checklist items that are specific, actionable, and relevant to the feature context. |
0 commit comments