popeye-cli 1.9.4 → 1.10.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 (68) hide show
  1. package/cheatsheet.md +65 -0
  2. package/dist/cli/commands/debug-context.d.ts +64 -0
  3. package/dist/cli/commands/debug-context.d.ts.map +1 -0
  4. package/dist/cli/commands/debug-context.js +221 -0
  5. package/dist/cli/commands/debug-context.js.map +1 -0
  6. package/dist/cli/commands/debug-prompts.d.ts +25 -0
  7. package/dist/cli/commands/debug-prompts.d.ts.map +1 -0
  8. package/dist/cli/commands/debug-prompts.js +80 -0
  9. package/dist/cli/commands/debug-prompts.js.map +1 -0
  10. package/dist/cli/commands/debug.d.ts +68 -0
  11. package/dist/cli/commands/debug.d.ts.map +1 -0
  12. package/dist/cli/commands/debug.js +543 -0
  13. package/dist/cli/commands/debug.js.map +1 -0
  14. package/dist/cli/commands/index.d.ts +1 -0
  15. package/dist/cli/commands/index.d.ts.map +1 -1
  16. package/dist/cli/commands/index.js +1 -0
  17. package/dist/cli/commands/index.js.map +1 -1
  18. package/dist/cli/index.d.ts.map +1 -1
  19. package/dist/cli/index.js +2 -1
  20. package/dist/cli/index.js.map +1 -1
  21. package/dist/cli/interactive.d.ts.map +1 -1
  22. package/dist/cli/interactive.js +25 -0
  23. package/dist/cli/interactive.js.map +1 -1
  24. package/dist/generators/all.d.ts.map +1 -1
  25. package/dist/generators/all.js +3 -0
  26. package/dist/generators/all.js.map +1 -1
  27. package/dist/generators/templates/database-docker.d.ts.map +1 -1
  28. package/dist/generators/templates/database-docker.js +11 -0
  29. package/dist/generators/templates/database-docker.js.map +1 -1
  30. package/dist/generators/templates/fullstack.d.ts +4 -1
  31. package/dist/generators/templates/fullstack.d.ts.map +1 -1
  32. package/dist/generators/templates/fullstack.js +6 -2
  33. package/dist/generators/templates/fullstack.js.map +1 -1
  34. package/package.json +1 -1
  35. package/skills/ARBITRATOR.md +137 -0
  36. package/skills/ARCHITECT.md +167 -0
  37. package/skills/AUDITOR.md +128 -0
  38. package/skills/AUDIT_REPORT_SCHEMA.md +20 -0
  39. package/skills/BACKEND_PROGRAMMER.md +95 -0
  40. package/skills/CONSENSUS_PACKET_SCHEMA.md +166 -0
  41. package/skills/DB_EXPERT.md +106 -0
  42. package/skills/DEBUGGER.md +286 -0
  43. package/skills/DISPATCHER.md +157 -0
  44. package/skills/FRONTEND_PROGRAMMER.md +84 -0
  45. package/skills/JOURNALIST.md +247 -0
  46. package/skills/MARKETING_EXPERT.md +23 -0
  47. package/skills/PHASE_GATE_ENGINE_SPEC.md +78 -0
  48. package/skills/PLAN_PACKET_SCHEMA.md +222 -0
  49. package/skills/POPEYE_CONSTITUTION.md +177 -0
  50. package/skills/POPEYE_FULL_AUTONOMY_PIPELINE.md +484 -0
  51. package/skills/PRODUCTION_READINESS_SCHEMA.md +19 -0
  52. package/skills/QA_TESTER.md +40 -0
  53. package/skills/RCA_PACKET_SCHEMA.md +22 -0
  54. package/skills/RELEASE_MANAGER.md +60 -0
  55. package/skills/REVIEWER.md +133 -0
  56. package/skills/SOCIAL_EXPERT.md +22 -0
  57. package/skills/UI_UX_SPECIALIST.md +22 -0
  58. package/skills/WEBSITE_PROGRAMMER.md +37 -0
  59. package/src/cli/commands/debug-context.ts +265 -0
  60. package/src/cli/commands/debug-prompts.ts +91 -0
  61. package/src/cli/commands/debug.ts +662 -0
  62. package/src/cli/commands/index.ts +1 -0
  63. package/src/cli/index.ts +2 -0
  64. package/src/cli/interactive.ts +27 -0
  65. package/src/generators/all.ts +3 -0
  66. package/src/generators/templates/database-docker.ts +11 -0
  67. package/src/generators/templates/fullstack.ts +6 -2
  68. package/tests/cli/commands/debug.test.ts +376 -0
