ai-summon 0.0.1

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 (61) hide show
  1. package/.claude/commands/speckit.analyze.md +184 -0
  2. package/.claude/commands/speckit.checklist.md +294 -0
  3. package/.claude/commands/speckit.clarify.md +177 -0
  4. package/.claude/commands/speckit.constitution.md +78 -0
  5. package/.claude/commands/speckit.implement.md +121 -0
  6. package/.claude/commands/speckit.plan.md +81 -0
  7. package/.claude/commands/speckit.specify.md +204 -0
  8. package/.claude/commands/speckit.tasks.md +108 -0
  9. package/.claude/settings.local.json +23 -0
  10. package/.prettierignore +5 -0
  11. package/.prettierrc.json +10 -0
  12. package/.specify/memory/constitution.md +72 -0
  13. package/.specify/scripts/bash/check-prerequisites.sh +166 -0
  14. package/.specify/scripts/bash/common.sh +113 -0
  15. package/.specify/scripts/bash/create-new-feature.sh +97 -0
  16. package/.specify/scripts/bash/setup-plan.sh +60 -0
  17. package/.specify/scripts/bash/update-agent-context.sh +738 -0
  18. package/.specify/templates/agent-file-template.md +28 -0
  19. package/.specify/templates/checklist-template.md +40 -0
  20. package/.specify/templates/plan-template.md +111 -0
  21. package/.specify/templates/spec-template.md +115 -0
  22. package/.specify/templates/tasks-template.md +250 -0
  23. package/CLAUDE.md +199 -0
  24. package/PRD.md +268 -0
  25. package/README.md +171 -0
  26. package/dist/ai-summon.d.ts +2 -0
  27. package/dist/ai-summon.js +73 -0
  28. package/dist/commands/ide/index.d.ts +3 -0
  29. package/dist/commands/ide/index.js +253 -0
  30. package/dist/commands/init.d.ts +4 -0
  31. package/dist/commands/init.js +55 -0
  32. package/dist/commands/url.d.ts +4 -0
  33. package/dist/commands/url.js +223 -0
  34. package/dist/types/index.d.ts +40 -0
  35. package/dist/types/index.js +1 -0
  36. package/dist/util.d.ts +16 -0
  37. package/dist/util.js +109 -0
  38. package/eslint.config.js +47 -0
  39. package/package.json +47 -0
  40. package/specs/001-cloud-login-feature/contracts/cloud-command.ts +82 -0
  41. package/specs/001-cloud-login-feature/contracts/config-service.ts +170 -0
  42. package/specs/001-cloud-login-feature/data-model.md +269 -0
  43. package/specs/001-cloud-login-feature/plan.md +91 -0
  44. package/specs/001-cloud-login-feature/quickstart.md +366 -0
  45. package/specs/001-cloud-login-feature/research.md +290 -0
  46. package/specs/001-cloud-login-feature/spec.md +195 -0
  47. package/specs/001-cloud-login-feature/tasks.md +235 -0
  48. package/specs/001-cloud-scp-command/contracts/cloud-scp-api.ts +402 -0
  49. package/specs/001-cloud-scp-command/data-model.md +424 -0
  50. package/specs/001-cloud-scp-command/plan.md +124 -0
  51. package/specs/001-cloud-scp-command/quickstart.md +536 -0
  52. package/specs/001-cloud-scp-command/research.md +345 -0
  53. package/specs/001-cloud-scp-command/spec.md +248 -0
  54. package/specs/001-cloud-scp-command/tasks.md +434 -0
  55. package/src/ai-summon.ts +88 -0
  56. package/src/commands/ide/index.ts +322 -0
  57. package/src/commands/init.ts +64 -0
  58. package/src/commands/url.ts +262 -0
  59. package/src/types/index.ts +49 -0
  60. package/src/util.ts +146 -0
  61. package/tsconfig.json +21 -0
