@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-coders/context",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "CLI tool for generating codebase documentation and AI agent prompts",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -9,8 +9,12 @@
9
9
  "files": [
10
10
  "dist/**/*",
11
11
  "README.md",
12
- "LICENSE"
12
+ "LICENSE",
13
+ "prompts/**/*"
13
14
  ],
15
+ "engines": {
16
+ "node": ">=20.0.0"
17
+ },
14
18
  "scripts": {
15
19
  "build": "tsc",
16
20
  "dev": "tsx src/index.ts",
@@ -36,38 +40,37 @@
36
40
  },
37
41
  "keywords": [
38
42
  "cli",
39
- "ai",
40
43
  "documentation",
41
- "openrouter",
42
- "llm"
44
+ "agents",
45
+ "scaffold"
43
46
  ],
44
47
  "author": "",
45
48
  "license": "MIT",
46
49
  "dependencies": {
47
- "@anthropic-ai/sdk": "^0.30.0",
48
- "@google/genai": "^0.8.0",
49
- "@types/inquirer": "^9.0.8",
50
- "axios": "^1.7.0",
51
50
  "boxen": "^5.1.2",
52
51
  "chalk": "^4.1.2",
53
52
  "cli-progress": "^3.12.0",
54
- "commander": "^12.0.0",
55
- "dotenv": "^16.4.0",
53
+ "commander": "^14.0.1",
56
54
  "figures": "^3.2.0",
57
- "fs-extra": "^11.2.0",
58
- "glob": "^10.4.0",
59
- "inquirer": "^12.6.3",
60
- "openai": "^4.70.0",
61
- "ora": "^5.4.1"
55
+ "fs-extra": "^11.3.2",
56
+ "glob": "^10.4.5",
57
+ "ora": "^5.4.1",
58
+ "@anthropic-ai/sdk": "^0.64.0",
59
+ "@google/genai": "^0.14.1",
60
+ "axios": "^1.12.2",
61
+ "dotenv": "^17.2.2",
62
+ "openai": "^5.23.1",
63
+ "inquirer": "^12.6.3"
62
64
  },
63
65
  "devDependencies": {
64
- "@types/cli-progress": "^3.11.0",
65
66
  "@types/fs-extra": "^11.0.4",
66
- "@types/jest": "^29.5.0",
67
- "@types/node": "^22.0.0",
68
- "jest": "^29.7.0",
69
- "ts-jest": "^29.2.0",
70
- "tsx": "^4.19.0",
71
- "typescript": "^5.6.0"
67
+ "@types/jest": "^30.0.0",
68
+ "@types/node": "^24.5.2",
69
+ "jest": "^30.1.3",
70
+ "ts-jest": "^29.4.4",
71
+ "tsx": "^4.20.6",
72
+ "typescript": "^5.9.2",
73
+ "@types/cli-progress": "^3.11.0",
74
+ "@types/inquirer": "^9.0.8"
72
75
  }
73
76
  }
