@cluesmith/codev 1.1.1 → 1.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.
@@ -0,0 +1,278 @@
1
+ /**
2
+ * codev import - AI-assisted protocol import from other codev projects
3
+ *
4
+ * Fetches codev/ directory from another project (local or GitHub) and
5
+ * spawns an interactive Claude session to analyze differences and
6
+ * recommend imports.
7
+ */
8
+ import * as fs from 'node:fs';
9
+ import * as path from 'node:path';
10
+ import * as os from 'node:os';
11
+ import { spawn, execSync } from 'node:child_process';
12
+ import chalk from 'chalk';
13
+ import { findProjectRoot } from '../lib/skeleton.js';
14
+ /**
15
+ * Parse a source argument into its type and path
16
+ */
17
+ function parseSource(source) {
18
+ // GitHub URL patterns:
19
+ // - github:owner/repo
20
+ // - https://github.com/owner/repo
21
+ // - git@github.com:owner/repo.git
22
+ if (source.startsWith('github:')) {
23
+ const repo = source.slice('github:'.length);
24
+ return { type: 'github', path: repo, repo };
25
+ }
26
+ if (source.includes('github.com')) {
27
+ // Extract owner/repo from URL
28
+ // Regex captures owner/repo including dots (e.g., vercel/next.js, owner/repo.name)
29
+ const match = source.match(/github\.com[/:]([\w.-]+\/[\w.-]+)/);
30
+ if (match) {
31
+ const repo = match[1].replace(/\.git$/, '');
32
+ return { type: 'github', path: repo, repo };
33
+ }
34
+ }
35
+ // Treat as local path
36
+ return { type: 'local', path: source };
37
+ }
38
+ /**
39
+ * Fetch codev directory from GitHub
40
+ */
41
+ async function fetchFromGitHub(repo, tempDir) {
42
+ console.log(chalk.dim(`Fetching from GitHub: ${repo}...`));
43
+ // Clone with depth 1 to get only latest
44
+ const cloneUrl = `https://github.com/${repo}.git`;
45
+ try {
46
+ execSync(`git clone --depth 1 "${cloneUrl}" "${tempDir}"`, {
47
+ stdio: 'pipe',
48
+ encoding: 'utf-8',
49
+ });
50
+ }
51
+ catch (error) {
52
+ throw new Error(`Failed to clone ${repo}: ${error instanceof Error ? error.message : String(error)}`);
53
+ }
54
+ const codevDir = path.join(tempDir, 'codev');
55
+ if (!fs.existsSync(codevDir)) {
56
+ throw new Error(`Repository ${repo} does not have a codev/ directory`);
57
+ }
58
+ return codevDir;
59
+ }
60
+ /**
61
+ * Read relevant codev files for comparison
62
+ */
63
+ function readCodevDirectory(dir) {
64
+ const files = new Map();
65
+ // Directories to include in comparison
66
+ const includeDirs = ['protocols', 'resources', 'roles'];
67
+ function walkDir(currentPath, relativePath) {
68
+ if (!fs.existsSync(currentPath))
69
+ return;
70
+ const entries = fs.readdirSync(currentPath, { withFileTypes: true });
71
+ for (const entry of entries) {
72
+ const fullPath = path.join(currentPath, entry.name);
73
+ const relPath = relativePath ? `${relativePath}/${entry.name}` : entry.name;
74
+ if (entry.isDirectory()) {
75
+ walkDir(fullPath, relPath);
76
+ }
77
+ else if (entry.name.endsWith('.md')) {
78
+ try {
79
+ const content = fs.readFileSync(fullPath, 'utf-8');
80
+ files.set(relPath, content);
81
+ }
82
+ catch {
83
+ // Skip unreadable files
84
+ }
85
+ }
86
+ }
87
+ }
88
+ for (const subdir of includeDirs) {
89
+ walkDir(path.join(dir, subdir), subdir);
90
+ }
91
+ return files;
92
+ }
93
+ /**
94
+ * Format files map for Claude context
95
+ */
96
+ function formatFilesForContext(files, label) {
97
+ let output = `## ${label}\n\n`;
98
+ if (files.size === 0) {
99
+ output += '(No codev files found)\n';
100
+ return output;
101
+ }
102
+ for (const [filePath, content] of files) {
103
+ output += `### ${filePath}\n\n`;
104
+ output += '```markdown\n';
105
+ // Truncate very long files
106
+ if (content.length > 10000) {
107
+ output += content.substring(0, 10000);
108
+ output += '\n\n... (truncated, ' + content.length + ' chars total)\n';
109
+ }
110
+ else {
111
+ output += content;
112
+ }
113
+ output += '\n```\n\n';
114
+ }
115
+ return output;
116
+ }
117
+ /**
118
+ * Build the prompt for Claude
119
+ */
120
+ function buildImportPrompt(sourceFiles, targetFiles, sourceLabel) {
121
+ return `You are helping import protocol improvements from another codev project.
122
+
123
+ The user wants to import improvements from "${sourceLabel}" into their local codev installation.
124
+
125
+ ${formatFilesForContext(sourceFiles, 'SOURCE (from ' + sourceLabel + ')')}
126
+
127
+ ${formatFilesForContext(targetFiles, 'TARGET (local codev/)')}
128
+
129
+ ---
130
+
131
+ ## Your Task
132
+
133
+ Analyze the differences between SOURCE and TARGET and help the user decide what to import.
134
+
135
+ Focus on:
136
+ 1. **Protocol improvements**: New phases, better documentation, additional guidance
137
+ 2. **Lessons learned**: Wisdom from other projects' reviews
138
+ 3. **Architectural patterns**: Better ways to document or structure things
139
+ 4. **New protocols**: Protocols that exist in source but not target
140
+
141
+ For each potential import, explain:
142
+ - What it is and why it might be valuable
143
+ - Any risks or considerations
144
+ - Your recommendation (import, skip, or merge manually)
145
+
146
+ Be interactive - discuss with the user and wait for their approval before making changes.
147
+
148
+ When the user approves a change, make the edit to the appropriate file in codev/.
149
+
150
+ Start by summarizing the key differences you found.`;
151
+ }
152
+ /**
153
+ * Main import entry point
154
+ */
155
+ export async function importCommand(source, options = {}) {
156
+ const { dryRun = false } = options;
157
+ if (!source) {
158
+ throw new Error('Source required.\n\n' +
159
+ 'Usage:\n' +
160
+ ' codev import /path/to/other-project\n' +
161
+ ' codev import github:owner/repo\n' +
162
+ ' codev import https://github.com/owner/repo');
163
+ }
164
+ const projectRoot = findProjectRoot();
165
+ const localCodevDir = path.join(projectRoot, 'codev');
166
+ if (!fs.existsSync(localCodevDir)) {
167
+ throw new Error('No codev/ directory found in current project.\n' +
168
+ 'Run "codev init" or "codev adopt" first.');
169
+ }
170
+ console.log('');
171
+ console.log(chalk.bold('Codev Import'));
172
+ console.log(chalk.dim('AI-assisted protocol import from other projects'));
173
+ console.log('');
174
+ const parsed = parseSource(source);
175
+ let sourceCodevDir;
176
+ let tempDir = null;
177
+ let sourceLabel = source;
178
+ try {
179
+ if (parsed.type === 'github') {
180
+ // Create temp directory for GitHub clone
181
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codev-import-'));
182
+ sourceCodevDir = await fetchFromGitHub(parsed.repo, tempDir);
183
+ sourceLabel = `github:${parsed.repo}`;
184
+ console.log(chalk.green('✓'), `Fetched ${parsed.repo}`);
185
+ }
186
+ else {
187
+ // Local path
188
+ sourceCodevDir = path.join(parsed.path, 'codev');
189
+ if (!fs.existsSync(sourceCodevDir)) {
190
+ // Maybe they specified the codev dir directly?
191
+ if (fs.existsSync(parsed.path) && fs.statSync(parsed.path).isDirectory()) {
192
+ // Check if it looks like a codev directory
193
+ if (fs.existsSync(path.join(parsed.path, 'protocols')) ||
194
+ fs.existsSync(path.join(parsed.path, 'roles'))) {
195
+ sourceCodevDir = parsed.path;
196
+ }
197
+ else {
198
+ throw new Error(`No codev/ directory found at ${parsed.path}`);
199
+ }
200
+ }
201
+ else {
202
+ throw new Error(`Path not found: ${parsed.path}`);
203
+ }
204
+ }
205
+ sourceLabel = path.basename(path.dirname(sourceCodevDir)) || parsed.path;
206
+ console.log(chalk.green('✓'), `Found local source: ${sourceCodevDir}`);
207
+ }
208
+ // Read files from both directories
209
+ console.log(chalk.dim('Reading source files...'));
210
+ const sourceFiles = readCodevDirectory(sourceCodevDir);
211
+ console.log(chalk.dim(` Found ${sourceFiles.size} files`));
212
+ console.log(chalk.dim('Reading target files...'));
213
+ const targetFiles = readCodevDirectory(localCodevDir);
214
+ console.log(chalk.dim(` Found ${targetFiles.size} files`));
215
+ if (sourceFiles.size === 0) {
216
+ throw new Error('No codev files found in source');
217
+ }
218
+ // Build the prompt
219
+ const prompt = buildImportPrompt(sourceFiles, targetFiles, sourceLabel);
220
+ if (dryRun) {
221
+ console.log('');
222
+ console.log(chalk.yellow('Dry run - would spawn Claude with this context:'));
223
+ console.log('');
224
+ console.log(chalk.dim('Source files:'));
225
+ for (const file of sourceFiles.keys()) {
226
+ console.log(chalk.dim(` - ${file}`));
227
+ }
228
+ console.log('');
229
+ console.log(chalk.dim('Target files:'));
230
+ for (const file of targetFiles.keys()) {
231
+ console.log(chalk.dim(` - ${file}`));
232
+ }
233
+ console.log('');
234
+ console.log(chalk.dim('Prompt length:'), prompt.length, 'chars');
235
+ return;
236
+ }
237
+ // Check if claude is available
238
+ try {
239
+ execSync('which claude', { stdio: 'pipe' });
240
+ }
241
+ catch {
242
+ throw new Error('Claude CLI not found.\n' +
243
+ 'Install with: npm install -g @anthropic-ai/claude-code');
244
+ }
245
+ console.log('');
246
+ console.log(chalk.bold('Starting interactive Claude session...'));
247
+ console.log(chalk.dim('Claude will analyze the differences and help you decide what to import.'));
248
+ console.log('');
249
+ // Spawn interactive Claude session
250
+ // We use -p to pass the initial prompt, but NOT --print so it stays interactive
251
+ const claudeProcess = spawn('claude', ['-p', prompt], {
252
+ stdio: 'inherit',
253
+ cwd: projectRoot, // Run from project root so Claude can make edits
254
+ });
255
+ await new Promise((resolve, reject) => {
256
+ claudeProcess.on('close', (code) => {
257
+ if (code === 0) {
258
+ resolve();
259
+ }
260
+ else {
261
+ reject(new Error(`Claude exited with code ${code}`));
262
+ }
263
+ });
264
+ claudeProcess.on('error', (error) => {
265
+ reject(error);
266
+ });
267
+ });
268
+ console.log('');
269
+ console.log(chalk.green('✓'), 'Import session complete');
270
+ }
271
+ finally {
272
+ // Clean up temp directory if we created one
273
+ if (tempDir && fs.existsSync(tempDir)) {
274
+ fs.rmSync(tempDir, { recursive: true, force: true });
275
+ }
276
+ }
277
+ }
278
+ //# sourceMappingURL=import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/commands/import.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CA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AgF;QAChF,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;YACpD,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,WAAW,EAAE,iDAAiD;SACpE,CAAC,CAAC;QAEH,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBACjC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;oBACf,OAAO,EAAE,CAAC;gBACZ,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,yBAAyB,CAAC,CAAC;IAE3D,CAAC;YAAS,CAAC;QACT,4CAA4C;QAC5C,IAAI,OAAO,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACtC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cluesmith/codev",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Codev CLI - AI-assisted software development framework",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,7 @@
33
33
  "@types/node": "^22.10.1",
34
34
  "tsx": "^4.19.2",
35
35
  "typescript": "^5.7.2",
36
- "vitest": "^2.1.6"
36
+ "vitest": "^4.0.15"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=18.0.0"
@@ -141,6 +141,7 @@ You need at least one AI CLI installed to use Codev. Install more for multi-agen
141
141
  | Requirement | Value |
142
142
  |-------------|-------|
143
143
  | Purpose | Primary AI agent for development |
144
+ | Required For | `codev import` command (spawns interactive Claude session) |
144
145
  | Documentation | [docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code) |
145
146
 
146
147
  **Installation:**
@@ -46,6 +46,7 @@ This installs all three commands globally: `codev`, `af`, and `consult`.
46
46
  | `codev doctor` | Check system dependencies |
47
47
  | `codev update` | Update codev templates and protocols |
48
48
  | `codev eject [path]` | Copy embedded files for customization |
49
+ | `codev import <source>` | AI-assisted protocol import from other projects |
49
50
  | `codev tower` | Cross-project dashboard |
50
51
 
51
52
  See [codev.md](codev.md) for full documentation.
@@ -0,0 +1,2 @@
1
+ # Maintenance run files go here
2
+ # Files are numbered: 0001-maintenance.md, 0002-maintenance.md, etc.