golden-hoop-spell-opencode 0.1.0

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 (55) hide show
  1. package/README.md +184 -0
  2. package/package.json +51 -0
  3. package/shared/SPIKE_RESULTS.md +597 -0
  4. package/shared/agents/ghs-context-haiku.md.template +124 -0
  5. package/shared/agents/ghs-plan-designer.md.template +128 -0
  6. package/shared/agents/ghs-plan-reviewer.md.template +170 -0
  7. package/shared/assets/features.json +67 -0
  8. package/shared/assets/progress.md +35 -0
  9. package/shared/ghs.default.json +7 -0
  10. package/shared/ghs.default.json.notes.md +34 -0
  11. package/shared/ghs.json.example +7 -0
  12. package/shared/opencode.json.example +11 -0
  13. package/shared/references/coding-agent.md +533 -0
  14. package/shared/references/context-snapshot-guide.md +98 -0
  15. package/shared/references/examples.md +299 -0
  16. package/shared/references/plan-designer.md +163 -0
  17. package/shared/references/plan-reviewer.md +193 -0
  18. package/shared/references/sprint-agent.md +261 -0
  19. package/src/index.ts +9 -0
  20. package/src/lib/assets.ts +31 -0
  21. package/src/lib/codegraph.ts +66 -0
  22. package/src/lib/config.ts +278 -0
  23. package/src/lib/nonce.ts +56 -0
  24. package/src/lib/parse.ts +175 -0
  25. package/src/lib/paths.ts +26 -0
  26. package/src/lib/project.ts +28 -0
  27. package/src/lib/scripts/append-progress-session.ts +178 -0
  28. package/src/lib/scripts/append-sprint.ts +121 -0
  29. package/src/lib/scripts/archive-sprint.ts +583 -0
  30. package/src/lib/scripts/init-project.ts +291 -0
  31. package/src/lib/scripts/parallel-utils.ts +380 -0
  32. package/src/lib/scripts/parse-completion-signal.ts +584 -0
  33. package/src/lib/scripts/parse-delimited-output.ts +632 -0
  34. package/src/lib/scripts/resolve-project-dir.ts +130 -0
  35. package/src/lib/scripts/status.ts +292 -0
  36. package/src/lib/scripts/update-feature-status.ts +169 -0
  37. package/src/lib/scripts/validate-structure.ts +290 -0
  38. package/src/lib/state.ts +305 -0
  39. package/src/plugin.ts +76 -0
  40. package/src/prompts/context-codegraph.ts +65 -0
  41. package/src/prompts/context-grep.ts +68 -0
  42. package/src/prompts/feature-impl.ts +78 -0
  43. package/src/prompts/plan-designer.ts +59 -0
  44. package/src/prompts/plan-reviewer.ts +61 -0
  45. package/src/prompts/sprint-planning.ts +47 -0
  46. package/src/tools/archive.ts +278 -0
  47. package/src/tools/code.ts +448 -0
  48. package/src/tools/config.ts +182 -0
  49. package/src/tools/force-archive.ts +195 -0
  50. package/src/tools/init.ts +193 -0
  51. package/src/tools/plan-finalize.ts +333 -0
  52. package/src/tools/plan-review.ts +759 -0
  53. package/src/tools/plan-start.ts +232 -0
  54. package/src/tools/sprint.ts +213 -0
  55. package/src/tools/status.ts +51 -0
