codesyncer 1.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.
Files changed (61) hide show
  1. package/LICENSE +31 -0
  2. package/README.ko.md +417 -0
  3. package/README.md +417 -0
  4. package/bin/codesyncer.js +3 -0
  5. package/dist/commands/add-repo.d.ts +3 -0
  6. package/dist/commands/add-repo.d.ts.map +1 -0
  7. package/dist/commands/add-repo.js +145 -0
  8. package/dist/commands/add-repo.js.map +1 -0
  9. package/dist/commands/init.d.ts +3 -0
  10. package/dist/commands/init.d.ts.map +1 -0
  11. package/dist/commands/init.js +489 -0
  12. package/dist/commands/init.js.map +1 -0
  13. package/dist/commands/update.d.ts +3 -0
  14. package/dist/commands/update.d.ts.map +1 -0
  15. package/dist/commands/update.js +123 -0
  16. package/dist/commands/update.js.map +1 -0
  17. package/dist/constants/keywords.d.ts +23 -0
  18. package/dist/constants/keywords.d.ts.map +1 -0
  19. package/dist/constants/keywords.js +133 -0
  20. package/dist/constants/keywords.js.map +1 -0
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +52 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/templates/en/architecture.md +147 -0
  26. package/dist/templates/en/claude.md +267 -0
  27. package/dist/templates/en/comment_guide.md +324 -0
  28. package/dist/templates/en/decisions.md +227 -0
  29. package/dist/templates/en/master.md +179 -0
  30. package/dist/templates/ko/architecture.md +147 -0
  31. package/dist/templates/ko/claude.md +267 -0
  32. package/dist/templates/ko/comment_guide.md +324 -0
  33. package/dist/templates/ko/decisions.md +227 -0
  34. package/dist/templates/ko/master.md +179 -0
  35. package/dist/types.d.ts +78 -0
  36. package/dist/types.d.ts.map +1 -0
  37. package/dist/types.js +16 -0
  38. package/dist/types.js.map +1 -0
  39. package/dist/utils/messages.d.ts +129 -0
  40. package/dist/utils/messages.d.ts.map +1 -0
  41. package/dist/utils/messages.js +168 -0
  42. package/dist/utils/messages.js.map +1 -0
  43. package/dist/utils/scanner.d.ts +11 -0
  44. package/dist/utils/scanner.d.ts.map +1 -0
  45. package/dist/utils/scanner.js +311 -0
  46. package/dist/utils/scanner.js.map +1 -0
  47. package/dist/utils/template-loader.d.ts +18 -0
  48. package/dist/utils/template-loader.d.ts.map +1 -0
  49. package/dist/utils/template-loader.js +496 -0
  50. package/dist/utils/template-loader.js.map +1 -0
  51. package/package.json +70 -0
  52. package/src/templates/en/architecture.md +147 -0
  53. package/src/templates/en/claude.md +267 -0
  54. package/src/templates/en/comment_guide.md +324 -0
  55. package/src/templates/en/decisions.md +227 -0
  56. package/src/templates/en/master.md +179 -0
  57. package/src/templates/ko/architecture.md +147 -0
  58. package/src/templates/ko/claude.md +267 -0
  59. package/src/templates/ko/comment_guide.md +324 -0
  60. package/src/templates/ko/decisions.md +227 -0
  61. package/src/templates/ko/master.md +179 -0
