popilot 0.2.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 (136) hide show
  1. package/README.md +372 -0
  2. package/adapters/claude-code/.claude/commands/_domain.md.hbs +32 -0
  3. package/adapters/claude-code/.claude/commands/analytics.md.hbs +55 -0
  4. package/adapters/claude-code/.claude/commands/daily.md.hbs +301 -0
  5. package/adapters/claude-code/.claude/commands/dev.md.hbs +62 -0
  6. package/adapters/claude-code/.claude/commands/handoff.md +258 -0
  7. package/adapters/claude-code/.claude/commands/market.md +120 -0
  8. package/adapters/claude-code/.claude/commands/metrics.md +123 -0
  9. package/adapters/claude-code/.claude/commands/oscar-loop.md +436 -0
  10. package/adapters/claude-code/.claude/commands/party.md +85 -0
  11. package/adapters/claude-code/.claude/commands/plan.md +43 -0
  12. package/adapters/claude-code/.claude/commands/research.md +203 -0
  13. package/adapters/claude-code/.claude/commands/retro.md +68 -0
  14. package/adapters/claude-code/.claude/commands/save.md +440 -0
  15. package/adapters/claude-code/.claude/commands/sessions.md +139 -0
  16. package/adapters/claude-code/.claude/commands/sprint.md +106 -0
  17. package/adapters/claude-code/.claude/commands/start.md +368 -0
  18. package/adapters/claude-code/.claude/commands/strategy.md +41 -0
  19. package/adapters/claude-code/.claude/commands/task.md +220 -0
  20. package/adapters/claude-code/.claude/commands/tracking.md +116 -0
  21. package/adapters/claude-code/.claude/commands/validate.md +58 -0
  22. package/adapters/claude-code/CLAUDE.md.hbs +208 -0
  23. package/adapters/claude-code/manifest.yaml +36 -0
  24. package/bin/cli.mjs +218 -0
  25. package/lib/adapter.mjs +68 -0
  26. package/lib/doctor.mjs +161 -0
  27. package/lib/hydrate.mjs +421 -0
  28. package/lib/prompt.mjs +78 -0
  29. package/lib/scaffold.mjs +155 -0
  30. package/lib/setup-wizard.mjs +331 -0
  31. package/lib/template-engine.mjs +164 -0
  32. package/lib/yaml-lite.mjs +476 -0
  33. package/package.json +30 -0
  34. package/scaffold/.context/.secrets.yaml.example +20 -0
  35. package/scaffold/.context/WORKFLOW.md.hbs +332 -0
  36. package/scaffold/.context/agents/TEMPLATE.md +115 -0
  37. package/scaffold/.context/agents/analyst.md.hbs +362 -0
  38. package/scaffold/.context/agents/developer.md.hbs +390 -0
  39. package/scaffold/.context/agents/handoff-specialist.md.hbs +292 -0
  40. package/scaffold/.context/agents/market-researcher.md.hbs +288 -0
  41. package/scaffold/.context/agents/ollie.md +323 -0
  42. package/scaffold/.context/agents/operations.md.hbs +293 -0
  43. package/scaffold/.context/agents/orchestrator.md.hbs +434 -0
  44. package/scaffold/.context/agents/planner.md.hbs +405 -0
  45. package/scaffold/.context/agents/qa.md.hbs +409 -0
  46. package/scaffold/.context/agents/researcher.md.hbs +330 -0
  47. package/scaffold/.context/agents/sage.md +349 -0
  48. package/scaffold/.context/agents/strategist.md.hbs +339 -0
  49. package/scaffold/.context/agents/tracking-governor.md.hbs +291 -0
  50. package/scaffold/.context/agents/validator.md.hbs +365 -0
  51. package/scaffold/.context/integrations/_registry.yaml +38 -0
  52. package/scaffold/.context/integrations/providers/channel_io.yaml +38 -0
  53. package/scaffold/.context/integrations/providers/corti.yaml +203 -0
  54. package/scaffold/.context/integrations/providers/ga4.yaml +116 -0
  55. package/scaffold/.context/integrations/providers/intercom.yaml +47 -0
  56. package/scaffold/.context/integrations/providers/linear.yaml +46 -0
  57. package/scaffold/.context/integrations/providers/mixpanel.yaml +73 -0
  58. package/scaffold/.context/integrations/providers/notebooklm.yaml +74 -0
  59. package/scaffold/.context/integrations/providers/notion.yaml +129 -0
  60. package/scaffold/.context/integrations/providers/prod_db.yaml +183 -0
  61. package/scaffold/.context/oscar/workflows/multi-agent.md +82 -0
  62. package/scaffold/.context/oscar/workflows/ollie-sage.md +128 -0
  63. package/scaffold/.context/oscar/workflows/session-git.md +71 -0
  64. package/scaffold/.context/oscar/workflows/setup.md +663 -0
  65. package/scaffold/.context/oscar/workflows/tracking.md +118 -0
  66. package/scaffold/.context/project.yaml.example +102 -0
  67. package/scaffold/.context/templates/dev-guide.md +217 -0
  68. package/scaffold/.context/templates/epic-spec.md +225 -0
  69. package/scaffold/.context/templates/guardrail.md +94 -0
  70. package/scaffold/.context/templates/handoff-checklist.md +197 -0
  71. package/scaffold/.context/templates/prd.md +80 -0
  72. package/scaffold/.context/templates/retrospective.md +78 -0
  73. package/scaffold/.context/templates/screen-spec.md +714 -0
  74. package/scaffold/.context/templates/sprint-plan.md +72 -0
  75. package/scaffold/.context/templates/sprint-status.yaml +109 -0
  76. package/scaffold/.context/templates/story-v2.md +228 -0
  77. package/scaffold/.context/templates/validation-report.md +99 -0
  78. package/scaffold/.gitignore.append +7 -0
  79. package/scaffold/spec-site/env.d.ts +7 -0
  80. package/scaffold/spec-site/index.html +14 -0
  81. package/scaffold/spec-site/package.json +20 -0
  82. package/scaffold/spec-site/src/App.vue +27 -0
  83. package/scaffold/spec-site/src/assets/icons/menu/ic_ads.svg +10 -0
  84. package/scaffold/spec-site/src/assets/icons/menu/ic_ads_on.svg +10 -0
  85. package/scaffold/spec-site/src/assets/icons/menu/ic_board.svg +14 -0
  86. package/scaffold/spec-site/src/assets/icons/menu/ic_board_on.svg +14 -0
  87. package/scaffold/spec-site/src/assets/icons/menu/ic_dashboard.svg +21 -0
  88. package/scaffold/spec-site/src/assets/icons/menu/ic_dashboard_on.svg +21 -0
  89. package/scaffold/spec-site/src/assets/icons/menu/ic_pricing.svg +20 -0
  90. package/scaffold/spec-site/src/assets/icons/menu/ic_pricing_on.svg +20 -0
  91. package/scaffold/spec-site/src/assets/icons/menu/ic_store.svg +11 -0
  92. package/scaffold/spec-site/src/assets/icons/menu/ic_store_on.svg +11 -0
  93. package/scaffold/spec-site/src/components/Accordion.vue +108 -0
  94. package/scaffold/spec-site/src/components/AppHeader.vue +304 -0
  95. package/scaffold/spec-site/src/components/Badge.vue +25 -0
  96. package/scaffold/spec-site/src/components/CoachingCard.vue +112 -0
  97. package/scaffold/spec-site/src/components/MemoSidebar.vue +239 -0
  98. package/scaffold/spec-site/src/components/MockupShell.vue +100 -0
  99. package/scaffold/spec-site/src/components/RuleTable.vue +99 -0
  100. package/scaffold/spec-site/src/components/ScenarioSwitcher.vue +103 -0
  101. package/scaffold/spec-site/src/components/SpecNav.vue +26 -0
  102. package/scaffold/spec-site/src/components/SpecSection.vue +59 -0
  103. package/scaffold/spec-site/src/components/SummaryGrid.vue +39 -0
  104. package/scaffold/spec-site/src/components/VersionBadge.vue +38 -0
  105. package/scaffold/spec-site/src/composables/useActiveSection.ts +53 -0
  106. package/scaffold/spec-site/src/composables/useMemo.ts +138 -0
  107. package/scaffold/spec-site/src/composables/useRetro.ts +313 -0
  108. package/scaffold/spec-site/src/composables/useScenario.ts +43 -0
  109. package/scaffold/spec-site/src/composables/useScenarioStore.ts +102 -0
  110. package/scaffold/spec-site/src/composables/useTurso.ts +160 -0
  111. package/scaffold/spec-site/src/composables/useUser.ts +25 -0
  112. package/scaffold/spec-site/src/data/navigation.ts +59 -0
  113. package/scaffold/spec-site/src/data/types.ts +90 -0
  114. package/scaffold/spec-site/src/data/wireframeRegistry.ts +25 -0
  115. package/scaffold/spec-site/src/layouts/SplitPaneLayout.vue +79 -0
  116. package/scaffold/spec-site/src/main.ts +10 -0
  117. package/scaffold/spec-site/src/pages/IndexPage.vue +66 -0
  118. package/scaffold/spec-site/src/pages/PolicyDetail.vue +215 -0
  119. package/scaffold/spec-site/src/pages/PolicyIndex.vue +74 -0
  120. package/scaffold/spec-site/src/pages/retro/RetroActions.vue +191 -0
  121. package/scaffold/spec-site/src/pages/retro/RetroBoard.vue +192 -0
  122. package/scaffold/spec-site/src/pages/retro/RetroCard.vue +131 -0
  123. package/scaffold/spec-site/src/pages/retro/RetroHeader.vue +287 -0
  124. package/scaffold/spec-site/src/pages/retro/RetroPage.vue +178 -0
  125. package/scaffold/spec-site/src/pages/shared/NoContentPlaceholder.vue +34 -0
  126. package/scaffold/spec-site/src/pages/shared/PlaceholderContent.vue +22 -0
  127. package/scaffold/spec-site/src/pages/shared/PlaceholderSpecPanel.vue +16 -0
  128. package/scaffold/spec-site/src/pages/shared/PolicyFallback.vue +145 -0
  129. package/scaffold/spec-site/src/pages/wireframe/WireframeShell.vue +151 -0
  130. package/scaffold/spec-site/src/router.ts +85 -0
  131. package/scaffold/spec-site/src/styles/base.css +21 -0
  132. package/scaffold/spec-site/src/styles/split-pane.css +143 -0
  133. package/scaffold/spec-site/src/styles/variables.css +47 -0
  134. package/scaffold/spec-site/src/utils/markdown.ts +197 -0
  135. package/scaffold/spec-site/tsconfig.json +20 -0
  136. package/scaffold/spec-site/vite.config.ts +18 -0