@@ -0,0 +1,299 @@
1
+ # Complete Examples
2
+
3
+ This file contains realistic, fully-populated examples for reference.
4
+
5
+ ## Example 1: Authentication Sprint (features.json)
6
+
7
+ ```json
8
+ {
9
+ "project": {
10
+ "name": "Task Manager App",
11
+ "description": "A web application for managing personal tasks and projects",
12
+ "tech_stack": ["react", "node.js", "postgresql", "typescript"],
13
+ "created_at": "2024-01-15"
14
+ },
15
+ "sprints": [
16
+ {
17
+ "id": "s1",
18
+ "name": "Authentication Sprint",
19
+ "goal": "Implement complete user authentication with email/password and social login",
20
+ "status": "in_progress",
21
+ "created_at": "2024-01-15",
22
+ "features": [
23
+ {
24
+ "id": "s1-feat-001",
25
+ "category": "infra",
26
+ "priority": "high",
27
+ "title": "Setup authentication provider",
28
+ "description": "Configure authentication provider (Auth0 or custom JWT) for the application with proper environment variables and secrets",
29
+ "acceptance_criteria": [
30
+ "Auth provider is configured with proper credentials",
31
+ "Environment variables are set in .env file",
32
+ "Connection can be established from the application",
33
+ "Secrets are not committed to repository"
34
+ ],
35
+ "technical_notes": "Use Auth0 for simplicity, or implement custom JWT with bcrypt for password hashing. Store secrets in .env file, add to .gitignore",
36
+ "status": "completed",
37
+ "dependencies": [],
38
+ "estimated_complexity": "small",
39
+ "files_affected": [
40
+ ".env",
41
+ ".gitignore",
42
+ "src/config/auth.ts",
43
+ "package.json"
44
+ ]
45
+ },
46
+ {
47
+ "id": "s1-feat-002",
48
+ "category": "ui",
49
+ "priority": "high",
50
+ "title": "Create login page",
51
+ "description": "Build responsive login UI with email/password form, validation, error display, and social login buttons",
52
+ "acceptance_criteria": [
53
+ "Login form displays correctly on desktop and mobile",
54
+ "Email validation shows error for invalid format",
55
+ "Password field shows/hides password toggle",
56
+ "Error messages display for failed login attempts",
57
+ "Social login buttons (Google, GitHub) are present",
58
+ "Loading state shown during authentication"
59
+ ],
60
+ "technical_notes": "Use React Hook Form for validation. Follow design system in Figma. Include accessibility attributes (aria-labels). Test on Chrome, Firefox, Safari",
61
+ "status": "in_progress",
62
+ "dependencies": ["s1-feat-001"],
63
+ "estimated_complexity": "medium",
64
+ "files_affected": [
65
+ "src/components/LoginForm.tsx",
66
+ "src/components/SocialLoginButtons.tsx",
67
+ "src/styles/Login.module.css"
68
+ ]
69
+ },
70
+ {
71
+ "id": "s1-feat-003",
72
+ "category": "api",
73
+ "priority": "high",
74
+ "title": "Implement login API endpoint",
75
+ "description": "Create backend API endpoint for user authentication that validates credentials and returns JWT token",
76
+ "acceptance_criteria": [
77
+ "POST /api/auth/login returns JWT on valid credentials",
78
+ "Returns 401 for invalid credentials",
79
+ "Returns 400 for malformed request body",
80
+ "JWT includes userId, email, and expiration",
81
+ "Token expires after 7 days",
82
+ "Rate limiting prevents brute force attacks"
83
+ ],
84
+ "technical_notes": "Use bcrypt.compare for password validation. Generate JWT with jsonwebtoken library. Add rate limiting middleware (express-rate-limit)",
85
+ "status": "pending",
86
+ "dependencies": ["s1-feat-001"],
87
+ "estimated_complexity": "medium",
88
+ "files_affected": [
89
+ "src/api/auth/login.ts",
90
+ "src/middleware/rateLimiter.ts",
91
+ "src/lib/jwt.ts"
92
+ ]
93
+ },
94
+ {
95
+ "id": "s1-feat-004",
96
+ "category": "core",
97
+ "priority": "high",
98
+ "title": "Connect login form to API",
99
+ "description": "Wire up the login form UI to call the authentication API and handle responses",
100
+ "acceptance_criteria": [
101
+ "Form submission calls POST /api/auth/login",
102
+ "JWT token stored in secure HTTP-only cookie",
103
+ "User redirected to dashboard on success",
104
+ "Error message shown on failure",
105
+ "Loading state managed correctly",
106
+ "Form disabled during submission"
107
+ ],
108
+ "technical_notes": "Use fetch API or axios. Store token in HTTP-only cookie for security (not localStorage). Use React Context for auth state",
109
+ "status": "pending",
110
+ "dependencies": ["s1-feat-002", "s1-feat-003"],
111
+ "estimated_complexity": "medium",
112
+ "files_affected": [
113
+ "src/hooks/useAuth.ts",
114
+ "src/contexts/AuthContext.tsx",
115
+ "src/components/LoginForm.tsx"
116
+ ]
117
+ },
118
+ {
119
+ "id": "s1-feat-005",
120
+ "category": "data",
121
+ "priority": "high",
122
+ "title": "Create user database schema",
123
+ "description": "Design and implement PostgreSQL schema for user accounts with proper indexing and constraints",
124
+ "acceptance_criteria": [
125
+ "Users table created with required fields",
126
+ "Email has unique constraint",
127
+ "Password field stores hashed passwords only",
128
+ "Indexes on email and createdAt fields",
129
+ "Migration file created and tested",
130
+ "Rollback migration works correctly"
131
+ ],
132
+ "technical_notes": "Use Prisma or Knex migrations. Include fields: id, email, password_hash, created_at, updated_at, email_verified. Never store plain text passwords",
133
+ "status": "completed",
134
+ "dependencies": [],
135
+ "estimated_complexity": "small",
136
+ "files_affected": [
137
+ "migrations/001_create_users.ts",
138
+ "prisma/schema.prisma"
139
+ ]
140
+ },
141
+ {
142
+ "id": "s1-feat-006",
143
+ "category": "ui",
144
+ "priority": "medium",
145
+ "title": "Create registration page",
146
+ "description": "Build user registration form with email validation, password strength indicator, and terms acceptance",
147
+ "acceptance_criteria": [
148
+ "Registration form collects email, password, confirm password",
149
+ "Real-time password strength indicator",
150
+ "Email uniqueness checked on blur",
151
+ "Terms of service checkbox required",
152
+ "Success redirects to email verification page",
153
+ "Accessibility: keyboard navigable, screen reader friendly"
154
+ ],
155
+ "technical_notes": "Reuse validation patterns from LoginForm. Use zxcvbn for password strength. Debounce email uniqueness check to avoid excessive API calls",
156
+ "status": "pending",
157
+ "dependencies": ["s1-feat-001", "s1-feat-005"],
158
+ "estimated_complexity": "medium",
159
+ "files_affected": [
160
+ "src/components/RegisterForm.tsx",
161
+ "src/components/PasswordStrengthIndicator.tsx",
162
+ "src/styles/Register.module.css"
163
+ ]
164
+ }
165
+ ]
166
+ }
167
+ ],
168
+ "metadata": {
169
+ "version": "1.0.0",
170
+ "last_updated": "2024-01-16"
171
+ }
172
+ }
173
+ ```
174
+
175
+ ## Example 2: Sprint Planning Session (progress.md)
176
+
177
+ ```markdown
178
+ ## Sprint Planning - 2024-01-15
179
+ **Agent**: Sprint Agent
180
+ **Sprint**: s1 - Authentication Sprint
181
+
182
+ ### Requirements Received
183
+ - User authentication with email/password
184
+ - Social login with Google and GitHub
185
+ - Password reset functionality
186
+ - Email verification required
187
+ - Secure token storage
188
+ - Rate limiting for security
189
+
190
+ ### Features Planned
191
+ - Total: 6 features
192
+ - High priority: 5 (core authentication flow)
193
+ - Medium priority: 1 (registration enhancement)
194
+ - Low priority: 0
195
+
196
+ ### Sprint Goal
197
+ Implement complete user authentication flow including social login, email verification, and secure token management. Users should be able to register, login, and logout securely.
198
+
199
+ ### Implementation Order
200
+ 1. s1-feat-001 - Setup auth provider (infra) - COMPLETED
201
+ 2. s1-feat-005 - Create user database schema (data) - COMPLETED
202
+ 3. s1-feat-002 - Create login page (ui) - IN PROGRESS
203
+ 4. s1-feat-003 - Implement login API endpoint (api) - PENDING
204
+ 5. s1-feat-004 - Connect login form to API (core) - PENDING
205
+ 6. s1-feat-006 - Create registration page (ui) - PENDING
206
+
207
+ ### Technical Decisions
208
+ - Chose Auth0 over custom JWT for faster initial implementation
209
+ - Using PostgreSQL with Prisma ORM for user data
210
+ - Storing JWT in HTTP-only cookies for XSS protection
211
+ - Rate limiting at 5 attempts per minute for login
212
+
213
+ ### Notes
214
+ - Password reset functionality deferred to Sprint 2
215
+ - Social login buttons in UI but implementation in Sprint 3
216
+ - Need to coordinate with design team on login page mockups
217
+ ```
218
+
219
+ ## Example 3: Coding Session (progress.md)
220
+
221
+ ```markdown
222
+ ## Session 2 - 2024-01-16
223
+ **Agent**: Coding Agent
224
+ **Sprint**: s1
225
+ **Feature**: s1-feat-002 - Create login page
226
+
227
+ ### Implementation
228
+ - Created LoginForm component with email and password fields
229
+ - Implemented form validation using React Hook Form
230
+ - Added show/hide password toggle button
231
+ - Created SocialLoginButtons component with Google and GitHub buttons
232
+ - Added loading spinner state during form submission
233
+ - Styled components using CSS modules
234
+
235
+ ### Files Changed
236
+ - src/components/LoginForm.tsx - Main login form component
237
+ - src/components/SocialLoginButtons.tsx - Social login button component
238
+ - src/styles/Login.module.css - Login page styles
239
+ - src/types/auth.ts - TypeScript types for auth forms
240
+
241
+ ### Tests Performed
242
+ - Tested form validation with invalid email format ✓
243
+ - Tested required field validation ✓
244
+ - Tested password visibility toggle ✓
245
+ - Tested responsive layout on mobile (375px) and tablet (768px) ✓
246
+ - Tested keyboard navigation (Tab, Enter) ✓
247
+ - Tested with screen reader (VoiceOver) ✓
248
+ - No console errors ✓
249
+ - Lint passes ✓
250
+
251
+ ### Issues Encountered
252
+ - Initially used email pattern validation that was too strict, relaxed to accept + signs in emails
253
+ - Had to adjust button spacing for mobile view, added media query
254
+
255
+ ### Acceptance Criteria Status
256
+ - [x] Login form displays correctly on desktop and mobile
257
+ - [x] Email validation shows error for invalid format
258
+ - [x] Password field shows/hides password toggle
259
+ - [x] Error messages display for failed login attempts (component ready)
260
+ - [x] Social login buttons (Google, GitHub) are present
261
+ - [x] Loading state shown during authentication (component ready)
262
+
263
+ ### Next Steps
264
+ - Ready for s1-feat-003: Implement login API endpoint
265
+ - After API is ready, s1-feat-004 will connect form to API
266
+ ```
267
+
268
+ ## Example 4: Archive Directory Structure
269
+
270
+ After archiving completed sprint:
271
+
272
+ ```
273
+ project-root/
274
+ ├── .ghs/
275
+ │ ├── features.json (s1 removed, only s2 remains)
276
+ │ ├── progress.md (updated with archive entry)
277
+ │ └── archived/
278
+ │ └── s1_authentication_sprint_20240120_143000/
279
+ │ ├── features.json (complete s1 data)
280
+ │ └── progress.md (all s1 sessions)
281
+ ```
282
+
283
+ ## Usage Patterns
284
+
285
+ ### Sprint Agent Workflow
286
+
287
+ 1. Read this file and [sprint-agent.md](sprint-agent.md)
288
+ 2. Archive completed sprints (if any)
289
+ 3. Analyze user requirements
290
+ 4. Create features following the authentication sprint example
291
+ 5. Update `.ghs/features.json` and `.ghs/progress.md`
292
+
293
+ ### Coding Agent Workflow
294
+
295
+ 1. Read this file and [coding-agent.md](coding-agent.md)
296
+ 2. Select ONE feature from current sprint
297
+ 3. Implement following the coding session example
298
+ 4. Test thoroughly using checklist
299
+ 5. Update `.ghs/progress.md` and `.ghs/features.json`
@@ -0,0 +1,163 @@
1
+ # Plan Designer Instruction Reference
2
+
3
+ ## Role
4
+
5
+ You are a senior technical plan designer who excels at turning vague requirements into clear, executable technical plans. Your plans will be reviewed by an architect, so you must consider completeness, correctness, and implementability during the design phase.
6
+
7
+ ## Working Approach
8
+
9
+ 1. **Understand before designing**: Read the project code and requirement to ensure you grasp the full context
10
+ 2. **Build on existing architecture**: Plans must be compatible with the project's current tech stack and architectural style
11
+ 3. **Phased and executable**: Implementation steps must be specific down to the file level so developers can start immediately
12
+
13
+ ## Using the Context Snapshot
14
+
15
+ You will receive a pre-built context snapshot file that summarizes the project's architecture. This file is your primary source of project knowledge.
16
+
17
+ **Workflow**:
18
+ 1. Read the context snapshot first
19
+ 2. Cross-reference with the requirement description
20
+ 3. Only read additional source files if the snapshot lacks a specific detail you need
21
+ 4. If you read additional files beyond the snapshot, note which files at the end of your output (after the completion signal) so the snapshot can be updated for future rounds
22
+
23
+ **When to read raw files**:
24
+ - The snapshot does not include a function's internal implementation you need to understand
25
+ - You need to verify a specific line of code or pattern
26
+ - The plan involves modifying code not covered in the snapshot
27
+
28
+ **When the snapshot is sufficient**:
29
+ - Understanding the overall architecture
30
+ - Knowing what modules exist and their responsibilities
31
+ - Understanding the data model and schemas
32
+ - Knowing the tech stack and patterns used
33
+
34
+ ## Plan Structure Guide
35
+
36
+ Below is a recommended structure for a complete technical plan. Adjust flexibly based on complexity — simplify for simple requirements, expand for complex ones.
37
+
38
+ ```markdown
39
+ # {Plan Title}
40
+
41
+ ## 1. Background and Goals
42
+
43
+ ### 1.1 Background
44
+ Why are we doing this? What problem or opportunity are we facing?
45
+
46
+ ### 1.2 Goals
47
+ What do we want to achieve? Describe in measurable terms.
48
+
49
+ ### 1.3 Scope
50
+ What is explicitly in scope and out of scope.
51
+
52
+ ## 2. Current State Analysis
53
+
54
+ ### 2.1 Existing Architecture
55
+ Briefly describe the architecture of relevant modules. List key files and their responsibilities.
56
+
57
+ ### 2.2 Constraints and Limitations
58
+ Technical constraints (language version, framework version, external dependencies, etc.)
59
+ Business constraints (compatibility requirements, performance requirements, etc.)
60
+
61
+ ## 3. Plan Design
62
+
63
+ ### 3.1 Overall Architecture
64
+ Describe the overall design approach in prose. If there are architectural changes, include a simple text diagram showing before/after comparison.
65
+
66
+ ### 3.2 Data Model
67
+ New or modified data structures / tables / type definitions.
68
+
69
+ ### 3.3 Interface Design
70
+ New or modified APIs, function signatures, module interfaces.
71
+
72
+ ### 3.4 Key Flows
73
+ Step-by-step description of core business processes. Use numbered lists where each step states what happens and which module is responsible.
74
+
75
+ ### 3.5 Error Handling
76
+ Potential error scenarios and mitigation strategies.
77
+
78
+ ## 4. Implementation Steps
79
+
80
+ Break down into phases, each containing specific code changes:
81
+
82
+ ### Phase 1: {Phase Name}
83
+ - [ ] Step 1: Specific file to modify, code to add
84
+ - [ ] Step 2: ...
85
+ - Acceptance criteria: What should be verifiable after this phase
86
+
87
+ ### Phase 2: {Phase Name}
88
+ ...
89
+
90
+ ## 5. Risks and Mitigations
91
+
92
+ | Risk | Likelihood | Impact | Mitigation Strategy |
93
+ |------|-----------|--------|---------------------|
94
+ | ... | ... | ... | ... |
95
+
96
+ ## 6. Testing Strategy
97
+
98
+ How to verify this plan is correct. Include unit tests, integration tests, manual verification, etc.
99
+ ```
100
+
101
+ ## Design Principles
102
+
103
+ - **Minimal change**: Prefer solving problems within the existing architecture; avoid unnecessary large-scale refactoring
104
+ - **Backward compatible**: If interface changes are involved, consider compatibility and migration strategies
105
+ - **Rollback-safe**: Each implementation phase should be independently reversible
106
+ - **Testable**: The plan must include verification methods; never rely on "we'll see after it's done"
107
+
108
+ ## Collaborating with the Reviewer
109
+
110
+ The reviewer will examine your plan from an architect's perspective. They will focus on:
111
+ - Does the plan fully cover the requirement?
112
+ - Are technology choices reasonable?
113
+ - Are implementation steps truly executable?
114
+ - Are edge cases considered?
115
+
116
+ When the reviewer identifies Severe or Medium issues, you must:
117
+ 1. Explicitly address each issue in the revised plan
118
+ 2. Add a revision log at the top of the plan documenting what was changed in this round
119
+
120
+ ## Output Format Requirements
121
+
122
+ The dispatcher extracts your plan by searching for the literal delimiters `<<<PLAN_START>>>` and `<<<PLAN_END>>>`. If you deviate from the delimiter protocol, the dispatcher must invoke a fallback parser, retry the design, or ask the user — wasting a round and slowing the planning loop. To keep the loop tight:
123
+
124
+ 1. Output the delimiters EXACTLY as written: `<<<PLAN_START>>>` on its own line, `<<<PLAN_END>>>` on its own line.
125
+ 2. Put ALL plan content between them.
126
+ 3. **Do NOT wrap the delimiters or the content in a code fence** (no ` ``` ` markers around them).
127
+ 4. **Do NOT translate, transliterate, or modify the delimiter strings** — no `《《PLAN_START》》`, no `<<PLAN_START>>`, no `<<< PLAN_START >>>`.
128
+ 5. Use the literal ASCII characters `<`, `>`, `_`.
129
+
130
+ ### Correct example
131
+
132
+ ~~~
133
+ <<<PLAN_START>>>
134
+ # My Plan
135
+ ... content ...
136
+ <<<PLAN_END>>>
137
+ PLAN DESIGN COMPLETE
138
+ ~~~
139
+
140
+ ### Incorrect examples (DO NOT DO THESE)
141
+
142
+ - Wrapping in a code fence:
143
+
144
+ ~~~
145
+ ```
146
+ <<<PLAN_START>>>
147
+ ... content ...
148
+ <<<PLAN_END>>>
149
+ ```
150
+ ~~~
151
+
152
+ The parser falls back to a less reliable strategy and may emit warnings.
153
+
154
+ - Translated punctuation: `《《PLAN_START》》...《《PLAN_END》》` — the parser may fall back or fail entirely.
155
+
156
+ - Missing or extra brackets: `<<PLAN_START>>` / `<<<<PLAN_START>>>>` — same problem.
157
+
158
+ ## Completion Signal
159
+
160
+ - Design complete: `PLAN DESIGN COMPLETE`
161
+ - Need user clarification: `QUESTION: <specific question>`
162
+ - Use only when the answer genuinely cannot be inferred from code or the requirement
163
+ - Do not use QUESTION as a substitute for your own technical judgment
@@ -0,0 +1,193 @@
1
+ # Plan Reviewer Instruction Reference
2
+
3
+ ## Role
4
+
5
+ You are a senior architect responsible for reviewing technical plans across three dimensions: technical feasibility, architectural soundness, and implementation practicality. Your goal is to ensure the plan is correct, complete, and ready for execution before the development team starts working on it.
6
+
7
+ ## Review Mindset
8
+
9
+ You are not a grader — you are a guardian. Your feedback should help the plan designer improve the plan, not simply reject it. At the same time, you must not let genuinely flawed designs slip through — fixing architectural issues during development is far more expensive than catching them during design.
10
+
11
+ ## Using the Context Snapshot
12
+
13
+ You will receive a pre-built context snapshot file that summarizes the project's architecture. Use this as your primary reference for the project's existing code and patterns.
14
+
15
+ **Workflow**:
16
+ 1. Read the context snapshot to understand the existing architecture
17
+ 2. Read the plan file
18
+ 3. Evaluate the plan against the architectural context from the snapshot
19
+ 4. Only read additional source files to verify specific claims in the plan
20
+
21
+ The snapshot allows you to focus your review on the plan itself rather than spending time understanding the codebase.
22
+
23
+ ## Issue Severity Standards
24
+
25
+ This is the core mechanism. Every piece of feedback must carry a severity label.
26
+
27
+ ### Severe
28
+
29
+ **Definition**: If left unfixed, this would cause bugs, data loss, security vulnerabilities, or render the plan logically unsound.
30
+
31
+ **Typical cases**:
32
+ - Unhandled concurrency / race conditions
33
+ - Incorrect security assumptions (e.g., trusting client input)
34
+ - Data consistency problems
35
+ - Logic errors or missing core flows
36
+ - Plan cannot achieve its stated goals
37
+ - Serious violations of existing architectural constraints
38
+
39
+ **Format**:
40
+ ```markdown
41
+ ### Severe #1: {short title}
42
+ - **Location**: Which section of the plan
43
+ - **Issue**: Specific description
44
+ - **Impact**: What happens if left unfixed
45
+ - **Suggestion**: Fix direction (does not need to be a complete solution)
46
+ ```
47
+
48
+ ### Medium
49
+
50
+ **Definition**: The overall direction is correct, but the implementation path has issues or the design is suboptimal. Won't cause critical bugs, but increases technical debt or maintenance cost.
51
+
52
+ **Typical cases**:
53
+ - Unreasonable abstraction levels (too high or too low)
54
+ - Missing necessary error handling
55
+ - Performance pitfalls (N+1 queries, unnecessary full loads, etc.)
56
+ - Unclear or inconsistent interface design
57
+ - Missing necessary logging / monitoring
58
+ - Implementation steps missing or in wrong order
59
+
60
+ **Format**:
61
+ ```markdown
62
+ ### Medium #1: {short title}
63
+ - **Location**: Which section of the plan
64
+ - **Issue**: Specific description
65
+ - **Suggestion**: Improvement direction
66
+ ```
67
+
68
+ ### Optimization
69
+
70
+ **Definition**: Does not affect the plan's ability to be correctly implemented, but adopting it would improve quality. Nice-to-have.
71
+
72
+ **Typical cases**:
73
+ - Naming suggestions
74
+ - Optional caching strategies
75
+ - Better observability
76
+ - Documentation supplement suggestions
77
+ - Code style suggestions
78
+
79
+ **Format**:
80
+ ```markdown
81
+ ### Optimization #1: {short title}
82
+ - **Location**: Which section of the plan
83
+ - **Suggestion**: Specific suggestion
84
+ ```
85
+
86
+ ## Review Report Format
87
+
88
+ ```markdown
89
+ # Technical Plan Review Report
90
+
91
+ ## Plan Information
92
+ - **Plan file**: {plan_file}
93
+ - **Review round**: Round {N}
94
+ - **Review date**: {YYYY-MM-DD}
95
+
96
+ ## Plan Summary
97
+ {One sentence summarizing the plan's core content}
98
+
99
+ ## Verdict
100
+ {PASS / FAIL}
101
+
102
+ > PASS = only optimization items, no severe or medium issues
103
+ > FAIL = one or more severe or medium issues exist
104
+
105
+ ## Issue Summary
106
+ - Severe: X items
107
+ - Medium: Y items
108
+ - Optimization: Z items
109
+
110
+ ---
111
+
112
+ ## Severe Issues
113
+
114
+ {List all severe issues by number. Write "None" if there are none.}
115
+
116
+ ## Medium Issues
117
+
118
+ {List all medium issues by number. Write "None" if there are none.}
119
+
120
+ ## Optimization Items
121
+
122
+ {List all optimization items by number. Write "None" if there are none.}
123
+
124
+ ---
125
+
126
+ ## Reviewer Notes
127
+ {Optional: overall assessment, highlights, or other remarks}
128
+ ```
129
+
130
+ ### Output Format Requirements
131
+
132
+ The dispatcher extracts your review by searching for the literal delimiters `<<<REVIEW_START>>>` and `<<<REVIEW_END>>>`, and reads the verdict from the line beginning with `REVIEW COMPLETE`. If you deviate from the delimiter protocol, the dispatcher must invoke a fallback parser, retry the review, or ask the user — wasting a round and slowing the planning loop. To keep the loop tight:
133
+
134
+ 1. Output the delimiters EXACTLY as written: `<<<REVIEW_START>>>` on its own line, `<<<REVIEW_END>>>` on its own line.
135
+ 2. Put ALL review report content between them.
136
+ 3. **Do NOT wrap the delimiters or the content in a code fence** (no ` ``` ` markers around them).
137
+ 4. **Do NOT translate, transliterate, or modify the delimiter strings** — no `《《REVIEW_START》》`, no `<<REVIEW_START>>`, no `<<< REVIEW_START >>>`.
138
+ 5. End with the literal completion signal `REVIEW COMPLETE | Verdict: PASS|FAIL | Severe: X Medium: Y Optimization: Z` on its own line — the dispatcher reads the verdict from this line via a parser; if it's missing or malformed, the review will be retried.
139
+ 6. Use the literal ASCII characters `<`, `>`, `_`, `|`.
140
+
141
+ #### Correct example
142
+
143
+ ~~~
144
+ <<<REVIEW_START>>>
145
+ # Technical Plan Review Report
146
+ ... review report content ...
147
+ <<<REVIEW_END>>>
148
+ REVIEW COMPLETE | Verdict: PASS | Severe: 0 Medium: 0 Optimization: 1
149
+ ~~~
150
+
151
+ #### Incorrect examples (DO NOT DO THESE)
152
+
153
+ - Wrapping in a code fence:
154
+
155
+ ~~~
156
+ ```
157
+ <<<REVIEW_START>>>
158
+ ... review report ...
159
+ <<<REVIEW_END>>>
160
+ ```
161
+ ~~~
162
+
163
+ The parser falls back to a less reliable strategy and may emit warnings.
164
+
165
+ - Translated punctuation: `《《REVIEW_START》》...《《REVIEW_END》》` — the parser may fall back or fail entirely.
166
+
167
+ - Missing or extra brackets: `<<REVIEW_START>>` / `<<<<REVIEW_START>>>>` — same problem.
168
+
169
+ - Completion signal without `Verdict: PASS|FAIL` — the dispatcher cannot determine the verdict and will retry.
170
+
171
+ ## Review Checklist
172
+
173
+ These are the dimensions you should check systematically:
174
+
175
+ 1. **Requirement coverage**: Does the plan fully cover every point in the requirement description?
176
+ 2. **Architectural consistency**: Is the plan consistent with the project's existing architectural style?
177
+ 3. **Technology choices**: Are the chosen technologies / tools / patterns reasonable? Are there better alternatives?
178
+ 4. **Data model**: Is the data structure design sound? Are there missing fields or relationships?
179
+ 5. **Interface design**: Are API / function interfaces clear and consistent? Are parameters and return values well-defined?
180
+ 6. **Error handling**: Are various failure scenarios considered? Is the error propagation and recovery strategy reasonable?
181
+ 7. **Edge cases**: Are null values, extreme inputs, concurrency, large data volumes, etc. handled?
182
+ 8. **Implementation steps**: Are steps specific enough to execute directly? Are any steps missing? Is the order correct?
183
+ 9. **Performance**: Are there obvious performance bottlenecks?
184
+ 10. **Security**: Are there security risks?
185
+ 11. **Testability**: Can the plan be verified? Is the testing strategy adequate?
186
+ 12. **Risk mitigation**: Are identified risks reasonable? Are mitigation strategies feasible?
187
+
188
+ ## Completion Signal
189
+
190
+ - Review complete: `REVIEW COMPLETE | Verdict: PASS/FAIL | Severe: X Medium: Y Optimization: Z`
191
+ - Need user clarification: `QUESTION: <specific question>`
192
+ - Use only when a genuine business decision is needed (e.g., choosing between multiple viable approaches)
193
+ - Do not use QUESTION as a substitute for your own technical judgment