@compilr-dev/cli 0.4.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 (152) hide show
  1. package/README.md +110 -0
  2. package/dist/agent.d.ts +62 -0
  3. package/dist/agent.js +317 -0
  4. package/dist/agents/registry.d.ts +66 -0
  5. package/dist/agents/registry.js +238 -0
  6. package/dist/agents/types.d.ts +40 -0
  7. package/dist/agents/types.js +94 -0
  8. package/dist/commands/custom-registry.d.ts +69 -0
  9. package/dist/commands/custom-registry.js +246 -0
  10. package/dist/commands/index.d.ts +7 -0
  11. package/dist/commands/index.js +7 -0
  12. package/dist/commands/types.d.ts +31 -0
  13. package/dist/commands/types.js +26 -0
  14. package/dist/commands.d.ts +63 -0
  15. package/dist/commands.js +324 -0
  16. package/dist/db/index.d.ts +42 -0
  17. package/dist/db/index.js +146 -0
  18. package/dist/db/repositories/document-repository.d.ts +63 -0
  19. package/dist/db/repositories/document-repository.js +184 -0
  20. package/dist/db/repositories/index.d.ts +9 -0
  21. package/dist/db/repositories/index.js +6 -0
  22. package/dist/db/repositories/project-repository.d.ts +132 -0
  23. package/dist/db/repositories/project-repository.js +337 -0
  24. package/dist/db/repositories/work-item-repository.d.ts +115 -0
  25. package/dist/db/repositories/work-item-repository.js +389 -0
  26. package/dist/db/schema.d.ts +83 -0
  27. package/dist/db/schema.js +143 -0
  28. package/dist/debug.d.ts +8 -0
  29. package/dist/debug.js +48 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.js +348 -0
  32. package/dist/index.old.d.ts +7 -0
  33. package/dist/index.old.js +1014 -0
  34. package/dist/repl.d.ts +121 -0
  35. package/dist/repl.js +1878 -0
  36. package/dist/settings/index.d.ts +80 -0
  37. package/dist/settings/index.js +195 -0
  38. package/dist/shared-handlers.d.ts +63 -0
  39. package/dist/shared-handlers.js +57 -0
  40. package/dist/slash-autocomplete.d.ts +41 -0
  41. package/dist/slash-autocomplete.js +638 -0
  42. package/dist/state.d.ts +75 -0
  43. package/dist/state.js +130 -0
  44. package/dist/tabbed-menu.d.ts +11 -0
  45. package/dist/tabbed-menu.js +328 -0
  46. package/dist/templates/backlog-md.d.ts +7 -0
  47. package/dist/templates/backlog-md.js +94 -0
  48. package/dist/templates/claude-md.d.ts +7 -0
  49. package/dist/templates/claude-md.js +189 -0
  50. package/dist/templates/coding-standards.d.ts +7 -0
  51. package/dist/templates/coding-standards.js +299 -0
  52. package/dist/templates/compilr-md.d.ts +7 -0
  53. package/dist/templates/compilr-md.js +189 -0
  54. package/dist/templates/config-json.d.ts +38 -0
  55. package/dist/templates/config-json.js +39 -0
  56. package/dist/templates/gitignore.d.ts +7 -0
  57. package/dist/templates/gitignore.js +85 -0
  58. package/dist/templates/index.d.ts +19 -0
  59. package/dist/templates/index.js +302 -0
  60. package/dist/templates/package-json.d.ts +7 -0
  61. package/dist/templates/package-json.js +111 -0
  62. package/dist/templates/readme-md.d.ts +7 -0
  63. package/dist/templates/readme-md.js +161 -0
  64. package/dist/templates/tsconfig.d.ts +7 -0
  65. package/dist/templates/tsconfig.js +61 -0
  66. package/dist/templates/types.d.ts +33 -0
  67. package/dist/templates/types.js +24 -0
  68. package/dist/test-autocomplete.d.ts +7 -0
  69. package/dist/test-autocomplete.js +85 -0
  70. package/dist/test-tabbed-menu.d.ts +7 -0
  71. package/dist/test-tabbed-menu.js +25 -0
  72. package/dist/themes/colors.d.ts +49 -0
  73. package/dist/themes/colors.js +135 -0
  74. package/dist/themes/index.d.ts +23 -0
  75. package/dist/themes/index.js +24 -0
  76. package/dist/themes/registry.d.ts +60 -0
  77. package/dist/themes/registry.js +195 -0
  78. package/dist/themes/types.d.ts +82 -0
  79. package/dist/themes/types.js +7 -0
  80. package/dist/tool-selector.d.ts +71 -0
  81. package/dist/tool-selector.js +184 -0
  82. package/dist/tools/ask-user-simple.d.ts +19 -0
  83. package/dist/tools/ask-user-simple.js +86 -0
  84. package/dist/tools/ask-user.d.ts +32 -0
  85. package/dist/tools/ask-user.js +113 -0
  86. package/dist/tools/backlog.d.ts +53 -0
  87. package/dist/tools/backlog.js +709 -0
  88. package/dist/tools.d.ts +15 -0
  89. package/dist/tools.js +121 -0
  90. package/dist/ui/agents-overlay.d.ts +12 -0
  91. package/dist/ui/agents-overlay.js +501 -0
  92. package/dist/ui/arch-type-overlay.d.ts +20 -0
  93. package/dist/ui/arch-type-overlay.js +229 -0
  94. package/dist/ui/ask-user-overlay.d.ts +26 -0
  95. package/dist/ui/ask-user-overlay.js +647 -0
  96. package/dist/ui/ask-user-simple-overlay.d.ts +25 -0
  97. package/dist/ui/ask-user-simple-overlay.js +242 -0
  98. package/dist/ui/backlog-overlay.d.ts +17 -0
  99. package/dist/ui/backlog-overlay.js +786 -0
  100. package/dist/ui/commands-overlay.d.ts +11 -0
  101. package/dist/ui/commands-overlay.js +410 -0
  102. package/dist/ui/config-overlay.d.ts +34 -0
  103. package/dist/ui/config-overlay.js +977 -0
  104. package/dist/ui/conversation.d.ts +82 -0
  105. package/dist/ui/conversation.js +508 -0
  106. package/dist/ui/diff.d.ts +38 -0
  107. package/dist/ui/diff.js +182 -0
  108. package/dist/ui/ephemeral.d.ts +111 -0
  109. package/dist/ui/ephemeral.js +413 -0
  110. package/dist/ui/file-autocomplete.d.ts +45 -0
  111. package/dist/ui/file-autocomplete.js +237 -0
  112. package/dist/ui/footer.d.ts +153 -0
  113. package/dist/ui/footer.js +422 -0
  114. package/dist/ui/index.d.ts +12 -0
  115. package/dist/ui/index.js +15 -0
  116. package/dist/ui/init-overlay.d.ts +24 -0
  117. package/dist/ui/init-overlay.js +525 -0
  118. package/dist/ui/input-prompt-v2.d.ts +179 -0
  119. package/dist/ui/input-prompt-v2.js +991 -0
  120. package/dist/ui/input-prompt.d.ts +97 -0
  121. package/dist/ui/input-prompt.js +800 -0
  122. package/dist/ui/iteration-limit-overlay.d.ts +21 -0
  123. package/dist/ui/iteration-limit-overlay.js +150 -0
  124. package/dist/ui/keys-overlay.d.ts +14 -0
  125. package/dist/ui/keys-overlay.js +181 -0
  126. package/dist/ui/model-warning-overlay.d.ts +30 -0
  127. package/dist/ui/model-warning-overlay.js +171 -0
  128. package/dist/ui/overlay-controller.d.ts +25 -0
  129. package/dist/ui/overlay-controller.js +35 -0
  130. package/dist/ui/overlays.d.ts +47 -0
  131. package/dist/ui/overlays.js +627 -0
  132. package/dist/ui/permission-overlay.d.ts +16 -0
  133. package/dist/ui/permission-overlay.js +494 -0
  134. package/dist/ui/terminal.d.ts +117 -0
  135. package/dist/ui/terminal.js +237 -0
  136. package/dist/ui/todo-zone.d.ts +112 -0
  137. package/dist/ui/todo-zone.js +353 -0
  138. package/dist/ui/tools-overlay.d.ts +26 -0
  139. package/dist/ui/tools-overlay.js +278 -0
  140. package/dist/ui/tutorial-overlay.d.ts +10 -0
  141. package/dist/ui/tutorial-overlay.js +936 -0
  142. package/dist/ui/types.d.ts +103 -0
  143. package/dist/ui/types.js +33 -0
  144. package/dist/utils/credentials.d.ts +55 -0
  145. package/dist/utils/credentials.js +268 -0
  146. package/dist/utils/model-tiers.d.ts +37 -0
  147. package/dist/utils/model-tiers.js +118 -0
  148. package/dist/utils/project-memory.d.ts +47 -0
  149. package/dist/utils/project-memory.js +117 -0
  150. package/dist/utils/project-status.d.ts +56 -0
  151. package/dist/utils/project-status.js +237 -0
  152. package/package.json +66 -0
