5.8 KiB
5.8 KiB
allowed-tools, description, argument-hint
| allowed-tools | description | argument-hint |
|---|---|---|
| Bash(cat:*), Bash(ls:*), Bash(test:*), Bash(touch:*), Bash(find:*), Bash(mkdir:*), Write. Web | Create or review specification | feature description or refinement instructions |
Context
- Refinement instructions: $ARGUMENTS
- Current spec: !
cat spec/.current 2>/dev/null || echo "No active spec" - Project context: @CLAUDE.md
Your Task
Phase 0: Context Check
-
Check for CLAUDE.md
- If
CLAUDE.mdis not found in project root, display this warning once:⚠️ No CLAUDE.md found. SPECKL works best when your project has a CLAUDE.md file with: - Project overview and tech stack - Explicit non-goals (what you're NOT building) - Key constraints (performance, compliance, tech limits) - Design values (guiding principles) Proceeding without project context may result in less focused specifications.
- If
-
Check for README.md
- If
spec/<current-spec>/README.mdis not found, display this warning:⚠️ No README.md found in the spec directory. This file should contain the feature description to guide spec creation. Consider running `/spkl:init "feature description"` to set up properly.
- If
Phase 1: Read Feature Description
- Read the README.md in the current spec directory
- Read
spec/<current-spec>/README.mdto understand the feature description - This is your primary source of truth for what the user wants to build
- Read
Phase 2: Research (REQUIRED)
Always research before proceeding:
- Use the README.md description to understand the feature intent and context
- Search for similar existing implementations in the codebase
- Research relevant best practices, technical requirements, and security/performance considerations
- Validate assumptions about external APIs, libraries, or standards
For refinements, focus on how $ARGUMENTS impacts the existing spec. Present findings before Phase 3.
Note: The README.md acts as your research brief. Use it to guide what areas of the codebase need investigation.
Phase 3: Spec Creation or Review
-
If
spec/<current-spec>/spec.mddoes not exist, create it via Write with this minimal template (use README.md description and research findings to populate):# <short title> # Goal <user/system outcome> # Inputs - <specific data, params, triggers - include concrete values/enums if relevant> # Outputs - <UI state / API / file> # Constraints - <stack, performance, compliance> # Requirements - <WHAT needs to be built, not HOW - avoid code snippets, focus on components/capabilities> # Dependencies - <existing systems to study before implementing - read these to understand patterns and context> # Out of Scope - <explicit non-goals> # Done - <user-observable outcomes - behaviors the user can see/test, not technical tasks> -
If
spec/<current-spec>/spec.mdexists:- Print the current spec content for reference.
- If
$ARGUMENTSis provided, apply the refinement instructions to improve the spec. - If
$ARGUMENTSis empty, offer to review the spec for clarity and completeness. - Suggest improvements as a unified diff (GNU diff -u format) against the existing text.
- Interpret
$ARGUMENTSas guidance on what to clarify, tighten, or adjust (e.g., "make constraints more specific", "clarify the auth flow", "add performance requirements"). - Do not expand scope unless explicitly requested—focus on ambiguity removal, tighter constraints, clearer Done items.
Critical Constraints
Evidence-Based Suggestions Only:
✅ INCLUDE if there's direct evidence:
- Systems that already display/process this exact data type (e.g., if transaction log shows refunds, mention it for refund reason feature)
- Areas that must change because they currently handle the feature being modified
- Components explicitly named in the user's outline or existing spec
❌ EXCLUDE if speculative:
- Systems that could theoretically use this data but don't currently (e.g., analytics that doesn't mention refunds)
- "Nice to have" integrations that aren't already connected
- Tangentially related features that might benefit
Evidence test: Before suggesting any system/area, confirm:
- Does it currently handle this exact data/feature? OR
- Did the user explicitly mention it in their outline?
If both answers are "no", don't include it.
Guidelines
- KISS. Boundaries over blueprints.
- Dependencies: List existing systems developers should read/understand before starting. Include components you'll modify if understanding them is prerequisite.
- Requirements: State WHAT needs building, not HOW. No code snippets. "Create RefundReason enum", not "public enum RefundReason { ... }"
- Done: Observable user outcomes only. "Merchants can select refund reason" not "RefundReason enum created"
- Prefer edits that remove ambiguity rather than add new scope.
- Ground specs in research, not assumptions.
- If uncertain about technical details, search first, spec second.
- When in doubt, leave it out. Smaller, focused specs ship faster.
- Better to under-specify than over-promise.
- When refining, address the specific concerns in
$ARGUMENTSwhile maintaining the spec's structure.
After Completion
- For creation:
- Confirm the spec was written to
spec/<current-spec>/spec.md - Explain that the spec was created from the README.md description plus research findings
- Suggest running
/spkl:spec <refinements>if changes are needed
- Confirm the spec was written to
- For refinement: Ask if user wants to apply the suggested diff