@ai-coders/context 0.2.1 → 0.3.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 (168) hide show
  1. package/README.md +113 -580
  2. package/dist/generators/agents/agentGenerator.d.ts +6 -9
  3. package/dist/generators/agents/agentGenerator.d.ts.map +1 -1
  4. package/dist/generators/agents/agentGenerator.js +89 -32
  5. package/dist/generators/agents/agentGenerator.js.map +1 -1
  6. package/dist/generators/agents/index.d.ts +0 -2
  7. package/dist/generators/agents/index.d.ts.map +1 -1
  8. package/dist/generators/agents/index.js +1 -5
  9. package/dist/generators/agents/index.js.map +1 -1
  10. package/dist/generators/agents/templates/index.d.ts +4 -0
  11. package/dist/generators/agents/templates/index.d.ts.map +1 -0
  12. package/dist/generators/agents/templates/index.js +8 -0
  13. package/dist/generators/agents/templates/index.js.map +1 -0
  14. package/dist/generators/agents/templates/indexTemplate.d.ts +3 -0
  15. package/dist/generators/agents/templates/indexTemplate.d.ts.map +1 -0
  16. package/dist/generators/agents/templates/indexTemplate.js +35 -0
  17. package/dist/generators/agents/templates/indexTemplate.js.map +1 -0
  18. package/dist/generators/agents/templates/playbookTemplate.d.ts +4 -0
  19. package/dist/generators/agents/templates/playbookTemplate.d.ts.map +1 -0
  20. package/dist/generators/agents/templates/playbookTemplate.js +63 -0
  21. package/dist/generators/agents/templates/playbookTemplate.js.map +1 -0
  22. package/dist/generators/agents/templates/types.d.ts +14 -0
  23. package/dist/generators/agents/templates/types.d.ts.map +1 -0
  24. package/dist/generators/agents/templates/types.js +3 -0
  25. package/dist/generators/agents/templates/types.js.map +1 -0
  26. package/dist/generators/documentation/documentationGenerator.d.ts +9 -15
  27. package/dist/generators/documentation/documentationGenerator.d.ts.map +1 -1
  28. package/dist/generators/documentation/documentationGenerator.js +65 -77
  29. package/dist/generators/documentation/documentationGenerator.js.map +1 -1
  30. package/dist/generators/documentation/guideRegistry.d.ts +6 -0
  31. package/dist/generators/documentation/guideRegistry.d.ts.map +1 -0
  32. package/dist/generators/documentation/guideRegistry.js +82 -0
  33. package/dist/generators/documentation/guideRegistry.js.map +1 -0
  34. package/dist/generators/documentation/index.d.ts +0 -6
  35. package/dist/generators/documentation/index.d.ts.map +1 -1
  36. package/dist/generators/documentation/index.js +1 -17
  37. package/dist/generators/documentation/index.js.map +1 -1
  38. package/dist/generators/documentation/templates/architectureTemplate.d.ts +3 -0
  39. package/dist/generators/documentation/templates/architectureTemplate.d.ts.map +1 -0
  40. package/dist/generators/documentation/templates/architectureTemplate.js +66 -0
  41. package/dist/generators/documentation/templates/architectureTemplate.js.map +1 -0
  42. package/dist/generators/documentation/templates/common.d.ts +7 -0
  43. package/dist/generators/documentation/templates/common.d.ts.map +1 -0
  44. package/dist/generators/documentation/templates/common.js +58 -0
  45. package/dist/generators/documentation/templates/common.js.map +1 -0
  46. package/dist/generators/documentation/templates/dataFlowTemplate.d.ts +3 -0
  47. package/dist/generators/documentation/templates/dataFlowTemplate.d.ts.map +1 -0
  48. package/dist/generators/documentation/templates/dataFlowTemplate.js +55 -0
  49. package/dist/generators/documentation/templates/dataFlowTemplate.js.map +1 -0
  50. package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts +2 -0
  51. package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts.map +1 -0
  52. package/dist/generators/documentation/templates/developmentWorkflowTemplate.js +59 -0
  53. package/dist/generators/documentation/templates/developmentWorkflowTemplate.js.map +1 -0
  54. package/dist/generators/documentation/templates/frontMatter.d.ts +11 -0
  55. package/dist/generators/documentation/templates/frontMatter.d.ts.map +1 -0
  56. package/dist/generators/documentation/templates/frontMatter.js +29 -0
  57. package/dist/generators/documentation/templates/frontMatter.js.map +1 -0
  58. package/dist/generators/documentation/templates/glossaryTemplate.d.ts +3 -0
  59. package/dist/generators/documentation/templates/glossaryTemplate.d.ts.map +1 -0
  60. package/dist/generators/documentation/templates/glossaryTemplate.js +55 -0
  61. package/dist/generators/documentation/templates/glossaryTemplate.js.map +1 -0
  62. package/dist/generators/documentation/templates/index.d.ts +11 -0
  63. package/dist/generators/documentation/templates/index.d.ts.map +1 -0
  64. package/dist/generators/documentation/templates/index.js +22 -0
  65. package/dist/generators/documentation/templates/index.js.map +1 -0
  66. package/dist/generators/documentation/templates/indexTemplate.d.ts +3 -0
  67. package/dist/generators/documentation/templates/indexTemplate.d.ts.map +1 -0
  68. package/dist/generators/documentation/templates/indexTemplate.js +56 -0
  69. package/dist/generators/documentation/templates/indexTemplate.js.map +1 -0
  70. package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts +3 -0
  71. package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts.map +1 -0
  72. package/dist/generators/documentation/templates/projectOverviewTemplate.js +68 -0
  73. package/dist/generators/documentation/templates/projectOverviewTemplate.js.map +1 -0
  74. package/dist/generators/documentation/templates/securityTemplate.d.ts +2 -0
  75. package/dist/generators/documentation/templates/securityTemplate.d.ts.map +1 -0
  76. package/dist/generators/documentation/templates/securityTemplate.js +53 -0
  77. package/dist/generators/documentation/templates/securityTemplate.js.map +1 -0
  78. package/dist/generators/documentation/templates/testingTemplate.d.ts +2 -0
  79. package/dist/generators/documentation/templates/testingTemplate.d.ts.map +1 -0
  80. package/dist/generators/documentation/templates/testingTemplate.js +59 -0
  81. package/dist/generators/documentation/templates/testingTemplate.js.map +1 -0
  82. package/dist/generators/documentation/templates/toolingTemplate.d.ts +2 -0
  83. package/dist/generators/documentation/templates/toolingTemplate.d.ts.map +1 -0
  84. package/dist/generators/documentation/templates/toolingTemplate.js +56 -0
  85. package/dist/generators/documentation/templates/toolingTemplate.js.map +1 -0
  86. package/dist/generators/documentation/templates/types.d.ts +23 -0
  87. package/dist/generators/documentation/templates/types.d.ts.map +1 -0
  88. package/dist/generators/documentation/templates/types.js +3 -0
  89. package/dist/generators/documentation/templates/types.js.map +1 -0
  90. package/dist/generators/documentation/templates.d.ts +31 -0
  91. package/dist/generators/documentation/templates.d.ts.map +1 -0
  92. package/dist/generators/documentation/templates.js +566 -0
  93. package/dist/generators/documentation/templates.js.map +1 -0
  94. package/dist/generators/plans/index.d.ts +2 -0
  95. package/dist/generators/plans/index.d.ts.map +1 -0
  96. package/dist/generators/plans/index.js +6 -0
  97. package/dist/generators/plans/index.js.map +1 -0
  98. package/dist/generators/plans/planGenerator.d.ts +22 -0
  99. package/dist/generators/plans/planGenerator.d.ts.map +1 -0
  100. package/dist/generators/plans/planGenerator.js +109 -0
  101. package/dist/generators/plans/planGenerator.js.map +1 -0
  102. package/dist/generators/plans/templates/indexTemplate.d.ts +3 -0
  103. package/dist/generators/plans/templates/indexTemplate.d.ts.map +1 -0
  104. package/dist/generators/plans/templates/indexTemplate.js +36 -0
  105. package/dist/generators/plans/templates/indexTemplate.js.map +1 -0
  106. package/dist/generators/plans/templates/planTemplate.d.ts +3 -0
  107. package/dist/generators/plans/templates/planTemplate.d.ts.map +1 -0
  108. package/dist/generators/plans/templates/planTemplate.js +83 -0
  109. package/dist/generators/plans/templates/planTemplate.js.map +1 -0
  110. package/dist/generators/plans/templates/types.d.ts +19 -0
  111. package/dist/generators/plans/templates/types.d.ts.map +1 -0
  112. package/dist/generators/plans/templates/types.js +3 -0
  113. package/dist/generators/plans/templates/types.js.map +1 -0
  114. package/dist/generators/shared/contextGenerator.d.ts +2 -7
  115. package/dist/generators/shared/contextGenerator.d.ts.map +1 -1
  116. package/dist/generators/shared/contextGenerator.js +2 -98
  117. package/dist/generators/shared/contextGenerator.js.map +1 -1
  118. package/dist/generators/shared/directoryTemplateHelpers.d.ts +2 -0
  119. package/dist/generators/shared/directoryTemplateHelpers.d.ts.map +1 -0
  120. package/dist/generators/shared/directoryTemplateHelpers.js +12 -0
  121. package/dist/generators/shared/directoryTemplateHelpers.js.map +1 -0
  122. package/dist/generators/shared/index.d.ts +1 -0
  123. package/dist/generators/shared/index.d.ts.map +1 -1
  124. package/dist/generators/shared/index.js +3 -1
  125. package/dist/generators/shared/index.js.map +1 -1
  126. package/dist/index.d.ts +6 -4
  127. package/dist/index.d.ts.map +1 -1
  128. package/dist/index.js +1300 -609
  129. package/dist/index.js.map +1 -1
  130. package/dist/utils/cliUI.d.ts +6 -4
  131. package/dist/utils/cliUI.d.ts.map +1 -1
  132. package/dist/utils/cliUI.js +71 -56
  133. package/dist/utils/cliUI.js.map +1 -1
  134. package/dist/utils/i18n.d.ts +181 -0
  135. package/dist/utils/i18n.d.ts.map +1 -0
  136. package/dist/utils/i18n.js +401 -0
  137. package/dist/utils/i18n.js.map +1 -0
  138. package/package.json +26 -23
  139. package/prompts/update_plan_prompt.md +42 -0
  140. package/prompts/update_scaffold_prompt.md +48 -0
  141. package/dist/generators/agentGenerator.d.ts +0 -23
  142. package/dist/generators/agentGenerator.d.ts.map +0 -1
  143. package/dist/generators/agentGenerator.js +0 -357
  144. package/dist/generators/agentGenerator.js.map +0 -1
  145. package/dist/generators/documentation/enhancedDocumentationGenerator.d.ts +0 -21
  146. package/dist/generators/documentation/enhancedDocumentationGenerator.d.ts.map +0 -1
  147. package/dist/generators/documentation/enhancedDocumentationGenerator.js +0 -216
  148. package/dist/generators/documentation/enhancedDocumentationGenerator.js.map +0 -1
  149. package/dist/generators/documentation/newDocumentationTemplates.d.ts +0 -19
  150. package/dist/generators/documentation/newDocumentationTemplates.d.ts.map +0 -1
  151. package/dist/generators/documentation/newDocumentationTemplates.js +0 -307
  152. package/dist/generators/documentation/newDocumentationTemplates.js.map +0 -1
  153. package/dist/generators/documentationGenerator.d.ts +0 -22
  154. package/dist/generators/documentationGenerator.d.ts.map +0 -1
  155. package/dist/generators/documentationGenerator.js +0 -235
  156. package/dist/generators/documentationGenerator.js.map +0 -1
  157. package/dist/generators/documentationTemplates.d.ts +0 -16
  158. package/dist/generators/documentationTemplates.d.ts.map +0 -1
  159. package/dist/generators/documentationTemplates.js +0 -326
  160. package/dist/generators/documentationTemplates.js.map +0 -1
  161. package/dist/generators/documentationUtils.d.ts +0 -7
  162. package/dist/generators/documentationUtils.d.ts.map +0 -1
  163. package/dist/generators/documentationUtils.js +0 -38
  164. package/dist/generators/documentationUtils.js.map +0 -1
  165. package/dist/generators/incrementalDocumentationGenerator.d.ts +0 -33
  166. package/dist/generators/incrementalDocumentationGenerator.d.ts.map +0 -1
  167. package/dist/generators/incrementalDocumentationGenerator.js +0 -400
  168. package/dist/generators/incrementalDocumentationGenerator.js.map +0 -1
