budtags/skills/create-plan/SKILL.md
Thorough, question-driven feature planning. Asks questions you haven't thought of. Fills gaps with questions, not assumptions. Produces comprehensive plan documents ready for decomposition.
npx skillsauth add jwilly246/budtags-claude-plugin create-planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
PURPOSE: Transform a feature idea into a comprehensive, implementation-ready plan through active codebase research and thorough questioning.
PHILOSOPHY: 5 hours planning, 1 hour coding. Research before asking. Ask questions you haven't thought of. Fill gaps with questions, not assumptions. Reuse before creating.
╔══════════════════════════════════════════════════════════════════╗
║ THIS SKILL RESEARCHES THE CODEBASE, ASKS QUESTIONS, AND WRITES ║
║ A PLAN DOCUMENT. ║
║ ║
║ ✅ DO: Research the codebase BEFORE asking questions ║
║ ✅ DO: Identify reusable code, patterns, and components ║
║ ✅ DO: Check installed packages before suggesting new ones ║
║ ✅ DO: Ask probing questions before making decisions ║
║ ✅ DO: Challenge assumptions ║
║ ✅ DO: Cover edge cases and error scenarios ║
║ ✅ DO: Explore integration points thoroughly ║
║ ✅ DO: Document decisions WITH rationale ║
║ ✅ DO: Produce a plan ready for /decompose-plan ║
║ ║
║ ❌ DO NOT: Make assumptions without asking ║
║ ❌ DO NOT: Skip codebase research ║
║ ❌ DO NOT: Assume package versions - READ them ║
║ ❌ DO NOT: Install packages without explicit permission ║
║ ❌ DO NOT: Skip domains (security, testing, edge cases) ║
║ ❌ DO NOT: Write implementation code ║
║ ❌ DO NOT: Rush through phases to "get to coding" ║
║ ❌ DO NOT: Accept vague answers - dig deeper ║
║ ║
║ WHEN IN DOUBT: RESEARCH FIRST, THEN ASK. NEVER ASSUME. ║
╚══════════════════════════════════════════════════════════════════╝
/create-plan <feature-name>
Example:
/create-plan marketplace-advertising
The skill progresses through 11 phases, starting with codebase research. Don't rush - each phase matters.
Phase 0: Codebase Discovery → Research existing code, packages, patterns (MANDATORY)
Phase 1: Discovery → What are we building? Why?
Phase 2: User Stories → Who uses it? What do they do?
Phase 3: Data Model → What entities? Relationships?
Phase 4: Business Rules → Edge cases? Constraints? State machines?
Phase 5: UI/UX → Where does it live? How does it look?
Phase 6: Integration → External APIs? Existing systems?
Phase 7: Security → Access control? Data protection?
Phase 8: Performance → Scale? Caching? Rate limiting?
Phase 9: Testing Strategy → What to test? How to verify?
Phase 10: Synthesis → Write the plan document
Phase 0 is MANDATORY: Always research the codebase before asking questions. Between phases: Summarize what was decided, confirm understanding, then proceed.
Goal: Research the codebase before asking ANY user questions. Understand what exists, what can be reused, and what patterns to follow.
Run these checks FIRST:
# Read composer.json - note Laravel version, installed packages
cat composer.json
# Read package.json - note React version, UI libraries, tooling
cat package.json
# Check for Laravel Boost (if installed)
composer show spatie/laravel-boost 2>/dev/null || echo "Laravel Boost not installed"
Document:
^11.0)Use Laravel Boost (if available) or manual exploration:
# With Laravel Boost
php artisan boost:models # List all models with relationships
php artisan boost:routes # List all routes
# Without Laravel Boost - manual exploration
ls -la app/Models/
ls -la app/Http/Controllers/
ls -la resources/js/Components/
ls -la app/Services/
Document:
Search for features similar to what the user is requesting:
# Grep for related keywords in controllers, models, components
grep -r "keyword" app/Http/Controllers/
grep -r "keyword" app/Models/
grep -r "keyword" resources/js/
# Find similar implementations
find . -name "*Similar*.php" -o -name "*Related*.tsx"
Actions:
Catalog reusable assets:
Frontend Components:
ls resources/js/Components/
ls resources/js/Components/Inputs/
ls resources/js/Components/Modals/
ls resources/js/hooks/
Backend Services:
ls app/Services/
ls app/Models/Traits/
Before Phase 1, present to user:
## Phase 0 Summary: Codebase Discovery
### Package Versions
| Package | Version |
|---------|---------|
| Laravel | {version from composer.json} |
| React | {version from package.json} |
| Inertia | {version} |
| TanStack Query | {version} |
### Similar Features Found
- **{FeatureName}**: {location} - {what it does}
- **{FeatureName}**: {location} - {what it does}
### Reusable Components Discovered
- **UI Components**: Button, TextInput, DataTable, Modal...
- **Services**: {ServiceName} pattern in app/Services/
- **Traits**: {TraitName} in app/Models/Traits/
### Patterns Observed
- Controller naming: {pattern}
- Route structure: {pattern}
- Modal patterns: {pattern}
### Proceeding to Phase 1: Discovery
Goal: Understand the feature at a high level.
Before asking discovery questions, search for existing related features:
Present discoveries: "I found existing {feature} in {location} that may be related to what you're describing."
Business Value:
Scope Definition:
Success Criteria:
Goal: Understand ALL user types and their complete journeys.
Before asking user story questions, check existing role/permission implementations:
Present discoveries: "I found these existing user roles/permissions: {list}. The {SimilarFeature} handles role-based access by {pattern}."
User Types:
For EACH User Type:
Edge Cases:
| User Type | Can Create | Can Read | Can Update | Can Delete | Special Actions | |-----------|------------|----------|------------|------------|-----------------| | Seller | Orders | Own orders, pricing | Own pending orders | Own pending orders | Cancel, view analytics | | Admin | Pricing tiers | All orders | Order status | Pricing tiers | Approve, reject, activate |
Goal: Define all entities, their attributes, and relationships.
Before asking data model questions, examine existing models:
Present discoveries: "I found these relevant model patterns: {Model} uses {Trait} for {purpose}. The {SimilarModel} has a status state machine you could follow."
Entities:
Relationships:
State Machines:
Temporal Aspects:
BudTags Specifics:
Entity: AdvertisingOrder
├── id (uuid)
├── organization_id (fk, required) ── ORGANIZATION SCOPING
├── status (enum: pending → approved → ...) ── STATE MACHINE
├── price_snapshot (int, cents) ── IMMUTABLE COPY
├── requested_start_date (date, required)
├── actual_start_date (date, nullable) ── SET LATER
└── timestamps
Goal: Capture ALL the rules, constraints, and edge cases.
Before asking business rules questions, find existing validation patterns:
Present discoveries: "I found these existing validation patterns: {FormRequest} validates {similar fields}. The {Service} handles state transitions using {pattern}."
Validation Rules:
State Transition Rules:
Edge Cases (THE HARD QUESTIONS):
Constraints:
Error Handling:
Goal: Understand where this lives in the app and how users interact.
Before asking UI questions, catalog what exists:
resources/js/Components/resources/js/hooks/Present discoveries: "I found these existing components you could reuse: Button, TextInput, DataTable, Modal. There's also an existing {SimilarModal} that has a similar pattern to what you're describing. The {SimilarPage} shows how navigation is structured."
Navigation & Placement:
Layout & Components:
Forms & Modals (CRITICAL - BudTags uses Inertia useForm):
Data Fetching Pattern Decision: | Scenario | Use This | |----------|----------| | Form submission, CRUD | Inertia useForm | | Read-only dashboard data | React Query | | Real-time/polling data | React Query | | Navigation with data | Inertia page props |
Interactions:
States & Loading:
Responsive & Accessibility:
Real-time:
Goal: Understand all integration points with external systems and existing code.
Before asking integration questions, map existing integrations:
app/Services/app/Jobs/app/Notifications/Present discoveries: "I found existing integrations: {Service} handles {ExternalAPI} calls with retry logic. The {Job} pattern shows how background processing is structured."
External APIs:
MetrcApi User Context (CRITICAL if Metrc integration involved):
$api->set_user(request()->user()) before any API interaction$api->set_user($this->user) in handle()$this->user is set by set_user() — some internal methods access it directly (no fallback), so omitting set_user() causes null-reference crashes in deeper code pathsheaders() method has a fallback ($this->user ?? request()->user()) that masks the problem — basic API calls appear to work without set_user(), but deeper methods crashset_user() is preserved when refactoring controller codeExisting Code:
File Storage:
Email/Notifications:
Background Jobs:
Goal: Identify and address ALL security concerns.
Before asking security questions, find existing auth patterns:
app/Policies/app/Http/Middleware/Present discoveries: "I found these security patterns: {Policy} handles {authorization}. The {Controller} enforces org-scoping using {pattern}. Existing middleware: {list}."
Authentication:
Authorization:
Data Access:
Input Validation:
Sensitive Data:
Rate Limiting:
request()->user()->active_orgGoal: Ensure the feature will perform well at scale.
Before asking performance questions, check existing patterns:
Present discoveries: "I found these performance patterns: {Model} uses eager loading for {relationships}. The {Controller} caches {data} for {duration}. Existing indexes: {list}."
Scale Expectations:
Query Performance:
Caching:
Rate Limiting:
Goal: Define how to verify the feature works correctly.
IMPORTANT: All testing must follow the budtags-testing skill. Key principles:
Before asking testing questions, find existing test patterns:
tests/Feature/ for similar featurestests/resources/js/**/*.test.{ts,tsx} for Vitest patternsresources/js/testing/ for available test utilities (custom render, Inertia mocks, QueryClient wrapper)Present discoveries: "I found these test patterns: {TestClass} tests {feature} with {pattern}. The {Factory} has useful states: {states}. Security tests follow {pattern}."
PHP Unit Tests:
PHP Feature Tests:
Vitest (Frontend) Tests:
Integration Tests:
Feature: AdvertisingSellerController
PHP Feature Tests:
├── test_seller_can_view_advertising_settings
├── test_seller_can_submit_ad_order
├── test_seller_cannot_view_other_org_orders ← SECURITY
├── test_seller_can_cancel_pending_order
├── test_seller_cannot_cancel_active_order
└── test_order_snapshots_price_at_creation
Vitest Component Tests:
├── renders ad preview with correct dimensions
├── disables submit when form is invalid
└── shows error toast on failed submission
Goal: Compile everything into the plan document.
# {FEATURE_NAME} Implementation Plan
## Overview
{2-3 sentences on what we're building and why}
## Requirements Summary
| Area | Requirements |
|------|-------------|
| ... | ... |
## Integration Domains
Identifies which specialist agents should handle different parts of the implementation.
| Domain | Agent Required | Reason |
|--------|----------------|--------|
| Metrc sync | metrc-specialist | Has metrc-api skill (258 endpoints) |
| QuickBooks invoices | quickbooks-specialist | Has OAuth and invoice patterns |
| LeafLink orders | leaflink-specialist | Has marketplace API patterns |
| TanStack tables/queries | tanstack-specialist | Has all 6 tanstack-* skills |
| React components | react-specialist | Has verify-alignment skill |
| Backend CRUD | php-developer | Backend focused, reads patterns |
| Database/migrations | php-developer | Backend focused |
| Mixed frontend+backend | fullstack-developer | Fallback for spanning work |
{Fill in only domains relevant to this feature}
## Database Schema
{Tables, columns, relationships, indexes}
## Models
{Model definitions, relationships, scopes, factories}
## Backend Implementation
{Controllers, services, routes, form requests}
## Frontend Implementation
{Data fetching strategy, components, types}
## Integration Points
{External APIs, existing code touchpoints}
## Implementation Phases
{Ordered checklist of phases}
## Key Files to Create
{File manifest}
## Key Files to Modify
{Modification manifest}
## Verification Plan
{How to test it works}
## BudTags Alignment Checklist
{Pattern compliance verification}
/decompose-plan?For comprehensive question coverage, reference:
question-banks/data-model.md - Deep data modeling questionsquestion-banks/security.md - Security audit questionsquestion-banks/edge-cases.md - Common edge case scenariosquestion-banks/integration.md - Integration point questionsquestion-banks/budtags-specific.md - BudTags pattern questionscomposer.json and package.json before referencing packages## Before suggesting any package:
1. Read composer.json and package.json
2. Check if functionality exists in already-installed packages
3. If new package would help, pitch it:
- "This feature needs X. Package Y does this well because..."
- "Without it, we'd have to build [effort]. With it, we get [benefit]."
- "It's maintained by [who], last release [when], [N] stars."
4. Get buy-in, then add to plan
BudTags projects have Laravel Boost installed. Leverage it for introspection:
# Model introspection
php artisan boost:models # List all models with relationships
# Route introspection
php artisan boost:routes # List all routes
# Use in Phase 0 for rapid codebase mapping
For detailed research instructions per phase, see: research-directives.md
After each phase:
## Phase {N} Summary
**Decisions Made:**
- Decision 1: {choice} because {rationale}
- Decision 2: {choice} because {rationale}
**Open Questions:**
- Question 1 (will address in Phase {M})
**Proceeding to Phase {N+1}: {Phase Name}**
❌ "I'll assume X for now..." - ASK INSTEAD ❌ Skipping security questions because "it's internal" ❌ Accepting "same as feature Y" without documenting specifics ❌ Rushing through edge cases ❌ Writing the plan before all questions are answered ❌ Making UX decisions without understanding user workflows ❌ Ignoring error scenarios
The planning is complete when:
/decompose-planWhen planning is complete:
{FEATURE_NAME}-FEATURE-PLAN.md in project root/decompose-plan {FEATURE_NAME}-FEATURE-PLAN.mdDO NOT start implementing. Planning is its own phase.
development
Use this skill when generating ZPL code, working with ZPL commands, creating Zebra printer labels, or troubleshooting ZPL syntax and formatting issues.
development
Use this skill to verify that code aligns with BudTags coding standards, architectural patterns, and conventions before or after implementation.
development
Use this skill when working with Unleashed Software inventory/order management API integration, syncing inventory, importing orders, managing stock adjustments, or handling customer/product data from Unleashed.
data-ai
TanStack Virtual patterns for virtualized lists, tables, and grids with high-performance rendering of large datasets