# /sdd:story-quick-check Lightning-fast 30-second health check for current work in progress. --- ## Meta **Category**: Testing & Validation **Format**: Structured (Standard) **Execution Time**: 15-30 seconds **Prerequisites**: None (works at any stage) **Destructive**: No (100% read-only) **Related Commands**: - `/sdd:story-test-integration` - Comprehensive integration tests (3-8 min) - `/sdd:story-full-check` - Full validation suite (5 min) - `/sdd:story-save` - Save progress with git commit **Context Requirements**: - None (uses project defaults) --- ## Parameters **Check Scope** (optional): ```bash # Run all checks (default) /sdd:story-quick-check # Scope to specific checks --checks=syntax|tests|lint|git|all # Default: all --fix # Auto-fix issues when possible --verbose # Show detailed output ``` **Examples**: ```bash /sdd:story-quick-check # Full 30s check /sdd:story-quick-check --checks=tests # Only run tests (~10s) /sdd:story-quick-check --fix # Auto-fix lint/format issues ``` --- ## Process ### Phase 1: Basic Checks (10s) **Syntax & Compilation**: ```bash # Laravel: Check for syntax errors php -l app/**/*.php php artisan config:clear --quiet # Check: โœ“ PHP syntax valid โœ“ Configuration compiles โœ“ No fatal errors โœ“ Dependencies resolved ``` **Output**: ``` ๐Ÿ” BASIC CHECKS (8s) ==================== โœ… PHP syntax valid (127 files checked) โœ… Config compiles โœ… Autoload working โœ… Env file present ``` **If Errors**: ``` โŒ SYNTAX ERROR FOUND File: app/Livewire/TaskManager.php:42 Error: syntax error, unexpected 'public' (T_PUBLIC) Quick fix: Missing semicolon on line 41 ``` --- ### Phase 2: Test Check (10s) **Run Fast Tests**: ```bash # Laravel/Pest: Run unit tests only (fastest) php artisan test --filter=Unit --stop-on-failure # Check: โœ“ Existing tests still pass โœ“ No new test failures โœ“ Test files valid ``` **Output**: ``` ๐Ÿงช TEST CHECK (9s) ================== โœ… Unit tests: 24/24 passed โœ… No failures detected โš ๏ธ New code in TaskManager.php has no tests Tests run: 24 Duration: 0.8s ``` **If Failures**: ``` โŒ TEST FAILURES (2) 1. Task::updateOrder() - Expected 1, got 0 Location: tests/Unit/TaskTest.php:45 Quick fix: Update assertion to expect 0 2. Category::tasks() - Undefined property Location: tests/Unit/CategoryTest.php:28 Quick fix: Add relationship to Category model ``` --- ### Phase 3: Lint & Format Check (5s) **Code Quality**: ```bash # Laravel: Run Pint in test mode (no changes) vendor/bin/pint --test --dirty # Check: โœ“ Code formatting correct โœ“ No style violations โœ“ Follows Laravel standards ``` **Output**: ``` ๐Ÿ“‹ LINT CHECK (4s) ================== โœ… Formatting correct (Laravel Pint) โœ… No style violations โœ… PSR-12 compliant ``` **If Issues**: ``` โš ๏ธ FORMATTING ISSUES (3 files) - app/Livewire/TaskManager.php (12 changes) - app/Models/Task.php (3 changes) - routes/web.php (1 change) Auto-fix: vendor/bin/pint --dirty ``` --- ### Phase 4: Git Status Check (5s) **Repository Status**: ```bash # Check git state git status --short git diff --stat # Check: โœ“ Working directory clean (or changes tracked) โœ“ No merge conflicts โœ“ Branch status ``` **Output**: ``` ๐Ÿšฆ GIT CHECK (3s) ================= Branch: feature/STORY-DUE-002 Status: โš ๏ธ Uncommitted changes Modified files: M app/Livewire/TaskManager.php M resources/views/livewire/task-manager.blade.php ?? tests/Feature/TaskDueDateTest.php โœ“ No conflicts โœ“ Up to date with remote ``` --- ### Phase 5: Instant Results Summary (2s) **Generate Quick Report**: ``` โšก QUICK CHECK RESULTS ===================== Completed in 28 seconds โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Check โ”‚ Status โ”‚ Issues โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Syntax โ”‚ โœ… โ”‚ None โ”‚ โ”‚ Tests โ”‚ โš ๏ธ โ”‚ 2 new tests needed โ”‚ โ”‚ Lint/Format โ”‚ โœ… โ”‚ None โ”‚ โ”‚ Git Status โ”‚ โš ๏ธ โ”‚ Uncommitted changes โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ OVERALL: ๐ŸŸก YELLOW - Minor issues โš ๏ธ ISSUES FOUND (2): 1. New code missing tests (TaskManager.php) 2. Uncommitted changes (3 files) ๐Ÿ”ง QUICK FIXES: 1. Add test: php artisan make:test TaskManagerTest 2. Commit: /sdd:story-save "Add due date feature" Estimated fix time: 5 minutes ``` --- ### Phase 6: Auto-Fix (if --fix flag) **Automatic Fixes**: ```bash # If --fix flag provided /sdd:story-quick-check --fix # Auto-fixes: โœ“ Run Pint to format code โœ“ Clear config cache โœ“ Suggest test creation โœ“ Offer to commit changes ``` **Output**: ``` ๐Ÿ”ง AUTO-FIX APPLIED =================== โœ… Formatted 3 files (vendor/bin/pint) โœ… Cleared config cache โš ๏ธ Tests require manual creation โš ๏ธ Git commit requires manual action Updated status: ๐ŸŸข GREEN (after fixes) ``` --- ## Examples ### Example 1: All Clear ```bash $ /sdd:story-quick-check โšก QUICK CHECK RESULTS ===================== Completed in 22 seconds โœ… Syntax: Valid โœ… Tests: 24/24 passed โœ… Lint: No issues โœ… Git: Clean working directory OVERALL: ๐ŸŸข GREEN - All clear! โœ… Safe to proceed ``` ### Example 2: Minor Issues (Yellow) ```bash $ /sdd:story-quick-check โšก QUICK CHECK RESULTS ===================== Completed in 28 seconds OVERALL: ๐ŸŸก YELLOW - Minor issues โš ๏ธ ISSUES (2): 1. Formatting: 3 files need Pint 2. Git: 3 uncommitted changes ๐Ÿ”ง Quick fixes: vendor/bin/pint --dirty /sdd:story-save "Add feature" Estimated fix: 2 minutes ``` ### Example 3: Critical Issues (Red) ```bash $ /sdd:story-quick-check โšก QUICK CHECK RESULTS ===================== Completed in 18 seconds OVERALL: ๐Ÿ”ด RED - Blocking issues โŒ CRITICAL (2): 1. Syntax error: TaskManager.php:42 Missing semicolon on line 41 2. Test failures: 2/24 failed Task::updateOrder() - assertion failed Category::tasks() - undefined property ๐Ÿ”ง Must fix before continuing: 1. Fix syntax error 2. Update failing tests Do NOT proceed until resolved. ``` ### Example 4: Auto-Fix Applied ```bash $ /sdd:story-quick-check --fix โšก QUICK CHECK RESULTS ===================== ๐Ÿ”ง AUTO-FIX APPLIED: โœ… Formatted 3 files โœ… Cleared caches โœ… Resolved all auto-fixable issues OVERALL: ๐ŸŸข GREEN - All issues resolved! Remaining manual actions: - Consider adding tests for new code - Run /sdd:story-save to commit changes โœ… Safe to proceed ``` ### Example 5: Tests Only ```bash $ /sdd:story-quick-check --checks=tests ๐Ÿงช TEST CHECK (9s) ================== โœ… Unit tests: 24/24 passed โœ… Feature tests: 8/8 passed OVERALL: ๐ŸŸข GREEN โœ… All tests passing ``` --- ## Success Criteria **Command succeeds when**: - All checks complete within 30 seconds - Status report generated (green/yellow/red) - Quick fixes suggested for issues - Clear next action provided **Status Levels**: - ๐ŸŸข **GREEN**: No issues, safe to proceed - ๐ŸŸก **YELLOW**: Minor issues, fix before review - ๐Ÿ”ด **RED**: Blocking issues, must fix immediately --- ## Output Format **One-Liner Status** (always shown): ```bash โœ… Clear to proceed # or โš ๏ธ 3 issues need attention - 2min to fix # or โŒ STOP: 2 critical errors must be fixed ``` **Detailed Report** (when issues found): ``` Issue breakdown by priority Quick fix commands Estimated fix time Next recommended action ``` --- ## Notes - **Execution Time**: Always under 30 seconds - **Read-Only**: Never modifies code (unless `--fix` flag) - **Fast Feedback**: Designed for frequent use during development - **Minimal Scope**: Only checks critical items (syntax, tests, lint, git) - **Auto-Fix**: With `--fix` flag, automatically resolves formatting issues **Best Practices**: 1. Run before every `/sdd:story-save` commit 2. Run after making changes to verify stability 3. Use `--fix` to quickly resolve formatting issues 4. Use `--checks=tests` for rapid test validation 5. If RED, fix immediately before continuing work **When to Use**: - โœ… Before committing code (`/sdd:story-save`) - โœ… After implementing a feature - โœ… Before switching tasks - โœ… Multiple times per hour during active development **When NOT to Use**: - โŒ Instead of comprehensive testing (use `/sdd:story-test-integration`) - โŒ For deployment validation (use `/sdd:story-full-check`) - โŒ For final story validation (use `/sdd:story-validate`) **Next Steps**: ```bash ๐ŸŸข GREEN โ†’ Continue work or /sdd:story-save ๐ŸŸก YELLOW โ†’ Fix issues, re-check, then /sdd:story-save ๐Ÿ”ด RED โ†’ Fix critical issues immediately ``` **For Deeper Validation**: ```bash /sdd:story-test-integration # Integration + E2E tests (3-8 min) /sdd:story-full-check # Complete validation suite (5 min) ```