setup-vibeflow 0.10.1 → 0.12.1

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 (2) hide show
  1. package/index.js +51 -20
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -14,6 +14,7 @@ const COPILOT_FILES = [
14
14
  { src: 'github/prompts/vibeflow-audit.prompt.md', dest: '.github/prompts/vibeflow-audit.prompt.md' },
15
15
  { src: 'github/prompts/vibeflow-discover.prompt.md', dest: '.github/prompts/vibeflow-discover.prompt.md' },
16
16
  { src: 'github/prompts/vibeflow-gen-spec.prompt.md', dest: '.github/prompts/vibeflow-gen-spec.prompt.md' },
17
+ { src: 'github/prompts/vibeflow-implement.prompt.md', dest: '.github/prompts/vibeflow-implement.prompt.md' },
17
18
  { src: 'github/prompts/vibeflow-prompt-pack.prompt.md', dest: '.github/prompts/vibeflow-prompt-pack.prompt.md' },
18
19
  { src: 'github/prompts/vibeflow-quick.prompt.md', dest: '.github/prompts/vibeflow-quick.prompt.md' },
19
20
  { src: 'github/prompts/vibeflow-stats.prompt.md', dest: '.github/prompts/vibeflow-stats.prompt.md' },
@@ -29,6 +30,7 @@ const CURSOR_FILES = [
29
30
  { src: 'skills/vibeflow-audit/SKILL.md', dest: '.cursor/skills/vibeflow-audit/SKILL.md' },
30
31
  { src: 'skills/vibeflow-discover/SKILL.md', dest: '.cursor/skills/vibeflow-discover/SKILL.md' },
31
32
  { src: 'skills/vibeflow-gen-spec/SKILL.md', dest: '.cursor/skills/vibeflow-gen-spec/SKILL.md' },
33
+ { src: 'skills/vibeflow-implement/SKILL.md', dest: '.cursor/skills/vibeflow-implement/SKILL.md' },
32
34
  { src: 'skills/vibeflow-prompt-pack/SKILL.md', dest: '.cursor/skills/vibeflow-prompt-pack/SKILL.md' },
33
35
  { src: 'skills/vibeflow-quick/SKILL.md', dest: '.cursor/skills/vibeflow-quick/SKILL.md' },
34
36
  { src: 'skills/vibeflow-teach/SKILL.md', dest: '.cursor/skills/vibeflow-teach/SKILL.md' },
@@ -58,7 +60,8 @@ const EDITIONS = {
58
60
  },
59
61
  };
60
62
 
61
- const DUPLICATE_MARKER = 'vibeflow-architect';
63
+ const VIBEFLOW_START = '<!-- vibeflow:start -->';
64
+ const VIBEFLOW_END = '<!-- vibeflow:end -->';
62
65
 
63
66
  const GITIGNORE_MARKER = '# Vibeflow — installed + generated (remove to track in git)';
64
67
 
@@ -112,6 +115,32 @@ function extractCopilotInstructionsSnippet(fullContent) {
112
115
  return match[1].trim();
113
116
  }
114
117
 
118
+ function upsertDelimitedBlock(existing, newBlock, legacyMarker) {
119
+ const delimited = `${VIBEFLOW_START}\n${newBlock.trim()}\n${VIBEFLOW_END}`;
120
+
121
+ if (!existing) {
122
+ return { content: delimited + '\n', action: 'created' };
123
+ }
124
+
125
+ const startIdx = existing.indexOf(VIBEFLOW_START);
126
+ const endIdx = existing.indexOf(VIBEFLOW_END);
127
+
128
+ if (startIdx !== -1 && endIdx !== -1) {
129
+ const before = existing.slice(0, startIdx);
130
+ const after = existing.slice(endIdx + VIBEFLOW_END.length);
131
+ const content = before + delimited + after;
132
+ return { content, action: 'replaced' };
133
+ }
134
+
135
+ if (legacyMarker && existing.includes(legacyMarker)) {
136
+ const content = existing.trimEnd() + '\n\n' + delimited + '\n';
137
+ return { content, action: 'legacy-append', warning: true };
138
+ }
139
+
140
+ const content = existing.trimEnd() + '\n\n' + delimited + '\n';
141
+ return { content, action: 'appended' };
142
+ }
143
+
115
144
  function detectEdition() {
116
145
  const args = process.argv.slice(2);
117
146
  if (args.includes('--cursor')) return 'cursor';
@@ -213,19 +242,18 @@ async function main() {
213
242
  try {
214
243
  const agentsSource = await downloadFile(edition.baseUrl, edition.agentsSrc);
215
244
  const appendContent = extractAgentsAppendContent(agentsSource);
245
+ const existing = existsSync(agentsPath) ? readFileSync(agentsPath, 'utf-8') : null;
246
+ const result = upsertDelimitedBlock(existing, appendContent, '## Vibeflow Methodology');
247
+ writeFileSync(agentsPath, result.content, 'utf-8');
216
248
 
217
- if (existsSync(agentsPath)) {
218
- const existing = readFileSync(agentsPath, 'utf-8');
219
- if (existing.includes(DUPLICATE_MARKER) && !force) {
220
- log(pc.dim('-'), `${pc.dim('AGENTS.md')} ${pc.dim('(vibeflow block exists, skipped)')}`);
221
- } else {
222
- const updated = existing.trimEnd() + '\n\n' + appendContent;
223
- writeFileSync(agentsPath, updated, 'utf-8');
224
- log(pc.green('+'), `AGENTS.md ${pc.dim('(appended vibeflow block)')}`);
225
- }
226
- } else {
227
- writeFileSync(agentsPath, appendContent, 'utf-8');
249
+ if (result.action === 'created') {
228
250
  log(pc.green('+'), `AGENTS.md ${pc.dim('(created)')}`);
251
+ } else if (result.action === 'replaced') {
252
+ log(pc.green('+'), `AGENTS.md ${pc.dim('(vibeflow block updated)')}`);
253
+ } else if (result.action === 'appended') {
254
+ log(pc.green('+'), `AGENTS.md ${pc.dim('(appended vibeflow block)')}`);
255
+ } else if (result.warning) {
256
+ log(pc.yellow('!'), `AGENTS.md ${pc.dim('(new delimited block appended — please remove the old vibeflow block manually)')}`);
229
257
  }
230
258
  } catch (err) {
231
259
  log(pc.red('x'), `AGENTS.md — ${err.message}`);
@@ -237,15 +265,18 @@ async function main() {
237
265
  try {
238
266
  if (existsSync(copilotInstrPath)) {
239
267
  const existing = readFileSync(copilotInstrPath, 'utf-8');
240
- if (existing.includes('vibeflow') && !force) {
241
- log(pc.dim('-'), `${pc.dim('.github/copilot-instructions.md')} ${pc.dim('(vibeflow snippet exists, skipped)')}`);
242
- } else {
243
- const snippetSource = await downloadFile(edition.baseUrl, 'copilot-instructions.md');
244
- const snippet = extractCopilotInstructionsSnippet(snippetSource);
245
- if (snippet) {
246
- const updated = existing.trimEnd() + '\n\n' + snippet + '\n';
247
- writeFileSync(copilotInstrPath, updated, 'utf-8');
268
+ const snippetSource = await downloadFile(edition.baseUrl, 'copilot-instructions.md');
269
+ const snippet = extractCopilotInstructionsSnippet(snippetSource);
270
+ if (snippet) {
271
+ const result = upsertDelimitedBlock(existing, snippet, '## Vibeflow');
272
+ writeFileSync(copilotInstrPath, result.content, 'utf-8');
273
+
274
+ if (result.action === 'replaced') {
275
+ log(pc.green('+'), `.github/copilot-instructions.md ${pc.dim('(vibeflow snippet updated)')}`);
276
+ } else if (result.action === 'appended') {
248
277
  log(pc.green('+'), `.github/copilot-instructions.md ${pc.dim('(appended vibeflow snippet)')}`);
278
+ } else if (result.warning) {
279
+ log(pc.yellow('!'), `.github/copilot-instructions.md ${pc.dim('(new delimited snippet appended — please remove the old vibeflow block manually)')}`);
249
280
  }
250
281
  }
251
282
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "setup-vibeflow",
3
- "version": "0.10.1",
3
+ "version": "0.12.1",
4
4
  "description": "Install Vibeflow (spec-driven development) in your project",
5
5
  "bin": {
6
6
  "setup-vibeflow": "./index.js"