@smicolon/ai-kit 0.0.1 → 0.1.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 (163) hide show
  1. package/.claude-plugin/CLAUDE.md +7 -0
  2. package/.claude-plugin/marketplace.json +373 -0
  3. package/README.md +132 -0
  4. package/package.json +13 -3
  5. package/packs/architect/CHANGELOG.md +17 -0
  6. package/packs/architect/README.md +58 -0
  7. package/packs/architect/agents/system-architect.md +768 -0
  8. package/packs/architect/commands/diagram-create.md +300 -0
  9. package/packs/better-auth/.claude-plugin/plugin.json +14 -0
  10. package/packs/better-auth/.mcp.json +14 -0
  11. package/packs/better-auth/CHANGELOG.md +26 -0
  12. package/packs/better-auth/README.md +125 -0
  13. package/packs/better-auth/agents/auth-architect.md +278 -0
  14. package/packs/better-auth/commands/auth-provider-add.md +265 -0
  15. package/packs/better-auth/commands/auth-setup.md +298 -0
  16. package/packs/better-auth/skills/auth-security/SKILL.md +425 -0
  17. package/packs/better-auth/skills/better-auth-patterns/SKILL.md +455 -0
  18. package/packs/dev-loop/.claude-plugin/plugin.json +10 -0
  19. package/packs/dev-loop/CHANGELOG.md +69 -0
  20. package/packs/dev-loop/README.md +155 -0
  21. package/packs/dev-loop/commands/cancel-dev.md +21 -0
  22. package/packs/dev-loop/commands/dev-loop.md +72 -0
  23. package/packs/dev-loop/commands/dev-plan.md +351 -0
  24. package/packs/dev-loop/hooks/hooks.json +15 -0
  25. package/packs/dev-loop/hooks/stop-hook.sh +178 -0
  26. package/packs/dev-loop/scripts/setup-dev-loop.sh +194 -0
  27. package/packs/dev-loop/skills/tdd-planner/SKILL.md +249 -0
  28. package/packs/dev-loop/skills/tdd-planner/references/framework-patterns.md +874 -0
  29. package/packs/dev-loop/skills/tdd-planner/references/good-example.md +260 -0
  30. package/packs/dev-loop/skills/tdd-planner/references/plan-template.md +275 -0
  31. package/packs/django/CHANGELOG.md +39 -0
  32. package/packs/django/README.md +92 -0
  33. package/packs/django/agents/django-architect.md +182 -0
  34. package/packs/django/agents/django-builder.md +250 -0
  35. package/packs/django/agents/django-feature-based.md +420 -0
  36. package/packs/django/agents/django-reviewer.md +253 -0
  37. package/packs/django/agents/django-tester.md +230 -0
  38. package/packs/django/commands/api-endpoint.md +285 -0
  39. package/packs/django/commands/model-create.md +178 -0
  40. package/packs/django/commands/test-generate.md +325 -0
  41. package/packs/django/rules/migrations.md +138 -0
  42. package/packs/django/rules/models.md +167 -0
  43. package/packs/django/rules/serializers.md +126 -0
  44. package/packs/django/rules/services.md +131 -0
  45. package/packs/django/rules/tests.md +140 -0
  46. package/packs/django/rules/views.md +102 -0
  47. package/packs/django/skills/import-convention-enforcer/SKILL.md +226 -0
  48. package/packs/django/skills/import-convention-enforcer/patterns/django-imports.md +343 -0
  49. package/packs/django/skills/migration-safety-checker/SKILL.md +375 -0
  50. package/packs/django/skills/model-entity-validator/SKILL.md +298 -0
  51. package/packs/django/skills/performance-optimizer/SKILL.md +447 -0
  52. package/packs/django/skills/red-phase-verifier/SKILL.md +180 -0
  53. package/packs/django/skills/security-first-validator/SKILL.md +435 -0
  54. package/packs/django/skills/test-coverage-advisor/SKILL.md +394 -0
  55. package/packs/django/skills/test-validity-checker/SKILL.md +194 -0
  56. package/packs/failure-log/.claude-plugin/plugin.json +14 -0
  57. package/packs/failure-log/CHANGELOG.md +20 -0
  58. package/packs/failure-log/README.md +168 -0
  59. package/packs/failure-log/commands/failure-add.md +106 -0
  60. package/packs/failure-log/commands/failure-list.md +89 -0
  61. package/packs/failure-log/hooks/hooks.json +16 -0
  62. package/packs/failure-log/hooks/scripts/inject-failures.sh +64 -0
  63. package/packs/failure-log/skills/failure-log-manager/SKILL.md +164 -0
  64. package/packs/flutter/.claude-plugin/plugin.json +10 -0
  65. package/packs/flutter/CHANGELOG.md +19 -0
  66. package/packs/flutter/README.md +170 -0
  67. package/packs/flutter/agents/flutter-architect.md +166 -0
  68. package/packs/flutter/agents/flutter-builder.md +303 -0
  69. package/packs/flutter/agents/release-manager.md +355 -0
  70. package/packs/flutter/commands/fastlane-setup.md +188 -0
  71. package/packs/flutter/commands/flutter-build.md +90 -0
  72. package/packs/flutter/commands/flutter-deploy.md +133 -0
  73. package/packs/flutter/commands/flutter-test.md +117 -0
  74. package/packs/flutter/commands/signing-setup.md +209 -0
  75. package/packs/flutter/hooks/hooks.json +17 -0
  76. package/packs/flutter/skills/fastlane-knowledge/SKILL.md +193 -0
  77. package/packs/flutter/skills/flutter-architecture/SKILL.md +127 -0
  78. package/packs/flutter/skills/store-publishing/SKILL.md +163 -0
  79. package/packs/hono/.claude-plugin/plugin.json +19 -0
  80. package/packs/hono/CHANGELOG.md +19 -0
  81. package/packs/hono/README.md +143 -0
  82. package/packs/hono/agents/hono-architect.md +240 -0
  83. package/packs/hono/agents/hono-builder.md +285 -0
  84. package/packs/hono/agents/hono-reviewer.md +279 -0
  85. package/packs/hono/agents/hono-tester.md +346 -0
  86. package/packs/hono/commands/middleware-create.md +223 -0
  87. package/packs/hono/commands/project-init.md +306 -0
  88. package/packs/hono/commands/route-create.md +153 -0
  89. package/packs/hono/commands/rpc-client.md +263 -0
  90. package/packs/hono/hooks/hooks.json +4 -0
  91. package/packs/hono/skills/cloudflare-bindings/SKILL.md +408 -0
  92. package/packs/hono/skills/hono-patterns/SKILL.md +309 -0
  93. package/packs/hono/skills/rpc-typesafe/SKILL.md +388 -0
  94. package/packs/hono/skills/zod-validation/SKILL.md +332 -0
  95. package/packs/nestjs/CHANGELOG.md +29 -0
  96. package/packs/nestjs/README.md +75 -0
  97. package/packs/nestjs/agents/nestjs-architect.md +402 -0
  98. package/packs/nestjs/agents/nestjs-builder.md +301 -0
  99. package/packs/nestjs/agents/nestjs-tester.md +437 -0
  100. package/packs/nestjs/commands/module-create.md +369 -0
  101. package/packs/nestjs/rules/controllers.md +92 -0
  102. package/packs/nestjs/rules/dto.md +124 -0
  103. package/packs/nestjs/rules/entities.md +102 -0
  104. package/packs/nestjs/rules/services.md +106 -0
  105. package/packs/nestjs/skills/barrel-export-manager/SKILL.md +389 -0
  106. package/packs/nestjs/skills/import-convention-enforcer/SKILL.md +365 -0
  107. package/packs/nextjs/CHANGELOG.md +36 -0
  108. package/packs/nextjs/README.md +76 -0
  109. package/packs/nextjs/agents/frontend-tester.md +680 -0
  110. package/packs/nextjs/agents/frontend-visual.md +820 -0
  111. package/packs/nextjs/agents/nextjs-architect.md +331 -0
  112. package/packs/nextjs/agents/nextjs-modular.md +433 -0
  113. package/packs/nextjs/commands/component-create.md +398 -0
  114. package/packs/nextjs/rules/api-routes.md +129 -0
  115. package/packs/nextjs/rules/components.md +106 -0
  116. package/packs/nextjs/rules/hooks.md +132 -0
  117. package/packs/nextjs/skills/accessibility-validator/SKILL.md +445 -0
  118. package/packs/nextjs/skills/import-convention-enforcer/SKILL.md +399 -0
  119. package/packs/nextjs/skills/react-form-validator/SKILL.md +569 -0
  120. package/packs/nuxtjs/CHANGELOG.md +30 -0
  121. package/packs/nuxtjs/README.md +56 -0
  122. package/packs/nuxtjs/agents/frontend-tester.md +680 -0
  123. package/packs/nuxtjs/agents/frontend-visual.md +820 -0
  124. package/packs/nuxtjs/agents/nuxtjs-architect.md +537 -0
  125. package/packs/nuxtjs/commands/component-create.md +223 -0
  126. package/packs/nuxtjs/rules/components.md +101 -0
  127. package/packs/nuxtjs/rules/composables.md +118 -0
  128. package/packs/nuxtjs/rules/server-routes.md +127 -0
  129. package/packs/nuxtjs/skills/accessibility-validator/SKILL.md +183 -0
  130. package/packs/nuxtjs/skills/import-convention-enforcer/SKILL.md +196 -0
  131. package/packs/nuxtjs/skills/veevalidate-form-validator/SKILL.md +190 -0
  132. package/packs/onboard/CHANGELOG.md +22 -0
  133. package/packs/onboard/README.md +103 -0
  134. package/packs/onboard/agents/onboard-guide.md +118 -0
  135. package/packs/onboard/commands/onboard.md +313 -0
  136. package/packs/onboard/skills/onboard-context-provider/SKILL.md +98 -0
  137. package/packs/tanstack-router/.claude-plugin/plugin.json +14 -0
  138. package/packs/tanstack-router/CHANGELOG.md +30 -0
  139. package/packs/tanstack-router/README.md +113 -0
  140. package/packs/tanstack-router/agents/tanstack-architect.md +173 -0
  141. package/packs/tanstack-router/agents/tanstack-builder.md +360 -0
  142. package/packs/tanstack-router/agents/tanstack-tester.md +454 -0
  143. package/packs/tanstack-router/commands/form-create.md +313 -0
  144. package/packs/tanstack-router/commands/query-create.md +263 -0
  145. package/packs/tanstack-router/commands/route-create.md +190 -0
  146. package/packs/tanstack-router/commands/table-create.md +413 -0
  147. package/packs/tanstack-router/skills/ai-patterns/SKILL.md +370 -0
  148. package/packs/tanstack-router/skills/db-patterns/SKILL.md +346 -0
  149. package/packs/tanstack-router/skills/devtools-patterns/SKILL.md +415 -0
  150. package/packs/tanstack-router/skills/form-patterns/SKILL.md +425 -0
  151. package/packs/tanstack-router/skills/pacer-patterns/SKILL.md +341 -0
  152. package/packs/tanstack-router/skills/query-patterns/SKILL.md +359 -0
  153. package/packs/tanstack-router/skills/router-patterns/SKILL.md +285 -0
  154. package/packs/tanstack-router/skills/store-patterns/SKILL.md +351 -0
  155. package/packs/tanstack-router/skills/table-patterns/SKILL.md +531 -0
  156. package/packs/tanstack-router/skills/tanstack-conventions/SKILL.md +428 -0
  157. package/packs/tanstack-router/skills/virtual-patterns/SKILL.md +490 -0
  158. package/packs/worktree/.claude-plugin/plugin.json +19 -0
  159. package/packs/worktree/CHANGELOG.md +24 -0
  160. package/packs/worktree/README.md +110 -0
  161. package/packs/worktree/commands/wt.md +73 -0
  162. package/packs/worktree/scripts/wt.sh +396 -0
  163. package/packs/worktree/skills/worktree-manager/SKILL.md +68 -0
