create-vasvibe 2.3.1 → 2.5.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.
- package/README.md +170 -167
- package/bin/cli.mjs +9 -9
- package/package.json +44 -44
- package/src/git.mjs +47 -47
- package/src/index.mjs +228 -228
- package/src/prompts.mjs +113 -113
- package/src/scaffold.mjs +74 -74
- package/src/upgrade.mjs +121 -121
- package/src/utils.mjs +91 -91
- package/template/.agents/agents/analyst/agent.json +43 -43
- package/template/.agents/agents/backend/agent.json +44 -44
- package/template/.agents/agents/data-architect/agent.json +43 -43
- package/template/.agents/agents/devops/agent.json +44 -44
- package/template/.agents/agents/discovery/agent.json +43 -43
- package/template/.agents/agents/document/agent.json +43 -43
- package/template/.agents/agents/fixer/agent.json +44 -44
- package/template/.agents/agents/frontend/agent.json +44 -44
- package/template/.agents/agents/fullstack/agent.json +44 -44
- package/template/.agents/agents/initiator/agent.json +41 -41
- package/template/.agents/agents/manual-tester/agent.json +44 -0
- package/template/.agents/agents/orchestrator/agent.json +44 -44
- package/template/.agents/agents/pm/agent.json +42 -42
- package/template/.agents/agents/qa/agent.json +44 -44
- package/template/.agents/agents/reliability/agent.json +44 -44
- package/template/.agents/agents/security/agent.json +44 -44
- package/template/.agents/agents/sysarch/agent.json +44 -44
- package/template/.agents/agents/tester/agent.json +44 -44
- package/template/.agents/agents/toolsmith/agent.json +44 -44
- package/template/.agents/agents/ux-designer/agent.json +43 -43
- package/template/.agents/skills/find-skills/SKILL.md +142 -142
- package/template/.agents/skills/fullstack/SKILL.md +89 -89
- package/template/.agents/skills/penetration-testing/SKILL.md +94 -94
- package/template/.agents/skills/penetration-testing/references/automated-penetration-testing-framework.md +328 -328
- package/template/.agents/skills/penetration-testing/references/burp-suite-automation-script.md +135 -135
- package/template/.agents/skills/penetration-testing/scripts/security-checklist.sh +30 -30
- package/template/.agents/skills/pm/SKILL.md +170 -170
- package/template/.agents/skills/ui-ux-pro-max/SKILL.md +658 -658
- package/template/.agents/skills/ui-ux-pro-max/data/_sync_all.py +414 -414
- package/template/.agents/skills/ui-ux-pro-max/data/app-interface.csv +30 -30
- package/template/.agents/skills/ui-ux-pro-max/data/design.csv +1775 -1775
- package/template/.agents/skills/ui-ux-pro-max/data/draft.csv +1778 -1778
- package/template/.agents/skills/ui-ux-pro-max/data/icons.csv +105 -105
- package/template/.agents/skills/ui-ux-pro-max/data/products.csv +162 -162
- package/template/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -45
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/angular.csv +51 -51
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -54
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -53
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -56
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -53
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/laravel.csv +51 -51
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -53
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -51
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -59
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/react.csv +54 -54
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -61
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -54
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -51
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/threejs.csv +54 -54
- package/template/.agents/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -50
- package/template/.agents/skills/ui-ux-pro-max/data/typography.csv +74 -74
- package/template/.agents/skills/ui-ux-pro-max/scripts/core.py +262 -262
- package/template/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1148 -1148
- package/template/.agents/workflows/build-feature.md +21 -21
- package/template/.agents/workflows/daily-standup.md +16 -16
- package/template/.agents/workflows/deliver-feature.md +16 -16
- package/template/.agents/workflows/harden-release.md +21 -21
- package/template/.agents/workflows/plan-project.md +25 -25
- package/template/.agents/workflows/release.md +18 -18
- package/template/.agents/workflows/security-audit.md +19 -19
- package/template/.agents/workflows/setup-workspace.md +21 -21
- package/template/.agents/workflows/start-fix.md +17 -17
- package/template/.agents/workflows/test-feature.md +17 -17
- package/template/.claude/agents/analyst.md +75 -75
- package/template/.claude/agents/backend.md +61 -61
- package/template/.claude/agents/data-architect.md +43 -43
- package/template/.claude/agents/devops.md +44 -43
- package/template/.claude/agents/discovery.md +51 -51
- package/template/.claude/agents/document.md +51 -51
- package/template/.claude/agents/fixer.md +83 -82
- package/template/.claude/agents/frontend.md +58 -58
- package/template/.claude/agents/fullstack.md +84 -83
- package/template/.claude/agents/initiator.md +74 -74
- package/template/.claude/agents/manual-tester.md +108 -0
- package/template/.claude/agents/orchestrator.md +114 -113
- package/template/.claude/agents/pm.md +199 -199
- package/template/.claude/agents/qa.md +66 -65
- package/template/.claude/agents/reliability.md +48 -47
- package/template/.claude/agents/security.md +107 -106
- package/template/.claude/agents/sysarch.md +301 -301
- package/template/.claude/agents/tester.md +100 -100
- package/template/.claude/agents/toolsmith.md +77 -76
- package/template/.claude/agents/ux-designer.md +45 -45
- package/template/.claude/commands/build-feature.md +22 -22
- package/template/.claude/commands/daily-standup.md +16 -16
- package/template/.claude/commands/deliver-feature.md +17 -17
- package/template/.claude/commands/harden-release.md +22 -22
- package/template/.claude/commands/manual-test.md +19 -0
- package/template/.claude/commands/plan-project.md +26 -26
- package/template/.claude/commands/release.md +19 -19
- package/template/.claude/commands/security-audit.md +20 -20
- package/template/.claude/commands/setup-workspace.md +22 -22
- package/template/.claude/commands/start-fix.md +18 -18
- package/template/.claude/commands/test-feature.md +18 -18
- package/template/.claude/skills/find-skills +1 -0
- package/template/.claude/skills/penetration-testing/SKILL.md +94 -94
- package/template/.claude/skills/penetration-testing/references/automated-penetration-testing-framework.md +328 -328
- package/template/.claude/skills/penetration-testing/references/burp-suite-automation-script.md +135 -135
- package/template/.claude/skills/penetration-testing/scripts/security-checklist.sh +30 -30
- package/template/.claude/skills/ui-ux-pro-max/SKILL.md +658 -658
- package/template/.claude/skills/ui-ux-pro-max/data/_sync_all.py +414 -414
- package/template/.claude/skills/ui-ux-pro-max/data/app-interface.csv +30 -30
- package/template/.claude/skills/ui-ux-pro-max/data/design.csv +1775 -1775
- package/template/.claude/skills/ui-ux-pro-max/data/draft.csv +1778 -1778
- package/template/.claude/skills/ui-ux-pro-max/data/icons.csv +105 -105
- package/template/.claude/skills/ui-ux-pro-max/data/products.csv +162 -162
- package/template/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -45
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/angular.csv +51 -51
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -54
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -53
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -56
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -53
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/laravel.csv +51 -51
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -53
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -51
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -59
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -54
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -61
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -54
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -51
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/threejs.csv +54 -54
- package/template/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -50
- package/template/.claude/skills/ui-ux-pro-max/data/typography.csv +74 -74
- package/template/.claude/skills/ui-ux-pro-max/scripts/core.py +262 -262
- package/template/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1148 -1148
- package/template/.github/prompts/analyst.prompt.md +57 -57
- package/template/.github/prompts/backend.prompt.md +44 -44
- package/template/.github/prompts/data-architect.prompt.md +38 -38
- package/template/.github/prompts/devops.prompt.md +32 -32
- package/template/.github/prompts/discovery.prompt.md +39 -39
- package/template/.github/prompts/document.prompt.md +14 -14
- package/template/.github/prompts/fixer.prompt.md +90 -89
- package/template/.github/prompts/frontend.prompt.md +43 -43
- package/template/.github/prompts/fullstack.prompt.md +91 -91
- package/template/.github/prompts/initiator.prompt.md +55 -55
- package/template/.github/prompts/manual-tester.prompt.md +103 -0
- package/template/.github/prompts/orchestrator.prompt.md +75 -75
- package/template/.github/prompts/pm.prompt.md +186 -186
- package/template/.github/prompts/qa.prompt.md +57 -57
- package/template/.github/prompts/reliability.prompt.md +44 -44
- package/template/.github/prompts/security.prompt.md +41 -41
- package/template/.github/prompts/sysarch.prompt.md +351 -351
- package/template/.github/prompts/tester.prompt.md +107 -107
- package/template/.github/prompts/toolsmith.prompt.md +46 -46
- package/template/.github/prompts/ux-designer.prompt.md +41 -41
- package/template/.opencode/agents/analyst.md +75 -75
- package/template/.opencode/agents/backend.md +61 -61
- package/template/.opencode/agents/data-architect.md +43 -43
- package/template/.opencode/agents/devops.md +44 -41
- package/template/.opencode/agents/discovery.md +51 -51
- package/template/.opencode/agents/document.md +51 -51
- package/template/.opencode/agents/fixer.md +83 -82
- package/template/.opencode/agents/frontend.md +58 -58
- package/template/.opencode/agents/fullstack.md +84 -83
- package/template/.opencode/agents/initiator.md +74 -74
- package/template/.opencode/agents/manual-tester.md +107 -0
- package/template/.opencode/agents/orchestrator.md +116 -119
- package/template/.opencode/agents/pm.md +199 -199
- package/template/.opencode/agents/qa.md +66 -65
- package/template/.opencode/agents/reliability.md +48 -46
- package/template/.opencode/agents/security.md +107 -105
- package/template/.opencode/agents/sysarch.md +301 -301
- package/template/.opencode/agents/tester.md +100 -100
- package/template/.opencode/agents/toolsmith.md +77 -77
- package/template/.opencode/agents/ux-designer.md +45 -45
- package/template/.opencode/commands/build-feature.md +21 -21
- package/template/.opencode/commands/daily-standup.md +16 -16
- package/template/.opencode/commands/deliver-feature.md +16 -16
- package/template/.opencode/commands/harden-release.md +21 -21
- package/template/.opencode/commands/manual-test.md +18 -0
- package/template/.opencode/commands/plan-project.md +25 -25
- package/template/.opencode/commands/release.md +18 -18
- package/template/.opencode/commands/security-audit.md +19 -19
- package/template/.opencode/commands/setup-workspace.md +21 -21
- package/template/.opencode/commands/start-fix.md +17 -17
- package/template/.opencode/commands/test-feature.md +17 -17
- package/template/.opencode/skills/penetration-testing/SKILL.md +94 -94
- package/template/.opencode/skills/penetration-testing/references/automated-penetration-testing-framework.md +328 -328
- package/template/.opencode/skills/penetration-testing/references/burp-suite-automation-script.md +135 -135
- package/template/.opencode/skills/penetration-testing/scripts/security-checklist.sh +30 -30
- package/template/.opencode/skills/ui-ux-pro-max/SKILL.md +658 -658
- package/template/.opencode/skills/ui-ux-pro-max/data/_sync_all.py +414 -414
- package/template/.opencode/skills/ui-ux-pro-max/data/app-interface.csv +30 -30
- package/template/.opencode/skills/ui-ux-pro-max/data/design.csv +1775 -1775
- package/template/.opencode/skills/ui-ux-pro-max/data/draft.csv +1778 -1778
- package/template/.opencode/skills/ui-ux-pro-max/data/icons.csv +105 -105
- package/template/.opencode/skills/ui-ux-pro-max/data/products.csv +162 -162
- package/template/.opencode/skills/ui-ux-pro-max/data/react-performance.csv +45 -45
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/angular.csv +51 -51
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -54
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -53
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -56
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -53
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/laravel.csv +51 -51
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -53
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -51
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -59
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/react.csv +54 -54
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -61
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -54
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -51
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/threejs.csv +54 -54
- package/template/.opencode/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -50
- package/template/.opencode/skills/ui-ux-pro-max/data/typography.csv +74 -74
- package/template/.opencode/skills/ui-ux-pro-max/scripts/core.py +262 -262
- package/template/.opencode/skills/ui-ux-pro-max/scripts/design_system.py +1148 -1148
- package/template/AGENT_PERSONAS.md +595 -551
- package/template/GIT_STRUCTURE_GUIDE.md +270 -270
- package/template/PROJECT_README.example.md +81 -81
- package/template/QUICK-START.md +134 -131
- package/template/README.md +1942 -1919
- package/template/_gitignore +141 -141
- package/template/agent/workflows/_shared/change-management.md +70 -70
- package/template/agent/workflows/_shared/git-branch-management.md +25 -25
- package/template/agent/workflows/_shared/phases.md +88 -88
- package/template/agent/workflows/_shared/state-management.md +87 -87
- package/template/agent/workflows/_shared/work-depth.md +46 -46
- package/template/agent/workflows/analyst.md +75 -75
- package/template/agent/workflows/backend.md +61 -61
- package/template/agent/workflows/data-architect.md +43 -43
- package/template/agent/workflows/devops.md +44 -44
- package/template/agent/workflows/discovery.md +51 -51
- package/template/agent/workflows/document.md +51 -51
- package/template/agent/workflows/fixer.md +83 -82
- package/template/agent/workflows/frontend.md +58 -58
- package/template/agent/workflows/fullstack.md +84 -84
- package/template/agent/workflows/initiator.md +74 -74
- package/template/agent/workflows/manual-tester.md +103 -0
- package/template/agent/workflows/orchestrator.md +114 -114
- package/template/agent/workflows/pm.md +199 -199
- package/template/agent/workflows/qa.md +66 -66
- package/template/agent/workflows/reliability.md +48 -48
- package/template/agent/workflows/security.md +107 -107
- package/template/agent/workflows/sysarch.md +301 -301
- package/template/agent/workflows/tester.md +100 -100
- package/template/agent/workflows/toolsmith.md +77 -77
- package/template/agent/workflows/ux-designer.md +45 -45
- package/template/codes/.gitkeep +1 -1
- package/template/project_overview_example.md +54 -54
- package/template/schemas/adr.template.md +36 -36
- package/template/schemas/changelog.template.md +34 -34
- package/template/schemas/data-model.template.md +57 -57
- package/template/schemas/design-system.template.md +63 -63
- package/template/schemas/dev_log.template.md +20 -20
- package/template/schemas/product-ci.template.yml +50 -50
- package/template/schemas/requirements.template.md +64 -64
- package/template/schemas/security-standards.template.md +58 -58
- package/template/schemas/security_report.template.md +89 -89
- package/template/schemas/specification.template.md +57 -57
- package/template/schemas/style_guide.template.md +29 -29
- package/template/schemas/task_list.template.md +28 -28
- package/template/schemas/workspace-manifest.template.json +24 -24
- package/template/schemas/workspace-registry.json +94 -94
- package/template/skills-lock.json +11 -11
- package/template/specifications/.gitkeep +1 -1
- package/template/state/knowledge_base/.gitkeep +1 -1
- package/template/state/knowledge_base/requirements/.gitkeep +1 -1
- package/template/tests/.gitkeep +1 -1
- package/template/.agents/workflows/explorer.md +0 -78
- package/template/.agents/workflows/logger.md +0 -117
- package/template/.claude/settings.local.json +0 -35
- package/template/.claude/skills/find-skills/SKILL.md +0 -142
- package/template/.opencode/agents/explorer.md +0 -138
- package/template/.opencode/agents/logger.md +0 -143
package/src/prompts.mjs
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
// src/prompts.mjs
|
|
2
|
-
// Interactive prompts. Skipped when --yes is passed.
|
|
3
|
-
|
|
4
|
-
import prompts from 'prompts';
|
|
5
|
-
import { isValidProjectName } from './utils.mjs';
|
|
6
|
-
|
|
7
|
-
export async function runPrompts({ argName, flags }) {
|
|
8
|
-
if (flags.yes) {
|
|
9
|
-
return {
|
|
10
|
-
projectName: argName || 'my-vasvibe-project',
|
|
11
|
-
includeOpencode: flags.opencode !== false,
|
|
12
|
-
includeClaude: flags.claude !== false,
|
|
13
|
-
includeGithub: flags.github !== false,
|
|
14
|
-
includeWorkflows: flags.workflows !== false,
|
|
15
|
-
initGit: flags.git !== false,
|
|
16
|
-
workDepth: flags.depth || 'standard',
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const onCancel = () => {
|
|
21
|
-
console.log('\nAborted.');
|
|
22
|
-
process.exit(1);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const answers = await prompts(
|
|
26
|
-
[
|
|
27
|
-
{
|
|
28
|
-
type: argName ? null : 'text',
|
|
29
|
-
name: 'projectName',
|
|
30
|
-
message: 'Project name:',
|
|
31
|
-
initial: 'my-vasvibe-project',
|
|
32
|
-
validate: (v) =>
|
|
33
|
-
isValidProjectName(v) ||
|
|
34
|
-
'Use letters, numbers, dot, underscore, or dash. Cannot start with a dot.',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
type: flags.opencode === false ? null : 'toggle',
|
|
38
|
-
name: 'includeOpencode',
|
|
39
|
-
message: 'Include OpenCode commands & skills (.opencode/)?',
|
|
40
|
-
initial: true,
|
|
41
|
-
active: 'yes',
|
|
42
|
-
inactive: 'no',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
type: flags.claude === false ? null : 'toggle',
|
|
46
|
-
name: 'includeClaude',
|
|
47
|
-
message: 'Include Claude agents & skills (.claude/, .agents/)?',
|
|
48
|
-
initial: true,
|
|
49
|
-
active: 'yes',
|
|
50
|
-
inactive: 'no',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: flags.github === false ? null : 'toggle',
|
|
54
|
-
name: 'includeGithub',
|
|
55
|
-
message: 'Include GitHub Copilot prompts (.github/prompts/)?',
|
|
56
|
-
initial: true,
|
|
57
|
-
active: 'yes',
|
|
58
|
-
inactive: 'no',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: flags.workflows === false ? null : 'toggle',
|
|
62
|
-
name: 'includeWorkflows',
|
|
63
|
-
message: 'Include generic agent workflows (agent/workflows/)?',
|
|
64
|
-
initial: true,
|
|
65
|
-
active: 'yes',
|
|
66
|
-
inactive: 'no',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
type: flags.git === false ? null : 'toggle',
|
|
70
|
-
name: 'initGit',
|
|
71
|
-
message: 'Initialize a git repository?',
|
|
72
|
-
initial: true,
|
|
73
|
-
active: 'yes',
|
|
74
|
-
inactive: 'no',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
type: flags.depth ? null : 'select',
|
|
78
|
-
name: 'workDepth',
|
|
79
|
-
message: 'Default work depth for all agents?',
|
|
80
|
-
hint: 'Can be changed anytime in project_overview.md → ## 7. Project Settings',
|
|
81
|
-
choices: [
|
|
82
|
-
{
|
|
83
|
-
title: 'standard (recommended)',
|
|
84
|
-
description: 'Full spec, unit tests, code review — the default for everyday production development.',
|
|
85
|
-
value: 'standard',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
title: 'fast',
|
|
89
|
-
description: 'Core feature only, skip optional steps (unit tests, full docs, edge cases) — good for prototypes and MVPs.',
|
|
90
|
-
value: 'fast',
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
title: 'deep',
|
|
94
|
-
description: 'Maximum thoroughness — full security review, all edge cases, strict validation — for critical systems.',
|
|
95
|
-
value: 'deep',
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
initial: 0,
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
{ onCancel },
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
return {
|
|
105
|
-
projectName: argName || answers.projectName,
|
|
106
|
-
includeOpencode: flags.opencode === false ? false : answers.includeOpencode ?? true,
|
|
107
|
-
includeClaude: flags.claude === false ? false : answers.includeClaude ?? true,
|
|
108
|
-
includeGithub: flags.github === false ? false : answers.includeGithub ?? true,
|
|
109
|
-
includeWorkflows: flags.workflows === false ? false : answers.includeWorkflows ?? true,
|
|
110
|
-
initGit: flags.git === false ? false : answers.initGit ?? true,
|
|
111
|
-
workDepth: flags.depth || answers.workDepth || 'standard',
|
|
112
|
-
};
|
|
113
|
-
}
|
|
1
|
+
// src/prompts.mjs
|
|
2
|
+
// Interactive prompts. Skipped when --yes is passed.
|
|
3
|
+
|
|
4
|
+
import prompts from 'prompts';
|
|
5
|
+
import { isValidProjectName } from './utils.mjs';
|
|
6
|
+
|
|
7
|
+
export async function runPrompts({ argName, flags }) {
|
|
8
|
+
if (flags.yes) {
|
|
9
|
+
return {
|
|
10
|
+
projectName: argName || 'my-vasvibe-project',
|
|
11
|
+
includeOpencode: flags.opencode !== false,
|
|
12
|
+
includeClaude: flags.claude !== false,
|
|
13
|
+
includeGithub: flags.github !== false,
|
|
14
|
+
includeWorkflows: flags.workflows !== false,
|
|
15
|
+
initGit: flags.git !== false,
|
|
16
|
+
workDepth: flags.depth || 'standard',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const onCancel = () => {
|
|
21
|
+
console.log('\nAborted.');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const answers = await prompts(
|
|
26
|
+
[
|
|
27
|
+
{
|
|
28
|
+
type: argName ? null : 'text',
|
|
29
|
+
name: 'projectName',
|
|
30
|
+
message: 'Project name:',
|
|
31
|
+
initial: 'my-vasvibe-project',
|
|
32
|
+
validate: (v) =>
|
|
33
|
+
isValidProjectName(v) ||
|
|
34
|
+
'Use letters, numbers, dot, underscore, or dash. Cannot start with a dot.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: flags.opencode === false ? null : 'toggle',
|
|
38
|
+
name: 'includeOpencode',
|
|
39
|
+
message: 'Include OpenCode commands & skills (.opencode/)?',
|
|
40
|
+
initial: true,
|
|
41
|
+
active: 'yes',
|
|
42
|
+
inactive: 'no',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: flags.claude === false ? null : 'toggle',
|
|
46
|
+
name: 'includeClaude',
|
|
47
|
+
message: 'Include Claude agents & skills (.claude/, .agents/)?',
|
|
48
|
+
initial: true,
|
|
49
|
+
active: 'yes',
|
|
50
|
+
inactive: 'no',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: flags.github === false ? null : 'toggle',
|
|
54
|
+
name: 'includeGithub',
|
|
55
|
+
message: 'Include GitHub Copilot prompts (.github/prompts/)?',
|
|
56
|
+
initial: true,
|
|
57
|
+
active: 'yes',
|
|
58
|
+
inactive: 'no',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: flags.workflows === false ? null : 'toggle',
|
|
62
|
+
name: 'includeWorkflows',
|
|
63
|
+
message: 'Include generic agent workflows (agent/workflows/)?',
|
|
64
|
+
initial: true,
|
|
65
|
+
active: 'yes',
|
|
66
|
+
inactive: 'no',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: flags.git === false ? null : 'toggle',
|
|
70
|
+
name: 'initGit',
|
|
71
|
+
message: 'Initialize a git repository?',
|
|
72
|
+
initial: true,
|
|
73
|
+
active: 'yes',
|
|
74
|
+
inactive: 'no',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: flags.depth ? null : 'select',
|
|
78
|
+
name: 'workDepth',
|
|
79
|
+
message: 'Default work depth for all agents?',
|
|
80
|
+
hint: 'Can be changed anytime in project_overview.md → ## 7. Project Settings',
|
|
81
|
+
choices: [
|
|
82
|
+
{
|
|
83
|
+
title: 'standard (recommended)',
|
|
84
|
+
description: 'Full spec, unit tests, code review — the default for everyday production development.',
|
|
85
|
+
value: 'standard',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
title: 'fast',
|
|
89
|
+
description: 'Core feature only, skip optional steps (unit tests, full docs, edge cases) — good for prototypes and MVPs.',
|
|
90
|
+
value: 'fast',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: 'deep',
|
|
94
|
+
description: 'Maximum thoroughness — full security review, all edge cases, strict validation — for critical systems.',
|
|
95
|
+
value: 'deep',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
initial: 0,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
{ onCancel },
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
projectName: argName || answers.projectName,
|
|
106
|
+
includeOpencode: flags.opencode === false ? false : answers.includeOpencode ?? true,
|
|
107
|
+
includeClaude: flags.claude === false ? false : answers.includeClaude ?? true,
|
|
108
|
+
includeGithub: flags.github === false ? false : answers.includeGithub ?? true,
|
|
109
|
+
includeWorkflows: flags.workflows === false ? false : answers.includeWorkflows ?? true,
|
|
110
|
+
initGit: flags.git === false ? false : answers.initGit ?? true,
|
|
111
|
+
workDepth: flags.depth || answers.workDepth || 'standard',
|
|
112
|
+
};
|
|
113
|
+
}
|
package/src/scaffold.mjs
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
// src/scaffold.mjs
|
|
2
|
-
// Copy the bundled template into the target directory, applying selective
|
|
3
|
-
// includes and small file transforms (rename, placeholder replacement).
|
|
4
|
-
|
|
5
|
-
import { promises as fs } from 'node:fs';
|
|
6
|
-
import path from 'node:path';
|
|
7
|
-
import { fileURLToPath } from 'node:url';
|
|
8
|
-
import { copyDir, removePath, replaceInFile, pathExists } from './utils.mjs';
|
|
9
|
-
import { writeVersionFile } from './upgrade.mjs';
|
|
10
|
-
|
|
11
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
-
// packages/create-vasvibe/src → packages/create-vasvibe/template
|
|
13
|
-
const TEMPLATE_DIR = path.resolve(__dirname, '..', 'template');
|
|
14
|
-
|
|
15
|
-
const TOOLCHAIN_PATHS = {
|
|
16
|
-
opencode: ['.opencode'],
|
|
17
|
-
claude: ['.claude', '.agents'],
|
|
18
|
-
github: ['.github'],
|
|
19
|
-
workflows: ['agent'],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export async function scaffold({
|
|
23
|
-
targetDir,
|
|
24
|
-
projectName,
|
|
25
|
-
version,
|
|
26
|
-
workDepth = 'standard',
|
|
27
|
-
includeOpencode,
|
|
28
|
-
includeClaude,
|
|
29
|
-
includeGithub,
|
|
30
|
-
includeWorkflows,
|
|
31
|
-
}) {
|
|
32
|
-
if (!(await pathExists(TEMPLATE_DIR))) {
|
|
33
|
-
throw new Error(
|
|
34
|
-
`Template directory not found at ${TEMPLATE_DIR}. ` +
|
|
35
|
-
`If you are running from source, run "npm run sync-template" first.`,
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
await fs.mkdir(targetDir, { recursive: true });
|
|
40
|
-
|
|
41
|
-
// 1. Copy entire template tree.
|
|
42
|
-
await copyDir(TEMPLATE_DIR, targetDir);
|
|
43
|
-
|
|
44
|
-
// 2. Apply toolchain filters (delete excluded folders).
|
|
45
|
-
if (!includeOpencode) await removeAll(targetDir, TOOLCHAIN_PATHS.opencode);
|
|
46
|
-
if (!includeClaude) await removeAll(targetDir, TOOLCHAIN_PATHS.claude);
|
|
47
|
-
if (!includeGithub) await removeAll(targetDir, TOOLCHAIN_PATHS.github);
|
|
48
|
-
if (!includeWorkflows) await removeAll(targetDir, TOOLCHAIN_PATHS.workflows);
|
|
49
|
-
|
|
50
|
-
// 3. Rename _gitignore -> .gitignore (npm strips real .gitignore from packages).
|
|
51
|
-
const gi = path.join(targetDir, '_gitignore');
|
|
52
|
-
if (await pathExists(gi)) {
|
|
53
|
-
await fs.rename(gi, path.join(targetDir, '.gitignore'));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// 4. Replace placeholders in well-known files.
|
|
57
|
-
const year = String(new Date().getFullYear());
|
|
58
|
-
const replacements = { projectName, year, workDepth };
|
|
59
|
-
for (const rel of ['README.md', 'PROJECT_README.example.md', '.gitignore', 'AGENT_PERSONAS.md', 'GIT_STRUCTURE_GUIDE.md', 'project_overview_example.md']) {
|
|
60
|
-
const f = path.join(targetDir, rel);
|
|
61
|
-
if (await pathExists(f)) await replaceInFile(f, replacements);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// 5. Write version tracking file.
|
|
65
|
-
if (version) {
|
|
66
|
-
await writeVersionFile(targetDir, version);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async function removeAll(targetDir, relPaths) {
|
|
71
|
-
for (const rel of relPaths) {
|
|
72
|
-
await removePath(path.join(targetDir, rel));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
1
|
+
// src/scaffold.mjs
|
|
2
|
+
// Copy the bundled template into the target directory, applying selective
|
|
3
|
+
// includes and small file transforms (rename, placeholder replacement).
|
|
4
|
+
|
|
5
|
+
import { promises as fs } from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { copyDir, removePath, replaceInFile, pathExists } from './utils.mjs';
|
|
9
|
+
import { writeVersionFile } from './upgrade.mjs';
|
|
10
|
+
|
|
11
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
// packages/create-vasvibe/src → packages/create-vasvibe/template
|
|
13
|
+
const TEMPLATE_DIR = path.resolve(__dirname, '..', 'template');
|
|
14
|
+
|
|
15
|
+
const TOOLCHAIN_PATHS = {
|
|
16
|
+
opencode: ['.opencode'],
|
|
17
|
+
claude: ['.claude', '.agents'],
|
|
18
|
+
github: ['.github'],
|
|
19
|
+
workflows: ['agent'],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export async function scaffold({
|
|
23
|
+
targetDir,
|
|
24
|
+
projectName,
|
|
25
|
+
version,
|
|
26
|
+
workDepth = 'standard',
|
|
27
|
+
includeOpencode,
|
|
28
|
+
includeClaude,
|
|
29
|
+
includeGithub,
|
|
30
|
+
includeWorkflows,
|
|
31
|
+
}) {
|
|
32
|
+
if (!(await pathExists(TEMPLATE_DIR))) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
`Template directory not found at ${TEMPLATE_DIR}. ` +
|
|
35
|
+
`If you are running from source, run "npm run sync-template" first.`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
await fs.mkdir(targetDir, { recursive: true });
|
|
40
|
+
|
|
41
|
+
// 1. Copy entire template tree.
|
|
42
|
+
await copyDir(TEMPLATE_DIR, targetDir);
|
|
43
|
+
|
|
44
|
+
// 2. Apply toolchain filters (delete excluded folders).
|
|
45
|
+
if (!includeOpencode) await removeAll(targetDir, TOOLCHAIN_PATHS.opencode);
|
|
46
|
+
if (!includeClaude) await removeAll(targetDir, TOOLCHAIN_PATHS.claude);
|
|
47
|
+
if (!includeGithub) await removeAll(targetDir, TOOLCHAIN_PATHS.github);
|
|
48
|
+
if (!includeWorkflows) await removeAll(targetDir, TOOLCHAIN_PATHS.workflows);
|
|
49
|
+
|
|
50
|
+
// 3. Rename _gitignore -> .gitignore (npm strips real .gitignore from packages).
|
|
51
|
+
const gi = path.join(targetDir, '_gitignore');
|
|
52
|
+
if (await pathExists(gi)) {
|
|
53
|
+
await fs.rename(gi, path.join(targetDir, '.gitignore'));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 4. Replace placeholders in well-known files.
|
|
57
|
+
const year = String(new Date().getFullYear());
|
|
58
|
+
const replacements = { projectName, year, workDepth };
|
|
59
|
+
for (const rel of ['README.md', 'PROJECT_README.example.md', '.gitignore', 'AGENT_PERSONAS.md', 'GIT_STRUCTURE_GUIDE.md', 'project_overview_example.md']) {
|
|
60
|
+
const f = path.join(targetDir, rel);
|
|
61
|
+
if (await pathExists(f)) await replaceInFile(f, replacements);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 5. Write version tracking file.
|
|
65
|
+
if (version) {
|
|
66
|
+
await writeVersionFile(targetDir, version);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function removeAll(targetDir, relPaths) {
|
|
71
|
+
for (const rel of relPaths) {
|
|
72
|
+
await removePath(path.join(targetDir, rel));
|
|
73
|
+
}
|
|
74
|
+
}
|
package/src/upgrade.mjs
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
// src/upgrade.mjs
|
|
2
|
-
// Upgrade an existing vasvibe project: re-copy framework files (agents, schemas,
|
|
3
|
-
// workflows) without touching user-generated content (codes/, specifications/,
|
|
4
|
-
// task/, state/, project_overview.md, etc.).
|
|
5
|
-
|
|
6
|
-
import { promises as fs } from 'node:fs';
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
import { fileURLToPath } from 'node:url';
|
|
9
|
-
import { copyDir, pathExists, log } from './utils.mjs';
|
|
10
|
-
import pc from 'picocolors';
|
|
11
|
-
|
|
12
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const TEMPLATE_DIR = path.resolve(__dirname, '..', 'template');
|
|
14
|
-
const VERSION_FILE = '.vasvibe-version';
|
|
15
|
-
|
|
16
|
-
// Only these paths are safe to overwrite on upgrade.
|
|
17
|
-
// User content (codes/, specifications/, task/, state/, project_overview.md) is never touched.
|
|
18
|
-
const FRAMEWORK_PATHS = [
|
|
19
|
-
{ src: '.opencode', dest: '.opencode' },
|
|
20
|
-
{ src: '.claude', dest: '.claude' },
|
|
21
|
-
{ src: '.agents', dest: '.agents' },
|
|
22
|
-
{ src: '.github/prompts', dest: '.github/prompts' },
|
|
23
|
-
{ src: 'agent', dest: 'agent' },
|
|
24
|
-
{ src: 'schemas', dest: 'schemas' },
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
export async function readVersionFile(projectDir) {
|
|
28
|
-
const versionPath = path.join(projectDir, VERSION_FILE);
|
|
29
|
-
try {
|
|
30
|
-
const content = await fs.readFile(versionPath, 'utf8');
|
|
31
|
-
return content.trim();
|
|
32
|
-
} catch {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export async function writeVersionFile(projectDir, version) {
|
|
38
|
-
await fs.writeFile(path.join(projectDir, VERSION_FILE), version + '\n', 'utf8');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export async function isVasvibeProject(projectDir) {
|
|
42
|
-
// A vasvibe project has either .vasvibe-version or at least one agent directory.
|
|
43
|
-
if (await pathExists(path.join(projectDir, VERSION_FILE))) return true;
|
|
44
|
-
if (await pathExists(path.join(projectDir, 'agent/workflows'))) return true;
|
|
45
|
-
if (await pathExists(path.join(projectDir, '.opencode/agents'))) return true;
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export async function upgrade({ targetDir, currentVersion, newVersion, dryRun = false }) {
|
|
50
|
-
if (!(await pathExists(TEMPLATE_DIR))) {
|
|
51
|
-
throw new Error(`Template directory not found at ${TEMPLATE_DIR}.`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const updated = [];
|
|
55
|
-
const skipped = [];
|
|
56
|
-
|
|
57
|
-
for (const { src, dest } of FRAMEWORK_PATHS) {
|
|
58
|
-
const srcPath = path.join(TEMPLATE_DIR, src);
|
|
59
|
-
const destPath = path.join(targetDir, dest);
|
|
60
|
-
|
|
61
|
-
if (!(await pathExists(srcPath))) {
|
|
62
|
-
skipped.push(src);
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
// Only update if the destination already exists in the project
|
|
66
|
-
// (respect the user's original toolchain choices).
|
|
67
|
-
if (!(await pathExists(destPath))) {
|
|
68
|
-
skipped.push(dest + ' (not in project)');
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (!dryRun) {
|
|
73
|
-
await copyDir(srcPath, destPath);
|
|
74
|
-
}
|
|
75
|
-
updated.push(dest);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (!dryRun) {
|
|
79
|
-
await writeVersionFile(targetDir, newVersion);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return { updated, skipped };
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export async function runUpgrade({ targetDir, newVersion, dryRun }) {
|
|
86
|
-
const currentVersion = await readVersionFile(targetDir);
|
|
87
|
-
|
|
88
|
-
log.blank();
|
|
89
|
-
if (currentVersion) {
|
|
90
|
-
log.info(`Current version: ${pc.yellow(currentVersion)}`);
|
|
91
|
-
} else {
|
|
92
|
-
log.warn('No .vasvibe-version file found — project may have been created before version tracking was added.');
|
|
93
|
-
}
|
|
94
|
-
log.info(`Upgrading to: ${pc.green(newVersion)}`);
|
|
95
|
-
log.blank();
|
|
96
|
-
|
|
97
|
-
if (dryRun) {
|
|
98
|
-
log.step('Dry run — no files will be changed.');
|
|
99
|
-
log.blank();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const { updated, skipped } = await upgrade({ targetDir, currentVersion, newVersion, dryRun });
|
|
103
|
-
|
|
104
|
-
for (const p of updated) {
|
|
105
|
-
log.success(`Updated: ${pc.cyan(p)}`);
|
|
106
|
-
}
|
|
107
|
-
for (const p of skipped) {
|
|
108
|
-
log.step(`Skipped: ${pc.dim(p)}`);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
log.blank();
|
|
112
|
-
if (dryRun) {
|
|
113
|
-
log.info('Run without --dry-run to apply the upgrade.');
|
|
114
|
-
} else {
|
|
115
|
-
log.success(`Upgraded to ${pc.green(newVersion)}`);
|
|
116
|
-
log.blank();
|
|
117
|
-
log.step('Review the changes with ' + pc.cyan('git diff') + ' before committing.');
|
|
118
|
-
log.step('Your codes/, specifications/, task/, and state/ directories were not touched.');
|
|
119
|
-
}
|
|
120
|
-
log.blank();
|
|
121
|
-
}
|
|
1
|
+
// src/upgrade.mjs
|
|
2
|
+
// Upgrade an existing vasvibe project: re-copy framework files (agents, schemas,
|
|
3
|
+
// workflows) without touching user-generated content (codes/, specifications/,
|
|
4
|
+
// task/, state/, project_overview.md, etc.).
|
|
5
|
+
|
|
6
|
+
import { promises as fs } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { copyDir, pathExists, log } from './utils.mjs';
|
|
10
|
+
import pc from 'picocolors';
|
|
11
|
+
|
|
12
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const TEMPLATE_DIR = path.resolve(__dirname, '..', 'template');
|
|
14
|
+
const VERSION_FILE = '.vasvibe-version';
|
|
15
|
+
|
|
16
|
+
// Only these paths are safe to overwrite on upgrade.
|
|
17
|
+
// User content (codes/, specifications/, task/, state/, project_overview.md) is never touched.
|
|
18
|
+
const FRAMEWORK_PATHS = [
|
|
19
|
+
{ src: '.opencode', dest: '.opencode' },
|
|
20
|
+
{ src: '.claude', dest: '.claude' },
|
|
21
|
+
{ src: '.agents', dest: '.agents' },
|
|
22
|
+
{ src: '.github/prompts', dest: '.github/prompts' },
|
|
23
|
+
{ src: 'agent', dest: 'agent' },
|
|
24
|
+
{ src: 'schemas', dest: 'schemas' },
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export async function readVersionFile(projectDir) {
|
|
28
|
+
const versionPath = path.join(projectDir, VERSION_FILE);
|
|
29
|
+
try {
|
|
30
|
+
const content = await fs.readFile(versionPath, 'utf8');
|
|
31
|
+
return content.trim();
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function writeVersionFile(projectDir, version) {
|
|
38
|
+
await fs.writeFile(path.join(projectDir, VERSION_FILE), version + '\n', 'utf8');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function isVasvibeProject(projectDir) {
|
|
42
|
+
// A vasvibe project has either .vasvibe-version or at least one agent directory.
|
|
43
|
+
if (await pathExists(path.join(projectDir, VERSION_FILE))) return true;
|
|
44
|
+
if (await pathExists(path.join(projectDir, 'agent/workflows'))) return true;
|
|
45
|
+
if (await pathExists(path.join(projectDir, '.opencode/agents'))) return true;
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function upgrade({ targetDir, currentVersion, newVersion, dryRun = false }) {
|
|
50
|
+
if (!(await pathExists(TEMPLATE_DIR))) {
|
|
51
|
+
throw new Error(`Template directory not found at ${TEMPLATE_DIR}.`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const updated = [];
|
|
55
|
+
const skipped = [];
|
|
56
|
+
|
|
57
|
+
for (const { src, dest } of FRAMEWORK_PATHS) {
|
|
58
|
+
const srcPath = path.join(TEMPLATE_DIR, src);
|
|
59
|
+
const destPath = path.join(targetDir, dest);
|
|
60
|
+
|
|
61
|
+
if (!(await pathExists(srcPath))) {
|
|
62
|
+
skipped.push(src);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
// Only update if the destination already exists in the project
|
|
66
|
+
// (respect the user's original toolchain choices).
|
|
67
|
+
if (!(await pathExists(destPath))) {
|
|
68
|
+
skipped.push(dest + ' (not in project)');
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!dryRun) {
|
|
73
|
+
await copyDir(srcPath, destPath);
|
|
74
|
+
}
|
|
75
|
+
updated.push(dest);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (!dryRun) {
|
|
79
|
+
await writeVersionFile(targetDir, newVersion);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return { updated, skipped };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export async function runUpgrade({ targetDir, newVersion, dryRun }) {
|
|
86
|
+
const currentVersion = await readVersionFile(targetDir);
|
|
87
|
+
|
|
88
|
+
log.blank();
|
|
89
|
+
if (currentVersion) {
|
|
90
|
+
log.info(`Current version: ${pc.yellow(currentVersion)}`);
|
|
91
|
+
} else {
|
|
92
|
+
log.warn('No .vasvibe-version file found — project may have been created before version tracking was added.');
|
|
93
|
+
}
|
|
94
|
+
log.info(`Upgrading to: ${pc.green(newVersion)}`);
|
|
95
|
+
log.blank();
|
|
96
|
+
|
|
97
|
+
if (dryRun) {
|
|
98
|
+
log.step('Dry run — no files will be changed.');
|
|
99
|
+
log.blank();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const { updated, skipped } = await upgrade({ targetDir, currentVersion, newVersion, dryRun });
|
|
103
|
+
|
|
104
|
+
for (const p of updated) {
|
|
105
|
+
log.success(`Updated: ${pc.cyan(p)}`);
|
|
106
|
+
}
|
|
107
|
+
for (const p of skipped) {
|
|
108
|
+
log.step(`Skipped: ${pc.dim(p)}`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
log.blank();
|
|
112
|
+
if (dryRun) {
|
|
113
|
+
log.info('Run without --dry-run to apply the upgrade.');
|
|
114
|
+
} else {
|
|
115
|
+
log.success(`Upgraded to ${pc.green(newVersion)}`);
|
|
116
|
+
log.blank();
|
|
117
|
+
log.step('Review the changes with ' + pc.cyan('git diff') + ' before committing.');
|
|
118
|
+
log.step('Your codes/, specifications/, task/, and state/ directories were not touched.');
|
|
119
|
+
}
|
|
120
|
+
log.blank();
|
|
121
|
+
}
|