@@ -0,0 +1,189 @@
1
+ /**
2
+ * CLAUDE.md Template Generator
3
+ *
4
+ * Generates the AI assistant context file.
5
+ */
6
+ export function generateClaudeMd(config) {
7
+ const techStackSection = generateTechStackSection(config);
8
+ const codingStandardsSection = generateCodingStandardsSection(config);
9
+ return `# CLAUDE.md
10
+
11
+ This file provides guidance to AI coding assistants when working with this project.
12
+
13
+ ---
14
+
15
+ ## Project Overview
16
+
17
+ **Project:** ${config.name}
18
+ **Description:** ${config.description}
19
+
20
+ ---
21
+
22
+ ${techStackSection}
23
+
24
+ ---
25
+
26
+ ${codingStandardsSection}
27
+
28
+ ---
29
+
30
+ ## Project Structure
31
+
32
+ ${config.repoPattern === 'single' ? generateSingleRepoStructure() : generateTwoRepoStructure(config.name)}
33
+
34
+ ---
35
+
36
+ ## Architecture Decisions
37
+
38
+ Key architectural decisions are documented in:
39
+ - ${config.repoPattern === 'single' ? '`.compilr/architecture/decisions/`' : '`02-architecture/decisions/`'}
40
+
41
+ When making significant technical choices, create an ADR (Architecture Decision Record).
42
+
43
+ ---
44
+
45
+ ## Current Focus
46
+
47
+ *Updated by session management - tracks current sprint/milestone*
48
+
49
+ ---
50
+
51
+ ## Key Files
52
+
53
+ *Auto-populated based on usage - frequently referenced files appear here*
54
+
55
+ ---
56
+
57
+ ## Development Commands
58
+
59
+ \`\`\`bash
60
+ # Development
61
+ npm run dev # Start development server
62
+ npm run build # Production build
63
+ npm run lint # Lint code
64
+ npm run test # Run tests
65
+
66
+ # Project workflow
67
+ compilr start # Begin coding session with context
68
+ compilr save # Save session progress
69
+ compilr backlog # View/manage tasks
70
+ \`\`\`
71
+
72
+ ---
73
+
74
+ ## Notes for AI Assistants
75
+
76
+ 1. **Always read this file first** when starting a session
77
+ 2. **Check the backlog** before starting new work
78
+ 3. **Follow coding standards** defined in this project
79
+ 4. **Document decisions** when making architectural choices
80
+ 5. **Update session notes** at the end of each session
81
+
82
+ ---
83
+
84
+ *Last Updated: ${new Date().toISOString().split('T')[0]}*
85
+ `;
86
+ }
87
+ function generateTechStackSection(config) {
88
+ if (config.techStack === 'custom') {
89
+ return `## Tech Stack
90
+
91
+ *To be configured - update this section with your chosen technologies*
92
+
93
+ | Component | Technology | Notes |
94
+ |-----------|------------|-------|
95
+ | Frontend | TBD | |
96
+ | Backend | TBD | |
97
+ | Database | TBD | |
98
+ | Hosting | TBD | |`;
99
+ }
100
+ const stacks = {
101
+ 'react-node-pg': `## Tech Stack
102
+
103
+ | Component | Technology | Notes |
104
+ |-----------|------------|-------|
105
+ | Frontend | React 18 + Vite | TypeScript, modern React |
106
+ | Backend | Node.js + Express | TypeScript, REST API |
107
+ | Database | PostgreSQL | Relational, ACID compliant |
108
+ | ORM | Prisma | Type-safe database access |`,
109
+ 'react-python-pg': `## Tech Stack
110
+
111
+ | Component | Technology | Notes |
112
+ |-----------|------------|-------|
113
+ | Frontend | React 18 + Vite | TypeScript, modern React |
114
+ | Backend | Python + FastAPI | Async, auto-docs |
115
+ | Database | PostgreSQL | Relational, ACID compliant |
116
+ | ORM | SQLAlchemy | Python ORM |`,
117
+ 'vue-node-pg': `## Tech Stack
118
+
119
+ | Component | Technology | Notes |
120
+ |-----------|------------|-------|
121
+ | Frontend | Vue 3 + Vite | TypeScript, Composition API |
122
+ | Backend | Node.js + Express | TypeScript, REST API |
123
+ | Database | PostgreSQL | Relational, ACID compliant |
124
+ | ORM | Prisma | Type-safe database access |`,
125
+ };
126
+ return stacks[config.techStack] ?? stacks['react-node-pg'];
127
+ }
128
+ function generateCodingStandardsSection(config) {
129
+ if (config.codingStandards === 'custom') {
130
+ return `## Coding Standards
131
+
132
+ *To be configured - update this section with your coding standards*
133
+
134
+ See ${config.repoPattern === 'single' ? '`.compilr/architecture/coding-standards.md`' : '`02-architecture/coding-standards.md`'} for details.`;
135
+ }
136
+ const standards = config.codingStandards === 'strict'
137
+ ? `## Coding Standards
138
+
139
+ **Preset:** TypeScript Strict
140
+
141
+ - TypeScript strict mode enabled
142
+ - ESLint + Prettier configured
143
+ - Conventional commits required
144
+ - No \`any\` types allowed
145
+ - Explicit return types required
146
+ - Comprehensive error handling
147
+
148
+ See ${config.repoPattern === 'single' ? '`.compilr/architecture/coding-standards.md`' : '`02-architecture/coding-standards.md`'} for full details.`
149
+ : `## Coding Standards
150
+
151
+ **Preset:** TypeScript Relaxed
152
+
153
+ - TypeScript with relaxed settings
154
+ - ESLint + Prettier configured
155
+ - Conventional commits encouraged
156
+ - \`any\` types discouraged but allowed
157
+ - Implicit return types allowed
158
+
159
+ See ${config.repoPattern === 'single' ? '`.compilr/architecture/coding-standards.md`' : '`02-architecture/coding-standards.md`'} for full details.`;
160
+ return standards;
161
+ }
162
+ function generateSingleRepoStructure() {
163
+ return `\`\`\`
164
+ {project}/
165
+ ├── .compilr/ # Workflow files
166
+ │ ├── backlog.md # Task tracking
167
+ │ ├── architecture/ # ADRs, coding standards
168
+ │ └── sessions/ # Session notes
169
+ ├── src/ # Source code
170
+ ├── CLAUDE.md # This file
171
+ ├── package.json
172
+ └── README.md
173
+ \`\`\``;
174
+ }
175
+ function generateTwoRepoStructure(name) {
176
+ return `\`\`\`
177
+ ${name}/ # Code repository
178
+ ├── src/
179
+ ├── package.json
180
+ └── README.md
181
+
182
+ ${name}-docs/ # Documentation repository
183
+ ├── .compilr/
184
+ ├── CLAUDE.md # This file
185
+ ├── 01-planning/ # Backlog, roadmap
186
+ ├── 02-architecture/ # ADRs, standards
187
+ └── 04-session-notes/ # Session history
188
+ \`\`\``;
189
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Coding Standards Template Generator
3
+ *
4
+ * Generates the coding standards documentation.
5
+ */
6
+ import type { ProjectConfig } from './types.js';
7
+ export declare function generateCodingStandardsMd(config: ProjectConfig): string;
@@ -0,0 +1,299 @@
1
+ /**
2
+ * Coding Standards Template Generator
3
+ *
4
+ * Generates the coding standards documentation.
5
+ */
6
+ export function generateCodingStandardsMd(config) {
7
+ if (config.codingStandards === 'custom') {
8
+ return generateCustomTemplate(config);
9
+ }
10
+ return config.codingStandards === 'strict'
11
+ ? generateStrictTemplate(config)
12
+ : generateRelaxedTemplate(config);
13
+ }
14
+ function generateCustomTemplate(config) {
15
+ return `# Coding Standards - ${config.name}
16
+
17
+ *Configure your coding standards here*
18
+
19
+ ---
20
+
21
+ ## TypeScript Configuration
22
+
23
+ \`\`\`json
24
+ // tsconfig.json - customize as needed
25
+ {
26
+ "compilerOptions": {
27
+ "target": "ES2022",
28
+ "module": "NodeNext",
29
+ "strict": true, // Adjust based on preference
30
+ "esModuleInterop": true,
31
+ "skipLibCheck": true,
32
+ "forceConsistentCasingInFileNames": true
33
+ }
34
+ }
35
+ \`\`\`
36
+
37
+ ---
38
+
39
+ ## Linting
40
+
41
+ *Add your ESLint configuration*
42
+
43
+ ---
44
+
45
+ ## Formatting
46
+
47
+ *Add your Prettier configuration*
48
+
49
+ ---
50
+
51
+ ## Git Workflow
52
+
53
+ *Define your branching strategy and commit conventions*
54
+
55
+ ---
56
+
57
+ ## Code Review
58
+
59
+ *Define your code review process*
60
+
61
+ ---
62
+
63
+ *Last Updated: ${new Date().toISOString().split('T')[0]}*
64
+ `;
65
+ }
66
+ function generateStrictTemplate(config) {
67
+ return `# Coding Standards - ${config.name}
68
+
69
+ **Preset:** TypeScript Strict
70
+
71
+ ---
72
+
73
+ ## TypeScript Configuration
74
+
75
+ \`\`\`json
76
+ // tsconfig.json
77
+ {
78
+ "compilerOptions": {
79
+ "target": "ES2022",
80
+ "module": "NodeNext",
81
+ "moduleResolution": "NodeNext",
82
+ "strict": true,
83
+ "noUncheckedIndexedAccess": true,
84
+ "noImplicitReturns": true,
85
+ "noFallthroughCasesInSwitch": true,
86
+ "noUnusedLocals": true,
87
+ "noUnusedParameters": true,
88
+ "exactOptionalPropertyTypes": true,
89
+ "esModuleInterop": true,
90
+ "skipLibCheck": true,
91
+ "forceConsistentCasingInFileNames": true,
92
+ "declaration": true,
93
+ "declarationMap": true,
94
+ "sourceMap": true
95
+ }
96
+ }
97
+ \`\`\`
98
+
99
+ ---
100
+
101
+ ## ESLint Configuration
102
+
103
+ \`\`\`javascript
104
+ // eslint.config.js
105
+ import eslint from '@eslint/js';
106
+ import tseslint from 'typescript-eslint';
107
+
108
+ export default tseslint.config(
109
+ eslint.configs.recommended,
110
+ ...tseslint.configs.strictTypeChecked,
111
+ {
112
+ languageOptions: {
113
+ parserOptions: {
114
+ projectService: true,
115
+ tsconfigRootDir: import.meta.dirname,
116
+ },
117
+ },
118
+ rules: {
119
+ '@typescript-eslint/explicit-function-return-type': 'error',
120
+ '@typescript-eslint/no-explicit-any': 'error',
121
+ '@typescript-eslint/prefer-readonly': 'error',
122
+ '@typescript-eslint/no-unused-vars': [
123
+ 'error',
124
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
125
+ ],
126
+ },
127
+ }
128
+ );
129
+ \`\`\`
130
+
131
+ ---
132
+
133
+ ## Prettier Configuration
134
+
135
+ \`\`\`json
136
+ // .prettierrc
137
+ {
138
+ "semi": true,
139
+ "singleQuote": true,
140
+ "tabWidth": 2,
141
+ "trailingComma": "es5",
142
+ "printWidth": 100
143
+ }
144
+ \`\`\`
145
+
146
+ ---
147
+
148
+ ## Git Workflow
149
+
150
+ ### Branch Naming
151
+
152
+ \`\`\`
153
+ feat/feature-name # New features
154
+ fix/bug-description # Bug fixes
155
+ docs/update-area # Documentation
156
+ refactor/area # Code refactoring
157
+ \`\`\`
158
+
159
+ ### Commit Messages (Conventional Commits)
160
+
161
+ \`\`\`
162
+ feat: add user authentication
163
+ fix: resolve login redirect issue
164
+ docs: update API documentation
165
+ refactor: simplify database queries
166
+ test: add unit tests for auth module
167
+ chore: update dependencies
168
+ \`\`\`
169
+
170
+ ---
171
+
172
+ ## Code Review Checklist
173
+
174
+ Before merging, verify:
175
+
176
+ - [ ] All tests pass
177
+ - [ ] No TypeScript errors
178
+ - [ ] ESLint passes with no errors
179
+ - [ ] Code follows project patterns
180
+ - [ ] Documentation updated if needed
181
+ - [ ] No sensitive data in commits
182
+
183
+ ---
184
+
185
+ ## File Organization
186
+
187
+ \`\`\`
188
+ src/
189
+ ├── components/ # UI components
190
+ ├── features/ # Feature modules
191
+ ├── lib/ # Shared utilities
192
+ ├── hooks/ # Custom hooks
193
+ ├── types/ # TypeScript types
194
+ └── index.ts # Entry point
195
+ \`\`\`
196
+
197
+ ---
198
+
199
+ *Last Updated: ${new Date().toISOString().split('T')[0]}*
200
+ `;
201
+ }
202
+ function generateRelaxedTemplate(config) {
203
+ return `# Coding Standards - ${config.name}
204
+
205
+ **Preset:** TypeScript Relaxed
206
+
207
+ ---
208
+
209
+ ## TypeScript Configuration
210
+
211
+ \`\`\`json
212
+ // tsconfig.json
213
+ {
214
+ "compilerOptions": {
215
+ "target": "ES2022",
216
+ "module": "NodeNext",
217
+ "moduleResolution": "NodeNext",
218
+ "strict": true,
219
+ "esModuleInterop": true,
220
+ "skipLibCheck": true,
221
+ "forceConsistentCasingInFileNames": true,
222
+ "declaration": true,
223
+ "sourceMap": true
224
+ }
225
+ }
226
+ \`\`\`
227
+
228
+ ---
229
+
230
+ ## ESLint Configuration
231
+
232
+ \`\`\`javascript
233
+ // eslint.config.js
234
+ import eslint from '@eslint/js';
235
+ import tseslint from 'typescript-eslint';
236
+
237
+ export default tseslint.config(
238
+ eslint.configs.recommended,
239
+ ...tseslint.configs.recommended,
240
+ {
241
+ languageOptions: {
242
+ parserOptions: {
243
+ projectService: true,
244
+ tsconfigRootDir: import.meta.dirname,
245
+ },
246
+ },
247
+ rules: {
248
+ '@typescript-eslint/no-unused-vars': [
249
+ 'warn',
250
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
251
+ ],
252
+ '@typescript-eslint/no-explicit-any': 'warn',
253
+ },
254
+ }
255
+ );
256
+ \`\`\`
257
+
258
+ ---
259
+
260
+ ## Prettier Configuration
261
+
262
+ \`\`\`json
263
+ // .prettierrc
264
+ {
265
+ "semi": true,
266
+ "singleQuote": true,
267
+ "tabWidth": 2,
268
+ "trailingComma": "es5",
269
+ "printWidth": 100
270
+ }
271
+ \`\`\`
272
+
273
+ ---
274
+
275
+ ## Git Workflow
276
+
277
+ ### Commit Messages
278
+
279
+ Use descriptive commit messages. Conventional commits encouraged but not required:
280
+
281
+ \`\`\`
282
+ feat: add user authentication
283
+ fix: resolve login redirect issue
284
+ Update README
285
+ \`\`\`
286
+
287
+ ---
288
+
289
+ ## Code Review
290
+
291
+ - Tests should pass before merging
292
+ - No TypeScript errors
293
+ - Code should be readable
294
+
295
+ ---
296
+
297
+ *Last Updated: ${new Date().toISOString().split('T')[0]}*
298
+ `;
299
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * COMPILR.md Template Generator
3
+ *
4
+ * Generates the AI assistant context file.
5
+ */
6
+ import type { ProjectConfig } from './types.js';
7
+ export declare function generateCompilrMd(config: ProjectConfig): string;
@@ -0,0 +1,189 @@
1
+ /**
2
+ * COMPILR.md Template Generator
3
+ *
4
+ * Generates the AI assistant context file.
5
+ */
6
+ export function generateCompilrMd(config) {
7
+ const techStackSection = generateTechStackSection(config);
8
+ const codingStandardsSection = generateCodingStandardsSection(config);
9
+ return `# COMPILR.md
10
+
11
+ This file provides guidance to AI coding assistants when working with this project.
12
+
13
+ ---
14
+
15
+ ## Project Overview
16
+
17
+ **Project:** ${config.name}
18
+ **Description:** ${config.description}
19
+
20
+ ---
21
+
22
+ ${techStackSection}
23
+
24
+ ---
25
+
26
+ ${codingStandardsSection}
27
+
28
+ ---
29
+
30
+ ## Project Structure
31
+
32
+ ${config.repoPattern === 'single' ? generateSingleRepoStructure() : generateTwoRepoStructure(config.name)}
33
+
34
+ ---
35
+
36
+ ## Architecture Decisions
37
+
38
+ Key architectural decisions are documented in:
39
+ - ${config.repoPattern === 'single' ? '`.compilr/architecture/decisions/`' : '`02-architecture/decisions/`'}
40
+
41
+ When making significant technical choices, create an ADR (Architecture Decision Record).
42
+
43
+ ---
44
+
45
+ ## Current Focus
46
+
47
+ *Updated by session management - tracks current sprint/milestone*
48
+
49
+ ---
50
+
51
+ ## Key Files
52
+
53
+ *Auto-populated based on usage - frequently referenced files appear here*
54
+
55
+ ---
56
+
57
+ ## Development Commands
58
+
59
+ \`\`\`bash
60
+ # Development
61
+ npm run dev # Start development server
62
+ npm run build # Production build
63
+ npm run lint # Lint code
64
+ npm run test # Run tests
65
+
66
+ # Project workflow
67
+ compilr start # Begin coding session with context
68
+ compilr save # Save session progress
69
+ compilr backlog # View/manage tasks
70
+ \`\`\`
71
+
72
+ ---
73
+
74
+ ## Notes for AI Assistants
75
+
76
+ 1. **Always read this file first** when starting a session
77
+ 2. **Check the backlog** before starting new work
78
+ 3. **Follow coding standards** defined in this project
79
+ 4. **Document decisions** when making architectural choices
80
+ 5. **Update session notes** at the end of each session
81
+
82
+ ---
83
+
84
+ *Last Updated: ${new Date().toISOString().split('T')[0]}*
85
+ `;
86
+ }
87
+ function generateTechStackSection(config) {
88
+ if (config.techStack === 'custom') {
89
+ return `## Tech Stack
90
+
91
+ *To be configured - update this section with your chosen technologies*
92
+
93
+ | Component | Technology | Notes |
94
+ |-----------|------------|-------|
95
+ | Frontend | TBD | |
96
+ | Backend | TBD | |
97
+ | Database | TBD | |
98
+ | Hosting | TBD | |`;
99
+ }
100
+ const stacks = {
101
+ 'react-node-pg': `## Tech Stack
102
+
103
+ | Component | Technology | Notes |
104
+ |-----------|------------|-------|
105
+ | Frontend | React 18 + Vite | TypeScript, modern React |
106
+ | Backend | Node.js + Express | TypeScript, REST API |
107
+ | Database | PostgreSQL | Relational, ACID compliant |
108
+ | ORM | Prisma | Type-safe database access |`,
109
+ 'react-python-pg': `## Tech Stack
110
+
111
+ | Component | Technology | Notes |
112
+ |-----------|------------|-------|
113
+ | Frontend | React 18 + Vite | TypeScript, modern React |
114
+ | Backend | Python + FastAPI | Async, auto-docs |
115
+ | Database | PostgreSQL | Relational, ACID compliant |
116
+ | ORM | SQLAlchemy | Python ORM |`,
117
+ 'vue-node-pg': `## Tech Stack
118
+
119
+ | Component | Technology | Notes |
120
+ |-----------|------------|-------|
121
+ | Frontend | Vue 3 + Vite | TypeScript, Composition API |
122
+ | Backend | Node.js + Express | TypeScript, REST API |
123
+ | Database | PostgreSQL | Relational, ACID compliant |
124
+ | ORM | Prisma | Type-safe database access |`,
125
+ };
126
+ return stacks[config.techStack] ?? stacks['react-node-pg'];
127
+ }
128
+ function generateCodingStandardsSection(config) {
129
+ if (config.codingStandards === 'custom') {
130
+ return `## Coding Standards
131
+
132
+ *To be configured - update this section with your coding standards*
133
+
134
+ See ${config.repoPattern === 'single' ? '`.compilr/architecture/coding-standards.md`' : '`02-architecture/coding-standards.md`'} for details.`;
135
+ }
136
+ const standards = config.codingStandards === 'strict'
137
+ ? `## Coding Standards
138
+
139
+ **Preset:** TypeScript Strict
140
+
141
+ - TypeScript strict mode enabled
142
+ - ESLint + Prettier configured
143
+ - Conventional commits required
144
+ - No \`any\` types allowed
145
+ - Explicit return types required
146
+ - Comprehensive error handling
147
+
148
+ See ${config.repoPattern === 'single' ? '`.compilr/architecture/coding-standards.md`' : '`02-architecture/coding-standards.md`'} for full details.`
149
+ : `## Coding Standards
150
+
151
+ **Preset:** TypeScript Relaxed
152
+
153
+ - TypeScript with relaxed settings
154
+ - ESLint + Prettier configured
155
+ - Conventional commits encouraged
156
+ - \`any\` types discouraged but allowed
157
+ - Implicit return types allowed
158
+
159
+ See ${config.repoPattern === 'single' ? '`.compilr/architecture/coding-standards.md`' : '`02-architecture/coding-standards.md`'} for full details.`;
160
+ return standards;
161
+ }
162
+ function generateSingleRepoStructure() {
163
+ return `\`\`\`
164
+ {project}/
165
+ ├── .compilr/ # Workflow files
166
+ │ ├── backlog.md # Task tracking
167
+ │ ├── architecture/ # ADRs, coding standards
168
+ │ └── sessions/ # Session notes
169
+ ├── src/ # Source code
170
+ ├── COMPILR.md # This file
171
+ ├── package.json
172
+ └── README.md
173
+ \`\`\``;
174
+ }
175
+ function generateTwoRepoStructure(name) {
176
+ return `\`\`\`
177
+ ${name}/ # Code repository
178
+ ├── src/
179
+ ├── package.json
180
+ └── README.md
181
+
182
+ ${name}-docs/ # Documentation repository
183
+ ├── .compilr/
184
+ ├── COMPILR.md # This file
185
+ ├── 01-planning/ # Backlog, roadmap
186
+ ├── 02-architecture/ # ADRs, standards
187
+ └── 04-session-notes/ # Session history
188
+ \`\`\``;
189
+ }