vibe-coder-kit 6.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.
package/bin/vibe.js ADDED
@@ -0,0 +1,351 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Vibe Coder Kit - CLI Installer
5
+ *
6
+ * Usage:
7
+ * npx vibe-coder-kit init # Install VCK to current project
8
+ * npx vibe-coder-kit status # Show VCK status
9
+ * npx vibe-coder-kit doctor # Health check
10
+ * npx vibe-coder-kit version # Show version
11
+ */
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+ const { execSync } = require('child_process');
16
+
17
+ const VERSION = '6.0.0';
18
+ const VCK_SOURCE = path.join(__dirname, '..', '.vibe');
19
+
20
+ // Colors for terminal output
21
+ const colors = {
22
+ reset: '\x1b[0m',
23
+ bright: '\x1b[1m',
24
+ red: '\x1b[31m',
25
+ green: '\x1b[32m',
26
+ yellow: '\x1b[33m',
27
+ blue: '\x1b[34m',
28
+ magenta: '\x1b[35m',
29
+ cyan: '\x1b[36m',
30
+ };
31
+
32
+ function log(message, color = 'reset') {
33
+ console.log(`${colors[color]}${message}${colors.reset}`);
34
+ }
35
+
36
+ function logSuccess(message) {
37
+ log(`āœ“ ${message}`, 'green');
38
+ }
39
+
40
+ function logError(message) {
41
+ log(`āœ— ${message}`, 'red');
42
+ }
43
+
44
+ function logInfo(message) {
45
+ log(`ℹ ${message}`, 'cyan');
46
+ }
47
+
48
+ function logWarning(message) {
49
+ log(`⚠ ${message}`, 'yellow');
50
+ }
51
+
52
+ function showHelp() {
53
+ log('\nšŸš€ Vibe Coder Kit v' + VERSION, 'bright');
54
+ log('\nUsage:', 'bright');
55
+ log(' vibe init Install VCK to current project');
56
+ log(' vibe status Show VCK status');
57
+ log(' vibe doctor Health check');
58
+ log(' vibe version Show version');
59
+ log(' vibe help Show this help\n', 'bright');
60
+ }
61
+
62
+ function showVersion() {
63
+ log(`Vibe Coder Kit v${VERSION}`, 'bright');
64
+ }
65
+
66
+ function ensureDirectoryExists(dir) {
67
+ if (!fs.existsSync(dir)) {
68
+ fs.mkdirSync(dir, { recursive: true });
69
+ }
70
+ }
71
+
72
+ function copyDirSync(src, dest) {
73
+ ensureDirectoryExists(dest);
74
+
75
+ const entries = fs.readdirSync(src, { withFileTypes: true });
76
+
77
+ for (const entry of entries) {
78
+ const srcPath = path.join(src, entry.name);
79
+ const destPath = path.join(dest, entry.name);
80
+
81
+ if (entry.isDirectory()) {
82
+ copyDirSync(srcPath, destPath);
83
+ } else {
84
+ fs.copyFileSync(srcPath, destPath);
85
+ }
86
+ }
87
+ }
88
+
89
+ function initProject() {
90
+ log('\nšŸš€ Vibe Coder Kit - Initial Setup\n', 'bright');
91
+
92
+ const targetDir = process.cwd();
93
+ const vibeDir = path.join(targetDir, '.vibe');
94
+
95
+ // Check if .vibe already exists
96
+ if (fs.existsSync(vibeDir)) {
97
+ logWarning('.vibe directory already exists');
98
+
99
+ const overwrite = process.argv.includes('--force');
100
+ if (!overwrite) {
101
+ logInfo('Use --force to overwrite existing installation');
102
+ return;
103
+ }
104
+ logInfo('Overwriting existing installation...');
105
+ }
106
+
107
+ // Copy .vibe directory
108
+ logInfo('Copying .vibe directory...');
109
+ try {
110
+ if (fs.existsSync(vibeDir)) {
111
+ fs.rmSync(vibeDir, { recursive: true, force: true });
112
+ }
113
+ copyDirSync(VCK_SOURCE, vibeDir);
114
+ logSuccess('.vibe directory created');
115
+ } catch (error) {
116
+ logError(`Failed to copy .vibe directory: ${error.message}`);
117
+ return;
118
+ }
119
+
120
+ // Copy AGENTS.md
121
+ logInfo('Copying AGENTS.md...');
122
+ try {
123
+ const agentsMdSource = path.join(VCK_SOURCE, '..', 'AGENTS.md');
124
+ const agentsMdTarget = path.join(targetDir, 'AGENTS.md');
125
+
126
+ if (fs.existsSync(agentsMdSource)) {
127
+ fs.copyFileSync(agentsMdSource, agentsMdTarget);
128
+ logSuccess('AGENTS.md created');
129
+ } else {
130
+ // Create a basic AGENTS.md
131
+ const basicAgentsMd = `# Vibe Coder Kit
132
+
133
+ ## Kurallar
134
+ - Her adımda event kaydet
135
+ - Test yazmadan kod yazma
136
+ - Secret kullanma
137
+ - Budget aşıldığında dur
138
+
139
+ ## Kullanım
140
+ - \`vibe status\` - Durumu gƶster
141
+ - \`vibe doctor\` - Sağlık kontrolü
142
+ `;
143
+ fs.writeFileSync(agentsMdTarget, basicAgentsMd);
144
+ logSuccess('AGENTS.md created (basic)');
145
+ }
146
+ } catch (error) {
147
+ logWarning(`Failed to copy AGENTS.md: ${error.message}`);
148
+ }
149
+
150
+ // Initialize state directory
151
+ logInfo('Initializing state...');
152
+ const stateDir = path.join(vibeDir, 'state');
153
+ ensureDirectoryExists(stateDir);
154
+
155
+ const eventsFile = path.join(stateDir, 'events.jsonl');
156
+ if (!fs.existsSync(eventsFile)) {
157
+ fs.writeFileSync(eventsFile, '');
158
+ }
159
+
160
+ const derivedStateFile = path.join(stateDir, 'derived-state.json');
161
+ if (!fs.existsSync(derivedStateFile)) {
162
+ fs.writeFileSync(derivedStateFile, JSON.stringify({
163
+ currentPhase: 'init',
164
+ phaseHistory: [],
165
+ task: { title: '', description: '', priority: 'medium' },
166
+ decisions: [],
167
+ openQuestions: [],
168
+ scope: { inScope: [], outScope: [], decidedLater: [] },
169
+ blockerLog: [],
170
+ health: {
171
+ lastUpdated: new Date().toISOString(),
172
+ phaseDurationMinutes: 0,
173
+ openBlockers: 0,
174
+ },
175
+ }, null, 2));
176
+ }
177
+ logSuccess('State initialized');
178
+
179
+ // Initialize knowledge directory
180
+ logInfo('Initializing knowledge base...');
181
+ const knowledgeDir = path.join(vibeDir, 'memory', 'knowledge');
182
+ ensureDirectoryExists(knowledgeDir);
183
+
184
+ const indexPath = path.join(knowledgeDir, 'INDEX.md');
185
+ if (!fs.existsSync(indexPath)) {
186
+ fs.writeFileSync(indexPath, '# Knowledge Index\n\n| # | Date | Title | Tags | File |\n|---|------|-------|------|------|\n');
187
+ }
188
+ logSuccess('Knowledge base initialized');
189
+
190
+ // Initialize workspace directories
191
+ logInfo('Initializing workspace...');
192
+ const workspaceDirs = ['plans', 'reports', 'archive'];
193
+ for (const dir of workspaceDirs) {
194
+ ensureDirectoryExists(path.join(vibeDir, 'workspace', dir));
195
+ }
196
+ logSuccess('Workspace initialized');
197
+
198
+ log('\nāœ… Vibe Coder Kit installed successfully!\n', 'green');
199
+ log('Next steps:', 'bright');
200
+ log(' 1. Run "vibe doctor" to check health');
201
+ log(' 2. Run "vibe status" to see current state');
202
+ log(' 3. Start coding with AI assistance\n', 'bright');
203
+ }
204
+
205
+ function showStatus() {
206
+ log('\nšŸ“Š Vibe Coder Kit - Status\n', 'bright');
207
+
208
+ const targetDir = process.cwd();
209
+ const vibeDir = path.join(targetDir, '.vibe');
210
+
211
+ if (!fs.existsSync(vibeDir)) {
212
+ logError('Vibe Coder Kit not installed in this project');
213
+ logInfo('Run "vibe init" to install');
214
+ return;
215
+ }
216
+
217
+ // Read derived state
218
+ const derivedStateFile = path.join(vibeDir, 'state', 'derived-state.json');
219
+ if (fs.existsSync(derivedStateFile)) {
220
+ try {
221
+ const state = JSON.parse(fs.readFileSync(derivedStateFile, 'utf-8'));
222
+ log(`Current Phase: ${state.currentPhase}`, 'cyan');
223
+ log(`Last Updated: ${state.health.lastUpdated}`, 'cyan');
224
+ log(`Open Blockers: ${state.health.openBlockers}`, 'cyan');
225
+ } catch (error) {
226
+ logWarning('Failed to read state');
227
+ }
228
+ } else {
229
+ logWarning('No state found');
230
+ }
231
+
232
+ // Count events
233
+ const eventsFile = path.join(vibeDir, 'state', 'events.jsonl');
234
+ if (fs.existsSync(eventsFile)) {
235
+ const content = fs.readFileSync(eventsFile, 'utf-8');
236
+ const eventCount = content.split('\n').filter(l => l.trim()).length;
237
+ log(`Total Events: ${eventCount}`, 'cyan');
238
+ }
239
+
240
+ console.log('');
241
+ }
242
+
243
+ function runDoctor() {
244
+ log('\nšŸ„ Vibe Coder Kit - Health Check\n', 'bright');
245
+
246
+ const targetDir = process.cwd();
247
+ const vibeDir = path.join(targetDir, '.vibe');
248
+
249
+ const checks = [];
250
+
251
+ // Check .vibe directory
252
+ if (fs.existsSync(vibeDir)) {
253
+ logSuccess('.vibe directory exists');
254
+ checks.push({ name: 'Installation', status: 'ok' });
255
+ } else {
256
+ logError('.vibe directory not found');
257
+ checks.push({ name: 'Installation', status: 'error' });
258
+ }
259
+
260
+ // Check config.json
261
+ const configFile = path.join(vibeDir, 'config.json');
262
+ if (fs.existsSync(configFile)) {
263
+ try {
264
+ JSON.parse(fs.readFileSync(configFile, 'utf-8'));
265
+ logSuccess('config.json is valid');
266
+ checks.push({ name: 'Config', status: 'ok' });
267
+ } catch (error) {
268
+ logError('config.json is invalid');
269
+ checks.push({ name: 'Config', status: 'error' });
270
+ }
271
+ } else {
272
+ logWarning('config.json not found');
273
+ checks.push({ name: 'Config', status: 'warning' });
274
+ }
275
+
276
+ // Check phase-graph.json
277
+ const graphFile = path.join(vibeDir, 'phase-graph.json');
278
+ if (fs.existsSync(graphFile)) {
279
+ try {
280
+ JSON.parse(fs.readFileSync(graphFile, 'utf-8'));
281
+ logSuccess('phase-graph.json is valid');
282
+ checks.push({ name: 'Graph', status: 'ok' });
283
+ } catch (error) {
284
+ logError('phase-graph.json is invalid');
285
+ checks.push({ name: 'Graph', status: 'error' });
286
+ }
287
+ } else {
288
+ logWarning('phase-graph.json not found');
289
+ checks.push({ name: 'Graph', status: 'warning' });
290
+ }
291
+
292
+ // Check state directory
293
+ const stateDir = path.join(vibeDir, 'state');
294
+ if (fs.existsSync(stateDir)) {
295
+ logSuccess('State directory exists');
296
+ checks.push({ name: 'State', status: 'ok' });
297
+ } else {
298
+ logWarning('State directory not found');
299
+ checks.push({ name: 'State', status: 'warning' });
300
+ }
301
+
302
+ // Check knowledge directory
303
+ const knowledgeDir = path.join(vibeDir, 'memory', 'knowledge');
304
+ if (fs.existsSync(knowledgeDir)) {
305
+ logSuccess('Knowledge directory exists');
306
+ checks.push({ name: 'Knowledge', status: 'ok' });
307
+ } else {
308
+ logWarning('Knowledge directory not found');
309
+ checks.push({ name: 'Knowledge', status: 'warning' });
310
+ }
311
+
312
+ // Summary
313
+ const errors = checks.filter(c => c.status === 'error').length;
314
+ const warnings = checks.filter(c => c.status === 'warning').length;
315
+
316
+ console.log('');
317
+ if (errors === 0 && warnings === 0) {
318
+ logSuccess('All checks passed!');
319
+ } else if (errors === 0) {
320
+ logWarning(`${warnings} warning(s) found`);
321
+ } else {
322
+ logError(`${errors} error(s), ${warnings} warning(s) found`);
323
+ }
324
+ console.log('');
325
+ }
326
+
327
+ // Main CLI
328
+ const command = process.argv[2];
329
+
330
+ switch (command) {
331
+ case 'init':
332
+ initProject();
333
+ break;
334
+ case 'status':
335
+ showStatus();
336
+ break;
337
+ case 'doctor':
338
+ runDoctor();
339
+ break;
340
+ case 'version':
341
+ showVersion();
342
+ break;
343
+ case 'help':
344
+ case undefined:
345
+ showHelp();
346
+ break;
347
+ default:
348
+ logError(`Unknown command: ${command}`);
349
+ showHelp();
350
+ process.exit(1);
351
+ }
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "vibe-coder-kit",
3
+ "version": "6.0.0",
4
+ "description": "Production-ready AI agent workflow template with TypeScript enforcement",
5
+ "main": "dist/.vibe/core/index.js",
6
+ "types": "dist/.vibe/core/index.d.ts",
7
+ "bin": {
8
+ "vibe": "bin/vibe.js",
9
+ "vibe-coder-kit": "bin/vibe.js"
10
+ },
11
+ "files": [
12
+ "bin/",
13
+ ".vibe/",
14
+ "AGENTS.md",
15
+ "README.md"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "dev": "ts-node .vibe/core/cli.ts",
20
+ "start": "node dist/.vibe/core/cli.js",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest",
23
+ "lint": "eslint .vibe/core/**/*.ts",
24
+ "typecheck": "tsc --noEmit",
25
+ "postinstall": "node bin/vibe.js postinstall"
26
+ },
27
+ "dependencies": {
28
+ "yaml": "^2.4.0"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^20.11.0",
32
+ "typescript": "^5.3.0",
33
+ "ts-node": "^10.9.0",
34
+ "vitest": "^1.2.0",
35
+ "eslint": "^8.56.0",
36
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
37
+ "@typescript-eslint/parser": "^6.19.0"
38
+ },
39
+ "engines": {
40
+ "node": ">=18.0.0"
41
+ },
42
+ "keywords": [
43
+ "ai",
44
+ "agent",
45
+ "workflow",
46
+ "vibe-coder-kit",
47
+ "vibe",
48
+ "typescript",
49
+ "mcp",
50
+ "subagent"
51
+ ],
52
+ "author": "VCK Team",
53
+ "license": "MIT",
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "https://github.com/yourusername/vibe-coder-kit.git"
57
+ },
58
+ "homepage": "https://github.com/yourusername/vibe-coder-kit#readme",
59
+ "bugs": {
60
+ "url": "https://github.com/yourusername/vibe-coder-kit/issues"
61
+ }
62
+ }