@vtex/faststore-plugin-buyer-portal 2.0.6 → 2.0.7

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.
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: "speckit-plan"
3
+ description: "Execute the implementation planning workflow using the plan template to generate design artifacts."
4
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
5
+ metadata:
6
+ author: "github-spec-kit"
7
+ source: "templates/commands/plan.md"
8
+ ---
9
+
10
+
11
+ ## User Input
12
+
13
+ ```text
14
+ $ARGUMENTS
15
+ ```
16
+
17
+ You **MUST** consider the user input before proceeding (if not empty).
18
+
19
+ ## Pre-Execution Checks
20
+
21
+ **Check for extension hooks (before planning)**:
22
+ - Check if `.specify/extensions.yml` exists in the project root.
23
+ - If it exists, read it and look for entries under the `hooks.before_plan` key
24
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
25
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
26
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
27
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
28
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
29
+ - For each executable hook, output the following based on its `optional` flag:
30
+ - **Optional hook** (`optional: true`):
31
+ ```
32
+ ## Extension Hooks
33
+
34
+ **Optional Pre-Hook**: {extension}
35
+ Command: `/{command}`
36
+ Description: {description}
37
+
38
+ Prompt: {prompt}
39
+ To execute: `/{command}`
40
+ ```
41
+ - **Mandatory hook** (`optional: false`):
42
+ ```
43
+ ## Extension Hooks
44
+
45
+ **Automatic Pre-Hook**: {extension}
46
+ Executing: `/{command}`
47
+ EXECUTE_COMMAND: {command}
48
+
49
+ Wait for the result of the hook command before proceeding to the Outline.
50
+ ```
51
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
52
+
53
+ ## Outline
54
+
55
+ 1. **Setup**: Run `.specify/scripts/bash/setup-plan.sh --json` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. 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").
56
+
57
+ 2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).
58
+
59
+ 3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
60
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
61
+ - Fill Constitution Check section from constitution
62
+ - Evaluate gates (ERROR if violations unjustified)
63
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
64
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
65
+ - Phase 1: Update agent context by running the agent script
66
+ - Re-evaluate Constitution Check post-design
67
+
68
+ 4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
69
+
70
+ 5. **Check for extension hooks**: After reporting, check if `.specify/extensions.yml` exists in the project root.
71
+ - If it exists, read it and look for entries under the `hooks.after_plan` key
72
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
73
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
74
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
75
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
76
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
77
+ - For each executable hook, output the following based on its `optional` flag:
78
+ - **Optional hook** (`optional: true`):
79
+ ```
80
+ ## Extension Hooks
81
+
82
+ **Optional Hook**: {extension}
83
+ Command: `/{command}`
84
+ Description: {description}
85
+
86
+ Prompt: {prompt}
87
+ To execute: `/{command}`
88
+ ```
89
+ - **Mandatory hook** (`optional: false`):
90
+ ```
91
+ ## Extension Hooks
92
+
93
+ **Automatic Hook**: {extension}
94
+ Executing: `/{command}`
95
+ EXECUTE_COMMAND: {command}
96
+ ```
97
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
98
+
99
+ ## Phases
100
+
101
+ ### Phase 0: Outline & Research
102
+
103
+ 1. **Extract unknowns from Technical Context** above:
104
+ - For each NEEDS CLARIFICATION → research task
105
+ - For each dependency → best practices task
106
+ - For each integration → patterns task
107
+
108
+ 2. **Generate and dispatch research agents**:
109
+
110
+ ```text
111
+ For each unknown in Technical Context:
112
+ Task: "Research {unknown} for {feature context}"
113
+ For each technology choice:
114
+ Task: "Find best practices for {tech} in {domain}"
115
+ ```
116
+
117
+ 3. **Consolidate findings** in `research.md` using format:
118
+ - Decision: [what was chosen]
119
+ - Rationale: [why chosen]
120
+ - Alternatives considered: [what else evaluated]
121
+
122
+ **Output**: research.md with all NEEDS CLARIFICATION resolved
123
+
124
+ ### Phase 1: Design & Contracts
125
+
126
+ **Prerequisites:** `research.md` complete
127
+
128
+ 1. **Extract entities from feature spec** → `data-model.md`:
129
+ - Entity name, fields, relationships
130
+ - Validation rules from requirements
131
+ - State transitions if applicable
132
+
133
+ 2. **Define interface contracts** (if project has external interfaces) → `/contracts/`:
134
+ - Identify what interfaces the project exposes to users or other systems
135
+ - Document the contract format appropriate for the project type
136
+ - Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications
137
+ - Skip if project is purely internal (build scripts, one-off tools, etc.)
138
+
139
+ 3. **Agent context update**:
140
+ - Update the plan reference between the `<!-- SPECKIT START -->` and `<!-- SPECKIT END -->` markers in `.cursor/rules/specify-rules.mdc` to point to the plan file created in step 1 (the IMPL_PLAN path)
141
+
142
+ **Output**: data-model.md, /contracts/*, quickstart.md, updated agent context file
143
+
144
+ ## Key rules
145
+
146
+ - Use absolute paths for filesystem operations; use project-relative paths for references in documentation and agent context files
147
+ - ERROR on gate failures or unresolved clarifications
@@ -0,0 +1,325 @@
1
+ ---
2
+ name: "speckit-specify"
3
+ description: "Create or update the feature specification from a natural language feature description."
4
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
5
+ metadata:
6
+ author: "github-spec-kit"
7
+ source: "templates/commands/specify.md"
8
+ ---
9
+
10
+
11
+ ## User Input
12
+
13
+ ```text
14
+ $ARGUMENTS
15
+ ```
16
+
17
+ You **MUST** consider the user input before proceeding (if not empty).
18
+
19
+ ## Pre-Execution Checks
20
+
21
+ **Check for extension hooks (before specification)**:
22
+ - Check if `.specify/extensions.yml` exists in the project root.
23
+ - If it exists, read it and look for entries under the `hooks.before_specify` key
24
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
25
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
26
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
27
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
28
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
29
+ - For each executable hook, output the following based on its `optional` flag:
30
+ - **Optional hook** (`optional: true`):
31
+ ```
32
+ ## Extension Hooks
33
+
34
+ **Optional Pre-Hook**: {extension}
35
+ Command: `/{command}`
36
+ Description: {description}
37
+
38
+ Prompt: {prompt}
39
+ To execute: `/{command}`
40
+ ```
41
+ - **Mandatory hook** (`optional: false`):
42
+ ```
43
+ ## Extension Hooks
44
+
45
+ **Automatic Pre-Hook**: {extension}
46
+ Executing: `/{command}`
47
+ EXECUTE_COMMAND: {command}
48
+
49
+ Wait for the result of the hook command before proceeding to the Outline.
50
+ ```
51
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
52
+
53
+ ## Outline
54
+
55
+ The text the user typed after `/speckit-specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `$ARGUMENTS` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
56
+
57
+ Given that feature description, do this:
58
+
59
+ 1. **Generate a concise short name** (2-4 words) for the feature:
60
+ - Analyze the feature description and extract the most meaningful keywords
61
+ - Create a 2-4 word short name that captures the essence of the feature
62
+ - Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
63
+ - Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)
64
+ - Keep it concise but descriptive enough to understand the feature at a glance
65
+ - Examples:
66
+ - "I want to add user authentication" → "user-auth"
67
+ - "Implement OAuth2 integration for the API" → "oauth2-api-integration"
68
+ - "Create a dashboard for analytics" → "analytics-dashboard"
69
+ - "Fix payment processing timeout bug" → "fix-payment-timeout"
70
+
71
+ 2. **Branch creation** (optional, via hook):
72
+
73
+ If a `before_specify` hook ran successfully in the Pre-Execution Checks above, it will have created/switched to a git branch and output JSON containing `BRANCH_NAME` and `FEATURE_NUM`. Note these values for reference, but the branch name does **not** dictate the spec directory name.
74
+
75
+ If the user explicitly provided `GIT_BRANCH_NAME`, pass it through to the hook so the branch script uses the exact value as the branch name (bypassing all prefix/suffix generation).
76
+
77
+ 3. **Create the spec feature directory**:
78
+
79
+ Specs live under the default `specs/` directory unless the user explicitly provides `SPECIFY_FEATURE_DIRECTORY`.
80
+
81
+ **Resolution order for `SPECIFY_FEATURE_DIRECTORY`**:
82
+ 1. If the user explicitly provided `SPECIFY_FEATURE_DIRECTORY` (e.g., via environment variable, argument, or configuration), use it as-is
83
+ 2. Otherwise, auto-generate it under `specs/`:
84
+ - Check `.specify/init-options.json` for `branch_numbering`
85
+ - If `"timestamp"`: prefix is `YYYYMMDD-HHMMSS` (current timestamp)
86
+ - If `"sequential"` or absent: prefix is `NNN` (next available 3-digit number after scanning existing directories in `specs/`)
87
+ - Construct the directory name: `<prefix>-<short-name>` (e.g., `003-user-auth` or `20260319-143022-user-auth`)
88
+ - Set `SPECIFY_FEATURE_DIRECTORY` to `specs/<directory-name>`
89
+
90
+ **Create the directory and spec file**:
91
+ - `mkdir -p SPECIFY_FEATURE_DIRECTORY`
92
+ - Copy `.specify/templates/spec-template.md` to `SPECIFY_FEATURE_DIRECTORY/spec.md` as the starting point
93
+ - Set `SPEC_FILE` to `SPECIFY_FEATURE_DIRECTORY/spec.md`
94
+ - Persist the resolved path to `.specify/feature.json`:
95
+ ```json
96
+ {
97
+ "feature_directory": "<resolved feature dir>"
98
+ }
99
+ ```
100
+ Write the actual resolved directory path value (for example, `specs/003-user-auth`), not the literal string `SPECIFY_FEATURE_DIRECTORY`.
101
+ This allows downstream commands (`/speckit-plan`, `/speckit-tasks`, etc.) to locate the feature directory without relying on git branch name conventions.
102
+
103
+ **IMPORTANT**:
104
+ - You must only create one feature per `/speckit-specify` invocation
105
+ - The spec directory name and the git branch name are independent — they may be the same but that is the user's choice
106
+ - The spec directory and file are always created by this command, never by the hook
107
+
108
+ 4. Load `.specify/templates/spec-template.md` to understand required sections.
109
+
110
+ 5. Follow this execution flow:
111
+ 1. Parse user description from arguments
112
+ If empty: ERROR "No feature description provided"
113
+ 2. Extract key concepts from description
114
+ Identify: actors, actions, data, constraints
115
+ 3. For unclear aspects:
116
+ - Make informed guesses based on context and industry standards
117
+ - Only mark with [NEEDS CLARIFICATION: specific question] if:
118
+ - The choice significantly impacts feature scope or user experience
119
+ - Multiple reasonable interpretations exist with different implications
120
+ - No reasonable default exists
121
+ - **LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total**
122
+ - Prioritize clarifications by impact: scope > security/privacy > user experience > technical details
123
+ 4. Fill User Scenarios & Testing section
124
+ If no clear user flow: ERROR "Cannot determine user scenarios"
125
+ 5. Generate Functional Requirements
126
+ Each requirement must be testable
127
+ Use reasonable defaults for unspecified details (document assumptions in Assumptions section)
128
+ 6. Define Success Criteria
129
+ Create measurable, technology-agnostic outcomes
130
+ Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)
131
+ Each criterion must be verifiable without implementation details
132
+ 7. Identify Key Entities (if data involved)
133
+ 8. Return: SUCCESS (spec ready for planning)
134
+
135
+ 6. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
136
+
137
+ 7. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
138
+
139
+ a. **Create Spec Quality Checklist**: Generate a checklist file at `SPECIFY_FEATURE_DIRECTORY/checklists/requirements.md` using the checklist template structure with these validation items:
140
+
141
+ ```markdown
142
+ # Specification Quality Checklist: [FEATURE NAME]
143
+
144
+ **Purpose**: Validate specification completeness and quality before proceeding to planning
145
+ **Created**: [DATE]
146
+ **Feature**: [Link to spec.md]
147
+
148
+ ## Content Quality
149
+
150
+ - [ ] No implementation details (languages, frameworks, APIs)
151
+ - [ ] Focused on user value and business needs
152
+ - [ ] Written for non-technical stakeholders
153
+ - [ ] All mandatory sections completed
154
+
155
+ ## Requirement Completeness
156
+
157
+ - [ ] No [NEEDS CLARIFICATION] markers remain
158
+ - [ ] Requirements are testable and unambiguous
159
+ - [ ] Success criteria are measurable
160
+ - [ ] Success criteria are technology-agnostic (no implementation details)
161
+ - [ ] All acceptance scenarios are defined
162
+ - [ ] Edge cases are identified
163
+ - [ ] Scope is clearly bounded
164
+ - [ ] Dependencies and assumptions identified
165
+
166
+ ## Feature Readiness
167
+
168
+ - [ ] All functional requirements have clear acceptance criteria
169
+ - [ ] User scenarios cover primary flows
170
+ - [ ] Feature meets measurable outcomes defined in Success Criteria
171
+ - [ ] No implementation details leak into specification
172
+
173
+ ## Notes
174
+
175
+ - Items marked incomplete require spec updates before `/speckit-clarify` or `/speckit-plan`
176
+ ```
177
+
178
+ b. **Run Validation Check**: Review the spec against each checklist item:
179
+ - For each item, determine if it passes or fails
180
+ - Document specific issues found (quote relevant spec sections)
181
+
182
+ c. **Handle Validation Results**:
183
+
184
+ - **If all items pass**: Mark checklist complete and proceed to step 8
185
+
186
+ - **If items fail (excluding [NEEDS CLARIFICATION])**:
187
+ 1. List the failing items and specific issues
188
+ 2. Update the spec to address each issue
189
+ 3. Re-run validation until all items pass (max 3 iterations)
190
+ 4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user
191
+
192
+ - **If [NEEDS CLARIFICATION] markers remain**:
193
+ 1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec
194
+ 2. **LIMIT CHECK**: If more than 3 markers exist, keep only the 3 most critical (by scope/security/UX impact) and make informed guesses for the rest
195
+ 3. For each clarification needed (max 3), present options to user in this format:
196
+
197
+ ```markdown
198
+ ## Question [N]: [Topic]
199
+
200
+ **Context**: [Quote relevant spec section]
201
+
202
+ **What we need to know**: [Specific question from NEEDS CLARIFICATION marker]
203
+
204
+ **Suggested Answers**:
205
+
206
+ | Option | Answer | Implications |
207
+ |--------|--------|--------------|
208
+ | A | [First suggested answer] | [What this means for the feature] |
209
+ | B | [Second suggested answer] | [What this means for the feature] |
210
+ | C | [Third suggested answer] | [What this means for the feature] |
211
+ | Custom | Provide your own answer | [Explain how to provide custom input] |
212
+
213
+ **Your choice**: _[Wait for user response]_
214
+ ```
215
+
216
+ 4. **CRITICAL - Table Formatting**: Ensure markdown tables are properly formatted:
217
+ - Use consistent spacing with pipes aligned
218
+ - Each cell should have spaces around content: `| Content |` not `|Content|`
219
+ - Header separator must have at least 3 dashes: `|--------|`
220
+ - Test that the table renders correctly in markdown preview
221
+ 5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)
222
+ 6. Present all questions together before waiting for responses
223
+ 7. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")
224
+ 8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer
225
+ 9. Re-run validation after all clarifications are resolved
226
+
227
+ d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status
228
+
229
+ 8. **Report completion** to the user with:
230
+ - `SPECIFY_FEATURE_DIRECTORY` — the feature directory path
231
+ - `SPEC_FILE` — the spec file path
232
+ - Checklist results summary
233
+ - Readiness for the next phase (`/speckit-clarify` or `/speckit-plan`)
234
+
235
+ 9. **Check for extension hooks**: After reporting completion, check if `.specify/extensions.yml` exists in the project root.
236
+ - If it exists, read it and look for entries under the `hooks.after_specify` key
237
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
238
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
239
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
240
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
241
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
242
+ - For each executable hook, output the following based on its `optional` flag:
243
+ - **Optional hook** (`optional: true`):
244
+ ```
245
+ ## Extension Hooks
246
+
247
+ **Optional Hook**: {extension}
248
+ Command: `/{command}`
249
+ Description: {description}
250
+
251
+ Prompt: {prompt}
252
+ To execute: `/{command}`
253
+ ```
254
+ - **Mandatory hook** (`optional: false`):
255
+ ```
256
+ ## Extension Hooks
257
+
258
+ **Automatic Hook**: {extension}
259
+ Executing: `/{command}`
260
+ EXECUTE_COMMAND: {command}
261
+ ```
262
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
263
+
264
+ **NOTE:** Branch creation is handled by the `before_specify` hook (git extension). Spec directory and file creation are always handled by this core command.
265
+
266
+ ## Quick Guidelines
267
+
268
+ - Focus on **WHAT** users need and **WHY**.
269
+ - Avoid HOW to implement (no tech stack, APIs, code structure).
270
+ - Written for business stakeholders, not developers.
271
+ - DO NOT create any checklists that are embedded in the spec. That will be a separate command.
272
+
273
+ ### Section Requirements
274
+
275
+ - **Mandatory sections**: Must be completed for every feature
276
+ - **Optional sections**: Include only when relevant to the feature
277
+ - When a section doesn't apply, remove it entirely (don't leave as "N/A")
278
+
279
+ ### For AI Generation
280
+
281
+ When creating this spec from a user prompt:
282
+
283
+ 1. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps
284
+ 2. **Document assumptions**: Record reasonable defaults in the Assumptions section
285
+ 3. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
286
+ - Significantly impact feature scope or user experience
287
+ - Have multiple reasonable interpretations with different implications
288
+ - Lack any reasonable default
289
+ 4. **Prioritize clarifications**: scope > security/privacy > user experience > technical details
290
+ 5. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item
291
+ 6. **Common areas needing clarification** (only if no reasonable default exists):
292
+ - Feature scope and boundaries (include/exclude specific use cases)
293
+ - User types and permissions (if multiple conflicting interpretations possible)
294
+ - Security/compliance requirements (when legally/financially significant)
295
+
296
+ **Examples of reasonable defaults** (don't ask about these):
297
+
298
+ - Data retention: Industry-standard practices for the domain
299
+ - Performance targets: Standard web/mobile app expectations unless specified
300
+ - Error handling: User-friendly messages with appropriate fallbacks
301
+ - Authentication method: Standard session-based or OAuth2 for web apps
302
+ - Integration patterns: Use project-appropriate patterns (REST/GraphQL for web services, function calls for libraries, CLI args for tools, etc.)
303
+
304
+ ### Success Criteria Guidelines
305
+
306
+ Success criteria must be:
307
+
308
+ 1. **Measurable**: Include specific metrics (time, percentage, count, rate)
309
+ 2. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools
310
+ 3. **User-focused**: Describe outcomes from user/business perspective, not system internals
311
+ 4. **Verifiable**: Can be tested/validated without knowing implementation details
312
+
313
+ **Good examples**:
314
+
315
+ - "Users can complete checkout in under 3 minutes"
316
+ - "System supports 10,000 concurrent users"
317
+ - "95% of searches return results in under 1 second"
318
+ - "Task completion rate improves by 40%"
319
+
320
+ **Bad examples** (implementation-focused):
321
+
322
+ - "API response time is under 200ms" (too technical, use "Users see results instantly")
323
+ - "Database can handle 1000 TPS" (implementation detail, use user-facing metric)
324
+ - "React components render efficiently" (framework-specific)
325
+ - "Redis cache hit rate above 80%" (technology-specific)
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: "speckit-tasks"
3
+ description: "Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts."
4
+ compatibility: "Requires spec-kit project structure with .specify/ directory"
5
+ metadata:
6
+ author: "github-spec-kit"
7
+ source: "templates/commands/tasks.md"
8
+ ---
9
+
10
+
11
+ ## User Input
12
+
13
+ ```text
14
+ $ARGUMENTS
15
+ ```
16
+
17
+ You **MUST** consider the user input before proceeding (if not empty).
18
+
19
+ ## Pre-Execution Checks
20
+
21
+ **Check for extension hooks (before tasks generation)**:
22
+ - Check if `.specify/extensions.yml` exists in the project root.
23
+ - If it exists, read it and look for entries under the `hooks.before_tasks` key
24
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
25
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
26
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
27
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
28
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
29
+ - For each executable hook, output the following based on its `optional` flag:
30
+ - **Optional hook** (`optional: true`):
31
+ ```
32
+ ## Extension Hooks
33
+
34
+ **Optional Pre-Hook**: {extension}
35
+ Command: `/{command}`
36
+ Description: {description}
37
+
38
+ Prompt: {prompt}
39
+ To execute: `/{command}`
40
+ ```
41
+ - **Mandatory hook** (`optional: false`):
42
+ ```
43
+ ## Extension Hooks
44
+
45
+ **Automatic Pre-Hook**: {extension}
46
+ Executing: `/{command}`
47
+ EXECUTE_COMMAND: {command}
48
+
49
+ Wait for the result of the hook command before proceeding to the Outline.
50
+ ```
51
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
52
+
53
+ ## Outline
54
+
55
+ 1. **Setup**: Run `.specify/scripts/bash/setup-tasks.sh --json` from repo root and parse FEATURE_DIR, TASKS_TEMPLATE, and AVAILABLE_DOCS list. `FEATURE_DIR` and `TASKS_TEMPLATE` must be absolute paths when provided. `AVAILABLE_DOCS` is a list of document names/relative paths available under `FEATURE_DIR` (for example `research.md` or `contracts/`). 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").
56
+
57
+ 2. **Load design documents**: Read from FEATURE_DIR:
58
+ - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
59
+ - **Optional**: data-model.md (entities), contracts/ (interface contracts), research.md (decisions), quickstart.md (test scenarios)
60
+ - Note: Not all projects have all documents. Generate tasks based on what's available.
61
+
62
+ 3. **Execute task generation workflow**:
63
+ - Load plan.md and extract tech stack, libraries, project structure
64
+ - Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)
65
+ - If data-model.md exists: Extract entities and map to user stories
66
+ - If contracts/ exists: Map interface contracts to user stories
67
+ - If research.md exists: Extract decisions for setup tasks
68
+ - Generate tasks organized by user story (see Task Generation Rules below)
69
+ - Generate dependency graph showing user story completion order
70
+ - Create parallel execution examples per user story
71
+ - Validate task completeness (each user story has all needed tasks, independently testable)
72
+
73
+ 4. **Generate tasks.md**: Read the tasks template from TASKS_TEMPLATE (from the JSON output above) and use it as structure. If TASKS_TEMPLATE is empty, fall back to `.specify/templates/tasks-template.md`. Fill with:
74
+ - Correct feature name from plan.md
75
+ - Phase 1: Setup tasks (project initialization)
76
+ - Phase 2: Foundational tasks (blocking prerequisites for all user stories)
77
+ - Phase 3+: One phase per user story (in priority order from spec.md)
78
+ - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
79
+ - Final Phase: Polish & cross-cutting concerns
80
+ - All tasks must follow the strict checklist format (see Task Generation Rules below)
81
+ - Clear file paths for each task
82
+ - Dependencies section showing story completion order
83
+ - Parallel execution examples per story
84
+ - Implementation strategy section (MVP first, incremental delivery)
85
+
86
+ 5. **Report**: Output path to generated tasks.md and summary:
87
+ - Total task count
88
+ - Task count per user story
89
+ - Parallel opportunities identified
90
+ - Independent test criteria for each story
91
+ - Suggested MVP scope (typically just User Story 1)
92
+ - Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)
93
+
94
+ 6. **Check for extension hooks**: After tasks.md is generated, check if `.specify/extensions.yml` exists in the project root.
95
+ - If it exists, read it and look for entries under the `hooks.after_tasks` key
96
+ - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
97
+ - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
98
+ - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
99
+ - If the hook has no `condition` field, or it is null/empty, treat the hook as executable
100
+ - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
101
+ - For each executable hook, output the following based on its `optional` flag:
102
+ - **Optional hook** (`optional: true`):
103
+ ```
104
+ ## Extension Hooks
105
+
106
+ **Optional Hook**: {extension}
107
+ Command: `/{command}`
108
+ Description: {description}
109
+
110
+ Prompt: {prompt}
111
+ To execute: `/{command}`
112
+ ```
113
+ - **Mandatory hook** (`optional: false`):
114
+ ```
115
+ ## Extension Hooks
116
+
117
+ **Automatic Hook**: {extension}
118
+ Executing: `/{command}`
119
+ EXECUTE_COMMAND: {command}
120
+ ```
121
+ - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
122
+
123
+ Context for task generation: $ARGUMENTS
124
+
125
+ The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
126
+
127
+ ## Task Generation Rules
128
+
129
+ **CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.
130
+
131
+ **Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.
132
+
133
+ ### Checklist Format (REQUIRED)
134
+
135
+ Every task MUST strictly follow this format:
136
+
137
+ ```text
138
+ - [ ] [TaskID] [P?] [Story?] Description with file path
139
+ ```
140
+
141
+ **Format Components**:
142
+
143
+ 1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)
144
+ 2. **Task ID**: Sequential number (T001, T002, T003...) in execution order
145
+ 3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)
146
+ 4. **[Story] label**: REQUIRED for user story phase tasks only
147
+ - Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)
148
+ - Setup phase: NO story label
149
+ - Foundational phase: NO story label
150
+ - User Story phases: MUST have story label
151
+ - Polish phase: NO story label
152
+ 5. **Description**: Clear action with exact file path
153
+
154
+ **Examples**:
155
+
156
+ - ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`
157
+ - ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`
158
+ - ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`
159
+ - ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`
160
+ - ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)
161
+ - ❌ WRONG: `T001 [US1] Create model` (missing checkbox)
162
+ - ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)
163
+ - ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)
164
+
165
+ ### Task Organization
166
+
167
+ 1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:
168
+ - Each user story (P1, P2, P3...) gets its own phase
169
+ - Map all related components to their story:
170
+ - Models needed for that story
171
+ - Services needed for that story
172
+ - Interfaces/UI needed for that story
173
+ - If tests requested: Tests specific to that story
174
+ - Mark story dependencies (most stories should be independent)
175
+
176
+ 2. **From Contracts**:
177
+ - Map each interface contract → to the user story it serves
178
+ - If tests requested: Each interface contract → contract test task [P] before implementation in that story's phase
179
+
180
+ 3. **From Data Model**:
181
+ - Map each entity to the user story(ies) that need it
182
+ - If entity serves multiple stories: Put in earliest story or Setup phase
183
+ - Relationships → service layer tasks in appropriate story phase
184
+
185
+ 4. **From Setup/Infrastructure**:
186
+ - Shared infrastructure → Setup phase (Phase 1)
187
+ - Foundational/blocking tasks → Foundational phase (Phase 2)
188
+ - Story-specific setup → within that story's phase
189
+
190
+ ### Phase Structure
191
+
192
+ - **Phase 1**: Setup (project initialization)
193
+ - **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)
194
+ - **Phase 3+**: User Stories in priority order (P1, P2, P3...)
195
+ - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration
196
+ - Each phase should be a complete, independently testable increment
197
+ - **Final Phase**: Polish & Cross-Cutting Concerns