@@ -0,0 +1,714 @@
1
+ # {Epic Name} Screen Specification
2
+
3
+ > **Note**: Level 2/3 detailed UI specs can be replaced with spec-site Vue components ({Feature}Mockup.vue).
4
+ > Using interactive mockups instead of static ASCII art allows real-time demonstration of state-based branching.
5
+ >
6
+ > spec-site page structure:
7
+ > - `{feature}Data.ts` — Scenario + spec area definitions
8
+ > - `{Feature}Mockup.vue` — Interactive mockup
9
+ > - `{Feature}SpecPanel.vue` — Spec document panel
10
+
11
+ > 📋 Detailed screen specification at service planner level, written by Penny
12
+ > Written after Epic Spec → Story breakdown, before handoff
13
+
14
+ ---
15
+
16
+ ## Meta
17
+
18
+ | Item | Value |
19
+ |------|-------|
20
+ | **Epic ID** | E-XX |
21
+ | **Document Type** | Screen Specification |
22
+ | **Created Date** | YYYY-MM-DD |
23
+ | **Version** | v1.0 |
24
+ | **Status** | `draft` / `review` / `approved` |
25
+ | **Related Document** | [E-XX Epic Spec](../epic-specs/E-XX-xxx.md) |
26
+
27
+ > Version management: Update version on major changes + record in changelog section
28
+
29
+ ---
30
+
31
+ ## Table of Contents
32
+
33
+ 1. [Level 1. Overall IA & Entry Points](#level-1-overall-ia--entry-points)
34
+ 2. [Level 2. Main Screen](#level-2-main-screen)
35
+ 3. [Level 3. Component Details](#level-3-component-details)
36
+ 4. [Level 4. Modals & Dialogs](#level-4-modals--dialogs)
37
+ 5. [Level 5. External Integration](#level-5-external-integration)
38
+ 6. [Level 6. State-based UI](#level-6-state-based-ui)
39
+ 7. [Level 7. Policy Summary](#level-7-policy-summary)
40
+
41
+ ---
42
+
43
+ ## Level 1. Overall IA & Entry Points
44
+
45
+ > Define where this feature sits within the overall service structure
46
+
47
+ ### 1.1 Information Architecture (IA)
48
+
49
+ ```
50
+ [Top Menu] (GNB/LNB)
51
+ ├── [Existing Menu 1]
52
+ │ └── (existing structure)
53
+
54
+ ├── [Existing Menu 2]
55
+ │ └── (existing structure)
56
+
57
+ └── [New/Changed Feature] ← Scope of this screen spec
58
+ ├── [Sub-element 1]
59
+ │ ├── [Detail a]
60
+ │ └── [Detail b]
61
+ └── [Sub-element 2]
62
+ ```
63
+
64
+ ### 1.2 Entry Point Flows
65
+
66
+ | Entry Point | Location | User Action | System Response | Notes |
67
+ |-------------|----------|-------------|-----------------|-------|
68
+ | **A** | [Location detail] | [Click/tap, etc.] | [Navigate/modal open, etc.] | [Priority/frequency] |
69
+ | **B** | [Location detail] | [Click/tap, etc.] | [Navigate/modal open, etc.] | |
70
+ | **C** | [Location detail] | [Click/tap, etc.] | [Navigate/modal open, etc.] | |
71
+
72
+ ### 1.3 Menu Position Policy
73
+
74
+ | Item | Policy | Rationale |
75
+ |------|--------|-----------|
76
+ | **Menu Position** | [GNB/LNB/Tab, etc.] | [User accessibility, information architecture, etc.] |
77
+ | **Menu Name** | "[Menu name]" | [Naming convention, user language, etc.] |
78
+ | **Icon** | [Icon name/emoji] | [Visual association, consistency, etc.] |
79
+ | **Access Permission** | [All/Paid/Admin, etc.] | [Business policy] |
80
+ | **Display Condition** | [Always/Conditional] | [Details if conditional] |
81
+
82
+ ### 1.4 URL Design (For web)
83
+
84
+ | Screen | URL Pattern | Query Parameters |
85
+ |--------|------------|-----------------|
86
+ | Main | `/[path]` | - |
87
+ | Detail | `/[path]/:id` | - |
88
+ | With filter | `/[path]` | `?filter=xxx&sort=xxx` |
89
+
90
+ ---
91
+
92
+ ## Level 2. Main Screen
93
+
94
+ > Overall layout of the main screen and details for each area
95
+
96
+ ### 2.1 Overall Layout
97
+
98
+ ```
99
+ ┌─────────────────────────────────────────────────────────────────┐
100
+ │ [Header / GNB Area] │
101
+ ├─────────────────────────────────────────────────────────────────┤
102
+ │ │
103
+ │ ┌───────────────────────────────────────────────────────────┐ │
104
+ │ │ 2.2 Page Header [Action Btn] │ │
105
+ │ └───────────────────────────────────────────────────────────┘ │
106
+ │ │
107
+ │ ┌───────────────────────────────────────────────────────────┐ │
108
+ │ │ 2.3 Filter/Sort Area │ │
109
+ │ └───────────────────────────────────────────────────────────┘ │
110
+ │ │
111
+ │ ┌───────────────────────────────────────────────────────────┐ │
112
+ │ │ │ │
113
+ │ │ 2.4 Content Area │ │
114
+ │ │ │ │
115
+ │ │ ┌─────────────────────────────────────────────────────┐ │ │
116
+ │ │ │ [Item 1] │ │ │
117
+ │ │ └─────────────────────────────────────────────────────┘ │ │
118
+ │ │ ┌─────────────────────────────────────────────────────┐ │ │
119
+ │ │ │ [Item 2] │ │ │
120
+ │ │ └─────────────────────────────────────────────────────┘ │ │
121
+ │ │ │ │
122
+ │ │ 2.5 Pagination │ │
123
+ │ │ │ │
124
+ │ └───────────────────────────────────────────────────────────┘ │
125
+ │ │
126
+ └─────────────────────────────────────────────────────────────────┘
127
+ ```
128
+
129
+ ### 2.2 Page Header
130
+
131
+ ```
132
+ ┌─────────────────────────────────────────────────────────────────┐
133
+ │ [Icon] Page Title [Button1] [Button2] │
134
+ │ Subtitle or description text (optional) │
135
+ └─────────────────────────────────────────────────────────────────┘
136
+ ```
137
+
138
+ | Element | Spec | Policy |
139
+ |---------|------|--------|
140
+ | Icon | [Icon name] | [Display condition] |
141
+ | Title | "[Text]" | Fixed / Dynamic |
142
+ | Subtitle | "[Text]" | [Display condition] |
143
+ | Action Button 1 | "[Button name]" - Primary | [Click action] |
144
+ | Action Button 2 | "[Button name]" - Secondary | [Click action] |
145
+
146
+ ### 2.3 Filter/Sort Area
147
+
148
+ > Write if filters exist, otherwise note "Not applicable"
149
+
150
+ ```
151
+ ┌─────────────────────────────────────────────────────────────────┐
152
+ │ [Tab1] [Tab2] [Tab3] [Dropdown ▼] [Search 🔍] Total N │
153
+ └─────────────────────────────────────────────────────────────────┘
154
+ ```
155
+
156
+ #### 2.3.1 Tab/Filter Structure
157
+
158
+ | Filter | Type | Behavior | Default |
159
+ |--------|------|----------|---------|
160
+ | [Filter1] | Tab | [Behavior detail] | ✅ Default selected |
161
+ | [Filter2] | Dropdown | [Behavior detail] | [Default value] |
162
+ | [Search] | Text input | [Search target, method] | - |
163
+
164
+ #### 2.3.2 Dropdown Options (If applicable)
165
+
166
+ ```
167
+ ┌─────────────────────────┐
168
+ │ [Dropdown name] ▼ │
169
+ ├─────────────────────────┤
170
+ │ ○ Option 1 (default) │
171
+ │ ● Option 2 │
172
+ │ ○ Option 3 │
173
+ └─────────────────────────┘
174
+ ```
175
+
176
+ | Option | Behavior | Sort/Filter Criteria |
177
+ |--------|----------|---------------------|
178
+ | Option 1 | [Behavior] | [Criteria] |
179
+ | Option 2 | [Behavior] | [Criteria] |
180
+
181
+ #### 2.3.3 Count Display
182
+
183
+ | State | Display Format |
184
+ |-------|---------------|
185
+ | Total | "Total {N}" |
186
+ | Filter applied | "[Filter name] {N}" |
187
+ | 0 items | "[Empty state message]" (hide count) |
188
+
189
+ ### 2.4 Content Area
190
+
191
+ > Details defined in Level 3
192
+
193
+ | Policy | Content |
194
+ |--------|---------|
195
+ | Sort order | [Sort criteria] (ASC/DESC) |
196
+ | Grouping | [Grouping criteria] / None |
197
+ | Item spacing | [N]px |
198
+
199
+ ### 2.5 Pagination
200
+
201
+ | Policy | Content |
202
+ |--------|---------|
203
+ | Method | **Infinite scroll** / [Load more] button / Page numbers |
204
+ | Initial load | [N] items |
205
+ | Additional load | [N] items at a time |
206
+ | Load trigger | [Trigger condition: bottom Npx reached, etc.] |
207
+ | End reached | "[Message]" |
208
+
209
+ ### 2.6 Main Screen Policy Summary
210
+
211
+ | Item | Policy |
212
+ |------|--------|
213
+ | Sort order | [Criteria] |
214
+ | Sort on edit | [Maintain position / Re-sort] |
215
+ | New item added | [Top / Sorted position] |
216
+ | On deletion | [Immediate removal / Animation] |
217
+ | Real-time update | Yes / No (reflected on refresh) |
218
+ | Caching | [Caching policy: TTL, etc.] |
219
+ | URL state | [Query parameter persistence] |
220
+ | Back navigation | [State restoration] |
221
+
222
+ ---
223
+
224
+ ## Level 3. Component Details
225
+
226
+ > Detailed definition of key components displayed on the main screen
227
+
228
+ ### 3.1 Component Type Classification
229
+
230
+ ```
231
+ [Component Name]
232
+ ├── Type A: [Type description]
233
+ │ ├── State 1: [State description]
234
+ │ ├── State 2: [State description]
235
+ │ └── State 3: [State description]
236
+
237
+ └── Type B: [Type description]
238
+ ├── State 1: [State description]
239
+ └── State 2: [State description]
240
+ ```
241
+
242
+ ### 3.2 Common Structure
243
+
244
+ ```
245
+ ┌─────────────────────────────────────────────────────────────────┐
246
+ │ [3.3 Header Area] [Time] [···] │
247
+ │ │
248
+ │ [3.4 Body Area] │
249
+ │ │
250
+ │ [3.5 Supplementary Info Area - Optional] │
251
+ │ │
252
+ │ [3.6 Action Area - Optional] │
253
+ └─────────────────────────────────────────────────────────────────┘
254
+ ```
255
+
256
+ ### 3.3 Header Area
257
+
258
+ ```
259
+ [Icon/Badge] [Title Text] [Time] [More]
260
+ ```
261
+
262
+ | Element | Spec | Policy |
263
+ |---------|------|--------|
264
+ | Icon/Badge | [Icon name] | [Per-type branching] |
265
+ | Title | [Text format] | Max [N] chars, truncate with (...) if exceeded |
266
+ | Time | [Format] | Today/Yesterday/Date branching (see Level 7) |
267
+ | More [···] | Dropdown menu | [Menu items] |
268
+
269
+ #### More Menu
270
+
271
+ ```
272
+ ┌─────────────────┐
273
+ │ [Icon] Menu 1 │
274
+ │ [Icon] Menu 2 │
275
+ │ ─────────────── │
276
+ │ [Icon] Delete │ ← Dangerous actions separated
277
+ └─────────────────┘
278
+ ```
279
+
280
+ | Menu | Action | Condition |
281
+ |------|--------|-----------|
282
+ | Menu 1 | [Action] | [Display condition] |
283
+ | Menu 2 | [Action] | [Display condition] |
284
+ | Delete | Delete confirmation dialog | [Display condition] |
285
+
286
+ ### 3.4 Body Area (Per Type)
287
+
288
+ #### Type A: [Type Name]
289
+
290
+ ```
291
+ ┌─────────────────────────────────────────────────────────────────┐
292
+ │ [Type A body layout] │
293
+ │ │
294
+ │ ┌─────────────────────────────────────────────────────────┐ │
295
+ │ │ [Sub-element 1] │ │
296
+ │ └─────────────────────────────────────────────────────────┘ │
297
+ └─────────────────────────────────────────────────────────────────┘
298
+ ```
299
+
300
+ | Element | Spec | Policy |
301
+ |---------|------|--------|
302
+ | [Element name] | [Value/format] | [Rule] |
303
+
304
+ #### Type B: [Type Name]
305
+
306
+ ```
307
+ ┌─────────────────────────────────────────────────────────────────┐
308
+ │ [Type B body layout] │
309
+ └─────────────────────────────────────────────────────────────────┘
310
+ ```
311
+
312
+ ### 3.5 Supplementary Info Area
313
+
314
+ > Optional area, specify display conditions
315
+
316
+ | Element | Display Condition | Spec |
317
+ |---------|------------------|------|
318
+ | [Element name] | [Condition] | [Spec] |
319
+
320
+ ### 3.6 Action Area
321
+
322
+ > Interaction elements within the component
323
+
324
+ | Action | Trigger | Result |
325
+ |--------|---------|--------|
326
+ | [Action name] | [Click/hover, etc.] | [Behavior] |
327
+
328
+ ### 3.7 State Variants
329
+
330
+ #### State 1: [State Name]
331
+
332
+ ```
333
+ ┌─────────────────────────────────────────────────────────────────┐
334
+ │ [State 1 layout] │
335
+ └─────────────────────────────────────────────────────────────────┘
336
+ ```
337
+
338
+ | Condition | [State entry condition] |
339
+ |-----------|------------------------|
340
+
341
+ | Element | Spec |
342
+ |---------|------|
343
+ | [Element] | [Spec for this state] |
344
+
345
+ #### State 2: [State Name]
346
+
347
+ ```
348
+ ┌─────────────────────────────────────────────────────────────────┐
349
+ │ [State 2 layout] │
350
+ └─────────────────────────────────────────────────────────────────┘
351
+ ```
352
+
353
+ ### 3.8 Component Style Policy
354
+
355
+ | Item | Value |
356
+ |------|-------|
357
+ | Card spacing | [N]px |
358
+ | Card background | [Color code] |
359
+ | Card border | [Spec: Npx solid #color] |
360
+ | Card radius | [N]px |
361
+ | Card padding | [N]px |
362
+ | Hover effect | [Effect description] |
363
+ | Click area | [Entire / Specific element] |
364
+
365
+ ---
366
+
367
+ ## Level 4. Modals & Dialogs
368
+
369
+ > Define all modals/dialogs used on the screen
370
+
371
+ ### 4.1 Modal Types
372
+
373
+ | Modal | Trigger | Purpose | Type |
374
+ |-------|---------|---------|------|
375
+ | [Modal 1] | [Where it opens from] | [Purpose] | Form / Confirm / Info |
376
+ | [Modal 2] | [Where it opens from] | [Purpose] | Form / Confirm / Info |
377
+
378
+ ### 4.2 [Modal 1] Details
379
+
380
+ #### 4.2.1 Overall Layout
381
+
382
+ ```
383
+ ┌─────────────────────────────────────────────────────────────────┐
384
+ │ [✕] │
385
+ │ [Modal Title] │
386
+ │ │
387
+ │ ───────────────────────────────────────────────────────────── │
388
+ │ │
389
+ │ [Section 1 Label] │
390
+ │ ┌─────────────────────────────────────────────────────────────┐│
391
+ │ │ [Input field / Selection UI / Info display] ││
392
+ │ └─────────────────────────────────────────────────────────────┘│
393
+ │ │
394
+ │ [Section 2 Label] (Optional) │
395
+ │ ┌─────────────────────────────────────────────────────────────┐│
396
+ │ │ [Input field] ││
397
+ │ └─────────────────────────────────────────────────────────────┘│
398
+ │ 0/[max characters] │
399
+ │ │
400
+ │ ───────────────────────────────────────────────────────────── │
401
+ │ │
402
+ │ ☐ [Checkbox option] │
403
+ │ │
404
+ │ ───────────────────────────────────────────────────────────── │
405
+ │ │
406
+ │ [Cancel] [Confirm] │
407
+ │ │
408
+ └─────────────────────────────────────────────────────────────────┘
409
+ ```
410
+
411
+ #### 4.2.2 Section Details
412
+
413
+ | Section | Element | Type | Spec | Required |
414
+ |---------|---------|------|------|----------|
415
+ | Header | Title | Text | "[Title]" | - |
416
+ | Header | Close | Button | [✕] | - |
417
+ | [Section1] | [Field name] | [input/select/textarea, etc.] | [placeholder, default] | ✅/❌ |
418
+ | [Section2] | [Field name] | [Type] | [Spec] | ✅/❌ |
419
+ | Option | [Checkbox name] | checkbox | Default: [checked/unchecked] | - |
420
+
421
+ #### 4.2.3 Validation
422
+
423
+ | Field | Rule | Error Message |
424
+ |-------|------|---------------|
425
+ | [Field name] | Required | "Please enter [field name]" |
426
+ | [Field name] | Numbers only | "Please enter numbers only" |
427
+ | [Field name] | Range [N~M] | "Please enter a value between [N] and [M]" |
428
+ | [Field name] | Max [N] chars | (Input restriction enforced) |
429
+
430
+ #### 4.2.4 Post-save Behavior
431
+
432
+ | Step | Action |
433
+ |------|--------|
434
+ | 1 | API call ([METHOD] /[endpoint]) |
435
+ | 2 | Show loading spinner |
436
+ | 3 | On success: Close modal |
437
+ | 4 | On success: Toast "[Message]" |
438
+ | 5 | On success: [Follow-up action: refresh list, etc.] |
439
+ | 6 | On failure: Error toast + keep modal open |
440
+
441
+ ### 4.3 Delete Confirmation Dialog
442
+
443
+ > For confirming dangerous actions like delete/cancel
444
+
445
+ ```
446
+ ┌─────────────────────────────────────────────┐
447
+ │ [Icon] [Confirmation question] │
448
+ │ │
449
+ │ [Additional description - optional] │
450
+ │ │
451
+ │ [Cancel] [Delete/Confirm] │
452
+ └─────────────────────────────────────────────┘
453
+ ```
454
+
455
+ | Element | Spec |
456
+ |---------|------|
457
+ | Icon | [Warning/info icon] |
458
+ | Question | "[Question text]" |
459
+ | Description | "[Description text]" |
460
+ | Cancel button | Secondary |
461
+ | Confirm button | Danger / Primary |
462
+
463
+ ### 4.4 Common Modal Policies
464
+
465
+ #### 4.4.1 Behavior Policy
466
+
467
+ | Item | Policy |
468
+ |------|--------|
469
+ | Overlay | Semi-transparent black (rgba(0,0,0,0.5)) |
470
+ | Overlay click | Close modal / Keep open |
471
+ | ESC key | Close modal / Ignore |
472
+ | Scroll | Scroll within modal only, body fixed |
473
+ | Focus | First input field on modal open |
474
+ | Focus trap | Tab movement within modal only |
475
+
476
+ #### 4.4.2 Size Policy
477
+
478
+ | Device | Width | Height |
479
+ |--------|-------|--------|
480
+ | Desktop | [N]px | auto (max [N]vh) |
481
+ | Tablet | [N]px | auto |
482
+ | Mobile | 100% - [N]px | auto (max [N]vh) |
483
+
484
+ #### 4.4.3 Saving State
485
+
486
+ ```
487
+ ┌─────────────────────────────────────────────────────────────────┐
488
+ │ │
489
+ │ [Loading spinner] │
490
+ │ Saving... │
491
+ │ │
492
+ └─────────────────────────────────────────────────────────────────┘
493
+ ```
494
+
495
+ | State | Behavior |
496
+ |-------|----------|
497
+ | Save clicked | Disable button + spinner |
498
+ | Input fields | All disabled |
499
+ | Close | Not allowed |
500
+
501
+ ### 4.5 Toast Message Summary
502
+
503
+ | Situation | Message | Type |
504
+ |-----------|---------|------|
505
+ | [Situation1] | "[Message]" | success |
506
+ | [Situation2] | "[Message]" | info |
507
+ | [Situation3] | "[Message]" | error |
508
+
509
+ ---
510
+
511
+ ## Level 5. External Integration
512
+
513
+ > Define connections with existing screens/components
514
+
515
+ ### 5.1 Integration Overview
516
+
517
+ | Integration Target | Integration Method | Description |
518
+ |-------------------|-------------------|-------------|
519
+ | [Screen/Component name] | [Button/Link/Auto] | [Integration content] |
520
+
521
+ ### 5.2 [Integration Target 1] Details
522
+
523
+ #### 5.2.1 Integration Location
524
+
525
+ ```
526
+ ┌─────────────────────────────────────────────────────────────────┐
527
+ │ [Existing screen/component] │
528
+ │ │
529
+ │ ┌─────────────────────────────────────────────────────────────┐ │
530
+ │ │ [Integration point display] │ │
531
+ │ │ │ │
532
+ │ │ [Button/Link] ← Connects to this feature from here │ │
533
+ │ └─────────────────────────────────────────────────────────────┘ │
534
+ └─────────────────────────────────────────────────────────────────┘
535
+ ```
536
+
537
+ #### 5.2.2 Integration Behavior
538
+
539
+ | Trigger | Action | Data Passed |
540
+ |---------|--------|-------------|
541
+ | [Trigger] | [Result] | [Data passed] |
542
+
543
+ #### 5.2.3 Data Integration
544
+
545
+ | Data | Direction | Purpose |
546
+ |------|-----------|---------|
547
+ | [Data name] | [From] → [To] | [Purpose] |
548
+
549
+ ---
550
+
551
+ ## Level 6. State-based UI
552
+
553
+ > Define special states like loading, empty, error
554
+
555
+ ### 6.1 Loading State
556
+
557
+ #### 6.1.1 Initial Loading
558
+
559
+ ```
560
+ ┌─────────────────────────────────────────────────────────────────┐
561
+ │ │
562
+ │ ┌───────────────────────────────────────────────────────────┐ │
563
+ │ │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ │
564
+ │ │ ░░░░░░░░░░░░░░░░░░░ │ │
565
+ │ └───────────────────────────────────────────────────────────┘ │
566
+ │ ┌───────────────────────────────────────────────────────────┐ │
567
+ │ │ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ │
568
+ │ │ ░░░░░░░░░░░░░░░░░░░ │ │
569
+ │ └───────────────────────────────────────────────────────────┘ │
570
+ │ │
571
+ └─────────────────────────────────────────────────────────────────┘
572
+ ```
573
+
574
+ | Situation | UI Type | Description |
575
+ |-----------|---------|-------------|
576
+ | Initial loading | Skeleton / Spinner | [Count, shape] |
577
+ | Additional loading | [Method] | [Position] |
578
+
579
+ #### 6.1.2 Partial Loading
580
+
581
+ | Area | Loading UI |
582
+ |------|-----------|
583
+ | [Area name] | [Skeleton/Spinner/Inline] |
584
+
585
+ ### 6.2 Empty State
586
+
587
+ ```
588
+ ┌─────────────────────────────────────────────────────────────────┐
589
+ │ │
590
+ │ [Illustration/Icon] │
591
+ │ │
592
+ │ [Main message] │
593
+ │ [Sub message - optional] │
594
+ │ │
595
+ │ [CTA button - optional] │
596
+ │ │
597
+ └─────────────────────────────────────────────────────────────────┘
598
+ ```
599
+
600
+ | Situation | Icon | Message | CTA |
601
+ |-----------|------|---------|-----|
602
+ | [Situation1] | [Icon] | "[Message]" | [Button name] / None |
603
+ | [Situation2] | [Icon] | "[Message]" | [Button name] / None |
604
+
605
+ ### 6.3 Error State
606
+
607
+ ```
608
+ ┌─────────────────────────────────────────────────────────────────┐
609
+ │ │
610
+ │ [Error icon] │
611
+ │ │
612
+ │ [Error message] │
613
+ │ │
614
+ │ [Retry button] │
615
+ │ │
616
+ └─────────────────────────────────────────────────────────────────┘
617
+ ```
618
+
619
+ | Error Type | Message | Action |
620
+ |-----------|---------|--------|
621
+ | Network error | "[Message]" | [Retry button] |
622
+ | Server error | "[Message]" | [Notice] |
623
+ | No permission | "[Message]" | [Notice/button] |
624
+ | No data | "[Message]" | [Notice] |
625
+
626
+ ### 6.4 Permission/Access Restriction State
627
+
628
+ | Condition | UI | Message |
629
+ |-----------|-----|---------|
630
+ | [Condition1] | [Full block / Partial block] | "[Message]" |
631
+ | [Condition2] | [UI type] | "[Message]" |
632
+
633
+ ---
634
+
635
+ ## Level 7. Policy Summary
636
+
637
+ > Organize policies applied across the entire screen by category
638
+
639
+ ### 7.1 UI Policy
640
+
641
+ | Item | Policy | Notes |
642
+ |------|--------|-------|
643
+ | Responsive | [Support range: Desktop/Tablet/Mobile] | [breakpoint] |
644
+ | Dark mode | Supported / Not supported | |
645
+ | Accessibility | [Considerations] | |
646
+
647
+ ### 7.2 Time Display Policy
648
+
649
+ | Condition | Format | Example |
650
+ |-----------|--------|---------|
651
+ | Today | "HH:MM" / "AM/PM H:MM" | "10:30 AM" |
652
+ | Yesterday | "Yesterday HH:MM" | "Yesterday 14:20" |
653
+ | This year (within 7 days) | "N days ago" | "3 days ago" |
654
+ | This year (after 7 days) | "M/D" | "1/27" |
655
+ | Before this year | "YYYY/M/D" | "2025/12/15" |
656
+
657
+ ### 7.3 Text Policy
658
+
659
+ | Item | Policy |
660
+ |------|--------|
661
+ | Truncation | "..." after [N] characters |
662
+ | Line breaks | [Allowed/Not allowed, max lines] |
663
+ | Empty value | "[Replacement text]" or "-" |
664
+
665
+ ### 7.4 Interaction Policy
666
+
667
+ | Item | Policy |
668
+ |------|--------|
669
+ | Button double-click | [Prevention enabled/disabled] |
670
+ | Form resubmission | [Prevention enabled/disabled] |
671
+ | External links | New tab / Current tab |
672
+
673
+ ### 7.5 Data Policy
674
+
675
+ | Item | Policy |
676
+ |------|--------|
677
+ | Caching | [Strategy: TTL, invalidation conditions] |
678
+ | Real-time updates | [Support status, method] |
679
+ | Offline | [Support status, behavior] |
680
+
681
+ ### 7.6 Business Policy
682
+
683
+ | Item | Policy | Rationale |
684
+ |------|--------|-----------|
685
+ | [Policy1] | [Content] | [Reason] |
686
+ | [Policy2] | [Content] | [Reason] |
687
+
688
+ ---
689
+
690
+ ## Checklist
691
+
692
+ ### Screen Spec Completeness
693
+
694
+ - [ ] Level 1: Are IA and entry points clear?
695
+ - [ ] Level 2: Is the main screen layout expressed in ASCII?
696
+ - [ ] Level 3: Are all state variants defined for components?
697
+ - [ ] Level 4: Are modal validation and save behavior defined?
698
+ - [ ] Level 5: Are external screen integrations defined? (if applicable)
699
+ - [ ] Level 6: Are loading/empty/error states defined?
700
+ - [ ] Level 7: Are all policies organized in tables?
701
+
702
+ ### Quality Check
703
+
704
+ - [ ] Are specs (size, color, behavior) specified for all elements?
705
+ - [ ] Are ASCII diagrams sufficiently detailed?
706
+ - [ ] Is this at a level where developers can implement immediately?
707
+ - [ ] Is the Epic Spec business logic reflected?
708
+ - [ ] Are edge case UIs defined?
709
+
710
+ ---
711
+
712
+ **Created**: YYYY-MM-DD
713
+ **Last Modified**: YYYY-MM-DD
714
+ **Author**: 📋 Penny