viepilot 1.0.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 (84) hide show
  1. package/CHANGELOG.md +230 -0
  2. package/LICENSE +23 -0
  3. package/README.md +550 -0
  4. package/bin/viepilot.cjs +222 -0
  5. package/bin/vp-tools.cjs +912 -0
  6. package/dev-install.sh +109 -0
  7. package/docs/README.md +125 -0
  8. package/docs/advanced-usage.md +366 -0
  9. package/docs/api/README.md +12 -0
  10. package/docs/api/graphql-schema.md +5 -0
  11. package/docs/api/kafka-events.md +5 -0
  12. package/docs/api/rest-api.md +19 -0
  13. package/docs/api/websocket-api.md +5 -0
  14. package/docs/dev/architecture.md +226 -0
  15. package/docs/dev/cli-reference.md +324 -0
  16. package/docs/dev/contributing.md +195 -0
  17. package/docs/dev/deployment.md +204 -0
  18. package/docs/dev/getting-started.md +16 -0
  19. package/docs/dev/testing.md +171 -0
  20. package/docs/dev/ui-components-library.md +36 -0
  21. package/docs/getting-started.md +163 -0
  22. package/docs/skills-reference.md +399 -0
  23. package/docs/troubleshooting.md +297 -0
  24. package/docs/user/faq.md +117 -0
  25. package/docs/user/features/autonomous-mode.md +111 -0
  26. package/docs/user/features/checkpoint-recovery.md +76 -0
  27. package/docs/user/features/debug-mode.md +77 -0
  28. package/docs/user/features/ui-direction.md +29 -0
  29. package/docs/user/quick-start.md +157 -0
  30. package/docs/videos/01-installation.md +113 -0
  31. package/docs/videos/02-first-project.md +132 -0
  32. package/docs/videos/03-autonomous-mode.md +147 -0
  33. package/install.sh +144 -0
  34. package/lib/cli-shared.cjs +108 -0
  35. package/package.json +78 -0
  36. package/skills/vp-audit/SKILL.md +140 -0
  37. package/skills/vp-auto/SKILL.md +204 -0
  38. package/skills/vp-brainstorm/SKILL.md +75 -0
  39. package/skills/vp-crystallize/SKILL.md +175 -0
  40. package/skills/vp-debug/SKILL.md +96 -0
  41. package/skills/vp-docs/SKILL.md +258 -0
  42. package/skills/vp-evolve/SKILL.md +165 -0
  43. package/skills/vp-pause/SKILL.md +150 -0
  44. package/skills/vp-request/SKILL.md +250 -0
  45. package/skills/vp-resume/SKILL.md +141 -0
  46. package/skills/vp-rollback/SKILL.md +116 -0
  47. package/skills/vp-status/SKILL.md +137 -0
  48. package/skills/vp-task/SKILL.md +139 -0
  49. package/skills/vp-ui-components/SKILL.md +64 -0
  50. package/templates/phase/PHASE-STATE.md +35 -0
  51. package/templates/phase/SPEC.md +40 -0
  52. package/templates/phase/SUMMARY.md +67 -0
  53. package/templates/phase/TASK.md +101 -0
  54. package/templates/phase/VERIFICATION.md +49 -0
  55. package/templates/project/AI-GUIDE.md +114 -0
  56. package/templates/project/ARCHITECTURE.md +70 -0
  57. package/templates/project/CHANGELOG.md +36 -0
  58. package/templates/project/CONTRIBUTING.md +154 -0
  59. package/templates/project/CONTRIBUTORS.md +41 -0
  60. package/templates/project/PROJECT-CONTEXT.md +74 -0
  61. package/templates/project/PROJECT-META.md +133 -0
  62. package/templates/project/README.md +197 -0
  63. package/templates/project/ROADMAP.md +56 -0
  64. package/templates/project/SYSTEM-RULES.md +368 -0
  65. package/templates/project/TRACKER.md +50 -0
  66. package/ui-components/INDEX.md +9 -0
  67. package/ui-components/base/button/README.md +8 -0
  68. package/ui-components/base/button/metadata.json +8 -0
  69. package/ui-components/base/card/README.md +8 -0
  70. package/ui-components/base/card/metadata.json +8 -0
  71. package/ui-components/base/input/README.md +8 -0
  72. package/ui-components/base/input/metadata.json +8 -0
  73. package/workflows/audit.md +549 -0
  74. package/workflows/autonomous.md +425 -0
  75. package/workflows/brainstorm.md +257 -0
  76. package/workflows/crystallize.md +418 -0
  77. package/workflows/debug.md +241 -0
  78. package/workflows/documentation.md +587 -0
  79. package/workflows/evolve.md +258 -0
  80. package/workflows/pause-work.md +255 -0
  81. package/workflows/request.md +534 -0
  82. package/workflows/resume-work.md +226 -0
  83. package/workflows/rollback.md +202 -0
  84. package/workflows/ui-components.md +109 -0