@@ -0,0 +1,42 @@
1
+ # Prompt: Update Collaboration Plans
2
+
3
+ ## Purpose
4
+ You are an AI assistant responsible for refining collaboration plans that live in the `.context/plans/` directory. Each plan orchestrates work across documentation guides (`docs/`) and agent playbooks (`agents/`). Your goal is to replace placeholders with actionable guidance that keeps the plan aligned with the referenced docs, agents, and repository context.
5
+
6
+ ## Preparation Checklist
7
+ 1. Review the plan’s YAML front matter to understand the stated `ai_update_goal`, `required_inputs`, and `success_criteria`.
8
+ 2. Inspect the provided documentation excerpts (from `docs/`) and agent playbooks to ensure the plan reflects their current guidance.
9
+ 3. Confirm that the “Agent Lineup” and “Documentation Touchpoints” tables link to real files and reference the correct `ai-task` markers.
10
+ 4. Note any TODOs, `ai-slot` placeholders, or missing evidence sections that must be resolved.
11
+
12
+ ## Update Procedure
13
+ 1. **Task Snapshot**
14
+ - Summarize the primary goal and success signal in concrete terms.
15
+ - List authoritative references (docs, issues, specs) that contributors should consult.
16
+
17
+ 2. **Agent Alignment**
18
+ - For each agent in the lineup, describe why they are involved and call out the first responsibility they should focus on.
19
+ - Ensure playbook links and responsibility summaries match the referenced agent files.
20
+
21
+ 3. **Documentation Touchpoints**
22
+ - Map each plan stage to the docs excerpts provided, highlighting which sections need to be updated during execution.
23
+ - Keep the table sorted and ensure the listed `ai-task` markers exist.
24
+
25
+ 4. **Working Stages**
26
+ - Break the work into clear stages with owners, deliverables, and evidence checkpoints.
27
+ - Reference documentation and agent resources that the team should consult while executing each stage.
28
+
29
+ 5. **Evidence & Follow-up**
30
+ - Specify the artefacts that must be captured (PR links, test runs, change logs) before the plan is considered complete.
31
+ - Record any follow-up actions or decisions that require human confirmation.
32
+
33
+ ## Acceptance Criteria
34
+ - Every TODO or placeholder inside the plan’s `ai-task` block is resolved or accompanied by a clear escalation note.
35
+ - Tables reference existing files and stay in sync with the docs/agent indices.
36
+ - Stages provide actionable guidance, owners, and success signals.
37
+ - The plan remains fully self-contained and ready for contributors to execute.
38
+
39
+ ## Deliverables
40
+ - Updated plan Markdown returned verbatim.
41
+ - No additional commentary outside the Markdown output.
42
+
@@ -0,0 +1,48 @@
1
+ # Prompt: Update Repository Documentation and Agent Playbooks
2
+
3
+ ## Purpose
4
+ You are an AI assistant responsible for refreshing the documentation (`docs/`) and agent playbooks (`agents/`) generated by the ai-context scaffolding tool. Your goal is to bring every guide up to date with the latest repository state, fill in placeholder sections, and maintain cross-references between docs and agent instructions.
5
+
6
+ ## Context Gathering Checklist
7
+ 1. Run `git status -sb` to understand pending changes.
8
+ 2. Review the latest merged commits or PRs related to documentation, architecture, workflow, or testing.
9
+ 3. Inspect `package.json`, CI configuration, and any release or roadmap notes stored in the repository.
10
+ 4. Check `docs/README.md` for the current document map and update task markers (`ai-task:*`).
11
+ 5. Identify unresolved placeholders marked as `<!-- ai-slot:* -->`.
12
+
13
+ ## Update Procedure
14
+ 1. **Select a Guide**
15
+ - Navigate to `docs/<guide>.md`.
16
+ - Read the YAML front matter (`ai_update_goal`, `required_inputs`, `success_criteria`) and ensure you collect the listed inputs before editing.
17
+
18
+ 2. **Edit Within Task Wrappers**
19
+ - Update content strictly inside the matching `<!-- ai-task:... -->` block.
20
+ - Remove or replace any `TODO` text with accurate, current information.
21
+ - When you complete a placeholder slot (`<!-- ai-slot:... -->`), remove the wrapper and provide the finalized description.
22
+
23
+ 3. **Cross-Link Updates**
24
+ - Verify that links between docs remain valid.
25
+ - If you add new guides or sections, update `docs/README.md` and the document map table.
26
+
27
+ 4. **Agent Playbook Alignment**
28
+ - For each change in `docs/`, adjust the related `agents/*.md` playbooks.
29
+ - Ensure the "Documentation Touchpoints" list references the correct `ai-task` markers.
30
+ - Update collaboration checklists and evidence sections to reflect the latest workflows.
31
+
32
+ 5. **Evidence & Traceability**
33
+ - Note key sources (commit hashes, issues, ADRs) in the "Evidence to Capture" or "AI Update Checklist" summary lines.
34
+ - If anything is ambiguous or requires human follow-up, leave a concise note clearly labelled for maintainers.
35
+
36
+ ## Acceptance Criteria
37
+ - Every guide’s `success_criteria` field is satisfied.
38
+ - No unresolved `TODO` or `ai-slot` blocks remain unless they require explicit human input; in such cases, add a comment explaining the dependency.
39
+ - Agent playbooks list accurate responsibilities, best practices, and pointer links to the refreshed docs.
40
+ - Changes are self-contained, well-formatted Markdown, and reference any new external resources introduced.
41
+
42
+ ## Deliverables
43
+ - Updated Markdown files committed to the repository.
44
+ - A short changelog or PR description summarizing:
45
+ - Guides touched
46
+ - Key decisions or facts added
47
+ - Evidence links and any pending follow-ups
48
+
@@ -1,23 +0,0 @@
1
- import { RepoStructure } from '../types';
2
- import { FileMapper } from '../utils/fileMapper';
3
- import { BaseLLMClient } from '../services/baseLLMClient';
4
- export declare class AgentGenerator {
5
- private fileMapper;
6
- private llmClient;
7
- private agentTypes;
8
- constructor(fileMapper: FileMapper, llmClient: BaseLLMClient);
9
- generateAgentPrompts(repoStructure: RepoStructure, outputDir: string, verbose?: boolean): Promise<void>;
10
- private generateAgentPrompt;
11
- private formatAgentPrompt;
12
- private getAgentResponsibilities;
13
- private getAgentBestPractices;
14
- private getAgentCommands;
15
- private createRepoContext;
16
- private createFileContext;
17
- private createStructureOverview;
18
- private getFileTypeDistribution;
19
- private isImportantFile;
20
- private generateAgentIndex;
21
- private formatBytes;
22
- }
23
- //# sourceMappingURL=agentGenerator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agentGenerator.d.ts","sourceRoot":"","sources":["../../src/generators/agentGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAe,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,qBAAa,cAAc;IAavB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,SAAS;IAbnB,OAAO,CAAC,UAAU,CAShB;gBAGQ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,aAAa;IAG5B,oBAAoB,CACxB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,IAAI,CAAC;YA0CF,mBAAmB;IAiBjC,OAAO,CAAC,iBAAiB;IAoCzB,OAAO,CAAC,wBAAwB;IAwDhC,OAAO,CAAC,qBAAqB;IAgD7B,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,iBAAiB;YAyBX,iBAAiB;IAoB/B,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,eAAe;YAaT,kBAAkB;IA6ChC,OAAO,CAAC,WAAW;CAOpB"}
@@ -1,357 +0,0 @@
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.AgentGenerator = void 0;
40
- const fs = __importStar(require("fs-extra"));
41
- const path = __importStar(require("path"));
42
- const chalk_1 = __importDefault(require("chalk"));
43
- class AgentGenerator {
44
- constructor(fileMapper, llmClient) {
45
- this.fileMapper = fileMapper;
46
- this.llmClient = llmClient;
47
- this.agentTypes = [
48
- 'code-reviewer',
49
- 'bug-fixer',
50
- 'feature-developer',
51
- 'refactoring-specialist',
52
- 'test-writer',
53
- 'documentation-writer',
54
- 'performance-optimizer',
55
- 'security-auditor'
56
- ];
57
- }
58
- async generateAgentPrompts(repoStructure, outputDir, verbose = false) {
59
- const agentsDir = path.join(outputDir, 'agents');
60
- await fs.ensureDir(agentsDir);
61
- if (verbose) {
62
- console.log(chalk_1.default.blue(`🤖 Generating agent prompts in: ${agentsDir}`));
63
- }
64
- const repoContext = this.createRepoContext(repoStructure);
65
- const fileContext = await this.createFileContext(repoStructure);
66
- for (const agentType of this.agentTypes) {
67
- try {
68
- const fileName = `${agentType}.md`;
69
- if (verbose) {
70
- console.log(chalk_1.default.blue(`📄 Creating ${fileName}...`));
71
- }
72
- const agentPrompt = await this.generateAgentPrompt(agentType, repoContext, fileContext, repoStructure);
73
- const agentPath = path.join(agentsDir, fileName);
74
- await fs.writeFile(agentPath, agentPrompt);
75
- if (verbose) {
76
- console.log(chalk_1.default.green(`✅ Created ${fileName}`));
77
- }
78
- }
79
- catch (error) {
80
- if (verbose) {
81
- console.log(chalk_1.default.red(`❌ Error generating ${agentType}: ${error}`));
82
- }
83
- }
84
- }
85
- // Generate master agent index
86
- await this.generateAgentIndex(agentsDir, verbose);
87
- }
88
- async generateAgentPrompt(agentType, repoContext, fileContext, repoStructure) {
89
- const structureOverview = this.createStructureOverview(repoStructure);
90
- const agentPrompt = await this.llmClient.generateAgentPrompt(structureOverview, fileContext, agentType);
91
- return this.formatAgentPrompt(agentType, agentPrompt, repoContext);
92
- }
93
- formatAgentPrompt(agentType, generatedPrompt, repoContext) {
94
- const title = agentType.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
95
- return `# ${title} Agent
96
-
97
- ## Role Description
98
- You are a specialized ${title} agent for this codebase. Your primary function is to assist with ${agentType.replace('-', ' ')} tasks while maintaining deep understanding of the project structure and conventions.
99
-
100
- ## Repository Context
101
- ${repoContext}
102
-
103
- ## Agent-Specific Prompt
104
- ${generatedPrompt}
105
-
106
- ## Key Responsibilities
107
- ${this.getAgentResponsibilities(agentType)}
108
-
109
- ## Best Practices
110
- ${this.getAgentBestPractices(agentType)}
111
-
112
- ## Common Commands and Patterns
113
- ${this.getAgentCommands(agentType)}
114
-
115
- ---
116
- *Generated by AI Coders Context*
117
- *Agent Type: ${agentType}*
118
- *Generated on: ${new Date().toISOString()}*
119
- `;
120
- }
121
- getAgentResponsibilities(agentType) {
122
- const responsibilities = {
123
- 'code-reviewer': [
124
- 'Review code changes for quality, style, and best practices',
125
- 'Identify potential bugs and security issues',
126
- 'Ensure code follows project conventions',
127
- 'Provide constructive feedback and suggestions'
128
- ],
129
- 'bug-fixer': [
130
- 'Analyze bug reports and error messages',
131
- 'Identify root causes of issues',
132
- 'Implement targeted fixes with minimal side effects',
133
- 'Test fixes thoroughly before deployment'
134
- ],
135
- 'feature-developer': [
136
- 'Implement new features according to specifications',
137
- 'Design clean, maintainable code architecture',
138
- 'Integrate features with existing codebase',
139
- 'Write comprehensive tests for new functionality'
140
- ],
141
- 'refactoring-specialist': [
142
- 'Identify code smells and improvement opportunities',
143
- 'Refactor code while maintaining functionality',
144
- 'Improve code organization and structure',
145
- 'Optimize performance where applicable'
146
- ],
147
- 'test-writer': [
148
- 'Write comprehensive unit and integration tests',
149
- 'Ensure good test coverage across the codebase',
150
- 'Create test utilities and fixtures',
151
- 'Maintain and update existing tests'
152
- ],
153
- 'documentation-writer': [
154
- 'Create clear, comprehensive documentation',
155
- 'Update existing documentation as code changes',
156
- 'Write helpful code comments and examples',
157
- 'Maintain README and API documentation'
158
- ],
159
- 'performance-optimizer': [
160
- 'Identify performance bottlenecks',
161
- 'Optimize code for speed and efficiency',
162
- 'Implement caching strategies',
163
- 'Monitor and improve resource usage'
164
- ],
165
- 'security-auditor': [
166
- 'Identify security vulnerabilities',
167
- 'Implement security best practices',
168
- 'Review dependencies for security issues',
169
- 'Ensure data protection and privacy compliance'
170
- ]
171
- };
172
- return responsibilities[agentType]?.map(r => `- ${r}`).join('\n') ||
173
- '- Perform specialized tasks for this agent type';
174
- }
175
- getAgentBestPractices(agentType) {
176
- const practices = {
177
- 'code-reviewer': [
178
- 'Focus on maintainability and readability',
179
- 'Consider the broader impact of changes',
180
- 'Be constructive and specific in feedback'
181
- ],
182
- 'bug-fixer': [
183
- 'Reproduce the bug before fixing',
184
- 'Write tests to prevent regression',
185
- 'Document the fix for future reference'
186
- ],
187
- 'feature-developer': [
188
- 'Follow existing patterns and conventions',
189
- 'Consider edge cases and error handling',
190
- 'Write tests alongside implementation'
191
- ],
192
- 'refactoring-specialist': [
193
- 'Make small, incremental changes',
194
- 'Ensure tests pass after each refactor',
195
- 'Preserve existing functionality exactly'
196
- ],
197
- 'test-writer': [
198
- 'Write tests that are clear and maintainable',
199
- 'Test both happy path and edge cases',
200
- 'Use descriptive test names'
201
- ],
202
- 'documentation-writer': [
203
- 'Keep documentation up-to-date with code',
204
- 'Write from the user\'s perspective',
205
- 'Include practical examples'
206
- ],
207
- 'performance-optimizer': [
208
- 'Measure before optimizing',
209
- 'Focus on actual bottlenecks',
210
- 'Don\'t sacrifice readability unnecessarily'
211
- ],
212
- 'security-auditor': [
213
- 'Follow security best practices',
214
- 'Stay updated on common vulnerabilities',
215
- 'Consider the principle of least privilege'
216
- ]
217
- };
218
- return practices[agentType]?.map(p => `- ${p}`).join('\n') ||
219
- '- Follow general best practices for software development';
220
- }
221
- getAgentCommands(agentType) {
222
- return `Common patterns and commands for ${agentType} tasks:
223
-
224
- \`\`\`bash
225
- # Add relevant commands here based on the codebase
226
- npm test # Run tests
227
- npm run lint # Check code style
228
- npm run build # Build the project
229
- \`\`\`
230
-
231
- Refer to the project's package.json or documentation for specific commands.`;
232
- }
233
- createRepoContext(repoStructure) {
234
- const { files, totalFiles, totalSize } = repoStructure;
235
- const extensions = new Map();
236
- files.forEach(file => {
237
- const ext = file.extension || 'no-extension';
238
- extensions.set(ext, (extensions.get(ext) || 0) + 1);
239
- });
240
- const topExtensions = Array.from(extensions.entries())
241
- .sort((a, b) => b[1] - a[1])
242
- .slice(0, 5);
243
- return `**Project Statistics:**
244
- - Total Files: ${totalFiles}
245
- - Total Size: ${this.formatBytes(totalSize)}
246
- - Primary Languages: ${topExtensions.map(([ext, count]) => `${ext} (${count})`).join(', ')}
247
-
248
- **Key Project Files:**
249
- ${files
250
- .filter(f => ['package.json', 'README.md', 'tsconfig.json'].includes(path.basename(f.path)))
251
- .map(f => `- ${f.relativePath}`)
252
- .join('\n')}`;
253
- }
254
- async createFileContext(repoStructure) {
255
- const importantFiles = repoStructure.files
256
- .filter(f => this.isImportantFile(f.relativePath))
257
- .slice(0, 10);
258
- let context = '**Important Files Context:**\n\n';
259
- for (const file of importantFiles) {
260
- try {
261
- const content = await this.fileMapper.readFileContent(file.path);
262
- const preview = content.substring(0, 500);
263
- context += `**${file.relativePath}:**\n\`\`\`\n${preview}${content.length > 500 ? '...' : ''}\n\`\`\`\n\n`;
264
- }
265
- catch (error) {
266
- context += `**${file.relativePath}:** (Error reading file)\n\n`;
267
- }
268
- }
269
- return context;
270
- }
271
- createStructureOverview(repoStructure) {
272
- const directories = [...new Set(repoStructure.files.map(f => path.dirname(f.relativePath)))].filter(dir => dir !== '.').slice(0, 20);
273
- return `Repository Structure Overview:
274
-
275
- Directories:
276
- ${directories.map(dir => `- ${dir}`).join('\n')}
277
-
278
- File Types:
279
- ${this.getFileTypeDistribution(repoStructure)}
280
-
281
- Total Files: ${repoStructure.totalFiles}
282
- `;
283
- }
284
- getFileTypeDistribution(repoStructure) {
285
- const extensions = new Map();
286
- repoStructure.files.forEach(file => {
287
- const ext = file.extension || 'no-extension';
288
- extensions.set(ext, (extensions.get(ext) || 0) + 1);
289
- });
290
- return Array.from(extensions.entries())
291
- .sort((a, b) => b[1] - a[1])
292
- .slice(0, 10)
293
- .map(([ext, count]) => `- ${ext}: ${count} files`)
294
- .join('\n');
295
- }
296
- isImportantFile(filePath) {
297
- const importantFiles = [
298
- 'package.json', 'tsconfig.json', 'webpack.config.js',
299
- 'next.config.js', 'tailwind.config.js', 'README.md',
300
- '.gitignore', 'Dockerfile', 'docker-compose.yml'
301
- ];
302
- const fileName = path.basename(filePath);
303
- return importantFiles.includes(fileName) ||
304
- filePath.includes('config') ||
305
- filePath.includes('index');
306
- }
307
- async generateAgentIndex(agentsDir, verbose) {
308
- const fileName = 'README.md';
309
- if (verbose) {
310
- console.log(chalk_1.default.blue(`📄 Creating ${fileName}...`));
311
- }
312
- const indexContent = `# AI Agents Index
313
-
314
- This directory contains specialized AI agent prompts designed for this codebase.
315
-
316
- ## Available Agents
317
-
318
- ${this.agentTypes.map(type => {
319
- const title = type.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
320
- return `### [${title}](${type}.md)
321
- - **File:** \`${type}.md\`
322
- - **Purpose:** Specialized ${title.toLowerCase()} tasks
323
- `;
324
- }).join('\n')}
325
-
326
- ## Usage
327
-
328
- Each agent prompt is designed to provide context-aware assistance for specific development tasks. Use these prompts with your preferred AI assistant to get specialized help with your codebase.
329
-
330
- ## How to Use
331
-
332
- 1. Choose the appropriate agent for your task
333
- 2. Copy the agent prompt from the corresponding .md file
334
- 3. Provide the prompt to your AI assistant along with your specific question or task
335
- 4. The agent will provide context-aware assistance based on your codebase structure
336
-
337
- ---
338
- *Generated by AI Coders Context*
339
- *Generated on: ${new Date().toISOString()}*
340
- `;
341
- const indexPath = path.join(agentsDir, fileName);
342
- await fs.writeFile(indexPath, indexContent);
343
- if (verbose) {
344
- console.log(chalk_1.default.green(`✅ Created ${fileName}`));
345
- }
346
- }
347
- formatBytes(bytes) {
348
- if (bytes === 0)
349
- return '0 Bytes';
350
- const k = 1024;
351
- const sizes = ['Bytes', 'KB', 'MB', 'GB'];
352
- const i = Math.floor(Math.log(bytes) / Math.log(k));
353
- return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
354
- }
355
- }
356
- exports.AgentGenerator = AgentGenerator;
357
- //# sourceMappingURL=agentGenerator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agentGenerator.js","sourceRoot":"","sources":["../../src/generators/agentGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,2CAA6B;AAI7B,kDAA0B;AAE1B,MAAa,cAAc;IAYzB,YACU,UAAsB,EACtB,SAAwB;QADxB,eAAU,GAAV,UAAU,CAAY;QACtB,cAAS,GAAT,SAAS,CAAe;QAb1B,eAAU,GAAG;YACnB,eAAe;YACf,WAAW;YACX,mBAAmB;YACnB,wBAAwB;YACxB,aAAa;YACb,sBAAsB;YACtB,uBAA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AO,QAAQ,KAAK,KAAK,IAAI;gBACf,IAAI;6BACS,KAAK,CAAC,WAAW,EAAE;CAC/C,CAAC;QACF,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;iBAeI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;CACxC,CAAC;QAEE,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAE5C,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAEO,WAAW,CAAC,KAAa;QAC/B,IAAI,KAAK,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAClC,MAAM,CAAC,GAAG,IAAI,CAAC;QACf,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,OAAO,UAAU,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF;AAtXD,wCAsXC"}
@@ -1,21 +0,0 @@
1
- import { RepoStructure } from '../../types';
2
- import { FileMapper } from '../../utils/fileMapper';
3
- import { BaseLLMClient } from '../../services/baseLLMClient';
4
- import { DocumentationConfig } from './documentationTypes';
5
- export declare class EnhancedDocumentationGenerator {
6
- private fileMapper;
7
- private llmClient;
8
- private moduleGrouper;
9
- private newTemplates;
10
- private legacyTemplates;
11
- constructor(fileMapper: FileMapper, llmClient: BaseLLMClient);
12
- generateDocumentation(repoStructure: RepoStructure, outputDir: string, config?: Partial<DocumentationConfig>, verbose?: boolean): Promise<void>;
13
- private generateNewStyleDocumentation;
14
- private generateLegacyDocumentation;
15
- private generateMainIndex;
16
- private createCombinedIndex;
17
- private createLegacyOnlyIndex;
18
- generateMentalModelOnly(repoStructure: RepoStructure, outputDir: string, verbose?: boolean): Promise<void>;
19
- generateAIGuidelinesOnly(repoStructure: RepoStructure, outputDir: string, verbose?: boolean): Promise<void>;
20
- }
21
- //# sourceMappingURL=enhancedDocumentationGenerator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhancedDocumentationGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/documentation/enhancedDocumentationGenerator.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;AAK7D,OAAO,EACL,mBAAmB,EAIpB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,8BAA8B;IAMvC,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,SAAS;IANnB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,eAAe,CAAyB;gBAGtC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,aAAa;IAO5B,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;YA2BF,6BAA6B;YAoC7B,2BAA2B;YAkC3B,iBAAiB;IAsB/B,OAAO,CAAC,mBAAmB;IA2C3B,OAAO,CAAC,qBAAqB;IAmBvB,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;CAUjB"}