package/README.md ADDED
@@ -0,0 +1,417 @@
1
+ # CodeSyncer CLI
2
+
3
+ > AI-powered multi-repository collaboration system that works seamlessly with Claude Code, Cursor, GitHub Copilot, and more!
4
+
5
+ [![npm version](https://img.shields.io/npm/v/codesyncer.svg)](https://www.npmjs.com/package/codesyncer)
6
+ [![License](https://img.shields.io/badge/License-Commons%20Clause-red.svg)](./LICENSE)
7
+ [![GitHub stars](https://img.shields.io/github/stars/bitjaru/codesyncer.svg)](https://github.com/bitjaru/codesyncer/stargazers)
8
+ [![GitHub issues](https://img.shields.io/github/issues/bitjaru/codesyncer.svg)](https://github.com/bitjaru/codesyncer/issues)
9
+
10
+ [한국어 문서](./README.ko.md) | English
11
+
12
+ ---
13
+
14
+ ## 🎯 What is CodeSyncer?
15
+
16
+ CodeSyncer is a CLI tool that sets up an intelligent collaboration system between you and AI coding assistants across multiple repositories. It helps AI understand your project structure, coding standards, and business decisions through a structured documentation system.
17
+
18
+ ### Key Features
19
+
20
+ - 🤖 **AI-Agnostic**: Works with Claude Code, Cursor, GitHub Copilot, and more
21
+ - 📁 **Multi-Repository Support**: Seamlessly work across backend, frontend, mobile repos
22
+ - 🏷️ **Comment Tag System**: `@codesyncer-*` tags to record decisions and inferences
23
+ - 🤝 **Discussion Auto-Pause**: Automatically stops for critical decisions (payment, security, etc.)
24
+ - 🌐 **Multi-Language**: Full Korean and English support
25
+ - ⚡ **Quick Setup**: One-command installation for your entire workspace
26
+
27
+ ---
28
+
29
+ ## 📦 Installation
30
+
31
+ ```bash
32
+ npm install -g codesyncer
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 🚀 Quick Start
38
+
39
+ ### 1. Navigate to your workspace root
40
+
41
+ ```bash
42
+ cd /path/to/your/workspace
43
+ ```
44
+
45
+ Your workspace should contain multiple repository folders:
46
+ ```
47
+ workspace/
48
+ ├── backend/
49
+ ├── frontend/
50
+ └── mobile/
51
+ ```
52
+
53
+ ### 2. Run initialization
54
+
55
+ ```bash
56
+ codesyncer init
57
+ ```
58
+
59
+ ### 3. Choose setup mode
60
+
61
+ **⚡ Quick Setup** (Recommended)
62
+ - Auto-detects all repositories
63
+ - Creates collaboration system in one step
64
+ - Enables all discussion keywords automatically
65
+
66
+ **🔧 Expert Setup**
67
+ - Full customization options
68
+ - Select specific keyword categories
69
+ - Add custom keywords
70
+
71
+ ### 4. Select language
72
+
73
+ Choose between Korean (한글) or English
74
+
75
+ ### 5. That's it!
76
+
77
+ CodeSyncer will:
78
+ - Scan and detect your repositories (Java, Python, Node.js, React, etc.)
79
+ - Create master document at workspace root (`.codesyncer/MASTER_CODESYNCER.md`)
80
+ - Generate collaboration files in each repo (`.claude/` folder)
81
+ - `CLAUDE.md` - Coding guidelines
82
+ - `COMMENT_GUIDE.md` - Comment tag usage guide
83
+ - `ARCHITECTURE.md` - Project structure (auto-updated)
84
+ - `DECISIONS.md` - Decision log
85
+
86
+ ---
87
+
88
+ ## 📚 Usage
89
+
90
+ ### Initialize collaboration system
91
+ ```bash
92
+ codesyncer init
93
+ ```
94
+
95
+ ### Update project structure
96
+ ```bash
97
+ codesyncer update
98
+ ```
99
+
100
+ ### Add new repository to workspace
101
+ ```bash
102
+ codesyncer add-repo
103
+ ```
104
+
105
+ ---
106
+
107
+ ## 🏷️ Comment Tag System
108
+
109
+ CodeSyncer uses a structured comment tag system to permanently record all AI inferences and decisions in your code.
110
+
111
+ ### Available Tags
112
+
113
+ | Tag | Purpose | Example |
114
+ |-----|---------|---------|
115
+ | `@codesyncer-rule` | Special rules for non-standard implementations | `// @codesyncer-rule: Use any type here (external lib has no types)` |
116
+ | `@codesyncer-inference` | AI inferred something with rationale | `// @codesyncer-inference: Page size 20 (standard UX)` |
117
+ | `@codesyncer-decision` | Post-discussion decision | `// @codesyncer-decision: [2024-10-15] Using Stripe (intl payment)` |
118
+ | `@codesyncer-todo` | Needs user confirmation | `// @codesyncer-todo: Confirm API endpoint URL` |
119
+ | `@codesyncer-context` | Business context explanation | `// @codesyncer-context: GDPR compliance (30-day retention)` |
120
+
121
+ ### Legacy Compatibility
122
+
123
+ Existing `@claude-*` tags are fully compatible:
124
+ ```typescript
125
+ @claude-rule = @codesyncer-rule
126
+ @claude-inference = @codesyncer-inference
127
+ @claude-decision = @codesyncer-decision
128
+ @claude-todo = @codesyncer-todo
129
+ @claude-context = @codesyncer-context
130
+ ```
131
+
132
+ ---
133
+
134
+ ## 🤝 Auto-Discussion System
135
+
136
+ CodeSyncer automatically pauses AI work when critical keywords are detected, preventing costly mistakes.
137
+
138
+ ### Critical Keywords (Auto-Enabled)
139
+
140
+ - **💰 Payment & Billing**: payment, billing, subscription, charge, refund
141
+ - **🔐 Auth & Security**: authentication, login, permission, encrypt, token, jwt
142
+ - **🗑️ Data Operations**: delete, remove, drop, migrate, schema change
143
+ - **📜 Privacy & Compliance**: personal data, GDPR, privacy, PII
144
+
145
+ ### How It Works
146
+
147
+ 1. AI detects keyword (e.g., "payment")
148
+ 2. **Automatically pauses work**
149
+ 3. Presents recommendation + alternatives
150
+ 4. Waits for your decision
151
+ 5. Records decision in `DECISIONS.md` + code comments
152
+ 6. Resumes work
153
+
154
+ ---
155
+
156
+ ## 🌍 Multi-Language Support
157
+
158
+ CodeSyncer fully supports both Korean and English:
159
+ - Installation prompts
160
+ - Generated documentation
161
+ - Comment guidelines
162
+ - All UI messages
163
+
164
+ Switch language anytime during setup or use language-specific commands.
165
+
166
+ ---
167
+
168
+ ## 🔧 Tech Stack Auto-Detection
169
+
170
+ CodeSyncer automatically detects your project type and tech stack:
171
+
172
+ **Supported:**
173
+ - ☕ Java (Spring Boot)
174
+ - 🐍 Python (Django, FastAPI)
175
+ - 📘 TypeScript / JavaScript
176
+ - ⚛️ React / Next.js
177
+ - 🟢 Node.js / Express
178
+ - 📱 React Native
179
+
180
+ Detection happens automatically by scanning:
181
+ - `package.json`, `pom.xml`, `build.gradle`, `requirements.txt`
182
+ - Folder structure and dependency lists
183
+
184
+ ---
185
+
186
+ ## 📖 Example Workflow
187
+
188
+ ### Scenario: Adding Payment Feature
189
+
190
+ ```bash
191
+ User: "Add Stripe payment integration"
192
+
193
+ AI: ⚠️ 'payment' keyword detected. Discussion needed.
194
+
195
+ 💡 Recommendation: Use Stripe
196
+
197
+ 🔄 Alternatives:
198
+ A. Iamport (Korea only)
199
+ B. Toss Payments
200
+ C. Custom implementation
201
+
202
+ How would you like to proceed?
203
+
204
+ User: "Proceed"
205
+
206
+ AI: ✅ Recording decision...
207
+
208
+ Creating:
209
+ - backend/src/services/PaymentService.ts
210
+ /**
211
+ * @codesyncer-decision: [2024-11-12] Using Stripe (international support)
212
+ * @codesyncer-context: Support USD, EUR, KRW
213
+ */
214
+
215
+ - frontend/src/components/PaymentForm.tsx
216
+ - DECISIONS.md updated
217
+
218
+ ✅ Payment integration complete!
219
+ ```
220
+
221
+ ---
222
+
223
+ ## 🎯 Why CodeSyncer?
224
+
225
+ ### Before CodeSyncer ❌
226
+ - AI makes assumptions about critical business logic
227
+ - No record of why decisions were made
228
+ - Lost context switching between repos
229
+ - Inconsistent coding patterns across team
230
+
231
+ ### After CodeSyncer ✅
232
+ - AI pauses for important decisions
233
+ - All decisions permanently recorded
234
+ - Seamless multi-repo workflows
235
+ - Consistent collaboration system
236
+ - Onboarding new team members takes minutes
237
+
238
+ ---
239
+
240
+ ## 🤖 Supported AI Tools
241
+
242
+ ### ✅ Currently Supported
243
+ - **Claude Code** (Full support)
244
+
245
+ ### 🚧 Coming Soon (Community Contributions Welcome!)
246
+ - Cursor
247
+ - GitHub Copilot
248
+ - Continue.dev
249
+ - Codeium
250
+
251
+ Want to add support for your favorite AI tool? [Contribute here!](https://github.com/bitjaru/codesyncer/issues)
252
+
253
+ ---
254
+
255
+ ## 📁 Project Structure
256
+
257
+ After running `codesyncer init`, your workspace will look like:
258
+
259
+ ```
260
+ workspace/
261
+ ├── .codesyncer/
262
+ │ └── MASTER_CODESYNCER.md # Multi-repo auto-switching guide
263
+ ├── backend/
264
+ │ └── .claude/
265
+ │ ├── CLAUDE.md # Coding guidelines
266
+ │ ├── COMMENT_GUIDE.md # Tag usage guide
267
+ │ ├── ARCHITECTURE.md # Project structure
268
+ │ └── DECISIONS.md # Decision log
269
+ ├── frontend/
270
+ │ └── .claude/
271
+ │ └── (same files)
272
+ └── mobile/
273
+ └── .claude/
274
+ └── (same files)
275
+ ```
276
+
277
+ ---
278
+
279
+ ## 🛠️ Advanced Usage
280
+
281
+ ### Custom Keywords
282
+
283
+ In Expert setup mode, you can add custom keywords:
284
+
285
+ ```bash
286
+ codesyncer init --mode expert
287
+ ```
288
+
289
+ Then select "Add custom keywords" and specify:
290
+ - Keywords to detect
291
+ - Severity level (CRITICAL/IMPORTANT/MINOR)
292
+ - Description
293
+
294
+ ### Updating Existing Projects
295
+
296
+ Run `codesyncer update` to:
297
+ - Refresh project structure in `ARCHITECTURE.md`
298
+ - Update comment tag statistics
299
+ - Rescan file structure
300
+
301
+ ---
302
+
303
+ ## 🔍 Searching Tags
304
+
305
+ Find all tagged comments in your codebase:
306
+
307
+ ```bash
308
+ # All inferences
309
+ grep -r "@codesyncer-inference" ./src
310
+
311
+ # All TODOs
312
+ grep -r "@codesyncer-todo" ./src
313
+
314
+ # All decisions
315
+ grep -r "@codesyncer-decision" ./src
316
+ ```
317
+
318
+ ---
319
+
320
+ ## 🤝 Contributing
321
+
322
+ We welcome contributions! CodeSyncer is open source and community-driven.
323
+
324
+ ### 🚀 Quick Start for Contributors
325
+
326
+ 1. **Fork** this repository
327
+ 2. **Clone** your fork: `git clone https://github.com/YOUR_USERNAME/codesyncer.git`
328
+ 3. **Create a branch**: `git checkout -b feature/amazing-feature`
329
+ 4. **Make changes** and commit: `git commit -m "feat: Add amazing feature"`
330
+ 5. **Push** to your fork: `git push origin feature/amazing-feature`
331
+ 6. **Open a Pull Request** on GitHub
332
+
333
+ ### 🎯 Priority Areas for Contribution
334
+
335
+ - 🤖 **Add support for more AI tools** (Cursor, Copilot, Continue.dev)
336
+ - 🌐 **Additional language translations** (Japanese, Chinese, Spanish)
337
+ - 📦 **More tech stack templates** (Go, Rust, Ruby, PHP)
338
+ - 📝 **Documentation improvements**
339
+ - 🐛 **Bug fixes**
340
+
341
+ ### 📖 Guidelines
342
+
343
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed contribution guidelines.
344
+
345
+ ### 💬 Questions?
346
+
347
+ - 📝 Open an [Issue](https://github.com/bitjaru/codesyncer/issues)
348
+ - 💡 Start a [Discussion](https://github.com/bitjaru/codesyncer/discussions)
349
+
350
+ ---
351
+
352
+ ## 📝 License
353
+
354
+ **Commons Clause License + MIT**
355
+
356
+ - ✅ **Free to use** for personal and non-commercial projects
357
+ - ✅ **Free to fork and modify** the code
358
+ - ✅ **Free to contribute** back to the project
359
+ - ❌ **Cannot sell** this software or provide it as a paid service
360
+
361
+ See [LICENSE](./LICENSE) file for full details.
362
+
363
+ **Why Commons Clause?**
364
+ We want CodeSyncer to remain free and accessible to all developers while preventing commercial exploitation. If you need a commercial license, please contact us.
365
+
366
+ ---
367
+
368
+ ## 🙋 FAQ
369
+
370
+ **Q: Does this only work with Claude Code?**
371
+ A: Currently, yes. But we're building support for Cursor, GitHub Copilot, and other tools. Contributions welcome!
372
+
373
+ **Q: Can I use this on a single repository?**
374
+ A: Yes! Just run `codesyncer init` in any repository. The multi-repo features are optional.
375
+
376
+ **Q: Will this slow down AI responses?**
377
+ A: No. CodeSyncer only adds documentation files that AI reads once per session. It actually makes AI more efficient by providing context upfront.
378
+
379
+ **Q: Can I customize the keyword detection?**
380
+ A: Yes, use Expert setup mode to fully customize which keywords trigger discussions.
381
+
382
+ **Q: Is my code/data sent anywhere?**
383
+ A: No. CodeSyncer is a purely local CLI tool that generates documentation files in your repos. Nothing is sent to external servers.
384
+
385
+ ---
386
+
387
+ ## 🌟 Show Your Support
388
+
389
+ If CodeSyncer helps your team, please:
390
+ - ⭐ Star this repo
391
+ - 🐦 Share on Twitter
392
+ - 📝 Write about your experience
393
+ - 🤝 Contribute improvements
394
+
395
+ ### 💰 Support Development
396
+
397
+ If you'd like to support the development of CodeSyncer, you can donate via cryptocurrency:
398
+
399
+ **Ethereum (ETH) / ERC-20 Tokens:**
400
+ ```
401
+ 0x0a12177c448778a37Fa4EeA57d33D06713F200De
402
+ ```
403
+
404
+ Your support helps maintain and improve CodeSyncer! 🙏
405
+
406
+ ---
407
+
408
+ ## 📮 Contact
409
+
410
+ - **Issues**: [GitHub Issues](https://github.com/bitjaru/codesyncer/issues)
411
+ - **Discussions**: [GitHub Discussions](https://github.com/bitjaru/codesyncer/discussions)
412
+
413
+ ---
414
+
415
+ **Built with ❤️ by the CodeSyncer community**
416
+
417
+ *Making AI collaboration seamless, one repo at a time.*
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ require('../dist/index.js');
@@ -0,0 +1,3 @@
1
+ import { AddRepoOptions } from '../types';
2
+ export declare function addRepoCommand(options: AddRepoOptions): Promise<void>;
3
+ //# sourceMappingURL=add-repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-repo.d.ts","sourceRoot":"","sources":["../../src/commands/add-repo.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAgC,MAAM,UAAU,CAAC;AAIxE,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,iBAkH3D"}
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.addRepoCommand = addRepoCommand;
40
+ const inquirer_1 = __importDefault(require("inquirer"));
41
+ const chalk_1 = __importDefault(require("chalk"));
42
+ const ora_1 = __importDefault(require("ora"));
43
+ const fs = __importStar(require("fs-extra"));
44
+ const path = __importStar(require("path"));
45
+ const scanner_1 = require("../utils/scanner");
46
+ const template_loader_1 = require("../utils/template-loader");
47
+ async function addRepoCommand(options) {
48
+ console.log(chalk_1.default.bold.cyan('\n➕ CodeSyncer - Add Repository\n'));
49
+ const currentDir = process.cwd();
50
+ // Check if master setup exists
51
+ if (!(await (0, scanner_1.hasMasterSetup)(currentDir))) {
52
+ console.log(chalk_1.default.red('✗ No CodeSyncer master setup found.'));
53
+ console.log(chalk_1.default.gray('Run `codesyncer init` first.\n'));
54
+ return;
55
+ }
56
+ // Scan for repositories
57
+ const spinner = (0, ora_1.default)('Scanning for repositories...').start();
58
+ const foundRepos = await (0, scanner_1.scanForRepositories)(currentDir);
59
+ spinner.succeed(`Found ${foundRepos.length} repositories`);
60
+ // Filter out repos that already have CodeSyncer setup
61
+ const reposWithoutSetup = foundRepos.filter((r) => !r.hasCodeSyncer);
62
+ if (reposWithoutSetup.length === 0) {
63
+ console.log(chalk_1.default.green('\n✓ All repositories already have CodeSyncer setup!\n'));
64
+ return;
65
+ }
66
+ console.log(chalk_1.default.bold('\n📁 Repositories without CodeSyncer:\n'));
67
+ reposWithoutSetup.forEach((repo) => {
68
+ console.log(` ${chalk_1.default.gray('○')} ${chalk_1.default.bold(repo.name)} - ${chalk_1.default.gray(repo.type)}`);
69
+ });
70
+ // Select repository to add
71
+ const { selectedRepo } = await inquirer_1.default.prompt([
72
+ {
73
+ type: 'list',
74
+ name: 'selectedRepo',
75
+ message: 'Select repository to add CodeSyncer:',
76
+ choices: reposWithoutSetup.map((repo) => ({
77
+ name: `${repo.name} (${repo.type})`,
78
+ value: repo.name,
79
+ })),
80
+ },
81
+ ]);
82
+ const repo = foundRepos.find((r) => r.name === selectedRepo);
83
+ // Collect repository configuration
84
+ console.log(chalk_1.default.bold.cyan(`\n📦 Configure ${repo.name}:\n`));
85
+ const answers = await inquirer_1.default.prompt([
86
+ {
87
+ type: 'input',
88
+ name: 'projectName',
89
+ message: 'Project/Repository name:',
90
+ default: repo.name,
91
+ },
92
+ {
93
+ type: 'list',
94
+ name: 'type',
95
+ message: 'Project type:',
96
+ choices: ['frontend', 'backend', 'mobile', 'fullstack'],
97
+ default: repo.type,
98
+ },
99
+ {
100
+ type: 'input',
101
+ name: 'techStack',
102
+ message: 'Tech stack (comma-separated):',
103
+ default: 'TypeScript, Node.js',
104
+ filter: (input) => input.split(',').map((s) => s.trim()),
105
+ },
106
+ ]);
107
+ // Generate documents
108
+ const setupSpinner = (0, ora_1.default)(`Setting up ${repo.name}...`).start();
109
+ try {
110
+ const claudeDir = path.join(currentDir, repo.name, '.claude');
111
+ await fs.ensureDir(claudeDir);
112
+ const repoConfig = {
113
+ projectName: answers.projectName,
114
+ type: answers.type,
115
+ techStack: answers.techStack,
116
+ language: options.lang,
117
+ keywordCategories: [], // Add-repo doesn't configure keywords
118
+ };
119
+ // Generate all repository documents
120
+ const claudeDoc = await (0, template_loader_1.generateRepoDoc)('CLAUDE', repoConfig);
121
+ const commentGuide = await (0, template_loader_1.generateRepoDoc)('COMMENT_GUIDE', repoConfig);
122
+ const architecture = await (0, template_loader_1.generateRepoDoc)('ARCHITECTURE', repoConfig);
123
+ const decisions = await (0, template_loader_1.generateRepoDoc)('DECISIONS', repoConfig);
124
+ await fs.writeFile(path.join(claudeDir, 'CLAUDE.md'), claudeDoc, 'utf-8');
125
+ await fs.writeFile(path.join(claudeDir, 'COMMENT_GUIDE.md'), commentGuide, 'utf-8');
126
+ await fs.writeFile(path.join(claudeDir, 'ARCHITECTURE.md'), architecture, 'utf-8');
127
+ await fs.writeFile(path.join(claudeDir, 'DECISIONS.md'), decisions, 'utf-8');
128
+ setupSpinner.succeed(`Set up ${repo.name}`);
129
+ // Success message
130
+ console.log(chalk_1.default.bold.green('\n✅ Repository setup complete!\n'));
131
+ console.log(chalk_1.default.bold('📁 Created:\n'));
132
+ console.log(` ${chalk_1.default.cyan(`${repo.name}/.claude/`)}`);
133
+ console.log(` ├── CLAUDE.md ${chalk_1.default.gray('(Coding rules)')}`);
134
+ console.log(` ├── COMMENT_GUIDE.md ${chalk_1.default.gray('(Comment tags guide)')}`);
135
+ console.log(` ├── ARCHITECTURE.md ${chalk_1.default.gray('(Project structure)')}`);
136
+ console.log(` └── DECISIONS.md ${chalk_1.default.gray('(Decision log)')}\n`);
137
+ console.log(chalk_1.default.bold('📝 Next step:\n'));
138
+ console.log(` ${chalk_1.default.cyan('Run:')} codesyncer update ${chalk_1.default.gray('(to update master documentation)')}\n`);
139
+ }
140
+ catch (error) {
141
+ setupSpinner.fail(`Failed to set up ${repo.name}`);
142
+ console.error(chalk_1.default.red('\nError:'), error);
143
+ }
144
+ }
145
+ //# sourceMappingURL=add-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-repo.js","sourceRoot":"","sources":["../../src/commands/add-repo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,wCAkHC;AA3HD,wDAAgC;AAChC,kDAA0B;AAC1B,8CAAsB;AACtB,6CAA+B;AAC/B,2CAA6B;AAE7B,8CAAuE;AACvE,8DAA2D;AAEpD,KAAK,UAAU,cAAc,CAAC,OAAuB;IAC1D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC;IAElE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAEjC,+BAA+B;IAC/B,IAAI,CAAC,CAAC,MAAM,IAAA,wBAAc,EAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,CAAC;QAC1D,OAAO;IACT,CAAC;IAED,wBAAwB;IACxB,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,8BAA8B,CAAC,CAAC,KAAK,EA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Ae,CAAC,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,KAAK,eAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,+BAA+B,eAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC3E,OAAO,CAAC,GAAG,CAAC,+BAA+B,eAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;QACjF,OAAO,CAAC,GAAG,CAAC,+BAA+B,eAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,+BAA+B,eAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAE7E,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,eAAK,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,eAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,IAAI,CAAC,CAAC;IAC/G,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAY,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { InitOptions } from '../types';
2
+ export declare function initCommand(options: InitOptions): Promise<void>;
3
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAoH,MAAM,UAAU,CAAC;AAMzJ,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,iBAkErD"}