@@ -1,13 +1,10 @@
1
1
  import { RepoStructure } from '../../types';
2
- import { FileMapper } from '../../utils/fileMapper';
3
- import { BaseLLMClient } from '../../services/baseLLMClient';
4
2
  export declare class AgentGenerator {
5
- private llmClient;
6
- private contextUtils;
7
- private promptFormatter;
8
- constructor(fileMapper: FileMapper, llmClient: BaseLLMClient);
9
- generateAgentPrompts(repoStructure: RepoStructure, outputDir: string, verbose?: boolean): Promise<void>;
10
- private generateAgentPrompt;
11
- private generateAgentIndex;
3
+ private readonly docTouchpoints;
4
+ constructor(..._legacyArgs: unknown[]);
5
+ generateAgentPrompts(repoStructure: RepoStructure, outputDir: string, selectedAgentTypes?: string[], verbose?: boolean): Promise<number>;
6
+ private resolveAgentSelection;
7
+ private buildContext;
8
+ private formatDirectoryList;
12
9
  }
13
10
  //# sourceMappingURL=agentGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agentGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/agents/agentGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAM7D,qBAAa,cAAc;IAMvB,OAAO,CAAC,SAAS;IALnB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,eAAe,CAAkB;gBAGvC,UAAU,EAAE,UAAU,EACd,SAAS,EAAE,aAAa;IAM5B,oBAAoB,CACxB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,IAAI,CAAC;YA4BF,mBAAmB;YA0BnB,kBAAkB;CAOjC"}
