scaffold-doc-cli 1.0.1 → 1.0.3
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/.github/workflows/ai-doc-sync.yml +13 -4
- package/index.js +195 -178
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ on:
|
|
|
8
8
|
|
|
9
9
|
permissions:
|
|
10
10
|
contents: write
|
|
11
|
+
pull-requests: write
|
|
11
12
|
|
|
12
13
|
jobs:
|
|
13
14
|
doc-completion:
|
|
@@ -30,8 +31,16 @@ jobs:
|
|
|
30
31
|
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
31
32
|
run: node .github/scripts/doc-sync.mjs
|
|
32
33
|
|
|
33
|
-
- name:
|
|
34
|
-
uses:
|
|
34
|
+
- name: Create Pull Request
|
|
35
|
+
uses: peter-evans/create-pull-request@v5
|
|
35
36
|
with:
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
38
|
+
commit-message: "docs: auto-generated documentation updates"
|
|
39
|
+
title: "docs: AI-generated documentation updates"
|
|
40
|
+
body: |
|
|
41
|
+
Automatic documentation updates generated by AI based on recent code changes.
|
|
42
|
+
|
|
43
|
+
Please review and merge if accurate.
|
|
44
|
+
branch: ai-docs/${{ github.ref_name }}
|
|
45
|
+
base: ${{ github.head_ref || github.ref_name }}
|
|
46
|
+
delete-branch: true
|
package/index.js
CHANGED
|
@@ -8,53 +8,61 @@ import { fileURLToPath } from 'url';
|
|
|
8
8
|
|
|
9
9
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
10
10
|
|
|
11
|
+
// Handle version check
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
if (args.includes('-v') || args.includes('--version')) {
|
|
14
|
+
const packageJson = await fs.readJson(path.join(__dirname, 'package.json'));
|
|
15
|
+
console.log(packageJson.version);
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
async function init() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
20
|
+
console.log(chalk.green.bold('Welcome to the Motin Documentation Initializer! 🚀'));
|
|
21
|
+
|
|
22
|
+
const answers = await inquirer.prompt([
|
|
23
|
+
{
|
|
24
|
+
type: 'input',
|
|
25
|
+
name: 'projectName',
|
|
26
|
+
message: 'What is the name of your project?',
|
|
27
|
+
default: path.basename(process.cwd()),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'list',
|
|
31
|
+
name: 'stack',
|
|
32
|
+
message: 'Which technical stack are you using?',
|
|
33
|
+
choices: [
|
|
34
|
+
new inquirer.Separator('--- JavaScript/TypeScript ---'),
|
|
35
|
+
'Nuxt', 'Next.js', 'Vue', 'React', 'Angular', 'Svelte', 'Node (Express/NestJS)',
|
|
36
|
+
new inquirer.Separator('--- PHP ---'),
|
|
37
|
+
'Laravel', 'Symfony', 'Generic PHP',
|
|
38
|
+
new inquirer.Separator('--- Python ---'),
|
|
39
|
+
'Django', 'FastAPI', 'Flask', 'Generic Python',
|
|
40
|
+
new inquirer.Separator('--- Other ---'),
|
|
41
|
+
'Java (Spring)', 'Ruby (Rails)', 'Go', 'Rust', 'Other'
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
type: 'confirm',
|
|
46
|
+
name: 'includeWorkflow',
|
|
47
|
+
message: 'Do you want to include a GitHub Workflow for AI doc completion?',
|
|
48
|
+
default: true,
|
|
49
|
+
},
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
const docsDir = path.join(process.cwd(), '.docs');
|
|
53
|
+
const referenceDir = path.join(docsDir, 'reference');
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
const relativeDocsDir = path.relative(process.cwd(), docsDir);
|
|
57
|
+
console.log(chalk.blue(`\nCreating documentation directory at ./${relativeDocsDir}...`));
|
|
58
|
+
await fs.ensureDir(docsDir);
|
|
59
|
+
await fs.ensureDir(referenceDir);
|
|
60
|
+
|
|
61
|
+
// 1. Create Standard Files
|
|
62
|
+
// ------------------------
|
|
63
|
+
|
|
64
|
+
// index.md
|
|
65
|
+
const indexContent = `<!--
|
|
58
66
|
AI_DOC_START
|
|
59
67
|
CONTEXT: This is the entry point for the project documentation.
|
|
60
68
|
INSTRUCTION: Analyze the project structure and update the "Overview" section.
|
|
@@ -70,10 +78,10 @@ Documentation initialized.
|
|
|
70
78
|
- [Getting Started](./getting-started.md)
|
|
71
79
|
- [Architecture](./architecture.md)
|
|
72
80
|
`;
|
|
73
|
-
|
|
81
|
+
await fs.writeFile(path.join(docsDir, 'index.md'), indexContent);
|
|
74
82
|
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
// getting-started.md
|
|
84
|
+
const gettingStartedContent = `# Getting Started
|
|
77
85
|
|
|
78
86
|
<!--
|
|
79
87
|
INSTRUCTION: Document the installation and setup steps.
|
|
@@ -87,10 +95,10 @@ Documentation initialized.
|
|
|
87
95
|
<!-- AI_CONTENT_START -->
|
|
88
96
|
<!-- AI_CONTENT_END -->
|
|
89
97
|
`;
|
|
90
|
-
|
|
98
|
+
await fs.writeFile(path.join(docsDir, 'getting-started.md'), gettingStartedContent);
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
// architecture.md
|
|
101
|
+
const architectureContent = `# Architecture
|
|
94
102
|
|
|
95
103
|
<!--
|
|
96
104
|
INSTRUCTION: Document the high-level system architecture, data flow, and key design decisions.
|
|
@@ -100,31 +108,31 @@ Documentation initialized.
|
|
|
100
108
|
<!-- AI_CONTENT_START -->
|
|
101
109
|
<!-- AI_CONTENT_END -->
|
|
102
110
|
`;
|
|
103
|
-
|
|
111
|
+
await fs.writeFile(path.join(docsDir, 'architecture.md'), architectureContent);
|
|
104
112
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
// 2. Create Stack Specific Files (Granular)
|
|
114
|
+
// ----------------------------------------
|
|
115
|
+
const stackConfig = getStackConfig(answers.stack);
|
|
108
116
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
// Generate each reference file defined in the config
|
|
118
|
+
for (const [filename, contentGenerator] of Object.entries(stackConfig.files)) {
|
|
119
|
+
await fs.writeFile(path.join(referenceDir, filename), contentGenerator());
|
|
120
|
+
}
|
|
113
121
|
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
console.log(chalk.green('✔ Standard documentation files created'));
|
|
123
|
+
console.log(chalk.green(`✔ ${Object.keys(stackConfig.files).length} reference doc(s) created`));
|
|
116
124
|
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
// 3. Create MkDocs Config
|
|
126
|
+
// -----------------------
|
|
119
127
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
// Construct navigation for Reference section
|
|
129
|
+
const referenceNav = Object.keys(stackConfig.files).map(filename => {
|
|
130
|
+
// Convert 'controllers.md' -> 'Controllers'
|
|
131
|
+
const title = filename.replace('.md', '').charAt(0).toUpperCase() + filename.replace('.md', '').slice(1);
|
|
132
|
+
return ` - ${title}: reference/${filename}`;
|
|
133
|
+
}).join('\n');
|
|
126
134
|
|
|
127
|
-
|
|
135
|
+
const mkdocsContent = `site_name: ${answers.projectName} Documentation
|
|
128
136
|
docs_dir: .docs
|
|
129
137
|
theme: readthedocs
|
|
130
138
|
|
|
@@ -135,19 +143,19 @@ nav:
|
|
|
135
143
|
- Reference:
|
|
136
144
|
${referenceNav}
|
|
137
145
|
`;
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
await fs.writeFile(path.join(process.cwd(), 'mkdocs.yml'), mkdocsContent);
|
|
147
|
+
console.log(chalk.green('✔ mkdocs.yml created'));
|
|
140
148
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
149
|
+
// 4. Create GitHub Workflow & AI Script
|
|
150
|
+
// -------------------------
|
|
151
|
+
if (answers.includeWorkflow) {
|
|
152
|
+
const workflowDir = path.join(process.cwd(), '.github', 'workflows');
|
|
153
|
+
const scriptsDir = path.join(process.cwd(), '.github', 'scripts');
|
|
154
|
+
await fs.ensureDir(workflowDir);
|
|
155
|
+
await fs.ensureDir(scriptsDir);
|
|
148
156
|
|
|
149
|
-
|
|
150
|
-
|
|
157
|
+
// Workflow File
|
|
158
|
+
const workflowContent = `name: AI Doc Sync
|
|
151
159
|
|
|
152
160
|
on:
|
|
153
161
|
push:
|
|
@@ -157,6 +165,7 @@ on:
|
|
|
157
165
|
|
|
158
166
|
permissions:
|
|
159
167
|
contents: write
|
|
168
|
+
pull-requests: write
|
|
160
169
|
|
|
161
170
|
jobs:
|
|
162
171
|
doc-completion:
|
|
@@ -179,17 +188,25 @@ jobs:
|
|
|
179
188
|
GEMINI_API_KEY: \${{ secrets.GEMINI_API_KEY }}
|
|
180
189
|
run: node .github/scripts/doc-sync.mjs
|
|
181
190
|
|
|
182
|
-
- name:
|
|
183
|
-
uses:
|
|
191
|
+
- name: Create Pull Request
|
|
192
|
+
uses: peter-evans/create-pull-request@v5
|
|
184
193
|
with:
|
|
185
|
-
|
|
186
|
-
|
|
194
|
+
token: \${{ secrets.GITHUB_TOKEN }}
|
|
195
|
+
commit-message: "docs: auto-generated documentation updates"
|
|
196
|
+
title: "docs: AI-generated documentation updates"
|
|
197
|
+
body: |
|
|
198
|
+
Automatic documentation updates generated by AI based on recent code changes.
|
|
199
|
+
|
|
200
|
+
Please review and merge if accurate.
|
|
201
|
+
branch: ai-docs/\${{ github.ref_name }}
|
|
202
|
+
base: \${{ github.head_ref || github.ref_name }}
|
|
203
|
+
delete-branch: true
|
|
187
204
|
`;
|
|
188
|
-
|
|
189
|
-
|
|
205
|
+
await fs.writeFile(path.join(workflowDir, 'ai-doc-sync.yml'), workflowContent);
|
|
206
|
+
console.log(chalk.green('✔ .github/workflows/ai-doc-sync.yml created'));
|
|
190
207
|
|
|
191
|
-
|
|
192
|
-
|
|
208
|
+
// AI Sync Script
|
|
209
|
+
const scriptContent = `import { GoogleGenAI } from "@google/genai";
|
|
193
210
|
import fs from 'fs';
|
|
194
211
|
import path from 'path';
|
|
195
212
|
import { execSync } from 'child_process';
|
|
@@ -271,112 +288,112 @@ async function main() {
|
|
|
271
288
|
}
|
|
272
289
|
|
|
273
290
|
main();`;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
console.log(chalk.green.bold('\nDocumentation scaffolding complete! 🎉'));
|
|
279
|
-
console.log(chalk.yellow('Next steps:'));
|
|
280
|
-
console.log(`1. Review the generated files in ./${relativeDocsDir}`);
|
|
281
|
-
console.log('2. Run "mkdocs serve" to preview your documentation');
|
|
282
|
-
console.log('3. Commit the changes');
|
|
283
|
-
|
|
284
|
-
} catch (err) {
|
|
285
|
-
console.error(chalk.red('Error creating documentation files:'), err);
|
|
291
|
+
await fs.writeFile(path.join(scriptsDir, 'doc-sync.mjs'), scriptContent);
|
|
292
|
+
console.log(chalk.green('✔ .github/scripts/doc-sync.mjs created'));
|
|
286
293
|
}
|
|
294
|
+
|
|
295
|
+
console.log(chalk.green.bold('\nDocumentation scaffolding complete! 🎉'));
|
|
296
|
+
console.log(chalk.yellow('Next steps:'));
|
|
297
|
+
console.log(`1. Review the generated files in ./${relativeDocsDir}`);
|
|
298
|
+
console.log('2. Run "mkdocs serve" to preview your documentation');
|
|
299
|
+
console.log('3. Commit the changes');
|
|
300
|
+
|
|
301
|
+
} catch (err) {
|
|
302
|
+
console.error(chalk.red('Error creating documentation files:'), err);
|
|
303
|
+
}
|
|
287
304
|
}
|
|
288
305
|
|
|
289
306
|
// Config Factory
|
|
290
307
|
function getStackConfig(stack) {
|
|
291
|
-
|
|
308
|
+
const commonHeader = (type) => `<!--
|
|
292
309
|
AI_DOC_START
|
|
293
310
|
STACK: ${stack}
|
|
294
311
|
TYPE: ${type}
|
|
295
312
|
-->\n`;
|
|
296
313
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
// --- PHP: Laravel ---
|
|
309
|
-
if (stack.includes('Laravel')) {
|
|
310
|
-
return {
|
|
311
|
-
files: {
|
|
312
|
-
'controllers.md': () => `${commonHeader('Controllers')}# Controllers\n\n<!-- INSTRUCTION: Document Http Controllers found in /app/Http/Controllers -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
313
|
-
'models.md': () => `${commonHeader('Models')}# Models\n\n<!-- INSTRUCTION: Document Eloquent Models found in /app/Models -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
314
|
-
'routes.md': () => `${commonHeader('Routes')}# Routes\n\n<!-- INSTRUCTION: Document application routes found in /routes -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
}
|
|
314
|
+
// --- PHP: Symfony ---
|
|
315
|
+
if (stack.includes('Symfony')) {
|
|
316
|
+
return {
|
|
317
|
+
files: {
|
|
318
|
+
'controllers.md': () => `${commonHeader('Controllers')}# Controllers\n\n<!-- INSTRUCTION: Document all Symfony Controllers found in /src/Controller -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
319
|
+
'entities.md': () => `${commonHeader('Entities')}# Entities\n\n<!-- INSTRUCTION: Document all Doctrine Entities found in /src/Entity -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
320
|
+
'services.md': () => `${commonHeader('Services')}# Services\n\n<!-- INSTRUCTION: Document core application services found in /src/Service -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
}
|
|
318
324
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
// --- PHP: Laravel ---
|
|
326
|
+
if (stack.includes('Laravel')) {
|
|
327
|
+
return {
|
|
328
|
+
files: {
|
|
329
|
+
'controllers.md': () => `${commonHeader('Controllers')}# Controllers\n\n<!-- INSTRUCTION: Document Http Controllers found in /app/Http/Controllers -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
330
|
+
'models.md': () => `${commonHeader('Models')}# Models\n\n<!-- INSTRUCTION: Document Eloquent Models found in /app/Models -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
331
|
+
'routes.md': () => `${commonHeader('Routes')}# Routes\n\n<!-- INSTRUCTION: Document application routes found in /routes -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
}
|
|
329
335
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
336
|
+
// --- JS: Nuxt ---
|
|
337
|
+
if (stack.includes('Nuxt')) {
|
|
338
|
+
return {
|
|
339
|
+
files: {
|
|
340
|
+
'components.md': () => `${commonHeader('Components')}# Components\n\n<!-- INSTRUCTION: Document Vue components in /components -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
341
|
+
'composables.md': () => `${commonHeader('Composables')}# Composables\n\n<!-- INSTRUCTION: Document auto-imported composables in /composables -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
342
|
+
'server-routes.md': () => `${commonHeader('Server Routes')}# Server Routes\n\n<!-- INSTRUCTION: Document Nitro server routes in /server/api -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
}
|
|
340
346
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
347
|
+
// --- JS: General (React, Next, Vue) ---
|
|
348
|
+
if (stack.includes('React') || stack.includes('Next') || stack.includes('Vue') || stack.includes('Angular') || stack.includes('Svelte')) {
|
|
349
|
+
return {
|
|
350
|
+
files: {
|
|
351
|
+
'components.md': () => `${commonHeader('Components')}# Components\n\n<!-- INSTRUCTION: Document UI components -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
352
|
+
'hooks.md': () => `${commonHeader('Hooks')}# Hooks\n\n<!-- INSTRUCTION: Document custom hooks/composables -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
353
|
+
'api.md': () => `${commonHeader('API')}# API Integration\n\n<!-- INSTRUCTION: Document API clients or fetch wrappers -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
}
|
|
351
357
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
358
|
+
// --- Python: Django ---
|
|
359
|
+
if (stack.includes('Django')) {
|
|
360
|
+
return {
|
|
361
|
+
files: {
|
|
362
|
+
'models.md': () => `${commonHeader('Models')}# Models\n\n<!-- INSTRUCTION: Document Django Models -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
363
|
+
'views.md': () => `${commonHeader('Views')}# Views\n\n<!-- INSTRUCTION: Document Django Views/ViewSets -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
364
|
+
'admin.md': () => `${commonHeader('Admin')}# Admin Customization\n\n<!-- INSTRUCTION: Document Admin classes -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
}
|
|
361
368
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
369
|
+
// --- Python: FastAPI ---
|
|
370
|
+
if (stack.includes('FastAPI')) {
|
|
371
|
+
return {
|
|
372
|
+
files: {
|
|
373
|
+
'endpoints.md': () => `${commonHeader('Endpoints')}# Endpoints\n\n<!-- INSTRUCTION: Document FastAPI routes and decorators -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
374
|
+
'models.md': () => `${commonHeader('Models')}# Pydantic Models\n\n<!-- INSTRUCTION: Document Pydantic models -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
372
378
|
|
|
373
|
-
|
|
379
|
+
// --- Java/Spring ---
|
|
380
|
+
if (stack.includes('Spring') || stack.includes('Java')) {
|
|
374
381
|
return {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
382
|
+
files: {
|
|
383
|
+
'controllers.md': () => `${commonHeader('Controllers')}# Controllers\n\n<!-- INSTRUCTION: Document REST Controllers -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
384
|
+
'services.md': () => `${commonHeader('Services')}# Services\n\n<!-- INSTRUCTION: Document Service beans -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
385
|
+
'domain.md': () => `${commonHeader('Domain')}# Domain Models\n\n<!-- INSTRUCTION: Document Entity classes -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
386
|
+
}
|
|
379
387
|
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// --- Default Fallback ---
|
|
391
|
+
return {
|
|
392
|
+
files: {
|
|
393
|
+
'api.md': () => `${commonHeader('API')}# API Reference\n\n<!-- INSTRUCTION: Document public API endpoints -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
394
|
+
'modules.md': () => `${commonHeader('Modules')}# Core Modules\n\n<!-- INSTRUCTION: Document core logical modules -->\n\n## List\n<!-- AI_CONTENT_START -->\n<!-- AI_CONTENT_END -->`,
|
|
395
|
+
}
|
|
396
|
+
};
|
|
380
397
|
}
|
|
381
398
|
|
|
382
399
|
init();
|