pmpt-cli 1.12.1 → 1.12.2

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.
@@ -190,22 +190,24 @@ export async function cmdClone(slug) {
190
190
  // Copy AI prompt to clipboard
191
191
  const aiContent = readFileSync(aiMdPath, 'utf-8');
192
192
  const copied = copyToClipboard(aiContent);
193
+ p.log.info('Tips:');
194
+ p.log.message(' pmpt history — view version history');
195
+ p.log.message(' pmpt plan — view or edit AI prompt');
196
+ p.log.message(' pmpt save — save a new snapshot');
197
+ p.log.message('');
193
198
  if (copied) {
194
- p.log.message('');
195
- p.log.success('AI prompt copied to clipboard!');
196
- p.log.message('');
197
199
  const banner = [
198
- '',
199
200
  '┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓',
200
201
  '┃ ┃',
201
202
  '┃ 📋 NEXT STEP ┃',
202
203
  '┃ ┃',
203
- '┃ Open your AI coding tool and press: ┃',
204
+ '┃ AI prompt is already copied to clipboard! ┃',
205
+ '┃ Open your AI coding tool and paste it: ┃',
204
206
  '┃ ┃',
205
207
  '┃ ⌘ + V (Mac) ┃',
206
208
  '┃ Ctrl + V (Windows/Linux) ┃',
207
209
  '┃ ┃',
208
- '┃ Your cloned project context is ready! 🚀 ┃',
210
+ '┃ Your project context is ready! 🚀 ┃',
209
211
  '┃ ┃',
210
212
  '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛',
211
213
  '',
@@ -216,9 +218,5 @@ export async function cmdClone(slug) {
216
218
  p.log.warn('Could not copy to clipboard.');
217
219
  p.log.info(`Read it at: ${aiMdPath}`);
218
220
  }
219
- p.log.info('Tips:');
220
- p.log.message(' pmpt history — view version history');
221
- p.log.message(' pmpt plan — view or edit AI prompt');
222
- p.log.message(' pmpt save — save a new snapshot');
223
221
  p.outro('Project cloned!');
224
222
  }
@@ -176,7 +176,7 @@ export async function cmdInit(path, options) {
176
176
  const s2 = p.spinner();
177
177
  s2.start('Scanning project and generating plan...');
178
178
  const answers = scanResultToAnswers(scanResult, userDesc);
179
- const { planPath, promptPath } = savePlanDocuments(projectPath, answers);
179
+ const { planPath, promptPath } = savePlanDocuments(projectPath, answers, origin);
180
180
  const progress = initPlanProgress(projectPath);
181
181
  progress.completed = true;
182
182
  progress.answers = answers;
@@ -197,17 +197,19 @@ export async function cmdInit(path, options) {
197
197
  // Copy to clipboard
198
198
  const content = readFileSync(promptPath, 'utf-8');
199
199
  const copied = copyToClipboard(content);
200
+ p.log.info('Tips:');
201
+ p.log.message(' pmpt plan — View or edit your AI prompt');
202
+ p.log.message(' pmpt save — Save a snapshot anytime');
203
+ p.log.message(' pmpt watch — Auto-save on file changes');
204
+ p.log.message('');
200
205
  if (copied) {
201
- p.log.message('');
202
- p.log.success('AI prompt copied to clipboard!');
203
- p.log.message('');
204
206
  const banner = [
205
- '',
206
207
  '┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓',
207
208
  '┃ ┃',
208
209
  '┃ 📋 NEXT STEP ┃',
209
210
  '┃ ┃',
210
- '┃ Open your AI coding tool and press: ┃',
211
+ '┃ AI prompt is already copied to clipboard! ┃',
212
+ '┃ Open your AI coding tool and paste it: ┃',
211
213
  '┃ ┃',
212
214
  '┃ ⌘ + V (Mac) ┃',
213
215
  '┃ Ctrl + V (Windows/Linux) ┃',
@@ -223,10 +225,6 @@ export async function cmdInit(path, options) {
223
225
  p.log.warn('Could not copy to clipboard.');
224
226
  p.log.info(`Read it at: ${promptPath}`);
225
227
  }
226
- p.log.info('Tips:');
227
- p.log.message(' pmpt plan — View or edit your AI prompt');
228
- p.log.message(' pmpt save — Save a snapshot anytime');
229
- p.log.message(' pmpt watch — Auto-save on file changes');
230
228
  p.outro('Ready to go!');
231
229
  }
232
230
  else if (scanChoice === 'manual') {
@@ -1,7 +1,7 @@
1
1
  import * as p from '@clack/prompts';
2
2
  import { resolve } from 'path';
3
3
  import { existsSync, readFileSync } from 'fs';
4
- import { isInitialized } from '../lib/config.js';
4
+ import { isInitialized, loadConfig } from '../lib/config.js';
5
5
  import { copyToClipboard } from '../lib/clipboard.js';
6
6
  import { cmdWatch } from './watch.js';
7
7
  import { PLAN_QUESTIONS, getPlanProgress, initPlanProgress, savePlanProgress, savePlanDocuments, } from '../lib/plan.js';
@@ -88,16 +88,14 @@ export async function cmdPlan(path, options) {
88
88
  if (action === 'copy') {
89
89
  const copied = copyToClipboard(content);
90
90
  if (copied) {
91
- p.log.success('AI prompt copied to clipboard!');
92
91
  p.log.message('');
93
- // Eye-catching next step banner
94
92
  const banner = [
95
- '',
96
93
  '┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓',
97
94
  '┃ ┃',
98
95
  '┃ 📋 NEXT STEP ┃',
99
96
  '┃ ┃',
100
- '┃ Open your AI coding tool and press: ┃',
97
+ '┃ AI prompt is already copied to clipboard! ┃',
98
+ '┃ Open your AI coding tool and paste it: ┃',
101
99
  '┃ ┃',
102
100
  '┃ ⌘ + V (Mac) ┃',
103
101
  '┃ Ctrl + V (Windows/Linux) ┃',
@@ -159,9 +157,10 @@ export async function cmdPlan(path, options) {
159
157
  p.outro('');
160
158
  process.exit(1);
161
159
  }
160
+ const config = loadConfig(projectPath);
162
161
  const s = p.spinner();
163
162
  s.start('Generating documents from answers file...');
164
- const { planPath, promptPath } = savePlanDocuments(projectPath, answers);
163
+ const { planPath, promptPath } = savePlanDocuments(projectPath, answers, config?.origin);
165
164
  progress.completed = true;
166
165
  progress.answers = answers;
167
166
  savePlanProgress(projectPath, progress);
@@ -197,9 +196,10 @@ export async function cmdPlan(path, options) {
197
196
  answers[question.key] = answer;
198
197
  }
199
198
  // Generate documents
199
+ const config = loadConfig(projectPath);
200
200
  const s = p.spinner();
201
201
  s.start('Generating your AI prompt...');
202
- const { planPath, promptPath } = savePlanDocuments(projectPath, answers);
202
+ const { planPath, promptPath } = savePlanDocuments(projectPath, answers, config?.origin);
203
203
  // Update progress
204
204
  progress.completed = true;
205
205
  progress.answers = answers;
@@ -233,16 +233,13 @@ export async function cmdPlan(path, options) {
233
233
  const copied = copyToClipboard(content);
234
234
  if (copied) {
235
235
  p.log.message('');
236
- p.log.success('AI prompt copied to clipboard!');
237
- p.log.message('');
238
- // Eye-catching next step banner
239
236
  const banner = [
240
- '',
241
237
  '┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓',
242
238
  '┃ ┃',
243
239
  '┃ 📋 NEXT STEP ┃',
244
240
  '┃ ┃',
245
- '┃ Open your AI coding tool and press: ┃',
241
+ '┃ AI prompt is already copied to clipboard! ┃',
242
+ '┃ Open your AI coding tool and paste it: ┃',
246
243
  '┃ ┃',
247
244
  '┃ ⌘ + V (Mac) ┃',
248
245
  '┃ Ctrl + V (Windows/Linux) ┃',
@@ -411,6 +411,7 @@ export async function cmdPublish(path, options) {
411
411
  if (config) {
412
412
  config.lastPublished = new Date().toISOString();
413
413
  config.lastPublishedSlug = slug;
414
+ config.lastPublishedVersionCount = snapshots.length;
414
415
  saveConfig(projectPath, config);
415
416
  }
416
417
  p.note([
@@ -67,6 +67,13 @@ export async function cmdUpdate(path) {
67
67
  p.outro('');
68
68
  return;
69
69
  }
70
+ // Check if already up to date
71
+ if (config?.lastPublishedVersionCount === snapshots.length) {
72
+ p.log.success('Already up to date — no new snapshots since last publish.');
73
+ p.log.info('Run `pmpt save` to create a new snapshot, then try again.');
74
+ p.outro('');
75
+ return;
76
+ }
70
77
  // Quality gate
71
78
  const docsDir = getDocsDir(projectPath);
72
79
  const aiMdPath = join(docsDir, 'pmpt.ai.md');
@@ -136,6 +143,7 @@ export async function cmdUpdate(path) {
136
143
  s.stop('Updated!');
137
144
  if (config) {
138
145
  config.lastPublished = new Date().toISOString();
146
+ config.lastPublishedVersionCount = snapshots.length;
139
147
  saveConfig(projectPath, config);
140
148
  }
141
149
  p.note([
package/dist/lib/plan.js CHANGED
@@ -42,7 +42,7 @@ export const PLAN_QUESTIONS = [
42
42
  },
43
43
  ];
44
44
  // Generate AI instruction file (pmpt.ai.md) — always English, AI-facing
45
- export function generateAIPrompt(answers) {
45
+ export function generateAIPrompt(answers, origin) {
46
46
  // Parse features (support comma, semicolon, or newline separators)
47
47
  const features = answers.coreFeatures
48
48
  .split(/[,;\n]/)
@@ -56,10 +56,28 @@ export function generateAIPrompt(answers) {
56
56
  const techSection = answers.techStack
57
57
  ? `\n## Tech Stack Preferences\n${answers.techStack}\n`
58
58
  : '';
59
+ const isAdopted = origin === 'adopted';
60
+ const workflowSteps = isAdopted
61
+ ? `This is an **existing project** — you are joining mid-development.
62
+
63
+ 1. First, explore the existing codebase and understand the current architecture.
64
+ 2. Review what's already implemented vs what still needs to be done.
65
+ 3. Suggest improvements or next steps based on the current state.
66
+ 4. Continue development from where it left off.
67
+
68
+ Do NOT start from scratch. Build on the existing code.`
69
+ : `Please help me build this product based on the requirements above.
70
+
71
+ 1. First, review the requirements and ask if anything is unclear.
72
+ 2. Propose a technical architecture.
73
+ 3. Outline the implementation steps.
74
+ 4. Start coding from the first step.
75
+
76
+ I'll confirm progress at each step before moving to the next.`;
59
77
  return `<!-- This file is for AI tools only. Do not edit manually. -->
60
78
  <!-- Paste this into Claude Code, Codex, Cursor, or any AI coding tool. -->
61
79
 
62
- # ${answers.projectName} — Product Development Request
80
+ # ${answers.projectName} — ${isAdopted ? 'Continue Development' : 'Product Development Request'}
63
81
 
64
82
  ## What I Want to Build
65
83
  ${answers.productIdea}
@@ -69,14 +87,7 @@ ${features}
69
87
  ${techSection}
70
88
  ---
71
89
 
72
- Please help me build this product based on the requirements above.
73
-
74
- 1. First, review the requirements and ask if anything is unclear.
75
- 2. Propose a technical architecture.
76
- 3. Outline the implementation steps.
77
- 4. Start coding from the first step.
78
-
79
- I'll confirm progress at each step before moving to the next.
90
+ ${workflowSteps}
80
91
 
81
92
  ## Documentation Rule
82
93
 
@@ -186,7 +197,7 @@ export function initPlanProgress(projectPath) {
186
197
  savePlanProgress(projectPath, progress);
187
198
  return progress;
188
199
  }
189
- export function savePlanDocuments(projectPath, answers) {
200
+ export function savePlanDocuments(projectPath, answers, origin) {
190
201
  const pmptDir = getPmptDir(projectPath);
191
202
  mkdirSync(pmptDir, { recursive: true });
192
203
  // Save plan to pmpt folder
@@ -199,7 +210,7 @@ export function savePlanDocuments(projectPath, answers) {
199
210
  writeFileSync(pmptMdPath, pmptMdContent, 'utf-8');
200
211
  // Save AI instruction file
201
212
  const promptPath = join(pmptDir, 'pmpt.ai.md');
202
- const promptContent = generateAIPrompt(answers);
213
+ const promptContent = generateAIPrompt(answers, origin);
203
214
  writeFileSync(promptPath, promptContent, 'utf-8');
204
215
  // Create initial snapshot
205
216
  createFullSnapshot(projectPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmpt-cli",
3
- "version": "1.12.1",
3
+ "version": "1.12.2",
4
4
  "description": "Record and share your AI-driven product development journey",
5
5
  "type": "module",
6
6
  "bin": {