1
+ {"version":3,"file":"agentGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/agents/agentGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAe5C,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CA8C7B;gBAEU,GAAG,WAAW,EAAE,OAAO,EAAE;IAG/B,oBAAoB,CACxB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,MAAM,CAAC;IAuBlB,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,mBAAmB;CAO5B"}
@@ -35,45 +35,102 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.AgentGenerator = void 0;
37
37
  const path = __importStar(require("path"));
38
- const agentTypes_1 = require("./agentTypes");
39
- const contextUtils_1 = require("./contextUtils");
40
- const promptFormatter_1 = require("./promptFormatter");
41
38
  const shared_1 = require("../shared");
39
+ const agentTypes_1 = require("./agentTypes");
40
+ const templates_1 = require("./templates");
42
41
  class AgentGenerator {
43
- constructor(fileMapper, llmClient) {
44
- this.llmClient = llmClient;
45
- this.contextUtils = new contextUtils_1.ContextUtils(fileMapper);
46
- this.promptFormatter = new promptFormatter_1.PromptFormatter();
42
+ constructor(..._legacyArgs) {
43
+ this.docTouchpoints = [
44
+ {
45
+ title: 'Documentation Index',
46
+ path: '../docs/README.md',
47
+ marker: 'ai-task:docs-index'
48
+ },
49
+ {
50
+ title: 'Project Overview',
51
+ path: '../docs/project-overview.md',
52
+ marker: 'ai-task:project-overview'
53
+ },
54
+ {
55
+ title: 'Architecture Notes',
56
+ path: '../docs/architecture.md',
57
+ marker: 'ai-task:architecture-notes'
58
+ },
59
+ {
60
+ title: 'Development Workflow',
61
+ path: '../docs/development-workflow.md',
62
+ marker: 'ai-task:development-workflow'
63
+ },
64
+ {
65
+ title: 'Testing Strategy',
66
+ path: '../docs/testing-strategy.md',
67
+ marker: 'ai-task:testing-strategy'
68
+ },
69
+ {
70
+ title: 'Glossary & Domain Concepts',
71
+ path: '../docs/glossary.md',
72
+ marker: 'ai-task:glossary'
73
+ },
74
+ {
75
+ title: 'Data Flow & Integrations',
76
+ path: '../docs/data-flow.md',
77
+ marker: 'ai-task:data-flow'
78
+ },
79
+ {
80
+ title: 'Security & Compliance Notes',
81
+ path: '../docs/security.md',
82
+ marker: 'ai-task:security'
83
+ },
84
+ {
85
+ title: 'Tooling & Productivity Guide',
86
+ path: '../docs/tooling.md',
87
+ marker: 'ai-task:tooling'
88
+ }
89
+ ];
47
90
  }
48
- async generateAgentPrompts(repoStructure, outputDir, verbose = false) {
91
+ async generateAgentPrompts(repoStructure, outputDir, selectedAgentTypes, verbose = false) {
49
92
  const agentsDir = path.join(outputDir, 'agents');
50
- await shared_1.GeneratorUtils.ensureDirectoryAndLog(agentsDir, verbose, '🤖 Generating agent prompts in');
51
- const repoContext = this.contextUtils.createRepoContext(repoStructure);
52
- const fileContext = await this.contextUtils.createFileContext(repoStructure);
53
- for (const agentType of agentTypes_1.AGENT_TYPES) {
54
- try {
55
- const fileName = `${agentType}.md`;
56
- const agentPrompt = await this.generateAgentPrompt(agentType, repoContext, fileContext, repoStructure);
57
- const agentPath = path.join(agentsDir, fileName);
58
- await shared_1.GeneratorUtils.writeFileWithLogging(agentPath, agentPrompt, verbose);
59
- }
60
- catch (error) {
61
- shared_1.GeneratorUtils.logError(`Error generating ${agentType}`, error, verbose);
62
- }
93
+ await shared_1.GeneratorUtils.ensureDirectoryAndLog(agentsDir, verbose, 'Generating agent scaffold in');
94
+ const context = this.buildContext(repoStructure);
95
+ const agentTypes = this.resolveAgentSelection(selectedAgentTypes);
96
+ let created = 0;
97
+ for (const agentType of agentTypes) {
98
+ const content = (0, templates_1.renderAgentPlaybook)(agentType, context.topLevelDirectories, this.docTouchpoints);
99
+ const filePath = path.join(agentsDir, `${agentType}.md`);
100
+ await shared_1.GeneratorUtils.writeFileWithLogging(filePath, content, verbose, `Created ${agentType}.md`);
101
+ created += 1;
63
102
  }
64
- // Generate master agent index
65
- await this.generateAgentIndex(agentsDir, verbose);
103
+ const indexPath = path.join(agentsDir, 'README.md');
104
+ const indexContent = (0, templates_1.renderAgentIndex)(agentTypes);
105
+ await shared_1.GeneratorUtils.writeFileWithLogging(indexPath, indexContent, verbose, 'Created README.md');
106
+ created += 1;
107
+ return created;
66
108
  }
67
- async generateAgentPrompt(agentType, repoContext, fileContext, repoStructure) {
68
- const structureOverview = this.contextUtils.createStructureOverview(repoStructure);
69
- const agentPrompt = await this.llmClient.generateAgentPrompt(structureOverview, fileContext, agentType);
70
- return this.promptFormatter.formatAgentPrompt(agentType, agentPrompt, repoContext);
109
+ resolveAgentSelection(selected) {
110
+ if (!selected || selected.length === 0) {
111
+ return agentTypes_1.AGENT_TYPES;
112
+ }
113
+ const allowed = new Set(agentTypes_1.AGENT_TYPES);
114
+ const filtered = selected.filter((agent) => allowed.has(agent));
115
+ return (filtered.length > 0 ? filtered : agentTypes_1.AGENT_TYPES);
71
116
  }
72
- async generateAgentIndex(agentsDir, verbose) {
73
- const fileName = 'README.md';
74
- const indexContent = this.promptFormatter.generateAgentIndex();
75
- const indexPath = path.join(agentsDir, fileName);
76
- await shared_1.GeneratorUtils.writeFileWithLogging(indexPath, indexContent, verbose);
117
+ buildContext(repoStructure) {
118
+ const directorySet = new Set();
119
+ repoStructure.directories.forEach(dir => {
120
+ const [firstSegment] = dir.relativePath.split(/[\\/]/).filter(Boolean);
121
+ if (firstSegment) {
122
+ directorySet.add(firstSegment);
123
+ }
124
+ });
125
+ return {
126
+ topLevelDirectories: Array.from(directorySet).sort()
127
+ };
128
+ }
129
+ formatDirectoryList(topLevelDirectories) {
130
+ if (topLevelDirectories.length === 0) {
131
+ return '';
132
+ }
133
+ return topLevelDirectories.map(dir => `- \`${dir}/\` — Note why this directory matters for the agent.`).join('\n');
77
134
  }
78
135
  }
79
136
  exports.AgentGenerator = AgentGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"agentGenerator.js","sourceRoot":"","sources":["../../../src/generators/agents/agentGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAI7B,6CAAsD;AACtD,iDAA8C;AAC9C,uDAAoD;AACpD,sCAA2C;AAE3C,MAAa,cAAc;IAIzB,YACE,UAAsB,EACd,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;QAEhC,IAAI,CAAC,YAAY,GAAG,IAAI,2BAAY,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,CAAC,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;IAC/C,CAAC;IAED,KAAK,CAAC,oBAAoB,CACxB,aAA4B,EAC5B,SAAiB,EACjB,UAAmB,KAAK;QAExB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,uBAAc,CAAC,qBAAqB,CAAC,SAAS,EAAE,OAAO,EAAE,gCAAgC,CAAC,CAAC;QAEjG,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QAE7E,KAAK,MAAM,SAAS,IAAI,wBAAW,EAAE,CAAC;YACpC,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,GAAG,SAAS,KAAK,CAAC;gBACnC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAChD,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,CACd,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AAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAkB,CAAC,CAAC,CAAC;QACjG,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,wBAAW,CAAyB,CAAC;IAChF,CAAC;IAEO,YAAY,CAAC,aAA4B;QAC/C,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;QAEvC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACtC,MAAM,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACvE,IAAI,YAAY,EAAE,CAAC;gBACjB,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACjC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE;SACrD,CAAC;IACJ,CAAC;IAEO,mBAAmB,CAAC,mBAA6B;QACvD,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,sDAAsD,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrH,CAAC;CACF;AAhHD,wCAgHC"}
@@ -1,6 +1,4 @@
1
1
  export { AgentGenerator } from './agentGenerator';
2
2
  export { AGENT_TYPES, AgentType, IMPORTANT_FILES } from './agentTypes';
3
3
  export { AGENT_RESPONSIBILITIES, AGENT_BEST_PRACTICES } from './agentConfig';
4
- export { ContextUtils } from './contextUtils';
5
- export { PromptFormatter } from './promptFormatter';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PromptFormatter = exports.ContextUtils = exports.AGENT_BEST_PRACTICES = exports.AGENT_RESPONSIBILITIES = exports.IMPORTANT_FILES = exports.AGENT_TYPES = exports.AgentGenerator = void 0;
3
+ exports.AGENT_BEST_PRACTICES = exports.AGENT_RESPONSIBILITIES = exports.IMPORTANT_FILES = exports.AGENT_TYPES = exports.AgentGenerator = void 0;
4
4
  var agentGenerator_1 = require("./agentGenerator");
5
5
  Object.defineProperty(exports, "AgentGenerator", { enumerable: true, get: function () { return agentGenerator_1.AgentGenerator; } });
6
6
  var agentTypes_1 = require("./agentTypes");
@@ -9,8 +9,4 @@ Object.defineProperty(exports, "IMPORTANT_FILES", { enumerable: true, get: funct
9
9
  var agentConfig_1 = require("./agentConfig");
10
10
  Object.defineProperty(exports, "AGENT_RESPONSIBILITIES", { enumerable: true, get: function () { return agentConfig_1.AGENT_RESPONSIBILITIES; } });
11
11
  Object.defineProperty(exports, "AGENT_BEST_PRACTICES", { enumerable: true, get: function () { return agentConfig_1.AGENT_BEST_PRACTICES; } });
12
- var contextUtils_1 = require("./contextUtils");
13
- Object.defineProperty(exports, "ContextUtils", { enumerable: true, get: function () { return contextUtils_1.ContextUtils; } });
14
- var promptFormatter_1 = require("./promptFormatter");
15
- Object.defineProperty(exports, "PromptFormatter", { enumerable: true, get: function () { return promptFormatter_1.PromptFormatter; } });
16
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/agents/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,2CAAuE;AAA9D,yGAAA,WAAW,OAAA;AAAa,6GAAA,eAAe,OAAA;AAChD,6CAA6E;AAApE,qHAAA,sBAAsB,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AACrD,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/agents/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,2CAAuE;AAA9D,yGAAA,WAAW,OAAA;AAAa,6GAAA,eAAe,OAAA;AAChD,6CAA6E;AAApE,qHAAA,sBAAsB,OAAA;AAAE,mHAAA,oBAAoB,OAAA"}
@@ -0,0 +1,4 @@
1
+ export { renderAgentPlaybook } from './playbookTemplate';
2
+ export { renderAgentIndex } from './indexTemplate';
3
+ export type { AgentTemplateContext, DocTouchpoint } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generators/agents/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderAgentIndex = exports.renderAgentPlaybook = void 0;
4
+ var playbookTemplate_1 = require("./playbookTemplate");
5
+ Object.defineProperty(exports, "renderAgentPlaybook", { enumerable: true, get: function () { return playbookTemplate_1.renderAgentPlaybook; } });
6
+ var indexTemplate_1 = require("./indexTemplate");
7
+ Object.defineProperty(exports, "renderAgentIndex", { enumerable: true, get: function () { return indexTemplate_1.renderAgentIndex; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generators/agents/templates/index.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AAAhD,uHAAA,mBAAmB,OAAA;AAC5B,iDAAmD;AAA1C,iHAAA,gBAAgB,OAAA"}
@@ -0,0 +1,3 @@
1
+ import { AgentType } from '../agentTypes';
2
+ export declare function renderAgentIndex(agentTypes: readonly AgentType[]): string;
3
+ //# sourceMappingURL=indexTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/agents/templates/indexTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAwBzE"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderAgentIndex = renderAgentIndex;
4
+ const agentConfig_1 = require("../agentConfig");
5
+ function renderAgentIndex(agentTypes) {
6
+ const agentEntries = agentTypes.map(type => {
7
+ const title = formatTitle(type);
8
+ const primaryResponsibility = agentConfig_1.AGENT_RESPONSIBILITIES[type]?.[0] || 'Document responsibilities here.';
9
+ return `- [${title}](./${type}.md) — ${primaryResponsibility}`;
10
+ }).join('\n');
11
+ return `# Agent Handbook
12
+
13
+ This directory contains ready-to-customize playbooks for AI agents collaborating on the repository.
14
+
15
+ ## Available Agents
16
+ ${agentEntries}
17
+
18
+ ## How To Use These Playbooks
19
+ 1. Pick the agent that matches your task.
20
+ 2. Enrich the template with project-specific context or links.
21
+ 3. Share the final prompt with your AI assistant.
22
+ 4. Capture learnings in the relevant documentation file so future runs improve.
23
+
24
+ ## Related Resources
25
+ - [Documentation Index](../docs/README.md)
26
+ - [Contributor Guidelines](../AGENTS.md)
27
+ `;
28
+ }
29
+ function formatTitle(agentType) {
30
+ return agentType
31
+ .split('-')
32
+ .map(segment => segment.charAt(0).toUpperCase() + segment.slice(1))
33
+ .join(' ');
34
+ }
35
+ //# sourceMappingURL=indexTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexTemplate.js","sourceRoot":"","sources":["../../../../src/generators/agents/templates/indexTemplate.ts"],"names":[],"mappings":";;AAGA,4CAwBC;AA1BD,gDAAwD;AAExD,SAAgB,gBAAgB,CAAC,UAAgC;IAC/D,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACzC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,qBAAqB,GAAG,oCAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,iCAAiC,CAAC;QACrG,OAAO,MAAM,KAAK,OAAO,IAAI,UAAU,qBAAqB,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO;;;;;EAKP,YAAY;;;;;;;;;;;CAWb,CAAC;AACF,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB;IACpC,OAAO,SAAS;SACb,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClE,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AgentType } from '../agentTypes';
2
+ import { DocTouchpoint } from './types';
3
+ export declare function renderAgentPlaybook(agentType: AgentType, topLevelDirectories: string[], touchpoints: DocTouchpoint[]): string;
4
+ //# sourceMappingURL=playbookTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playbookTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/agents/templates/playbookTemplate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,MAAM,EAAE,EAC7B,WAAW,EAAE,aAAa,EAAE,GAC3B,MAAM,CA8CR"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderAgentPlaybook = renderAgentPlaybook;
4
+ const agentConfig_1 = require("../agentConfig");
5
+ const directoryTemplateHelpers_1 = require("../../shared/directoryTemplateHelpers");
6
+ function renderAgentPlaybook(agentType, topLevelDirectories, touchpoints) {
7
+ const title = formatTitle(agentType);
8
+ const responsibilities = agentConfig_1.AGENT_RESPONSIBILITIES[agentType] || ['Clarify this agent\'s responsibilities.'];
9
+ const bestPractices = agentConfig_1.AGENT_BEST_PRACTICES[agentType] || ['Document preferred workflows.'];
10
+ const directoryList = (0, directoryTemplateHelpers_1.formatDirectoryList)(topLevelDirectories);
11
+ const touchpointList = touchpoints
12
+ .map(tp => `- [${tp.title}](${tp.path}) — ${tp.marker}`)
13
+ .join('\n');
14
+ return `# ${title} Agent Playbook
15
+
16
+ ## Mission
17
+ Describe how the ${title.toLowerCase()} agent supports the team and when to engage it.
18
+
19
+ ## Responsibilities
20
+ ${formatList(responsibilities)}
21
+
22
+ ## Best Practices
23
+ ${formatList(bestPractices)}
24
+
25
+ ## Key Project Resources
26
+ - Documentation index: [docs/README.md](../docs/README.md)
27
+ - Agent handbook: [agents/README.md](./README.md)
28
+ - Contributor guide: [AGENTS.md](../AGENTS.md)
29
+
30
+ ## Repository Starting Points
31
+ ${directoryList || '- Add directory highlights relevant to this agent.'}
32
+
33
+ ## Documentation Touchpoints
34
+ ${touchpointList}
35
+
36
+ ## Collaboration Checklist
37
+ 1. Confirm assumptions with issue reporters or maintainers.
38
+ 2. Review open pull requests affecting this area.
39
+ 3. Update the relevant doc section listed above and remove any resolved \`ai-slot\` placeholders.
40
+ 4. Capture learnings back in [docs/README.md](../docs/README.md) or the appropriate task marker.
41
+
42
+ ## Hand-off Notes
43
+ Summarize outcomes, remaining risks, and suggested follow-up actions after the agent completes its work.
44
+
45
+ ## Evidence to Capture
46
+ - Reference commits, issues, or ADRs used to justify updates.
47
+ - Command output or logs that informed recommendations.
48
+ - Follow-up items for maintainers or future agent runs.
49
+ `;
50
+ }
51
+ function formatTitle(agentType) {
52
+ return agentType
53
+ .split('-')
54
+ .map(segment => segment.charAt(0).toUpperCase() + segment.slice(1))
55
+ .join(' ');
56
+ }
57
+ function formatList(items) {
58
+ if (!items.length) {
59
+ return '- _No entries defined yet._';
60
+ }
61
+ return items.map(item => `- ${item}`).join('\n');
62
+ }
63
+ //# sourceMappingURL=playbookTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playbookTemplate.js","sourceRoot":"","sources":["../../../../src/generators/agents/templates/playbookTemplate.ts"],"names":[],"mappings":";;AAKA,kDAkDC;AAvDD,gDAA8E;AAE9E,oFAA4E;AAG5E,SAAgB,mBAAmB,CACjC,SAAoB,EACpB,mBAA6B,EAC7B,WAA4B;IAE5B,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,C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ouchpoint {
3
+ title: string;
4
+ path: string;
5
+ marker: string;
6
+ }
7
+ export interface AgentTemplateContext {
8
+ agentType: AgentType;
9
+ topLevelDirectories: string[];
10
+ docTouchpoints: DocTouchpoint[];
11
+ responsibilities: string[];
12
+ bestPractices: string[];
13
+ }
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/generators/agents/templates/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/generators/agents/templates/types.ts"],"names":[],"mappings":""}
@@ -1,19 +1,13 @@
1
1
  import { RepoStructure } from '../../types';
2
- import { FileMapper } from '../../utils/fileMapper';
3
- import { BaseLLMClient } from '../../services/baseLLMClient';
4
- import { DocumentationConfig } from './documentationTypes';
2
+ interface DocumentationGenerationConfig {
3
+ selectedDocs?: string[];
4
+ }
5
5
  export declare class DocumentationGenerator {
6
- private fileMapper;
7
- private llmClient;
8
- private moduleGrouper;
9
- private templates;
10
- constructor(fileMapper: FileMapper, llmClient: BaseLLMClient);
11
- generateDocumentation(repoStructure: RepoStructure, outputDir: string, config?: Partial<DocumentationConfig>, verbose?: boolean): Promise<void>;
12
- private generateAllDocumentation;
13
- private generateMainIndex;
14
- generateMentalModelOnly(repoStructure: RepoStructure, outputDir: string, verbose?: boolean): Promise<void>;
15
- generateAIGuidelinesOnly(repoStructure: RepoStructure, outputDir: string, verbose?: boolean): Promise<void>;
16
- generateArchitectureDecisionsOnly(repoStructure: RepoStructure, outputDir: string, verbose?: boolean): Promise<void>;
17
- generateSoftwareGuidelinesOnly(repoStructure: RepoStructure, outputDir: string, verbose?: boolean): Promise<void>;
6
+ private readonly guides;
7
+ constructor(..._legacyArgs: unknown[]);
8
+ generateDocumentation(repoStructure: RepoStructure, outputDir: string, config?: DocumentationGenerationConfig, verbose?: boolean): Promise<number>;
9
+ private buildContext;
10
+ private getDocSections;
18
11
  }
12
+ export {};
19
13
  //# sourceMappingURL=documentationGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"documentationGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/documentation/documentationGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAI7D,OAAO,EAAE,mBAAmB,EAAgD,MAAM,sBAAsB,CAAC;AAEzG,qBAAa,sBAAsB;IAK/B,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,SAAS;IALnB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,SAAS,CAAyB;gBAGhC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,aAAa;IAM5B,qBAAqB,CACzB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,OAAO,CAAC,mBAAmB,CAAM,EACzC,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,IAAI,CAAC;YAkBF,wBAAwB;YAsCxB,iBAAiB;IAWzB,uBAAuB,CAC3B,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,IAAI,CAAC;IAWV,wBAAwB,CAC5B,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,IAAI,CAAC;IAWV,iCAAiC,CACrC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,IAAI,CAAC;IAWV,8BAA8B,CAClC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,IAAI,CAAC;CAUjB"}
1
+ {"version":3,"file":"documentationGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/documentation/documentationGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAsB5C,UAAU,6BAA6B;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;gBAE3C,GAAG,WAAW,EAAE,OAAO,EAAE;IAE/B,qBAAqB,CACzB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,6BAAkC,EAC1C,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,MAAM,CAAC;IAmBlB,OAAO,CAAC,YAAY;IA+BpB,OAAO,CAAC,cAAc;CAiCvB"}
@@ -35,92 +35,80 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.DocumentationGenerator = void 0;
37
37
  const path = __importStar(require("path"));
38
- const moduleGrouper_1 = require("../moduleGrouper");
39
38
  const shared_1 = require("../shared");
40
- const documentationTemplates_1 = require("./documentationTemplates");
41
- const documentationTypes_1 = require("./documentationTypes");
39
+ const templates_1 = require("./templates");
40
+ const guideRegistry_1 = require("./guideRegistry");
42
41
  class DocumentationGenerator {
43
- constructor(fileMapper, llmClient) {
44
- this.fileMapper = fileMapper;
45
- this.llmClient = llmClient;
46
- this.moduleGrouper = new moduleGrouper_1.ModuleGrouper(fileMapper);
47
- this.templates = new documentationTemplates_1.DocumentationTemplates(llmClient, fileMapper);
42
+ constructor(..._legacyArgs) {
43
+ this.guides = guideRegistry_1.DOCUMENT_GUIDES;
48
44
  }
49
45
  async generateDocumentation(repoStructure, outputDir, config = {}, verbose = false) {
50
- const fullConfig = {
51
- focusAreas: [],
52
- maxContentLength: 2000,
53
- includeExamples: true,
54
- enabledTypes: documentationTypes_1.DOCUMENTATION_TYPES_ARRAY,
55
- ...config
56
- };
57
46
  const docsDir = path.join(outputDir, 'docs');
58
- await shared_1.GeneratorUtils.ensureDirectoryAndLog(docsDir, verbose, '📚 Generating documentation in');
59
- const moduleGroups = this.moduleGrouper.getModuleGroups(repoStructure);
60
- await this.generateAllDocumentation(repoStructure, moduleGroups, docsDir, fullConfig.enabledTypes || documentationTypes_1.DOCUMENTATION_TYPES_ARRAY, verbose);
61
- await this.generateMainIndex(docsDir, fullConfig.enabledTypes || documentationTypes_1.DOCUMENTATION_TYPES_ARRAY, verbose);
47
+ await shared_1.GeneratorUtils.ensureDirectoryAndLog(docsDir, verbose, 'Generating documentation scaffold in');
48
+ const guidesToGenerate = (0, guideRegistry_1.getGuidesByKeys)(config.selectedDocs);
49
+ const context = this.buildContext(repoStructure, guidesToGenerate);
50
+ const sections = this.getDocSections(guidesToGenerate);
51
+ let created = 0;
52
+ for (const section of sections) {
53
+ const targetPath = path.join(docsDir, section.fileName);
54
+ const content = section.content(context);
55
+ await shared_1.GeneratorUtils.writeFileWithLogging(targetPath, content, verbose, `Created ${section.fileName}`);
56
+ created += 1;
57
+ }
58
+ return created;
62
59
  }
63
- async generateAllDocumentation(repoStructure, moduleGroups, docsDir, enabledTypes, verbose) {
64
- shared_1.GeneratorUtils.logProgress('🧠 Generating high-level conceptual documentation...', verbose);
65
- const generators = {
66
- 'mental-model': () => this.templates.createMentalModel(repoStructure, moduleGroups),
67
- 'architecture-decisions': () => this.templates.createArchitectureDecisions(repoStructure, moduleGroups),
68
- 'code-organization': () => this.templates.createCodeOrganization(repoStructure, moduleGroups),
69
- 'development-patterns': () => this.templates.createDevelopmentPatterns(repoStructure, moduleGroups),
70
- 'ai-guidelines': () => this.templates.createAIGuidelines(repoStructure, moduleGroups),
71
- 'contributing-workflows': () => this.templates.createContributingWorkflows(repoStructure, moduleGroups),
72
- 'domain-context': () => this.templates.createDomainContext(repoStructure, moduleGroups),
73
- 'software-guidelines': () => this.templates.createSoftwareGuidelines(repoStructure, moduleGroups)
60
+ buildContext(repoStructure, guides) {
61
+ const directorySet = new Set();
62
+ repoStructure.directories.forEach(dir => {
63
+ const [firstSegment] = dir.relativePath.split(/[\\/]/).filter(Boolean);
64
+ if (firstSegment) {
65
+ directorySet.add(firstSegment);
66
+ }
67
+ });
68
+ const topLevelDirectories = Array.from(directorySet).sort();
69
+ const directoryStats = topLevelDirectories.map(name => ({
70
+ name,
71
+ fileCount: repoStructure.files.filter(file => file.relativePath.startsWith(`${name}/`)).length
72
+ }));
73
+ const primaryLanguages = shared_1.GeneratorUtils.getTopFileExtensions(repoStructure, 5)
74
+ .filter(([ext]) => !!ext)
75
+ .map(([extension, count]) => ({ extension, count }));
76
+ return {
77
+ repoStructure,
78
+ topLevelDirectories,
79
+ primaryLanguages,
80
+ directoryStats,
81
+ guides
74
82
  };
75
- for (const docType of enabledTypes) {
76
- try {
77
- const content = await generators[docType]();
78
- const fileName = `${docType}.md`;
79
- const filePath = path.join(docsDir, fileName);
80
- await shared_1.GeneratorUtils.writeFileWithLogging(filePath, content, verbose, `Generated ${shared_1.GeneratorUtils.formatTitle(docType)}`);
83
+ }
84
+ getDocSections(guides) {
85
+ const sections = [
86
+ {
87
+ fileName: 'README.md',
88
+ content: context => (0, templates_1.renderIndex)(context)
81
89
  }
82
- catch (error) {
83
- shared_1.GeneratorUtils.logError(`Error generating ${docType}`, error, verbose);
90
+ ];
91
+ const renderMap = {
92
+ 'project-overview': templates_1.renderProjectOverview,
93
+ architecture: templates_1.renderArchitectureNotes,
94
+ 'development-workflow': () => (0, templates_1.renderDevelopmentWorkflow)(),
95
+ 'testing-strategy': () => (0, templates_1.renderTestingStrategy)(),
96
+ glossary: templates_1.renderGlossary,
97
+ 'data-flow': templates_1.renderDataFlow,
98
+ security: () => (0, templates_1.renderSecurity)(),
99
+ tooling: () => (0, templates_1.renderToolingGuide)()
100
+ };
101
+ guides.forEach(guide => {
102
+ const renderer = renderMap[guide.key];
103
+ if (!renderer) {
104
+ return;
84
105
  }
85
- }
86
- }
87
- async generateMainIndex(docsDir, enabledTypes, verbose) {
88
- const indexContent = this.templates.createDocumentationIndex(enabledTypes);
89
- const indexPath = path.join(docsDir, 'README.md');
90
- await shared_1.GeneratorUtils.writeFileWithLogging(indexPath, indexContent, verbose, 'Generated documentation index');
91
- }
92
- // Convenience methods for specific documentation types
93
- async generateMentalModelOnly(repoStructure, outputDir, verbose = false) {
94
- const docsDir = path.join(outputDir, 'docs');
95
- await shared_1.GeneratorUtils.ensureDirectoryAndLog(docsDir, verbose, '🧠 Generating mental model documentation');
96
- const moduleGroups = this.moduleGrouper.getModuleGroups(repoStructure);
97
- const content = await this.templates.createMentalModel(repoStructure, moduleGroups);
98
- const filePath = path.join(docsDir, 'mental-model.md');
99
- await shared_1.GeneratorUtils.writeFileWithLogging(filePath, content, verbose, 'Generated Mental Model');
100
- }
101
- async generateAIGuidelinesOnly(repoStructure, outputDir, verbose = false) {
102
- const docsDir = path.join(outputDir, 'docs');
103
- await shared_1.GeneratorUtils.ensureDirectoryAndLog(docsDir, verbose, '🤖 Generating AI guidelines documentation');
104
- const moduleGroups = this.moduleGrouper.getModuleGroups(repoStructure);
105
- const content = await this.templates.createAIGuidelines(repoStructure, moduleGroups);
106
- const filePath = path.join(docsDir, 'ai-guidelines.md');
107
- await shared_1.GeneratorUtils.writeFileWithLogging(filePath, content, verbose, 'Generated AI Guidelines');
108
- }
109
- async generateArchitectureDecisionsOnly(repoStructure, outputDir, verbose = false) {
110
- const docsDir = path.join(outputDir, 'docs');
111
- await shared_1.GeneratorUtils.ensureDirectoryAndLog(docsDir, verbose, '🏗️ Generating architecture decisions documentation');
112
- const moduleGroups = this.moduleGrouper.getModuleGroups(repoStructure);
113
- const content = await this.templates.createArchitectureDecisions(repoStructure, moduleGroups);
114
- const filePath = path.join(docsDir, 'architecture-decisions.md');
115
- await shared_1.GeneratorUtils.writeFileWithLogging(filePath, content, verbose, 'Generated Architecture Decisions');
116
- }
117
- async generateSoftwareGuidelinesOnly(repoStructure, outputDir, verbose = false) {
118
- const docsDir = path.join(outputDir, 'docs');
119
- await shared_1.GeneratorUtils.ensureDirectoryAndLog(docsDir, verbose, '📋 Generating software development guidelines');
120
- const moduleGroups = this.moduleGrouper.getModuleGroups(repoStructure);
121
- const content = await this.templates.createSoftwareGuidelines(repoStructure, moduleGroups);
122
- const filePath = path.join(docsDir, 'software-guidelines.md');
123
- await shared_1.GeneratorUtils.writeFileWithLogging(filePath, content, verbose, 'Generated Software Development Guidelines');
106
+ sections.push({
107
+ fileName: guide.file,
108
+ content: renderer
109
+ });
110
+ });
111
+ return sections;
124
112
  }
125
113
  }
126
114
  exports.DocumentationGenerator = DocumentationGenerator;