@@ -0,0 +1,194 @@
1
+ #!/bin/bash
2
+
3
+ # Dev Loop Setup Script
4
+ # Based on Ralph Wiggum pattern from official plugin
5
+ # Creates state file for in-session dev loop
6
+
7
+ set -euo pipefail
8
+
9
+ # Parse arguments
10
+ PROMPT_PARTS=()
11
+ MAX_ITERATIONS=50 # Default: 50 iterations (different from Ralph's unlimited)
12
+ COMPLETION_PROMISE="DONE" # Default: "DONE" (different from Ralph's null)
13
+ FROM_PLAN=false
14
+ PLAN_FILE=".claude/dev-plan.local.md"
15
+
16
+ # Parse options and positional arguments
17
+ while [[ $# -gt 0 ]]; do
18
+ case $1 in
19
+ -h|--help)
20
+ cat << 'HELP_EOF'
21
+ Dev Loop - Iterative development loop with sensible defaults
22
+
23
+ USAGE:
24
+ /dev-loop [PROMPT...] [OPTIONS]
25
+ /dev-loop --from-plan [OPTIONS]
26
+
27
+ ARGUMENTS:
28
+ PROMPT... Initial prompt to start the loop (can be multiple words without quotes)
29
+
30
+ OPTIONS:
31
+ --from-plan Use prompt from .claude/dev-plan.local.md
32
+ --max-iterations <n> Maximum iterations (default: 50)
33
+ --promise '<text>' Completion promise phrase (default: DONE)
34
+ -h, --help Show this help message
35
+
36
+ DESCRIPTION:
37
+ Starts a development loop in your CURRENT session. The stop hook prevents
38
+ exit and feeds your output back as input until completion or iteration limit.
39
+
40
+ To signal completion, output: <promise>DONE</promise>
41
+ (or your custom --promise value)
42
+
43
+ Use this for:
44
+ - TDD development cycles (Red-Green-Refactor)
45
+ - Bug fixing with iterative debugging
46
+ - Feature implementation with self-correction
47
+
48
+ DEFAULTS (different from Ralph Wiggum):
49
+ - Max iterations: 50 (Ralph: unlimited)
50
+ - Completion promise: DONE (Ralph: none)
51
+
52
+ EXAMPLES:
53
+ /dev-loop Build a todo API
54
+ /dev-loop Fix the auth bug --max-iterations 20
55
+ /dev-loop --from-plan
56
+ /dev-loop Refactor cache layer --promise 'REFACTOR COMPLETE'
57
+
58
+ STOPPING:
59
+ Output <promise>DONE</promise> or reach max iterations (50 by default).
60
+
61
+ WORKFLOW:
62
+ 1. /dev-plan "Your task" # Generate structured TDD plan
63
+ 2. Review .claude/dev-plan.local.md
64
+ 3. /dev-loop --from-plan # Execute with plan
65
+ HELP_EOF
66
+ exit 0
67
+ ;;
68
+ --max-iterations)
69
+ if [[ -z "${2:-}" ]]; then
70
+ echo "❌ Error: --max-iterations requires a number argument" >&2
71
+ echo "" >&2
72
+ echo " Valid examples:" >&2
73
+ echo " --max-iterations 10" >&2
74
+ echo " --max-iterations 50" >&2
75
+ echo " --max-iterations 0 (unlimited)" >&2
76
+ echo "" >&2
77
+ echo " You provided: --max-iterations (with no number)" >&2
78
+ exit 1
79
+ fi
80
+ if ! [[ "$2" =~ ^[0-9]+$ ]]; then
81
+ echo "❌ Error: --max-iterations must be a positive integer or 0, got: $2" >&2
82
+ echo "" >&2
83
+ echo " Valid examples:" >&2
84
+ echo " --max-iterations 10" >&2
85
+ echo " --max-iterations 50" >&2
86
+ echo " --max-iterations 0 (unlimited)" >&2
87
+ echo "" >&2
88
+ echo " Invalid: decimals (10.5), negative numbers (-5), text" >&2
89
+ exit 1
90
+ fi
91
+ MAX_ITERATIONS="$2"
92
+ shift 2
93
+ ;;
94
+ --promise|--completion-promise)
95
+ if [[ -z "${2:-}" ]]; then
96
+ echo "❌ Error: --promise requires a text argument" >&2
97
+ echo "" >&2
98
+ echo " Valid examples:" >&2
99
+ echo " --promise 'DONE'" >&2
100
+ echo " --promise 'TASK COMPLETE'" >&2
101
+ echo " --promise 'All tests passing'" >&2
102
+ echo "" >&2
103
+ echo " You provided: --promise (with no text)" >&2
104
+ echo "" >&2
105
+ echo " Note: Multi-word promises must be quoted!" >&2
106
+ exit 1
107
+ fi
108
+ COMPLETION_PROMISE="$2"
109
+ shift 2
110
+ ;;
111
+ --from-plan)
112
+ FROM_PLAN=true
113
+ shift
114
+ ;;
115
+ *)
116
+ # Non-option argument - collect all as prompt parts
117
+ PROMPT_PARTS+=("$1")
118
+ shift
119
+ ;;
120
+ esac
121
+ done
122
+
123
+ # Handle --from-plan
124
+ if [[ "$FROM_PLAN" == "true" ]]; then
125
+ if [[ ! -f "$PLAN_FILE" ]]; then
126
+ echo "❌ Error: Plan file not found at $PLAN_FILE" >&2
127
+ echo "" >&2
128
+ echo " Run /dev-plan first to generate a plan, or provide a prompt directly." >&2
129
+ echo "" >&2
130
+ echo " Examples:" >&2
131
+ echo " /dev-plan Build a REST API for todos" >&2
132
+ echo " /dev-loop --from-plan" >&2
133
+ exit 1
134
+ fi
135
+ PROMPT=$(cat "$PLAN_FILE")
136
+ echo "📋 Using plan from: $PLAN_FILE"
137
+ else
138
+ # Join all prompt parts with spaces
139
+ PROMPT="${PROMPT_PARTS[*]}"
140
+ fi
141
+
142
+ # Validate prompt is non-empty
143
+ if [[ -z "$PROMPT" ]]; then
144
+ echo "❌ Error: No prompt provided" >&2
145
+ echo "" >&2
146
+ echo " Dev loop needs a task description to work on." >&2
147
+ echo "" >&2
148
+ echo " Examples:" >&2
149
+ echo " /dev-loop Build a REST API for todos" >&2
150
+ echo " /dev-loop Fix the auth bug --max-iterations 20" >&2
151
+ echo " /dev-loop --from-plan" >&2
152
+ echo "" >&2
153
+ echo " For all options: /dev-loop --help" >&2
154
+ exit 1
155
+ fi
156
+
157
+ # Create state file for stop hook (markdown with YAML frontmatter)
158
+ mkdir -p .claude
159
+
160
+ # Quote completion promise for YAML
161
+ COMPLETION_PROMISE_YAML="\"$COMPLETION_PROMISE\""
162
+
163
+ cat > .claude/dev-loop.local.md <<EOF
164
+ ---
165
+ active: true
166
+ iteration: 1
167
+ max_iterations: $MAX_ITERATIONS
168
+ completion_promise: $COMPLETION_PROMISE_YAML
169
+ started_at: "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
170
+ ---
171
+
172
+ $PROMPT
173
+ EOF
174
+
175
+ # Output setup message
176
+ cat <<EOF
177
+ 🔄 Dev loop activated!
178
+
179
+ Iteration: 1
180
+ Max iterations: $(if [[ $MAX_ITERATIONS -gt 0 ]]; then echo $MAX_ITERATIONS; else echo "unlimited"; fi)
181
+ Completion promise: $COMPLETION_PROMISE
182
+
183
+ To complete: output <promise>$COMPLETION_PROMISE</promise>
184
+ (ONLY when task is COMPLETE - do not lie to exit!)
185
+
186
+ To monitor: head -10 .claude/dev-loop.local.md
187
+ To cancel: /cancel-dev
188
+
189
+ 🔄
190
+ EOF
191
+
192
+ # Output the initial prompt
193
+ echo ""
194
+ echo "$PROMPT"
@@ -0,0 +1,249 @@
1
+ ---
2
+ name: tdd-planner
3
+ description: This skill should be used when the user asks to "plan a feature", "prepare for dev loop", "structure TDD approach", "break down this task", "create development plan", or when generating structured prompts for iterative development. Creates dev-loop-ready plans with TDD phases, file tables, code snippets, and framework-specific guidance.
4
+ ---
5
+
6
+ # TDD Planner
7
+
8
+ Generate high-quality, structured development plans following Test-Driven Development principles for use with the dev-loop command.
9
+
10
+ ## Quality Standard
11
+
12
+ Every plan must meet this checklist before saving:
13
+
14
+ - [ ] Context lists **specific items** to work on (not just "the feature")
15
+ - [ ] Success criteria are **measurable** (numbers, specific behaviors)
16
+ - [ ] **Every task** has a file path
17
+ - [ ] **Code snippets** show implementation structure
18
+ - [ ] Verification has **expected output** (PASS/FAIL + why)
19
+ - [ ] Self-correction is **phase-specific**, not generic
20
+ - [ ] **Files to Modify** table exists
21
+ - [ ] **New Files to Create** table exists
22
+ - [ ] Stuck handling is **framework/task-specific**
23
+
24
+ **Reference:** See `references/good-example.md` for expected quality.
25
+
26
+ ## Activation Triggers
27
+
28
+ This skill activates when:
29
+ - Planning a feature for iterative development
30
+ - Preparing prompts for dev-loop execution
31
+ - Breaking down complex tasks into TDD phases
32
+ - Creating structured development workflows
33
+
34
+ ## Core Principles
35
+
36
+ 1. **Specificity Over Vagueness** - File paths, code snippets, measurable outcomes
37
+ 2. **Iteration Over Perfection** - Expect multiple passes, not first-draft solutions
38
+ 3. **Failures as Data** - Red phase tests MUST fail first
39
+ 4. **Framework Awareness** - Use correct patterns for detected framework
40
+
41
+ ## Required Plan Sections
42
+
43
+ ### 1. Context
44
+
45
+ ```markdown
46
+ ## Context
47
+
48
+ - **Framework**: Flutter / Django / Next.js / etc.
49
+ - **Current State**: What exists now
50
+ - **Test Command**: `flutter test` / `pytest` / etc.
51
+ - **Lint Command**: `flutter analyze` / `ruff check .` / etc.
52
+ - **Items to Work On**:
53
+ - `ComponentA` (description)
54
+ - `ComponentB` (description)
55
+ ```
56
+
57
+ ### 2. Success Criteria (Measurable)
58
+
59
+ ```markdown
60
+ ## Success Criteria
61
+
62
+ - [ ] Login returns JWT token (specific behavior)
63
+ - [ ] 81+ tests pass (quantitative)
64
+ - [ ] Invalid credentials return 401 (negative case)
65
+ - [ ] All tests pass (`flutter test`)
66
+ - [ ] Linter clean (`flutter analyze`)
67
+ ```
68
+
69
+ ### 3. File Tables (Required)
70
+
71
+ ```markdown
72
+ ## Files to Modify
73
+
74
+ | File | Action |
75
+ |------|--------|
76
+ | `lib/main.dart` | Replace MultiProvider with ProviderScope |
77
+ | `pubspec.yaml` | Add flutter_riverpod dependency |
78
+
79
+ ## New Files to Create
80
+
81
+ | File | Purpose |
82
+ |------|---------|
83
+ | `lib/providers/auth_provider.dart` | Riverpod auth state |
84
+ | `test/providers/auth_test.dart` | Auth provider tests |
85
+ ```
86
+
87
+ ### 4. Phases with Code Snippets
88
+
89
+ ```markdown
90
+ ### Phase 2: Green - Implement Auth Provider
91
+
92
+ **Goal:** Create Riverpod provider that passes tests
93
+
94
+ **Tasks:**
95
+ - [ ] Create `lib/providers/auth_provider.dart`:
96
+ - StateNotifierProvider with AuthNotifier
97
+ - Methods: login(), logout(), checkAuth()
98
+ - State: AuthState (authenticated, user, token)
99
+
100
+ **Implementation Structure:**
101
+ ```dart
102
+ final authProvider = StateNotifierProvider<AuthNotifier, AuthState>((ref) {
103
+ return AuthNotifier();
104
+ });
105
+
106
+ class AuthNotifier extends StateNotifier<AuthState> {
107
+ AuthNotifier() : super(AuthState.initial());
108
+
109
+ Future<void> login(String email, String password) async {
110
+ // Implementation
111
+ }
112
+ }
113
+ ```
114
+
115
+ **Verification:**
116
+ ```bash
117
+ flutter test test/providers/auth_test.dart
118
+ ```
119
+ **Expected:** Tests should PASS
120
+
121
+ **Self-correction:**
122
+ - If tests fail, check state class matches test expectations
123
+ - Verify StateNotifier lifecycle is correct
124
+ ```
125
+
126
+ ### 5. Stuck Handling (Framework-Specific)
127
+
128
+ ```markdown
129
+ ## Stuck Handling
130
+
131
+ ### If same test keeps failing:
132
+ 1. Read the exact error message
133
+ 2. Check if ProviderScope wraps the widget tree
134
+ 3. Verify ref.watch vs ref.read usage
135
+ 4. Check state class matches expected structure
136
+
137
+ ### If app won't start:
138
+ 1. Check ProviderScope is at app root
139
+ 2. Verify no circular provider dependencies
140
+ 3. Check async initialization is handled
141
+
142
+ ### Alternative approaches if blocked:
143
+ 1. Keep hybrid approach temporarily (both Provider and Riverpod)
144
+ 2. Migrate one screen at a time
145
+ 3. Use ChangeNotifierProvider adapter for gradual migration
146
+ ```
147
+
148
+ ## Framework Detection
149
+
150
+ **Package manager auto-detection** (defaults to `bun`):
151
+ - `bun.lockb` → bun
152
+ - `pnpm-lock.yaml` → pnpm
153
+ - `yarn.lock` → yarn
154
+ - `package-lock.json` → npm
155
+ - No lockfile → bun (default)
156
+
157
+ **Auto-detected frameworks (17+):**
158
+
159
+ | Category | Framework | Detection | Test | Lint |
160
+ |----------|-----------|-----------|------|------|
161
+ | **Mobile** | Flutter | `pubspec.yaml` | `flutter test` | `flutter analyze` |
162
+ | | React Native | `react-native` in package.json | `${PM} test` | `${PM} run lint` |
163
+ | **Python** | Django | `manage.py` | `pytest` | `ruff check .` |
164
+ | | FastAPI | `fastapi` in pyproject.toml | `pytest` | `ruff check .` |
165
+ | | Flask | `flask` in pyproject.toml | `pytest` | `ruff check .` |
166
+ | **Node.js** | NestJS | `@nestjs/core` | `${PM} test` | `${PM} run lint` |
167
+ | | Next.js | `next` | `${PM} test` | `${PM} run lint` |
168
+ | | Nuxt.js | `nuxt` | `${PM} test` | `${PM} run lint` |
169
+ | | Hono | `hono` | `bun test` | `bun run lint` |
170
+ | | Express | `express` | `${PM} test` | `${PM} run lint` |
171
+ | | TanStack | `@tanstack/react-router` | `bun test` | `bun run lint` |
172
+ | **Systems** | Go | `go.mod` | `go test ./...` | `golangci-lint run` |
173
+ | | Rust | `Cargo.toml` | `cargo test` | `cargo clippy` |
174
+ | **Web** | Rails | `rails` in Gemfile | `bundle exec rspec` | `bundle exec rubocop` |
175
+ | | Laravel | `laravel` in composer.json | `php artisan test` | `./vendor/bin/pint` |
176
+
177
+ `${PM}` = detected package manager (bun/pnpm/yarn/npm)
178
+
179
+ **Custom frameworks:**
180
+
181
+ ```bash
182
+ /dev-plan "Build API" --framework elixir --test-cmd "mix test" --lint-cmd "mix credo"
183
+ /dev-plan "Add feature" --test-cmd "make test" --lint-cmd "make lint"
184
+ ```
185
+
186
+ ## Phase Generation Rules
187
+
188
+ ### For New Features
189
+ 1. **Red**: Write tests for the feature interface (expect FAIL)
190
+ 2. **Green**: Implement minimum code to pass (include code snippet)
191
+ 3. **Refactor**: Clean up, add types, documentation
192
+
193
+ ### For Bug Fixes
194
+ 1. **Red**: Write test that reproduces the bug (should fail)
195
+ 2. **Green**: Fix the bug (test passes)
196
+ 3. **Refactor**: Ensure no regression, clean up
197
+
198
+ ### For Refactoring/Migration
199
+ 1. **Red**: Ensure existing tests pass (baseline)
200
+ 2. **Green**: Apply changes incrementally
201
+ 3. **Refactor**: Verify tests still pass after each change
202
+
203
+ ## Task Detail Pattern
204
+
205
+ **Bad Task:**
206
+ ```markdown
207
+ - [ ] Create login view
208
+ ```
209
+
210
+ **Good Task:**
211
+ ```markdown
212
+ - [ ] Create `lib/screens/login_screen.dart`:
213
+ - ConsumerStatefulWidget
214
+ - Form with email/password TextFormFields
215
+ - Calls `ref.read(authProvider.notifier).login()`
216
+ - Shows loading state during auth
217
+ - Navigates to home on success
218
+ - Shows error snackbar on failure
219
+ ```
220
+
221
+ ## Anti-Patterns to Avoid
222
+
223
+ | Don't | Do Instead |
224
+ |-------|------------|
225
+ | "Implement the feature" | "Create `lib/auth/login.dart` with ConsumerWidget" |
226
+ | "If it fails, try again" | "If tests pass in Red, they're too weak - add assertions" |
227
+ | Missing code snippets | Show actual structure with types and patterns |
228
+ | No file tables | Always list files to modify/create |
229
+ | "App works well" | "Login returns JWT, logout invalidates token, 401 on bad creds" |
230
+ | Generic stuck handling | Framework-specific: "Check ProviderScope wraps app" |
231
+
232
+ ## Usage
233
+
234
+ ### Generate Plan
235
+ ```bash
236
+ /dev-plan "Migrate to Riverpod" --framework flutter
237
+ /dev-plan "Add user authentication" --interactive
238
+ ```
239
+
240
+ ### Execute Plan
241
+ ```bash
242
+ /dev-loop --from-plan
243
+ ```
244
+
245
+ ## References
246
+
247
+ - `references/plan-template.md` - Full template with all variables
248
+ - `references/good-example.md` - High-quality Flutter migration example
249
+ - `references/framework-patterns.md` - Framework-specific patterns