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