@@ -0,0 +1,226 @@
1
+ <purpose>
2
+ Restore complete project context và resume work seamlessly từ previous session.
3
+ </purpose>
4
+
5
+ <process>
6
+
7
+ <step name="check_project">
8
+ ## 1. Check Project Exists
9
+
10
+ ```bash
11
+ if [ ! -f ".viepilot/TRACKER.md" ]; then
12
+ echo "No ViePilot project found"
13
+ exit 1
14
+ fi
15
+ ```
16
+
17
+ If not exists → Error and suggest `/vp-crystallize`
18
+ </step>
19
+
20
+ <step name="load_state">
21
+ ## 2. Load State
22
+
23
+ ### Try HANDOFF.json first (preferred)
24
+ ```bash
25
+ if [ -f ".viepilot/HANDOFF.json" ]; then
26
+ cat .viepilot/HANDOFF.json
27
+ fi
28
+ ```
29
+
30
+ Parse:
31
+ - phase, phase_name
32
+ - task, task_name, total_tasks
33
+ - status
34
+ - next_action
35
+ - context_notes
36
+ - blockers
37
+ - human_actions_pending
38
+
39
+ ### Fallback to TRACKER.md
40
+ ```bash
41
+ cat .viepilot/TRACKER.md
42
+ ```
43
+ Extract current state from file.
44
+
45
+ ### Load .continue-here.md if exists
46
+ ```bash
47
+ phase_dir=$(cat .viepilot/HANDOFF.json | jq -r '.phase_dir')
48
+ if [ -f "${phase_dir}/.continue-here.md" ]; then
49
+ cat "${phase_dir}/.continue-here.md"
50
+ fi
51
+ ```
52
+ </step>
53
+
54
+ <step name="check_uncommitted">
55
+ ## 3. Check Uncommitted Changes
56
+
57
+ ```bash
58
+ git status --porcelain
59
+ ```
60
+
61
+ If changes exist:
62
+ ```
63
+ ⚠ Uncommitted changes detected:
64
+ {list files}
65
+
66
+ Options:
67
+ 1. Continue with changes
68
+ 2. Stash changes first
69
+ 3. Review changes
70
+ ```
71
+ </step>
72
+
73
+ <step name="rebuild_context">
74
+ ## 4. Rebuild Context
75
+
76
+ Following AI-GUIDE.md strategy:
77
+
78
+ ### Minimal Load (always)
79
+ ```bash
80
+ cat .viepilot/AI-GUIDE.md
81
+ cat .viepilot/TRACKER.md
82
+ ```
83
+
84
+ ### Phase Load
85
+ ```bash
86
+ cat .viepilot/phases/{phase}/PHASE-STATE.md
87
+ cat .viepilot/phases/{phase}/SPEC.md
88
+ ```
89
+
90
+ ### Task Load
91
+ ```bash
92
+ cat .viepilot/phases/{phase}/tasks/{task}-*.md
93
+ ```
94
+
95
+ ### Context Required
96
+ Read `context_required` section from task file.
97
+ Load referenced files.
98
+ </step>
99
+
100
+ <step name="display_summary">
101
+ ## 5. Display State Summary
102
+
103
+ ```
104
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
105
+ VIEPILOT ► RESUME
106
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107
+
108
+ Project: {project_name}
109
+ Last Activity: {timestamp from HANDOFF}
110
+
111
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
112
+ CURRENT STATE
113
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
114
+
115
+ Phase: {phase_number} - {phase_name}
116
+ Task: {task_number}/{total} - {task_name}
117
+ Status: {status}
118
+
119
+ Progress: [████████░░] {percent}%
120
+
121
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
122
+ CONTEXT
123
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
124
+
125
+ {context_notes from HANDOFF.json}
126
+
127
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
128
+ NEXT ACTION
129
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
130
+
131
+ {next_action from HANDOFF.json}
132
+
133
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
134
+ ```
135
+
136
+ If blockers exist:
137
+ ```
138
+ ⚠ BLOCKERS
139
+ - {blocker 1}
140
+ - {blocker 2}
141
+ ```
142
+
143
+ If human actions pending:
144
+ ```
145
+ 📋 HUMAN ACTIONS NEEDED
146
+ - {action 1}
147
+ - {action 2}
148
+ ```
149
+ </step>
150
+
151
+ <step name="offer_options">
152
+ ## 6. Offer Options
153
+
154
+ ```
155
+ How would you like to proceed?
156
+
157
+ 1. Continue from task {task} (recommended)
158
+ 2. Restart current task from beginning
159
+ 3. Skip to next task
160
+ 4. View current task details
161
+ 5. Run /vp-status for full overview
162
+ 6. Start /vp-auto for autonomous mode
163
+ ```
164
+
165
+ Wait for user choice.
166
+ </step>
167
+
168
+ <step name="route_action">
169
+ ## 7. Route to Action
170
+
171
+ Based on user choice:
172
+
173
+ **1. Continue:**
174
+ - Context already loaded
175
+ - Display task objective
176
+ - Start working
177
+
178
+ **2. Restart:**
179
+ - Reset task state in PHASE-STATE.md
180
+ - Rollback if needed
181
+ - Start fresh
182
+
183
+ **3. Skip:**
184
+ - Ask for skip reason
185
+ - Mark task skipped
186
+ - Move to next
187
+
188
+ **4. View details:**
189
+ ```bash
190
+ cat .viepilot/phases/{phase}/tasks/{task}-*.md
191
+ ```
192
+ Display with syntax highlighting
193
+ Return to options
194
+
195
+ **5. Status:**
196
+ ```
197
+ Skill(skill="vp-status")
198
+ ```
199
+
200
+ **6. Auto:**
201
+ ```
202
+ Skill(skill="vp-auto", args="--from {phase}")
203
+ ```
204
+ </step>
205
+
206
+ <step name="update_session">
207
+ ## 8. Update Session
208
+
209
+ ```bash
210
+ # Update TRACKER.md with session start
211
+ # Mark HANDOFF.json as active (or clear it)
212
+ ```
213
+
214
+ Ready to work.
215
+ </step>
216
+
217
+ </process>
218
+
219
+ <success_criteria>
220
+ - [ ] HANDOFF.json or TRACKER.md loaded
221
+ - [ ] Context rebuilt efficiently
222
+ - [ ] State summary displayed clearly
223
+ - [ ] Blockers and human actions shown
224
+ - [ ] User offered appropriate options
225
+ - [ ] Routed to correct next action
226
+ </success_criteria>
@@ -0,0 +1,202 @@
1
+ <purpose>
2
+ Safe rollback to any ViePilot checkpoint với backup và state preservation.
3
+ </purpose>
4
+
5
+ <process>
6
+
7
+ <step name="list_checkpoints">
8
+ ## 1. List Available Checkpoints
9
+
10
+ ```bash
11
+ git tag -l "vp-*" --sort=-creatordate | head -20
12
+ ```
13
+
14
+ For each tag, get info:
15
+ ```bash
16
+ git log -1 --format="%h %ci %s" {tag}
17
+ ```
18
+
19
+ Display formatted list:
20
+ ```
21
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
22
+ VIEPILOT CHECKPOINTS
23
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
24
+
25
+ # TAG DATE DESCRIPTION
26
+ 1 vp-p2-t1 2026-03-30 Start Phase 2 Task 1
27
+ 2 vp-p1-complete 2026-03-30 Phase 1 complete
28
+ 3 vp-p1-t1-done 2026-03-30 Task 1.1-1.4 complete
29
+ 4 vp-p1-t1 2026-03-30 Start Phase 1 Task 1
30
+
31
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
32
+ ```
33
+
34
+ If `--list` flag, stop here.
35
+ </step>
36
+
37
+ <step name="select_target">
38
+ ## 2. Select Rollback Target
39
+
40
+ **If --to specified:**
41
+ Validate tag exists.
42
+
43
+ **If --latest:**
44
+ Select most recent vp-* tag.
45
+
46
+ **Otherwise:**
47
+ Ask user to select from list or enter tag name.
48
+ </step>
49
+
50
+ <step name="preview_changes">
51
+ ## 3. Preview Changes
52
+
53
+ Show what will happen:
54
+ ```bash
55
+ # Commits to undo
56
+ git log --oneline {tag}..HEAD
57
+
58
+ # Files that will change
59
+ git diff --stat {tag}
60
+ ```
61
+
62
+ Display:
63
+ ```
64
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
+ ROLLBACK PREVIEW
66
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
+
68
+ Target: {tag}
69
+ Current: {HEAD}
70
+
71
+ Commits to undo: {count}
72
+ {commit list}
73
+
74
+ Files affected: {count}
75
+ {file list}
76
+
77
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
78
+ ```
79
+
80
+ If `--dry-run`, stop here.
81
+ </step>
82
+
83
+ <step name="confirm_rollback">
84
+ ## 4. Confirm Rollback
85
+
86
+ If not `--force`:
87
+ ```
88
+ ⚠ WARNING: This will undo {count} commits.
89
+
90
+ Are you sure you want to rollback to {tag}? [y/N]
91
+ ```
92
+
93
+ Wait for confirmation.
94
+ </step>
95
+
96
+ <step name="create_backup">
97
+ ## 5. Create Backup
98
+
99
+ ```bash
100
+ # Create backup tag
101
+ BACKUP_TAG="vp-backup-$(date +%Y%m%d-%H%M%S)"
102
+ git tag $BACKUP_TAG
103
+
104
+ # Backup state files
105
+ cp .viepilot/HANDOFF.json .viepilot/HANDOFF.backup.json 2>/dev/null
106
+ cp .viepilot/TRACKER.md .viepilot/TRACKER.backup.md 2>/dev/null
107
+ ```
108
+
109
+ Log backup tag for undo.
110
+ </step>
111
+
112
+ <step name="execute_rollback">
113
+ ## 6. Execute Rollback
114
+
115
+ ```bash
116
+ # Hard reset to target
117
+ git reset --hard {tag}
118
+ ```
119
+
120
+ Verify success:
121
+ ```bash
122
+ git log -1 --oneline
123
+ ```
124
+ </step>
125
+
126
+ <step name="update_state">
127
+ ## 7. Update State Files
128
+
129
+ Parse tag to determine phase/task:
130
+ - `vp-p{N}-t{M}` → Phase N, Task M, status: in_progress
131
+ - `vp-p{N}-t{M}-done` → Phase N, Task M+1, status: not_started
132
+ - `vp-p{N}-complete` → Phase N+1, Task 1, status: not_started
133
+
134
+ Update HANDOFF.json accordingly.
135
+ Update TRACKER.md progress.
136
+ </step>
137
+
138
+ <step name="confirm_success">
139
+ ## 8. Confirm Success
140
+
141
+ ```
142
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
143
+ ROLLBACK COMPLETE ✓
144
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145
+
146
+ Rolled back to: {tag}
147
+ Commits undone: {count}
148
+
149
+ Backup created: {backup_tag}
150
+
151
+ Current state:
152
+ Phase: {phase}
153
+ Task: {task}
154
+ Status: {status}
155
+
156
+ To undo this rollback:
157
+ /vp-rollback --to {backup_tag}
158
+
159
+ Or manually:
160
+ git reset --hard {backup_tag}
161
+
162
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
163
+ ```
164
+ </step>
165
+
166
+ </process>
167
+
168
+ <error_handling>
169
+ **If tag doesn't exist:**
170
+ ```
171
+ ✖ Error: Checkpoint "{tag}" not found
172
+ Hint: Run /vp-rollback --list to see available checkpoints
173
+ ```
174
+
175
+ **If uncommitted changes:**
176
+ ```
177
+ ⚠ Warning: You have uncommitted changes
178
+
179
+ Options:
180
+ 1. Stash changes: git stash
181
+ 2. Commit changes: git commit
182
+ 3. Discard changes: git checkout -- .
183
+ 4. Cancel rollback
184
+ ```
185
+
186
+ **If rollback fails:**
187
+ ```
188
+ ✖ Rollback failed: {error}
189
+
190
+ Recovery:
191
+ git reset --hard {backup_tag}
192
+ ```
193
+ </error_handling>
194
+
195
+ <success_criteria>
196
+ - [ ] Checkpoints listed correctly
197
+ - [ ] Preview shown before execution
198
+ - [ ] Backup created successfully
199
+ - [ ] Rollback executed cleanly
200
+ - [ ] State files updated
201
+ - [ ] Undo instructions provided
202
+ </success_criteria>
@@ -0,0 +1,109 @@
1
+ <purpose>
2
+ Curate, classify, and store reusable UI components for future brainstorm and implementation.
3
+ </purpose>
4
+
5
+ <process>
6
+
7
+ <step name="prepare_store">
8
+ ## 1. Prepare Component Stores
9
+
10
+ Ensure both stores exist:
11
+
12
+ ```bash
13
+ mkdir -p "$HOME/.viepilot/ui-components"
14
+ mkdir -p ".viepilot/ui-components"
15
+ ```
16
+
17
+ Use:
18
+ - Global store (`$HOME/.viepilot/ui-components`) for cross-project reuse
19
+ - Local store (`.viepilot/ui-components`) for project-specific variants
20
+ </step>
21
+
22
+ <step name="collect_input">
23
+ ## 2. Collect Source Input
24
+
25
+ Accept sources:
26
+ - 21st.dev prompt/link/snippet
27
+ - Existing component markup
28
+ - User-written constraints and style notes
29
+
30
+ Capture metadata:
31
+ - source
32
+ - intent
33
+ - target contexts (landing, dashboard, form, etc.)
34
+ </step>
35
+
36
+ <step name="classify_component">
37
+ ## 3. Classify and Normalize
38
+
39
+ Classify component under one of:
40
+ - base
41
+ - navigation
42
+ - marketing
43
+ - form
44
+ - feedback
45
+ - data-display
46
+ - composite
47
+
48
+ Normalize naming:
49
+ - kebab-case component id
50
+ - minimal README with usage and constraints
51
+ - keep "raw inspiration" and "adapted draft" clearly separated
52
+ </step>
53
+
54
+ <step name="write_artifacts">
55
+ ## 4. Write Artifacts
56
+
57
+ For each component, create:
58
+
59
+ ```text
60
+ {store}/{category}/{component-id}/
61
+ README.md
62
+ SOURCE.md
63
+ component.html
64
+ component.css
65
+ metadata.json
66
+ ```
67
+
68
+ `metadata.json` minimum fields:
69
+ - `id`
70
+ - `category`
71
+ - `source`
72
+ - `tags`
73
+ - `stack_notes`
74
+ - `status` (`raw` | `adapted` | `approved`)
75
+ </step>
76
+
77
+ <step name="sync_index">
78
+ ## 5. Update Index
79
+
80
+ Update:
81
+ - `$HOME/.viepilot/ui-components/INDEX.md`
82
+ - `.viepilot/ui-components/INDEX.md`
83
+
84
+ Each entry includes:
85
+ - component id
86
+ - category
87
+ - status
88
+ - source link/reference
89
+ - last updated date
90
+ </step>
91
+
92
+ <step name="integration_notes">
93
+ ## 6. Integration with Brainstorm/Crystallize
94
+
95
+ When relevant:
96
+ - Recommend curated components during `/vp-brainstorm --ui`
97
+ - Reference selected component IDs in brainstorm session files
98
+ - Ensure `/vp-crystallize` can map selected IDs to implementation decisions
99
+ </step>
100
+
101
+ </process>
102
+
103
+ <success_criteria>
104
+ - [ ] Global and local stores exist
105
+ - [ ] Component classified with consistent taxonomy
106
+ - [ ] README + SOURCE + metadata created
107
+ - [ ] Global/local indexes updated
108
+ - [ ] Component is reusable in future UI direction sessions
109
+ </success_criteria>