@shakudo/opencode-mattermost-control 0.3.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.opencode/command/mattermost-connect.md +5 -0
  2. package/.opencode/command/mattermost-disconnect.md +5 -0
  3. package/.opencode/command/mattermost-monitor.md +12 -0
  4. package/.opencode/command/mattermost-status.md +5 -0
  5. package/.opencode/command/speckit.analyze.md +184 -0
  6. package/.opencode/command/speckit.checklist.md +294 -0
  7. package/.opencode/command/speckit.clarify.md +181 -0
  8. package/.opencode/command/speckit.constitution.md +82 -0
  9. package/.opencode/command/speckit.implement.md +135 -0
  10. package/.opencode/command/speckit.plan.md +89 -0
  11. package/.opencode/command/speckit.specify.md +258 -0
  12. package/.opencode/command/speckit.tasks.md +137 -0
  13. package/.opencode/command/speckit.taskstoissues.md +30 -0
  14. package/.opencode/plugin/mattermost-control/event-handlers/compaction.ts +61 -0
  15. package/.opencode/plugin/mattermost-control/event-handlers/file.ts +36 -0
  16. package/.opencode/plugin/mattermost-control/event-handlers/index.ts +14 -0
  17. package/.opencode/plugin/mattermost-control/event-handlers/message.ts +124 -0
  18. package/.opencode/plugin/mattermost-control/event-handlers/permission.ts +34 -0
  19. package/.opencode/plugin/mattermost-control/event-handlers/question.ts +92 -0
  20. package/.opencode/plugin/mattermost-control/event-handlers/session.ts +100 -0
  21. package/.opencode/plugin/mattermost-control/event-handlers/todo.ts +33 -0
  22. package/.opencode/plugin/mattermost-control/event-handlers/tool.ts +76 -0
  23. package/.opencode/plugin/mattermost-control/formatters.ts +202 -0
  24. package/.opencode/plugin/mattermost-control/index.ts +964 -0
  25. package/.opencode/plugin/mattermost-control/package.json +12 -0
  26. package/.opencode/plugin/mattermost-control/state.ts +180 -0
  27. package/.opencode/plugin/mattermost-control/timers.ts +96 -0
  28. package/.opencode/plugin/mattermost-control/tools/connect.ts +563 -0
  29. package/.opencode/plugin/mattermost-control/tools/file.ts +41 -0
  30. package/.opencode/plugin/mattermost-control/tools/index.ts +12 -0
  31. package/.opencode/plugin/mattermost-control/tools/monitor.ts +183 -0
  32. package/.opencode/plugin/mattermost-control/tools/schedule.ts +253 -0
  33. package/.opencode/plugin/mattermost-control/tools/session.ts +120 -0
  34. package/.opencode/plugin/mattermost-control/types.ts +107 -0
  35. package/LICENSE +21 -0
  36. package/README.md +1280 -0
  37. package/opencode-shared +359 -0
  38. package/opencode-shared-restart +495 -0
  39. package/opencode-shared-stop +90 -0
  40. package/package.json +65 -0
  41. package/src/clients/mattermost-client.ts +221 -0
  42. package/src/clients/websocket-client.ts +199 -0
  43. package/src/command-handler.ts +1035 -0
  44. package/src/config.ts +170 -0
  45. package/src/context-builder.ts +309 -0
  46. package/src/file-completion-handler.ts +521 -0
  47. package/src/file-handler.ts +242 -0
  48. package/src/guest-approval-handler.ts +223 -0
  49. package/src/logger.ts +73 -0
  50. package/src/merge-handler.ts +335 -0
  51. package/src/message-router.ts +151 -0
  52. package/src/models/index.ts +197 -0
  53. package/src/models/routing.ts +50 -0
  54. package/src/models/thread-mapping.ts +40 -0
  55. package/src/monitor-service.ts +222 -0
  56. package/src/notification-service.ts +118 -0
  57. package/src/opencode-session-registry.ts +370 -0
  58. package/src/persistence/team-store.ts +396 -0
  59. package/src/persistence/thread-mapping-store.ts +258 -0
  60. package/src/question-handler.ts +401 -0
  61. package/src/reaction-handler.ts +111 -0
  62. package/src/response-streamer.ts +364 -0
  63. package/src/scheduler/schedule-store.ts +261 -0
  64. package/src/scheduler/scheduler-service.ts +349 -0
  65. package/src/session-manager.ts +142 -0
  66. package/src/session-ownership-handler.ts +253 -0
  67. package/src/status-indicator.ts +279 -0
  68. package/src/thread-manager.ts +231 -0
  69. package/src/todo-manager.ts +162 -0
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Connect to Mattermost for remote control via DMs
3
+ ---
4
+
5
+ Use the mattermost_connect tool to connect to Mattermost. This enables remote control of this OpenCode session via DMs to the bot user.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Disconnect from Mattermost remote control
3
+ ---
4
+
5
+ Use the mattermost_disconnect tool to disconnect from Mattermost.
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: Monitor an OpenCode session for events (permission requests, idle, questions). Sends DM alerts when the session needs attention.
3
+ ---
4
+
5
+ Use the mattermost_monitor tool to monitor an OpenCode session. When the session triggers a permission request, goes idle, or asks a question, a DM alert will be sent to the specified user.
6
+
7
+ Arguments (optional):
8
+ - sessionId: Session ID to monitor (defaults to current session)
9
+ - targetUser: Mattermost username to notify (defaults to command invoker)
10
+ - persistent: Keep monitoring after each alert (default: true). Set to false for one-time alerts.
11
+
12
+ Use mattermost_unmonitor to stop monitoring.
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: Check Mattermost connection status
3
+ ---
4
+
5
+ Use the mattermost_status tool to check the current Mattermost connection status.
@@ -0,0 +1,184 @@
1
+ ---
2
+ description: Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
3
+ ---
4
+
5
+ ## User Input
6
+
7
+ ```text
8
+ $ARGUMENTS
9
+ ```
10
+
11
+ You **MUST** consider the user input before proceeding (if not empty).
12
+
13
+ ## Goal
14
+
15
+ Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/speckit.tasks` has successfully produced a complete `tasks.md`.
16
+
17
+ ## Operating Constraints
18
+
19
+ **STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
20
+
21
+ **Constitution Authority**: The project constitution (`.specify/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/speckit.analyze`.
22
+
23
+ ## Execution Steps
24
+
25
+ ### 1. Initialize Analysis Context
26
+
27
+ Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
28
+
29
+ - SPEC = FEATURE_DIR/spec.md
30
+ - PLAN = FEATURE_DIR/plan.md
31
+ - TASKS = FEATURE_DIR/tasks.md
32
+
33
+ Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
34
+ For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
35
+
36
+ ### 2. Load Artifacts (Progressive Disclosure)
37
+
38
+ Load only the minimal necessary context from each artifact:
39
+
40
+ **From spec.md:**
41
+
42
+ - Overview/Context
43
+ - Functional Requirements
44
+ - Non-Functional Requirements
45
+ - User Stories
46
+ - Edge Cases (if present)
47
+
48
+ **From plan.md:**
49
+
50
+ - Architecture/stack choices
51
+ - Data Model references
52
+ - Phases
53
+ - Technical constraints
54
+
55
+ **From tasks.md:**
56
+
57
+ - Task IDs
58
+ - Descriptions
59
+ - Phase grouping
60
+ - Parallel markers [P]
61
+ - Referenced file paths
62
+
63
+ **From constitution:**
64
+
65
+ - Load `.specify/memory/constitution.md` for principle validation
66
+
67
+ ### 3. Build Semantic Models
68
+
69
+ Create internal representations (do not include raw artifacts in output):
70
+
71
+ - **Requirements inventory**: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" → `user-can-upload-file`)
72
+ - **User story/action inventory**: Discrete user actions with acceptance criteria
73
+ - **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
74
+ - **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
75
+
76
+ ### 4. Detection Passes (Token-Efficient Analysis)
77
+
78
+ Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary.
79
+
80
+ #### A. Duplication Detection
81
+
82
+ - Identify near-duplicate requirements
83
+ - Mark lower-quality phrasing for consolidation
84
+
85
+ #### B. Ambiguity Detection
86
+
87
+ - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
88
+ - Flag unresolved placeholders (TODO, TKTK, ???, `<placeholder>`, etc.)
89
+
90
+ #### C. Underspecification
91
+
92
+ - Requirements with verbs but missing object or measurable outcome
93
+ - User stories missing acceptance criteria alignment
94
+ - Tasks referencing files or components not defined in spec/plan
95
+
96
+ #### D. Constitution Alignment
97
+
98
+ - Any requirement or plan element conflicting with a MUST principle
99
+ - Missing mandated sections or quality gates from constitution
100
+
101
+ #### E. Coverage Gaps
102
+
103
+ - Requirements with zero associated tasks
104
+ - Tasks with no mapped requirement/story
105
+ - Non-functional requirements not reflected in tasks (e.g., performance, security)
106
+
107
+ #### F. Inconsistency
108
+
109
+ - Terminology drift (same concept named differently across files)
110
+ - Data entities referenced in plan but absent in spec (or vice versa)
111
+ - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
112
+ - Conflicting requirements (e.g., one requires Next.js while other specifies Vue)
113
+
114
+ ### 5. Severity Assignment
115
+
116
+ Use this heuristic to prioritize findings:
117
+
118
+ - **CRITICAL**: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality
119
+ - **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
120
+ - **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
121
+ - **LOW**: Style/wording improvements, minor redundancy not affecting execution order
122
+
123
+ ### 6. Produce Compact Analysis Report
124
+
125
+ Output a Markdown report (no file writes) with the following structure:
126
+
127
+ ## Specification Analysis Report
128
+
129
+ | ID | Category | Severity | Location(s) | Summary | Recommendation |
130
+ |----|----------|----------|-------------|---------|----------------|
131
+ | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
132
+
133
+ (Add one row per finding; generate stable IDs prefixed by category initial.)
134
+
135
+ **Coverage Summary Table:**
136
+
137
+ | Requirement Key | Has Task? | Task IDs | Notes |
138
+ |-----------------|-----------|----------|-------|
139
+
140
+ **Constitution Alignment Issues:** (if any)
141
+
142
+ **Unmapped Tasks:** (if any)
143
+
144
+ **Metrics:**
145
+
146
+ - Total Requirements
147
+ - Total Tasks
148
+ - Coverage % (requirements with >=1 task)
149
+ - Ambiguity Count
150
+ - Duplication Count
151
+ - Critical Issues Count
152
+
153
+ ### 7. Provide Next Actions
154
+
155
+ At end of report, output a concise Next Actions block:
156
+
157
+ - If CRITICAL issues exist: Recommend resolving before `/speckit.implement`
158
+ - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
159
+ - Provide explicit command suggestions: e.g., "Run /speckit.specify with refinement", "Run /speckit.plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
160
+
161
+ ### 8. Offer Remediation
162
+
163
+ Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
164
+
165
+ ## Operating Principles
166
+
167
+ ### Context Efficiency
168
+
169
+ - **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
170
+ - **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
171
+ - **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
172
+ - **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
173
+
174
+ ### Analysis Guidelines
175
+
176
+ - **NEVER modify files** (this is read-only analysis)
177
+ - **NEVER hallucinate missing sections** (if absent, report them accurately)
178
+ - **Prioritize constitution violations** (these are always CRITICAL)
179
+ - **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
180
+ - **Report zero issues gracefully** (emit success report with coverage statistics)
181
+
182
+ ## Context
183
+
184
+ $ARGUMENTS
@@ -0,0 +1,294 @@
1
+ ---
2
+ description: Generate a custom checklist for the current feature based on user requirements.
3
+ ---
4
+
5
+ ## Checklist Purpose: "Unit Tests for English"
6
+
7
+ **CRITICAL CONCEPT**: Checklists are **UNIT TESTS FOR REQUIREMENTS WRITING** - they validate the quality, clarity, and completeness of requirements in a given domain.
8
+
9
+ **NOT for verification/testing**:
10
+
11
+ - ❌ NOT "Verify the button clicks correctly"
12
+ - ❌ NOT "Test error handling works"
13
+ - ❌ NOT "Confirm the API returns 200"
14
+ - ❌ NOT checking if code/implementation matches the spec
15
+
16
+ **FOR requirements quality validation**:
17
+
18
+ - ✅ "Are visual hierarchy requirements defined for all card types?" (completeness)
19
+ - ✅ "Is 'prominent display' quantified with specific sizing/positioning?" (clarity)
20
+ - ✅ "Are hover state requirements consistent across all interactive elements?" (consistency)
21
+ - ✅ "Are accessibility requirements defined for keyboard navigation?" (coverage)
22
+ - ✅ "Does the spec define what happens when logo image fails to load?" (edge cases)
23
+
24
+ **Metaphor**: If your spec is code written in English, the checklist is its unit test suite. You're testing whether the requirements are well-written, complete, unambiguous, and ready for implementation - NOT whether the implementation works.
25
+
26
+ ## User Input
27
+
28
+ ```text
29
+ $ARGUMENTS
30
+ ```
31
+
32
+ You **MUST** consider the user input before proceeding (if not empty).
33
+
34
+ ## Execution Steps
35
+
36
+ 1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS list.
37
+ - All file paths must be absolute.
38
+ - For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
39
+
40
+ 2. **Clarify intent (dynamic)**: Derive up to THREE initial contextual clarifying questions (no pre-baked catalog). They MUST:
41
+ - Be generated from the user's phrasing + extracted signals from spec/plan/tasks
42
+ - Only ask about information that materially changes checklist content
43
+ - Be skipped individually if already unambiguous in `$ARGUMENTS`
44
+ - Prefer precision over breadth
45
+
46
+ Generation algorithm:
47
+ 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").
48
+ 2. Cluster signals into candidate focus areas (max 4) ranked by relevance.
49
+ 3. Identify probable audience & timing (author, reviewer, QA, release) if not explicit.
50
+ 4. Detect missing dimensions: scope breadth, depth/rigor, risk emphasis, exclusion boundaries, measurable acceptance criteria.
51
+ 5. Formulate questions chosen from these archetypes:
52
+ - Scope refinement (e.g., "Should this include integration touchpoints with X and Y or stay limited to local module correctness?")
53
+ - Risk prioritization (e.g., "Which of these potential risk areas should receive mandatory gating checks?")
54
+ - Depth calibration (e.g., "Is this a lightweight pre-commit sanity list or a formal release gate?")
55
+ - Audience framing (e.g., "Will this be used by the author only or peers during PR review?")
56
+ - Boundary exclusion (e.g., "Should we explicitly exclude performance tuning items this round?")
57
+ - Scenario class gap (e.g., "No recovery flows detected—are rollback / partial failure paths in scope?")
58
+
59
+ Question formatting rules:
60
+ - If presenting options, generate a compact table with columns: Option | Candidate | Why It Matters
61
+ - Limit to A–E options maximum; omit table if a free-form answer is clearer
62
+ - Never ask the user to restate what they already said
63
+ - Avoid speculative categories (no hallucination). If uncertain, ask explicitly: "Confirm whether X belongs in scope."
64
+
65
+ Defaults when interaction impossible:
66
+ - Depth: Standard
67
+ - Audience: Reviewer (PR) if code-related; Author otherwise
68
+ - Focus: Top 2 relevance clusters
69
+
70
+ Output the questions (label Q1/Q2/Q3). After answers: if ≥2 scenario classes (Alternate / Exception / Recovery / Non-Functional domain) remain unclear, you MAY ask up to TWO more targeted follow‑ups (Q4/Q5) with a one-line justification each (e.g., "Unresolved recovery path risk"). Do not exceed five total questions. Skip escalation if user explicitly declines more.
71
+
72
+ 3. **Understand user request**: Combine `$ARGUMENTS` + clarifying answers:
73
+ - Derive checklist theme (e.g., security, review, deploy, ux)
74
+ - Consolidate explicit must-have items mentioned by user
75
+ - Map focus selections to category scaffolding
76
+ - Infer any missing context from spec/plan/tasks (do NOT hallucinate)
77
+
78
+ 4. **Load feature context**: Read from FEATURE_DIR:
79
+ - spec.md: Feature requirements and scope
80
+ - plan.md (if exists): Technical details, dependencies
81
+ - tasks.md (if exists): Implementation tasks
82
+
83
+ **Context Loading Strategy**:
84
+ - Load only necessary portions relevant to active focus areas (avoid full-file dumping)
85
+ - Prefer summarizing long sections into concise scenario/requirement bullets
86
+ - Use progressive disclosure: add follow-on retrieval only if gaps detected
87
+ - If source docs are large, generate interim summary items instead of embedding raw text
88
+
89
+ 5. **Generate checklist** - Create "Unit Tests for Requirements":
90
+ - Create `FEATURE_DIR/checklists/` directory if it doesn't exist
91
+ - Generate unique checklist filename:
92
+ - Use short, descriptive name based on domain (e.g., `ux.md`, `api.md`, `security.md`)
93
+ - Format: `[domain].md`
94
+ - If file exists, append to existing file
95
+ - Number items sequentially starting from CHK001
96
+ - Each `/speckit.checklist` run creates a NEW file (never overwrites existing checklists)
97
+
98
+ **CORE PRINCIPLE - Test the Requirements, Not the Implementation**:
99
+ Every checklist item MUST evaluate the REQUIREMENTS THEMSELVES for:
100
+ - **Completeness**: Are all necessary requirements present?
101
+ - **Clarity**: Are requirements unambiguous and specific?
102
+ - **Consistency**: Do requirements align with each other?
103
+ - **Measurability**: Can requirements be objectively verified?
104
+ - **Coverage**: Are all scenarios/edge cases addressed?
105
+
106
+ **Category Structure** - Group items by requirement quality dimensions:
107
+ - **Requirement Completeness** (Are all necessary requirements documented?)
108
+ - **Requirement Clarity** (Are requirements specific and unambiguous?)
109
+ - **Requirement Consistency** (Do requirements align without conflicts?)
110
+ - **Acceptance Criteria Quality** (Are success criteria measurable?)
111
+ - **Scenario Coverage** (Are all flows/cases addressed?)
112
+ - **Edge Case Coverage** (Are boundary conditions defined?)
113
+ - **Non-Functional Requirements** (Performance, Security, Accessibility, etc. - are they specified?)
114
+ - **Dependencies & Assumptions** (Are they documented and validated?)
115
+ - **Ambiguities & Conflicts** (What needs clarification?)
116
+
117
+ **HOW TO WRITE CHECKLIST ITEMS - "Unit Tests for English"**:
118
+
119
+ ❌ **WRONG** (Testing implementation):
120
+ - "Verify landing page displays 3 episode cards"
121
+ - "Test hover states work on desktop"
122
+ - "Confirm logo click navigates home"
123
+
124
+ ✅ **CORRECT** (Testing requirements quality):
125
+ - "Are the exact number and layout of featured episodes specified?" [Completeness]
126
+ - "Is 'prominent display' quantified with specific sizing/positioning?" [Clarity]
127
+ - "Are hover state requirements consistent across all interactive elements?" [Consistency]
128
+ - "Are keyboard navigation requirements defined for all interactive UI?" [Coverage]
129
+ - "Is the fallback behavior specified when logo image fails to load?" [Edge Cases]
130
+ - "Are loading states defined for asynchronous episode data?" [Completeness]
131
+ - "Does the spec define visual hierarchy for competing UI elements?" [Clarity]
132
+
133
+ **ITEM STRUCTURE**:
134
+ Each item should follow this pattern:
135
+ - Question format asking about requirement quality
136
+ - Focus on what's WRITTEN (or not written) in the spec/plan
137
+ - Include quality dimension in brackets [Completeness/Clarity/Consistency/etc.]
138
+ - Reference spec section `[Spec §X.Y]` when checking existing requirements
139
+ - Use `[Gap]` marker when checking for missing requirements
140
+
141
+ **EXAMPLES BY QUALITY DIMENSION**:
142
+
143
+ Completeness:
144
+ - "Are error handling requirements defined for all API failure modes? [Gap]"
145
+ - "Are accessibility requirements specified for all interactive elements? [Completeness]"
146
+ - "Are mobile breakpoint requirements defined for responsive layouts? [Gap]"
147
+
148
+ Clarity:
149
+ - "Is 'fast loading' quantified with specific timing thresholds? [Clarity, Spec §NFR-2]"
150
+ - "Are 'related episodes' selection criteria explicitly defined? [Clarity, Spec §FR-5]"
151
+ - "Is 'prominent' defined with measurable visual properties? [Ambiguity, Spec §FR-4]"
152
+
153
+ Consistency:
154
+ - "Do navigation requirements align across all pages? [Consistency, Spec §FR-10]"
155
+ - "Are card component requirements consistent between landing and detail pages? [Consistency]"
156
+
157
+ Coverage:
158
+ - "Are requirements defined for zero-state scenarios (no episodes)? [Coverage, Edge Case]"
159
+ - "Are concurrent user interaction scenarios addressed? [Coverage, Gap]"
160
+ - "Are requirements specified for partial data loading failures? [Coverage, Exception Flow]"
161
+
162
+ Measurability:
163
+ - "Are visual hierarchy requirements measurable/testable? [Acceptance Criteria, Spec §FR-1]"
164
+ - "Can 'balanced visual weight' be objectively verified? [Measurability, Spec §FR-2]"
165
+
166
+ **Scenario Classification & Coverage** (Requirements Quality Focus):
167
+ - Check if requirements exist for: Primary, Alternate, Exception/Error, Recovery, Non-Functional scenarios
168
+ - For each scenario class, ask: "Are [scenario type] requirements complete, clear, and consistent?"
169
+ - If scenario class missing: "Are [scenario type] requirements intentionally excluded or missing? [Gap]"
170
+ - Include resilience/rollback when state mutation occurs: "Are rollback requirements defined for migration failures? [Gap]"
171
+
172
+ **Traceability Requirements**:
173
+ - MINIMUM: ≥80% of items MUST include at least one traceability reference
174
+ - Each item should reference: spec section `[Spec §X.Y]`, or use markers: `[Gap]`, `[Ambiguity]`, `[Conflict]`, `[Assumption]`
175
+ - If no ID system exists: "Is a requirement & acceptance criteria ID scheme established? [Traceability]"
176
+
177
+ **Surface & Resolve Issues** (Requirements Quality Problems):
178
+ Ask questions about the requirements themselves:
179
+ - Ambiguities: "Is the term 'fast' quantified with specific metrics? [Ambiguity, Spec §NFR-1]"
180
+ - Conflicts: "Do navigation requirements conflict between §FR-10 and §FR-10a? [Conflict]"
181
+ - Assumptions: "Is the assumption of 'always available podcast API' validated? [Assumption]"
182
+ - Dependencies: "Are external podcast API requirements documented? [Dependency, Gap]"
183
+ - Missing definitions: "Is 'visual hierarchy' defined with measurable criteria? [Gap]"
184
+
185
+ **Content Consolidation**:
186
+ - Soft cap: If raw candidate items > 40, prioritize by risk/impact
187
+ - Merge near-duplicates checking the same requirement aspect
188
+ - If >5 low-impact edge cases, create one item: "Are edge cases X, Y, Z addressed in requirements? [Coverage]"
189
+
190
+ **🚫 ABSOLUTELY PROHIBITED** - These make it an implementation test, not a requirements test:
191
+ - ❌ Any item starting with "Verify", "Test", "Confirm", "Check" + implementation behavior
192
+ - ❌ References to code execution, user actions, system behavior
193
+ - ❌ "Displays correctly", "works properly", "functions as expected"
194
+ - ❌ "Click", "navigate", "render", "load", "execute"
195
+ - ❌ Test cases, test plans, QA procedures
196
+ - ❌ Implementation details (frameworks, APIs, algorithms)
197
+
198
+ **✅ REQUIRED PATTERNS** - These test requirements quality:
199
+ - ✅ "Are [requirement type] defined/specified/documented for [scenario]?"
200
+ - ✅ "Is [vague term] quantified/clarified with specific criteria?"
201
+ - ✅ "Are requirements consistent between [section A] and [section B]?"
202
+ - ✅ "Can [requirement] be objectively measured/verified?"
203
+ - ✅ "Are [edge cases/scenarios] addressed in requirements?"
204
+ - ✅ "Does the spec define [missing aspect]?"
205
+
206
+ 6. **Structure Reference**: Generate the checklist following the canonical template in `.specify/templates/checklist-template.md` for title, meta section, category headings, and ID formatting. If template is unavailable, use: H1 title, purpose/created meta lines, `##` category sections containing `- [ ] CHK### <requirement item>` lines with globally incrementing IDs starting at CHK001.
207
+
208
+ 7. **Report**: Output full path to created checklist, item count, and remind user that each run creates a new file. Summarize:
209
+ - Focus areas selected
210
+ - Depth level
211
+ - Actor/timing
212
+ - Any explicit user-specified must-have items incorporated
213
+
214
+ **Important**: Each `/speckit.checklist` command invocation creates a checklist file using short, descriptive names unless file already exists. This allows:
215
+
216
+ - Multiple checklists of different types (e.g., `ux.md`, `test.md`, `security.md`)
217
+ - Simple, memorable filenames that indicate checklist purpose
218
+ - Easy identification and navigation in the `checklists/` folder
219
+
220
+ To avoid clutter, use descriptive types and clean up obsolete checklists when done.
221
+
222
+ ## Example Checklist Types & Sample Items
223
+
224
+ **UX Requirements Quality:** `ux.md`
225
+
226
+ Sample items (testing the requirements, NOT the implementation):
227
+
228
+ - "Are visual hierarchy requirements defined with measurable criteria? [Clarity, Spec §FR-1]"
229
+ - "Is the number and positioning of UI elements explicitly specified? [Completeness, Spec §FR-1]"
230
+ - "Are interaction state requirements (hover, focus, active) consistently defined? [Consistency]"
231
+ - "Are accessibility requirements specified for all interactive elements? [Coverage, Gap]"
232
+ - "Is fallback behavior defined when images fail to load? [Edge Case, Gap]"
233
+ - "Can 'prominent display' be objectively measured? [Measurability, Spec §FR-4]"
234
+
235
+ **API Requirements Quality:** `api.md`
236
+
237
+ Sample items:
238
+
239
+ - "Are error response formats specified for all failure scenarios? [Completeness]"
240
+ - "Are rate limiting requirements quantified with specific thresholds? [Clarity]"
241
+ - "Are authentication requirements consistent across all endpoints? [Consistency]"
242
+ - "Are retry/timeout requirements defined for external dependencies? [Coverage, Gap]"
243
+ - "Is versioning strategy documented in requirements? [Gap]"
244
+
245
+ **Performance Requirements Quality:** `performance.md`
246
+
247
+ Sample items:
248
+
249
+ - "Are performance requirements quantified with specific metrics? [Clarity]"
250
+ - "Are performance targets defined for all critical user journeys? [Coverage]"
251
+ - "Are performance requirements under different load conditions specified? [Completeness]"
252
+ - "Can performance requirements be objectively measured? [Measurability]"
253
+ - "Are degradation requirements defined for high-load scenarios? [Edge Case, Gap]"
254
+
255
+ **Security Requirements Quality:** `security.md`
256
+
257
+ Sample items:
258
+
259
+ - "Are authentication requirements specified for all protected resources? [Coverage]"
260
+ - "Are data protection requirements defined for sensitive information? [Completeness]"
261
+ - "Is the threat model documented and requirements aligned to it? [Traceability]"
262
+ - "Are security requirements consistent with compliance obligations? [Consistency]"
263
+ - "Are security failure/breach response requirements defined? [Gap, Exception Flow]"
264
+
265
+ ## Anti-Examples: What NOT To Do
266
+
267
+ **❌ WRONG - These test implementation, not requirements:**
268
+
269
+ ```markdown
270
+ - [ ] CHK001 - Verify landing page displays 3 episode cards [Spec §FR-001]
271
+ - [ ] CHK002 - Test hover states work correctly on desktop [Spec §FR-003]
272
+ - [ ] CHK003 - Confirm logo click navigates to home page [Spec §FR-010]
273
+ - [ ] CHK004 - Check that related episodes section shows 3-5 items [Spec §FR-005]
274
+ ```
275
+
276
+ **✅ CORRECT - These test requirements quality:**
277
+
278
+ ```markdown
279
+ - [ ] CHK001 - Are the number and layout of featured episodes explicitly specified? [Completeness, Spec §FR-001]
280
+ - [ ] CHK002 - Are hover state requirements consistently defined for all interactive elements? [Consistency, Spec §FR-003]
281
+ - [ ] CHK003 - Are navigation requirements clear for all clickable brand elements? [Clarity, Spec §FR-010]
282
+ - [ ] CHK004 - Is the selection criteria for related episodes documented? [Gap, Spec §FR-005]
283
+ - [ ] CHK005 - Are loading state requirements defined for asynchronous episode data? [Gap]
284
+ - [ ] CHK006 - Can "visual hierarchy" requirements be objectively measured? [Measurability, Spec §FR-001]
285
+ ```
286
+
287
+ **Key Differences:**
288
+
289
+ - Wrong: Tests if the system works correctly
290
+ - Correct: Tests if the requirements are written correctly
291
+ - Wrong: Verification of behavior
292
+ - Correct: Validation of requirement quality
293
+ - Wrong: "Does it do X?"
294
+ - Correct: "Is X clearly specified?"