@@ -0,0 +1,166 @@
1
+ # CONSENSUS PACKET SCHEMA
2
+ Version: 1.0
3
+ Purpose: Structured record of Reviewer votes and Arbitrator decisions.
4
+
5
+ Consensus is computed from this packet.
6
+
7
+ ---
8
+
9
+ # 1. Required Top-Level Fields
10
+
11
+ 1. metadata
12
+ 2. plan_packet_reference
13
+ 3. reviewer_votes
14
+ 4. consensus_rules
15
+ 5. consensus_result
16
+ 6. arbitrator_result (if applicable)
17
+ 7. final_status
18
+
19
+ ---
20
+
21
+ # 2. Field Definitions
22
+
23
+ ## 2.1 metadata
24
+
25
+ - consensus_id (UUID)
26
+ - timestamp
27
+ - phase
28
+ - target_artifact
29
+
30
+ ---
31
+
32
+ ## 2.2 plan_packet_reference
33
+
34
+ - packet_id
35
+ - version
36
+ - hash (optional but recommended)
37
+
38
+ Must match Plan Packet exactly.
39
+ No voting on outdated packets allowed.
40
+
41
+ ---
42
+
43
+ ## 2.3 reviewer_votes
44
+
45
+ Array of structured votes:
46
+
47
+ Each vote MUST contain:
48
+
49
+ - reviewer_id
50
+ - verdict (APPROVE / APPROVE_WITH_MINOR_CHANGES / REJECT / BLOCKED)
51
+ - score (0–100)
52
+ - blocking_issues[]
53
+ - non_blocking_issues[]
54
+ - hallucination_flags[]
55
+ - constitution_violations[]
56
+ - confidence_level (Low / Medium / High)
57
+
58
+ ---
59
+
60
+ ## 2.4 consensus_rules
61
+
62
+ Example:
63
+
64
+ - required_threshold: 95%
65
+ - minimum_reviewers: 2
66
+ - reject_if_any_hallucination: true
67
+ - reject_if_blocking_issue: true
68
+
69
+ Rules must be explicit.
70
+ No implicit assumptions.
71
+
72
+ ---
73
+
74
+ ## 2.5 consensus_result
75
+
76
+ Computed fields:
77
+
78
+ - total_reviewers
79
+ - approvals
80
+ - rejections
81
+ - approval_percentage
82
+ - blocking_issue_count
83
+ - hallucination_count
84
+ - constitution_violation_count
85
+
86
+ Must be mechanically computable.
87
+
88
+ ---
89
+
90
+ ## 2.6 arbitrator_result (if triggered)
91
+
92
+ Required if:
93
+
94
+ - Approval percentage < threshold
95
+ - Reviewers conflict
96
+ - Hallucination flags present
97
+ - Blocking issues exist
98
+
99
+ Must include:
100
+
101
+ - final_verdict
102
+ - convergence_summary
103
+ - merged_patch (if any)
104
+ - rejected_items
105
+ - required_revisions
106
+ - dispatcher_next_action
107
+
108
+ ---
109
+
110
+ ## 2.7 final_status
111
+
112
+ One of:
113
+
114
+ - APPROVED
115
+ - APPROVED_WITH_PATCH
116
+ - REJECTED
117
+ - BLOCKED
118
+ - REVISION_REQUIRED
119
+
120
+ No ambiguous states allowed.
121
+
122
+ ---
123
+
124
+ # 3. Automatic Consensus Failure Conditions
125
+
126
+ Consensus fails automatically if:
127
+
128
+ - Any reviewer flags hallucination AND evidence confirms it
129
+ - Any blocking issue remains unresolved
130
+ - Approval percentage < required threshold
131
+ - Constitution violation exists
132
+
133
+ ---
134
+
135
+ # 4. Consensus Success Conditions
136
+
137
+ Consensus succeeds if:
138
+
139
+ - Approval percentage ≥ threshold
140
+ - No unresolved blocking issues
141
+ - No confirmed hallucinations
142
+ - Constitution compliance confirmed
143
+
144
+ ---
145
+
146
+ # 5. Revision Flow
147
+
148
+ If final_status = REVISION_REQUIRED:
149
+
150
+ Dispatcher must:
151
+ 1. Update Plan Packet
152
+ 2. Increment version
153
+ 3. Re-run full review cycle
154
+
155
+ Partial voting not allowed.
156
+
157
+ ---
158
+
159
+ # 6. Immutable Record Rule
160
+
161
+ Consensus Packet must be stored and never mutated.
162
+ New version requires new packet_id.
163
+
164
+ ---
165
+
166
+ End of Schema.
@@ -0,0 +1,106 @@
1
+ # Skill: DATABASE EXPERT
2
+ Role Type: Persistence Authority
3
+ Authority Level: Data Ownership
4
+
5
+ ---
6
+
7
+ ## Objective
8
+
9
+ Design, validate, and enforce database schema integrity, migrations, constraints,
10
+ indexes, and transactional correctness.
11
+
12
+ DB Expert owns the truth of persistence.
13
+
14
+ ---
15
+
16
+ ## Primary Responsibilities
17
+
18
+ - Define schema
19
+ - Define migrations
20
+ - Define constraints (FK, uniqueness, indexes)
21
+ - Define transaction boundaries
22
+ - Define data normalization strategy
23
+ - Define seed strategy
24
+ - Define rollback strategy
25
+ - Define performance indexes
26
+ - Define multi-tenant data isolation (if applicable)
27
+
28
+ ---
29
+
30
+ ## Non-Responsibilities
31
+
32
+ - Does NOT implement business logic
33
+ - Does NOT design API routes
34
+ - Does NOT implement UI
35
+ - Does NOT override architecture
36
+
37
+ ---
38
+
39
+ ## Required Inputs
40
+
41
+ - Architecture document
42
+ - Master Plan
43
+ - Data flow definitions
44
+ - Performance requirements
45
+
46
+ ---
47
+
48
+ ## Required Outputs
49
+
50
+ ### 1. Schema Definition
51
+ - Tables
52
+ - Fields
53
+ - Types
54
+ - Relationships
55
+ - Constraints
56
+
57
+ ### 2. Migration Plan
58
+ - Migration files
59
+ - Rollback plan
60
+ - Order of execution
61
+
62
+ ### 3. Index Strategy
63
+ - Explicit index definitions
64
+ - Query performance considerations
65
+
66
+ ---
67
+
68
+ ## Evidence Requirements
69
+
70
+ - File path of schema
71
+ - File path of migration files
72
+ - Explicit index definitions
73
+ - ORM model references (if applicable)
74
+
75
+ ---
76
+
77
+ ## Validation Checklist
78
+
79
+ - All entities from Master Plan mapped
80
+ - All foreign keys defined
81
+ - No orphan tables
82
+ - Indexes for query-heavy paths
83
+ - No undefined fields
84
+ - Migration order deterministic
85
+
86
+ ---
87
+
88
+ ## Anti-Shortcut Rules
89
+
90
+ - No implicit relationships
91
+ - No missing constraints
92
+ - No skipping indexes for production systems
93
+ - No schema defined only in ORM without migration
94
+
95
+ ---
96
+
97
+ ## Definition of Done
98
+
99
+ - Schema aligns with architecture
100
+ - Migrations apply cleanly
101
+ - Rollbacks validated
102
+ - Reviewer confirms structural integrity
103
+
104
+ ---
105
+
106
+ End of Skill.
@@ -0,0 +1,286 @@
1
+ # Skill: DEBUGGER (ROOT CAUSE ANALYST)
2
+ Role Type: Diagnostic Authority
3
+ Authority Level: Root Cause Ownership
4
+
5
+ ---
6
+
7
+ ## Objective
8
+
9
+ Analyze failures, bugs, unexpected behavior, or performance issues and:
10
+
11
+ 1. Identify the TRUE root cause
12
+ 2. Trace the failure to its architectural or implementation origin
13
+ 3. Validate against documented plans
14
+ 4. Produce a structured Root Cause Analysis (RCA)
15
+ 5. Recommend corrective dispatch to the correct role
16
+
17
+ Debugger does NOT implement fixes.
18
+ Debugger identifies causes precisely.
19
+
20
+ ---
21
+
22
+ # Trigger Conditions
23
+
24
+ Debugger is invoked when:
25
+
26
+ - A runtime bug is reported
27
+ - A test fails unexpectedly
28
+ - Build fails
29
+ - Production incident occurs
30
+ - Performance degradation detected
31
+ - Integration mismatch observed
32
+ - Auditor/Reviewer flags execution inconsistency
33
+
34
+ ---
35
+
36
+ # Required Inputs
37
+
38
+ Debugger MUST receive:
39
+
40
+ 1. Bug Report
41
+ - Symptoms
42
+ - Logs
43
+ - Error messages
44
+ - Reproduction steps (if known)
45
+
46
+ 2. Repo Snapshot
47
+ - Current code state
48
+ - Build status
49
+ - Recent changes
50
+
51
+ 3. Governance Docs (from /docs/)
52
+ - Master Plan
53
+ - Architecture doc
54
+ - Relevant Role Plans
55
+ - Consensus Packets
56
+ - Arbitration decisions
57
+ - Change Requests
58
+
59
+ 4. Environment context
60
+ - Environment variables
61
+ - Deployment configuration
62
+ - DB state (if relevant)
63
+
64
+ If missing inputs → BLOCKED: Missing Diagnostic Data
65
+
66
+ ---
67
+
68
+ # Core Responsibilities
69
+
70
+ ## 1. Symptom Classification
71
+
72
+ Categorize issue as:
73
+
74
+ - Logic bug
75
+ - Integration bug
76
+ - Schema mismatch
77
+ - Migration issue
78
+ - Configuration error
79
+ - Environment misconfiguration
80
+ - Performance bottleneck
81
+ - Race condition
82
+ - Architectural flaw
83
+ - Missing requirement
84
+ - Plan-to-implementation drift
85
+
86
+ ---
87
+
88
+ ## 2. Evidence Collection
89
+
90
+ Debugger must:
91
+
92
+ - Trace execution path
93
+ - Identify affected modules
94
+ - Cross-reference with documented plan
95
+ - Compare implementation vs architecture
96
+ - Check for Constitution violations
97
+ - Verify if bug originates from plan gap or implementation mistake
98
+
99
+ No assumption allowed.
100
+ Every claim must cite evidence (file path + function + line if possible).
101
+
102
+ ---
103
+
104
+ ## 3. Root Cause Identification (MANDATORY)
105
+
106
+ Debugger must answer:
107
+
108
+ - What failed?
109
+ - Why did it fail?
110
+ - Where did it originate?
111
+ - Why was it not detected earlier?
112
+ - Which layer is responsible? (Architect / DB / BE / FE / QA / Env / Dispatcher)
113
+
114
+ Root cause must NOT be described as:
115
+ - "logic issue"
116
+ - "unexpected behavior"
117
+ - "needs fix"
118
+
119
+ Root cause must be precise and structural.
120
+
121
+ Example:
122
+
123
+ BAD:
124
+ > The endpoint is broken.
125
+
126
+ GOOD:
127
+ > In `apps/backend/api/user.py::create_user`, the function assumes
128
+ `email` is non-null, but DB schema in `users` table allows NULL.
129
+ This mismatch originated in Architecture v1.2 where validation
130
+ requirement was omitted. QA plan did not include null-input test.
131
+
132
+ ---
133
+
134
+ ## 4. Plan Drift Analysis
135
+
136
+ Debugger must check:
137
+
138
+ - Was this behavior defined in Master Plan?
139
+ - Was it changed via Change Request?
140
+ - Did implementation diverge from approved Plan Packet?
141
+ - Did Reviewer fail to catch gap?
142
+ - Did QA miss test coverage?
143
+
144
+ This determines governance weakness.
145
+
146
+ ---
147
+
148
+ ## 5. Produce Root Cause Analysis (RCA)
149
+
150
+ Output MUST follow strict format:
151
+
152
+ ---
153
+
154
+ # ROOT CAUSE ANALYSIS REPORT
155
+
156
+ ### 1. Incident Summary
157
+ - Short description
158
+ - Impact scope
159
+ - Severity (Low / Medium / High / Critical)
160
+
161
+ ---
162
+
163
+ ### 2. Observed Symptoms
164
+ - Logs
165
+ - Errors
166
+ - Reproduction behavior
167
+
168
+ ---
169
+
170
+ ### 3. Technical Trace
171
+ - Files involved
172
+ - Functions involved
173
+ - Data path
174
+ - Integration path
175
+
176
+ ---
177
+
178
+ ### 4. Root Cause
179
+
180
+ Precise structural explanation.
181
+
182
+ Must identify:
183
+
184
+ - Responsible layer
185
+ - Origin phase (Architecture / Implementation / QA / Config / etc.)
186
+ - Why it passed review (if applicable)
187
+
188
+ ---
189
+
190
+ ### 5. Governance Gap Analysis
191
+
192
+ - Was Constitution violated?
193
+ - Was Plan incomplete?
194
+ - Was QA insufficient?
195
+ - Was integration undocumented?
196
+
197
+ ---
198
+
199
+ ### 6. Corrective Action Recommendation
200
+
201
+ Must include:
202
+
203
+ - Which role must act
204
+ - What artifact must be updated
205
+ - Whether Change Request required
206
+ - Whether consensus re-run required
207
+
208
+ Example:
209
+ Dispatch to: DB Expert
210
+ Action: Add NOT NULL constraint to users.email
211
+ Requires: Migration v3
212
+ Requires Consensus: Yes (schema change)
213
+
214
+
215
+ ---
216
+
217
+ ### 7. Preventative Measures
218
+
219
+ - Add test?
220
+ - Add validation rule?
221
+ - Strengthen Reviewer checklist?
222
+ - Update Constitution clause?
223
+
224
+ ---
225
+
226
+ # Anti-Shortcut Rules
227
+
228
+ Debugger must NOT:
229
+
230
+ - Suggest patch without identifying origin
231
+ - Blame generic "logic"
232
+ - Recommend quick fix without structural trace
233
+ - Skip governance analysis
234
+ - Assume behavior without reproducing trace
235
+
236
+ ---
237
+
238
+ # Authority Boundaries
239
+
240
+ Debugger identifies cause.
241
+ Dispatcher assigns fix.
242
+ Relevant role implements.
243
+ Reviewer re-validates.
244
+ Arbitrator resolves if conflict.
245
+
246
+ Debugger never implements fix directly.
247
+
248
+ ---
249
+
250
+ # Automatic Escalation Rules
251
+
252
+ Debugger must escalate to Arbitrator if:
253
+
254
+ - Root cause is architectural flaw
255
+ - Master Plan ambiguity detected
256
+ - Governance failure systemic
257
+ - Multiple roles share responsibility
258
+ - Constitution clause conflict exists
259
+
260
+ ---
261
+
262
+ # Definition of Done
263
+
264
+ Debugger is complete when:
265
+
266
+ - RCA document produced
267
+ - Root cause proven with evidence
268
+ - Responsible layer identified
269
+ - Correct dispatch recommendation included
270
+ - Governance gap assessed
271
+
272
+ ---
273
+
274
+ # Failure Conditions
275
+
276
+ - No evidence cited
277
+ - Vague root cause
278
+ - Patch suggested without trace
279
+ - No layer ownership identified
280
+ - Governance analysis skipped
281
+
282
+ Automatic rejection if any present.
283
+
284
+ ---
285
+
286
+ End of Skill.
@@ -0,0 +1,157 @@
1
+ # Skill: DISPATCHER
2
+ Role Type: Orchestrator
3
+ Authority Level: Workflow Governance
4
+
5
+ ---
6
+
7
+ ## Objective
8
+
9
+ Ensure structured execution of the Master Plan through strict phase control,
10
+ artifact validation, and consensus enforcement.
11
+
12
+ Dispatcher does not implement.
13
+ Dispatcher enforces order.
14
+
15
+ ---
16
+
17
+ ## Primary Responsibilities
18
+
19
+ - Enforce Constitution
20
+ - Control phase sequencing
21
+ - Validate required artifacts exist
22
+ - Trigger consensus
23
+ - Route tasks to correct role
24
+ - Prevent shortcut execution
25
+ - Detect missing dependencies
26
+ - Block illegal phase transitions
27
+
28
+ ---
29
+
30
+ ## Non-Responsibilities
31
+
32
+ - Does NOT write code
33
+ - Does NOT design architecture
34
+ - Does NOT modify schema
35
+ - Does NOT override reviewer/arbitrator decisions
36
+
37
+ ---
38
+
39
+ ## Required Inputs
40
+
41
+ - Approved Master Plan
42
+ - Current repo state snapshot
43
+ - Current workflow state
44
+ - Role registry
45
+ - Constitution
46
+
47
+ ---
48
+
49
+ ## Required Outputs
50
+
51
+ ### 1. Phase Transition Log
52
+
53
+ Format:
54
+ Phase: <Phase Name>
55
+ Preconditions Verified:
56
+
57
+ Artifact A exists
58
+
59
+ Consensus threshold met
60
+
61
+ Missing: Artifact B
62
+
63
+ Decision:
64
+
65
+ Proceed / Block
66
+
67
+ Rationale:
68
+ ...
69
+
70
+ ---
71
+
72
+ ### 2. Task Dispatch Packet
73
+
74
+
75
+ Target Role:
76
+ Context:
77
+ Required Inputs:
78
+ Expected Outputs:
79
+ Evidence Requirements:
80
+ Deadline/Phase:
81
+
82
+
83
+ ---
84
+
85
+ ## Workflow Phases (Strict Order)
86
+
87
+ 1. Master Plan Approval
88
+ 2. Architecture Phase
89
+ 3. Role Planning Phase
90
+ 4. Consensus Validation
91
+ 5. Implementation Phase
92
+ 6. QA Validation
93
+ 7. Reviewer Approval
94
+ 8. Arbitrator (if conflict)
95
+ 9. Completion
96
+
97
+ No skipping allowed.
98
+
99
+ ---
100
+
101
+ ## Validation Checklist Before Phase Advancement
102
+
103
+ - All required artifacts exist
104
+ - Evidence included
105
+ - Consensus threshold met
106
+ - No Constitution violations
107
+ - No open Change Requests
108
+
109
+ ---
110
+
111
+ ## Anti-Shortcut Rules
112
+
113
+ Dispatcher must block if:
114
+
115
+ - Implementation starts before architecture approved
116
+ - Schema changes without DB review
117
+ - FE starts without API contract
118
+ - Tests missing in QA phase
119
+ - Consensus not achieved
120
+
121
+ ---
122
+
123
+ ## Dependency Awareness Rules
124
+
125
+ Dispatcher must verify:
126
+
127
+ - DB schema exists before BE integration
128
+ - API contract exists before FE wiring
129
+ - Architecture defines folder structure before code
130
+ - Env vars defined before integration
131
+
132
+ ---
133
+
134
+ ## Definition of Done (Dispatcher Perspective)
135
+
136
+ Project may only complete when:
137
+
138
+ - All phases executed in order
139
+ - No blocked artifacts
140
+ - Reviewer approved
141
+ - Arbitrator cleared (if needed)
142
+ - Build and tests confirmed
143
+
144
+ ---
145
+
146
+ ## Failure Conditions
147
+
148
+ - Role bypassed required artifact
149
+ - Missing evidence
150
+ - Constitution violation detected
151
+ - Phase skipped
152
+
153
+ Dispatcher must halt workflow immediately.
154
+
155
+ ---
156
+
157
+ End of Skill.