@@ -0,0 +1,78 @@
1
+ ---
2
+ description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
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
+ ## Outline
14
+
15
+ You are updating the project constitution at `.specify/memory/constitution.md`. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`, `[PRINCIPLE_1_NAME]`). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.
16
+
17
+ Follow this execution flow:
18
+
19
+ 1. Load the existing constitution template at `.specify/memory/constitution.md`.
20
+ - Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.
21
+ **IMPORTANT**: The user might require less or more principles than the ones used in the template. If a number is specified, respect that - follow the general template. You will update the doc accordingly.
22
+
23
+ 2. Collect/derive values for placeholders:
24
+ - If user input (conversation) supplies a value, use it.
25
+ - Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
26
+ - For governance dates: `RATIFICATION_DATE` is the original adoption date (if unknown ask or mark TODO), `LAST_AMENDED_DATE` is today if changes are made, otherwise keep previous.
27
+ - `CONSTITUTION_VERSION` must increment according to semantic versioning rules:
28
+ - MAJOR: Backward incompatible governance/principle removals or redefinitions.
29
+ - MINOR: New principle/section added or materially expanded guidance.
30
+ - PATCH: Clarifications, wording, typo fixes, non-semantic refinements.
31
+ - If version bump type ambiguous, propose reasoning before finalizing.
32
+
33
+ 3. Draft the updated constitution content:
34
+ - Replace every placeholder with concrete text (no bracketed tokens left except intentionally retained template slots that the project has chosen not to define yet—explicitly justify any left).
35
+ - Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
36
+ - Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
37
+ - Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.
38
+
39
+ 4. Consistency propagation checklist (convert prior checklist into active validations):
40
+ - Read `.specify/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
41
+ - Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
42
+ - Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
43
+ - Read each command file in `.specify/templates/commands/*.md` (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.
44
+ - Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
45
+
46
+ 5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
47
+ - Version change: old → new
48
+ - List of modified principles (old title → new title if renamed)
49
+ - Added sections
50
+ - Removed sections
51
+ - Templates requiring updates (✅ updated / ⚠ pending) with file paths
52
+ - Follow-up TODOs if any placeholders intentionally deferred.
53
+
54
+ 6. Validation before final output:
55
+ - No remaining unexplained bracket tokens.
56
+ - Version line matches report.
57
+ - Dates ISO format YYYY-MM-DD.
58
+ - Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
59
+
60
+ 7. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).
61
+
62
+ 8. Output a final summary to the user with:
63
+ - New version and bump rationale.
64
+ - Any files flagged for manual follow-up.
65
+ - Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).
66
+
67
+ Formatting & Style Requirements:
68
+
69
+ - Use Markdown headings exactly as in the template (do not demote/promote levels).
70
+ - Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.
71
+ - Keep a single blank line between sections.
72
+ - Avoid trailing whitespace.
73
+
74
+ If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
75
+
76
+ If critical info missing (e.g., ratification date truly unknown), insert `TODO(<FIELD_NAME>): explanation` and include in the Sync Impact Report under deferred items.
77
+
78
+ Do not create a new template; always operate on the existing `.specify/memory/constitution.md` file.
@@ -0,0 +1,121 @@
1
+ ---
2
+ description: Execute the implementation plan by processing and executing all tasks defined in tasks.md
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
+ ## Outline
14
+
15
+ 1. Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. 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").
16
+
17
+ 2. **Check checklists status** (if FEATURE_DIR/checklists/ exists):
18
+ - Scan all checklist files in the checklists/ directory
19
+ - For each checklist, count:
20
+ - Total items: All lines matching `- [ ]` or `- [X]` or `- [x]`
21
+ - Completed items: Lines matching `- [X]` or `- [x]`
22
+ - Incomplete items: Lines matching `- [ ]`
23
+ - Create a status table:
24
+ ```
25
+ | Checklist | Total | Completed | Incomplete | Status |
26
+ |-----------|-------|-----------|------------|--------|
27
+ | ux.md | 12 | 12 | 0 | ✓ PASS |
28
+ | test.md | 8 | 5 | 3 | ✗ FAIL |
29
+ | security.md | 6 | 6 | 0 | ✓ PASS |
30
+ ```
31
+ - Calculate overall status:
32
+ - **PASS**: All checklists have 0 incomplete items
33
+ - **FAIL**: One or more checklists have incomplete items
34
+ - **If any checklist is incomplete**:
35
+ - Display the table with incomplete item counts
36
+ - **STOP** and ask: "Some checklists are incomplete. Do you want to proceed with implementation anyway? (yes/no)"
37
+ - Wait for user response before continuing
38
+ - If user says "no" or "wait" or "stop", halt execution
39
+ - If user says "yes" or "proceed" or "continue", proceed to step 3
40
+ - **If all checklists are complete**:
41
+ - Display the table showing all checklists passed
42
+ - Automatically proceed to step 3
43
+
44
+ 3. Load and analyze the implementation context:
45
+ - **REQUIRED**: Read tasks.md for the complete task list and execution plan
46
+ - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
47
+ - **IF EXISTS**: Read data-model.md for entities and relationships
48
+ - **IF EXISTS**: Read contracts/ for API specifications and test requirements
49
+ - **IF EXISTS**: Read research.md for technical decisions and constraints
50
+ - **IF EXISTS**: Read quickstart.md for integration scenarios
51
+
52
+ 4. **Project Setup Verification**:
53
+ - **REQUIRED**: Create/verify ignore files based on actual project setup:
54
+
55
+ **Detection & Creation Logic**:
56
+ - Check if the following command succeeds to determine if the repository is a git repo (create/verify .gitignore if so):
57
+
58
+ ```sh
59
+ git rev-parse --git-dir 2>/dev/null
60
+ ```
61
+
62
+ - Check if Dockerfile\* exists or Docker in plan.md → create/verify .dockerignore
63
+ - Check if .eslintrc* or eslint.config.* exists → create/verify .eslintignore
64
+ - Check if .prettierrc\* exists → create/verify .prettierignore
65
+ - Check if .npmrc or package.json exists → create/verify .npmignore (if publishing)
66
+ - Check if terraform files (\*.tf) exist → create/verify .terraformignore
67
+ - Check if .helmignore needed (helm charts present) → create/verify .helmignore
68
+
69
+ **If ignore file already exists**: Verify it contains essential patterns, append missing critical patterns only
70
+ **If ignore file missing**: Create with full pattern set for detected technology
71
+
72
+ **Common Patterns by Technology** (from plan.md tech stack):
73
+ - **Node.js/JavaScript**: `node_modules/`, `dist/`, `build/`, `*.log`, `.env*`
74
+ - **Python**: `__pycache__/`, `*.pyc`, `.venv/`, `venv/`, `dist/`, `*.egg-info/`
75
+ - **Java**: `target/`, `*.class`, `*.jar`, `.gradle/`, `build/`
76
+ - **C#/.NET**: `bin/`, `obj/`, `*.user`, `*.suo`, `packages/`
77
+ - **Go**: `*.exe`, `*.test`, `vendor/`, `*.out`
78
+ - **Universal**: `.DS_Store`, `Thumbs.db`, `*.tmp`, `*.swp`, `.vscode/`, `.idea/`
79
+
80
+ **Tool-Specific Patterns**:
81
+ - **Docker**: `node_modules/`, `.git/`, `Dockerfile*`, `.dockerignore`, `*.log*`, `.env*`, `coverage/`
82
+ - **ESLint**: `node_modules/`, `dist/`, `build/`, `coverage/`, `*.min.js`
83
+ - **Prettier**: `node_modules/`, `dist/`, `build/`, `coverage/`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`
84
+ - **Terraform**: `.terraform/`, `*.tfstate*`, `*.tfvars`, `.terraform.lock.hcl`
85
+
86
+ 5. Parse tasks.md structure and extract:
87
+ - **Task phases**: Setup, Tests, Core, Integration, Polish
88
+ - **Task dependencies**: Sequential vs parallel execution rules
89
+ - **Task details**: ID, description, file paths, parallel markers [P]
90
+ - **Execution flow**: Order and dependency requirements
91
+
92
+ 6. Execute implementation following the task plan:
93
+ - **Phase-by-phase execution**: Complete each phase before moving to the next
94
+ - **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
95
+ - **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
96
+ - **File-based coordination**: Tasks affecting the same files must run sequentially
97
+ - **Validation checkpoints**: Verify each phase completion before proceeding
98
+
99
+ 7. Implementation execution rules:
100
+ - **Setup first**: Initialize project structure, dependencies, configuration
101
+ - **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
102
+ - **Core development**: Implement models, services, CLI commands, endpoints
103
+ - **Integration work**: Database connections, middleware, logging, external services
104
+ - **Polish and validation**: Unit tests, performance optimization, documentation
105
+
106
+ 8. Progress tracking and error handling:
107
+ - Report progress after each completed task
108
+ - Halt execution if any non-parallel task fails
109
+ - For parallel tasks [P], continue with successful tasks, report failed ones
110
+ - Provide clear error messages with context for debugging
111
+ - Suggest next steps if implementation cannot proceed
112
+ - **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
113
+
114
+ 9. Completion validation:
115
+ - Verify all required tasks are completed
116
+ - Check that implemented features match the original specification
117
+ - Validate that tests pass and coverage meets requirements
118
+ - Confirm the implementation follows the technical plan
119
+ - Report final status with summary of completed work
120
+
121
+ Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/tasks` first to regenerate the task list.
@@ -0,0 +1,81 @@
1
+ ---
2
+ description: Execute the implementation planning workflow using the plan template to generate design artifacts.
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
+ ## Outline
14
+
15
+ 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").
16
+
17
+ 2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).
18
+
19
+ 3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
20
+ - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
21
+ - Fill Constitution Check section from constitution
22
+ - Evaluate gates (ERROR if violations unjustified)
23
+ - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
24
+ - Phase 1: Generate data-model.md, contracts/, quickstart.md
25
+ - Phase 1: Update agent context by running the agent script
26
+ - Re-evaluate Constitution Check post-design
27
+
28
+ 4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
29
+
30
+ ## Phases
31
+
32
+ ### Phase 0: Outline & Research
33
+
34
+ 1. **Extract unknowns from Technical Context** above:
35
+ - For each NEEDS CLARIFICATION → research task
36
+ - For each dependency → best practices task
37
+ - For each integration → patterns task
38
+
39
+ 2. **Generate and dispatch research agents**:
40
+
41
+ ```
42
+ For each unknown in Technical Context:
43
+ Task: "Research {unknown} for {feature context}"
44
+ For each technology choice:
45
+ Task: "Find best practices for {tech} in {domain}"
46
+ ```
47
+
48
+ 3. **Consolidate findings** in `research.md` using format:
49
+ - Decision: [what was chosen]
50
+ - Rationale: [why chosen]
51
+ - Alternatives considered: [what else evaluated]
52
+
53
+ **Output**: research.md with all NEEDS CLARIFICATION resolved
54
+
55
+ ### Phase 1: Design & Contracts
56
+
57
+ **Prerequisites:** `research.md` complete
58
+
59
+ 1. **Extract entities from feature spec** → `data-model.md`:
60
+ - Entity name, fields, relationships
61
+ - Validation rules from requirements
62
+ - State transitions if applicable
63
+
64
+ 2. **Generate API contracts** from functional requirements:
65
+ - For each user action → endpoint
66
+ - Use standard REST/GraphQL patterns
67
+ - Output OpenAPI/GraphQL schema to `/contracts/`
68
+
69
+ 3. **Agent context update**:
70
+ - Run `.specify/scripts/bash/update-agent-context.sh claude`
71
+ - These scripts detect which AI agent is in use
72
+ - Update the appropriate agent-specific context file
73
+ - Add only new technology from current plan
74
+ - Preserve manual additions between markers
75
+
76
+ **Output**: data-model.md, /contracts/\*, quickstart.md, agent-specific file
77
+
78
+ ## Key rules
79
+
80
+ - Use absolute paths
81
+ - ERROR on gate failures or unresolved clarifications
@@ -0,0 +1,204 @@
1
+ ---
2
+ description: Create or update the feature specification from a natural language feature description.
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
+ ## Outline
14
+
15
+ 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.
16
+
17
+ Given that feature description, do this:
18
+
19
+ 1. Run the script `.specify/scripts/bash/create-new-feature.sh --json "$ARGUMENTS"` from repo root and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute.
20
+ **IMPORTANT** You must only ever run this script once. The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for. 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").
21
+ 2. Load `.specify/templates/spec-template.md` to understand required sections.
22
+
23
+ 3. Follow this execution flow:
24
+ 1. Parse user description from Input
25
+ If empty: ERROR "No feature description provided"
26
+ 2. Extract key concepts from description
27
+ Identify: actors, actions, data, constraints
28
+ 3. For unclear aspects:
29
+ - Make informed guesses based on context and industry standards
30
+ - Only mark with [NEEDS CLARIFICATION: specific question] if:
31
+ - The choice significantly impacts feature scope or user experience
32
+ - Multiple reasonable interpretations exist with different implications
33
+ - No reasonable default exists
34
+ - **LIMIT: Maximum 3 [NEEDS CLARIFICATION] markers total**
35
+ - Prioritize clarifications by impact: scope > security/privacy > user experience > technical details
36
+ 4. Fill User Scenarios & Testing section
37
+ If no clear user flow: ERROR "Cannot determine user scenarios"
38
+ 5. Generate Functional Requirements
39
+ Each requirement must be testable
40
+ Use reasonable defaults for unspecified details (document assumptions in Assumptions section)
41
+ 6. Define Success Criteria
42
+ Create measurable, technology-agnostic outcomes
43
+ Include both quantitative metrics (time, performance, volume) and qualitative measures (user satisfaction, task completion)
44
+ Each criterion must be verifiable without implementation details
45
+ 7. Identify Key Entities (if data involved)
46
+ 8. Return: SUCCESS (spec ready for planning)
47
+
48
+ 4. 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.
49
+
50
+ 5. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
51
+
52
+ a. **Create Spec Quality Checklist**: Generate a checklist file at `FEATURE_DIR/checklists/requirements.md` using the checklist template structure with these validation items:
53
+
54
+ ```markdown
55
+ # Specification Quality Checklist: [FEATURE NAME]
56
+
57
+ **Purpose**: Validate specification completeness and quality before proceeding to planning
58
+ **Created**: [DATE]
59
+ **Feature**: [Link to spec.md]
60
+
61
+ ## Content Quality
62
+
63
+ - [ ] No implementation details (languages, frameworks, APIs)
64
+ - [ ] Focused on user value and business needs
65
+ - [ ] Written for non-technical stakeholders
66
+ - [ ] All mandatory sections completed
67
+
68
+ ## Requirement Completeness
69
+
70
+ - [ ] No [NEEDS CLARIFICATION] markers remain
71
+ - [ ] Requirements are testable and unambiguous
72
+ - [ ] Success criteria are measurable
73
+ - [ ] Success criteria are technology-agnostic (no implementation details)
74
+ - [ ] All acceptance scenarios are defined
75
+ - [ ] Edge cases are identified
76
+ - [ ] Scope is clearly bounded
77
+ - [ ] Dependencies and assumptions identified
78
+
79
+ ## Feature Readiness
80
+
81
+ - [ ] All functional requirements have clear acceptance criteria
82
+ - [ ] User scenarios cover primary flows
83
+ - [ ] Feature meets measurable outcomes defined in Success Criteria
84
+ - [ ] No implementation details leak into specification
85
+
86
+ ## Notes
87
+
88
+ - Items marked incomplete require spec updates before `/speckit.clarify` or `/speckit.plan`
89
+ ```
90
+
91
+ b. **Run Validation Check**: Review the spec against each checklist item:
92
+ - For each item, determine if it passes or fails
93
+ - Document specific issues found (quote relevant spec sections)
94
+
95
+ c. **Handle Validation Results**:
96
+ - **If all items pass**: Mark checklist complete and proceed to step 6
97
+ - **If items fail (excluding [NEEDS CLARIFICATION])**:
98
+ 1. List the failing items and specific issues
99
+ 2. Update the spec to address each issue
100
+ 3. Re-run validation until all items pass (max 3 iterations)
101
+ 4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user
102
+ - **If [NEEDS CLARIFICATION] markers remain**:
103
+ 1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec
104
+ 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
105
+ 3. For each clarification needed (max 3), present options to user in this format:
106
+
107
+ ```markdown
108
+ ## Question [N]: [Topic]
109
+
110
+ **Context**: [Quote relevant spec section]
111
+
112
+ **What we need to know**: [Specific question from NEEDS CLARIFICATION marker]
113
+
114
+ **Suggested Answers**:
115
+
116
+ | Option | Answer | Implications |
117
+ | ------ | ------------------------- | ------------------------------------- |
118
+ | A | [First suggested answer] | [What this means for the feature] |
119
+ | B | [Second suggested answer] | [What this means for the feature] |
120
+ | C | [Third suggested answer] | [What this means for the feature] |
121
+ | Custom | Provide your own answer | [Explain how to provide custom input] |
122
+
123
+ **Your choice**: _[Wait for user response]_
124
+ ```
125
+
126
+ 4. **CRITICAL - Table Formatting**: Ensure markdown tables are properly formatted:
127
+ - Use consistent spacing with pipes aligned
128
+ - Each cell should have spaces around content: `| Content |` not `|Content|`
129
+ - Header separator must have at least 3 dashes: `|--------|`
130
+ - Test that the table renders correctly in markdown preview
131
+ 5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)
132
+ 6. Present all questions together before waiting for responses
133
+ 7. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")
134
+ 8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer
135
+ 9. Re-run validation after all clarifications are resolved
136
+
137
+ d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status
138
+
139
+ 6. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (`/speckit.clarify` or `/speckit.plan`).
140
+
141
+ **NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.
142
+
143
+ ## General Guidelines
144
+
145
+ ## Quick Guidelines
146
+
147
+ - Focus on **WHAT** users need and **WHY**.
148
+ - Avoid HOW to implement (no tech stack, APIs, code structure).
149
+ - Written for business stakeholders, not developers.
150
+ - DO NOT create any checklists that are embedded in the spec. That will be a separate command.
151
+
152
+ ### Section Requirements
153
+
154
+ - **Mandatory sections**: Must be completed for every feature
155
+ - **Optional sections**: Include only when relevant to the feature
156
+ - When a section doesn't apply, remove it entirely (don't leave as "N/A")
157
+
158
+ ### For AI Generation
159
+
160
+ When creating this spec from a user prompt:
161
+
162
+ 1. **Make informed guesses**: Use context, industry standards, and common patterns to fill gaps
163
+ 2. **Document assumptions**: Record reasonable defaults in the Assumptions section
164
+ 3. **Limit clarifications**: Maximum 3 [NEEDS CLARIFICATION] markers - use only for critical decisions that:
165
+ - Significantly impact feature scope or user experience
166
+ - Have multiple reasonable interpretations with different implications
167
+ - Lack any reasonable default
168
+ 4. **Prioritize clarifications**: scope > security/privacy > user experience > technical details
169
+ 5. **Think like a tester**: Every vague requirement should fail the "testable and unambiguous" checklist item
170
+ 6. **Common areas needing clarification** (only if no reasonable default exists):
171
+ - Feature scope and boundaries (include/exclude specific use cases)
172
+ - User types and permissions (if multiple conflicting interpretations possible)
173
+ - Security/compliance requirements (when legally/financially significant)
174
+
175
+ **Examples of reasonable defaults** (don't ask about these):
176
+
177
+ - Data retention: Industry-standard practices for the domain
178
+ - Performance targets: Standard web/mobile app expectations unless specified
179
+ - Error handling: User-friendly messages with appropriate fallbacks
180
+ - Authentication method: Standard session-based or OAuth2 for web apps
181
+ - Integration patterns: RESTful APIs unless specified otherwise
182
+
183
+ ### Success Criteria Guidelines
184
+
185
+ Success criteria must be:
186
+
187
+ 1. **Measurable**: Include specific metrics (time, percentage, count, rate)
188
+ 2. **Technology-agnostic**: No mention of frameworks, languages, databases, or tools
189
+ 3. **User-focused**: Describe outcomes from user/business perspective, not system internals
190
+ 4. **Verifiable**: Can be tested/validated without knowing implementation details
191
+
192
+ **Good examples**:
193
+
194
+ - "Users can complete checkout in under 3 minutes"
195
+ - "System supports 10,000 concurrent users"
196
+ - "95% of searches return results in under 1 second"
197
+ - "Task completion rate improves by 40%"
198
+
199
+ **Bad examples** (implementation-focused):
200
+
201
+ - "API response time is under 200ms" (too technical, use "Users see results instantly")
202
+ - "Database can handle 1000 TPS" (implementation detail, use user-facing metric)
203
+ - "React components render efficiently" (framework-specific)
204
+ - "Redis cache hit rate above 80%" (technology-specific)
@@ -0,0 +1,108 @@
1
+ ---
2
+ description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.
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
+ ## Outline
14
+
15
+ 1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. 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").
16
+
17
+ 2. **Load design documents**: Read from FEATURE_DIR:
18
+ - **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
19
+ - **Optional**: data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)
20
+ - Note: Not all projects have all documents. Generate tasks based on what's available.
21
+
22
+ 3. **Execute task generation workflow** (follow the template structure):
23
+ - Load plan.md and extract tech stack, libraries, project structure
24
+ - **Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)**
25
+ - If data-model.md exists: Extract entities → map to user stories
26
+ - If contracts/ exists: Each file → map endpoints to user stories
27
+ - If research.md exists: Extract decisions → generate setup tasks
28
+ - **Generate tasks ORGANIZED BY USER STORY**:
29
+ - Setup tasks (shared infrastructure needed by all stories)
30
+ - **Foundational tasks (prerequisites that must complete before ANY user story can start)**
31
+ - For each user story (in priority order P1, P2, P3...):
32
+ - Group all tasks needed to complete JUST that story
33
+ - Include models, services, endpoints, UI components specific to that story
34
+ - Mark which tasks are [P] parallelizable
35
+ - If tests requested: Include tests specific to that story
36
+ - Polish/Integration tasks (cross-cutting concerns)
37
+ - **Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature spec or user asks for TDD approach
38
+ - Apply task rules:
39
+ - Different files = mark [P] for parallel
40
+ - Same file = sequential (no [P])
41
+ - If tests requested: Tests before implementation (TDD order)
42
+ - Number tasks sequentially (T001, T002...)
43
+ - Generate dependency graph showing user story completion order
44
+ - Create parallel execution examples per user story
45
+ - Validate task completeness (each user story has all needed tasks, independently testable)
46
+
47
+ 4. **Generate tasks.md**: Use `.specify.specify/templates/tasks-template.md` as structure, fill with:
48
+ - Correct feature name from plan.md
49
+ - Phase 1: Setup tasks (project initialization)
50
+ - Phase 2: Foundational tasks (blocking prerequisites for all user stories)
51
+ - Phase 3+: One phase per user story (in priority order from spec.md)
52
+ - Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
53
+ - Clear [Story] labels (US1, US2, US3...) for each task
54
+ - [P] markers for parallelizable tasks within each story
55
+ - Checkpoint markers after each story phase
56
+ - Final Phase: Polish & cross-cutting concerns
57
+ - Numbered tasks (T001, T002...) in execution order
58
+ - Clear file paths for each task
59
+ - Dependencies section showing story completion order
60
+ - Parallel execution examples per story
61
+ - Implementation strategy section (MVP first, incremental delivery)
62
+
63
+ 5. **Report**: Output path to generated tasks.md and summary:
64
+ - Total task count
65
+ - Task count per user story
66
+ - Parallel opportunities identified
67
+ - Independent test criteria for each story
68
+ - Suggested MVP scope (typically just User Story 1)
69
+
70
+ Context for task generation: $ARGUMENTS
71
+
72
+ The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
73
+
74
+ ## Task Generation Rules
75
+
76
+ **IMPORTANT**: Tests are optional. Only generate test tasks if the user explicitly requested testing or TDD approach in the feature specification.
77
+
78
+ **CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.
79
+
80
+ 1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:
81
+ - Each user story (P1, P2, P3...) gets its own phase
82
+ - Map all related components to their story:
83
+ - Models needed for that story
84
+ - Services needed for that story
85
+ - Endpoints/UI needed for that story
86
+ - If tests requested: Tests specific to that story
87
+ - Mark story dependencies (most stories should be independent)
88
+ 2. **From Contracts**:
89
+ - Map each contract/endpoint → to the user story it serves
90
+ - If tests requested: Each contract → contract test task [P] before implementation in that story's phase
91
+ 3. **From Data Model**:
92
+ - Map each entity → to the user story(ies) that need it
93
+ - If entity serves multiple stories: Put in earliest story or Setup phase
94
+ - Relationships → service layer tasks in appropriate story phase
95
+ 4. **From Setup/Infrastructure**:
96
+ - Shared infrastructure → Setup phase (Phase 1)
97
+ - Foundational/blocking tasks → Foundational phase (Phase 2)
98
+ - Examples: Database schema setup, authentication framework, core libraries, base configurations
99
+ - These MUST complete before any user story can be implemented
100
+ - Story-specific setup → within that story's phase
101
+
102
+ 5. **Ordering**:
103
+ - Phase 1: Setup (project initialization)
104
+ - Phase 2: Foundational (blocking prerequisites - must complete before user stories)
105
+ - Phase 3+: User Stories in priority order (P1, P2, P3...)
106
+ - Within each story: Tests (if requested) → Models → Services → Endpoints → Integration
107
+ - Final Phase: Polish & Cross-Cutting Concerns
108
+ - Each user story phase should be a complete, independently testable increment
@@ -0,0 +1,23 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(.specify/scripts/bash/setup-plan.sh:*)",
5
+ "Bash(git checkout:*)",
6
+ "Bash(.specify/scripts/bash/update-agent-context.sh:*)",
7
+ "Bash(.specify/scripts/bash/check-prerequisites.sh:*)",
8
+ "Bash(git rev-parse:*)",
9
+ "Bash(yarn build)",
10
+ "Bash(yarn build:install)",
11
+ "Bash(hsh cloud:*)",
12
+ "Bash(node:*)",
13
+ "Bash(yarn add:*)",
14
+ "Bash(yarn test)",
15
+ "Bash(yarn test:*)",
16
+ "Bash(yarn format)",
17
+ "Bash(yarn lint)",
18
+ "Bash(yarn lint:*)"
19
+ ],
20
+ "deny": [],
21
+ "ask": []
22
+ }
23
+ }
@@ -0,0 +1,5 @@
1
+ dist
2
+ node_modules
3
+ *.log
4
+ .DS_Store
5
+ coverage
@@ -0,0 +1,10 @@
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "es5",
4
+ "singleQuote": true,
5
+ "printWidth": 100,
6
+ "tabWidth": 2,
7
+ "useTabs": false,
8
+ "arrowParens": "always",
9
+ "endOfLine": "lf"
10
+ }