cortex-tms 2.1.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 (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +258 -0
  3. package/bin/cortex-tms.js +34 -0
  4. package/dist/__tests__/init.test.d.ts +2 -0
  5. package/dist/__tests__/init.test.d.ts.map +1 -0
  6. package/dist/__tests__/init.test.js +172 -0
  7. package/dist/__tests__/init.test.js.map +1 -0
  8. package/dist/__tests__/utils/temp-dir.d.ts +6 -0
  9. package/dist/__tests__/utils/temp-dir.d.ts.map +1 -0
  10. package/dist/__tests__/utils/temp-dir.js +34 -0
  11. package/dist/__tests__/utils/temp-dir.js.map +1 -0
  12. package/dist/__tests__/validate.test.d.ts +2 -0
  13. package/dist/__tests__/validate.test.d.ts.map +1 -0
  14. package/dist/__tests__/validate.test.js +207 -0
  15. package/dist/__tests__/validate.test.js.map +1 -0
  16. package/dist/cli.d.ts +3 -0
  17. package/dist/cli.d.ts.map +1 -0
  18. package/dist/cli.js +32 -0
  19. package/dist/cli.js.map +1 -0
  20. package/dist/commands/init.d.ts +4 -0
  21. package/dist/commands/init.d.ts.map +1 -0
  22. package/dist/commands/init.js +121 -0
  23. package/dist/commands/init.js.map +1 -0
  24. package/dist/commands/validate.d.ts +4 -0
  25. package/dist/commands/validate.d.ts.map +1 -0
  26. package/dist/commands/validate.js +151 -0
  27. package/dist/commands/validate.js.map +1 -0
  28. package/dist/types/cli.d.ts +94 -0
  29. package/dist/types/cli.d.ts.map +1 -0
  30. package/dist/types/cli.js +2 -0
  31. package/dist/types/cli.js.map +1 -0
  32. package/dist/utils/config.d.ts +13 -0
  33. package/dist/utils/config.d.ts.map +1 -0
  34. package/dist/utils/config.js +185 -0
  35. package/dist/utils/config.js.map +1 -0
  36. package/dist/utils/detection.d.ts +5 -0
  37. package/dist/utils/detection.d.ts.map +1 -0
  38. package/dist/utils/detection.js +60 -0
  39. package/dist/utils/detection.js.map +1 -0
  40. package/dist/utils/prompts.d.ts +5 -0
  41. package/dist/utils/prompts.d.ts.map +1 -0
  42. package/dist/utils/prompts.js +82 -0
  43. package/dist/utils/prompts.js.map +1 -0
  44. package/dist/utils/templates.d.ts +14 -0
  45. package/dist/utils/templates.d.ts.map +1 -0
  46. package/dist/utils/templates.js +98 -0
  47. package/dist/utils/templates.js.map +1 -0
  48. package/dist/utils/validator.d.ts +12 -0
  49. package/dist/utils/validator.d.ts.map +1 -0
  50. package/dist/utils/validator.js +241 -0
  51. package/dist/utils/validator.js.map +1 -0
  52. package/package.json +69 -0
  53. package/templates/.github/copilot-instructions.md +28 -0
  54. package/templates/CLAUDE.md +18 -0
  55. package/templates/FUTURE-ENHANCEMENTS.md +79 -0
  56. package/templates/NEXT-TASKS.md +20 -0
  57. package/templates/README.md +172 -0
  58. package/templates/docs/archive/v1.0-CHANGELOG.md +0 -0
  59. package/templates/docs/core/ARCHITECTURE.md +102 -0
  60. package/templates/docs/core/DECISIONS.md +83 -0
  61. package/templates/docs/core/DOMAIN-LOGIC.md +8 -0
  62. package/templates/docs/core/GLOSSARY.md +66 -0
  63. package/templates/docs/core/PATTERNS.md +55 -0
  64. package/templates/docs/core/SCHEMA.md +246 -0
  65. package/templates/docs/core/TROUBLESHOOTING.md +325 -0
@@ -0,0 +1,241 @@
1
+ import { readFile } from 'fs/promises';
2
+ import { existsSync } from 'fs';
3
+ import { join } from 'path';
4
+ import { loadConfig, mergeConfig, getEffectiveLineLimits, } from './config.js';
5
+ export const DEFAULT_LINE_LIMITS = {
6
+ 'NEXT-TASKS.md': 200,
7
+ 'FUTURE-ENHANCEMENTS.md': 500,
8
+ 'ARCHITECTURE.md': 500,
9
+ 'PATTERNS.md': 500,
10
+ 'DOMAIN-LOGIC.md': 300,
11
+ 'DECISIONS.md': 400,
12
+ 'GLOSSARY.md': 200,
13
+ 'SCHEMA.md': 600,
14
+ 'TROUBLESHOOTING.md': 400,
15
+ };
16
+ export const MANDATORY_FILES = [
17
+ 'NEXT-TASKS.md',
18
+ '.github/copilot-instructions.md',
19
+ 'CLAUDE.md',
20
+ ];
21
+ const PLACEHOLDER_PATTERNS = [
22
+ /\[Project Name\]/g,
23
+ /\[project-name\]/g,
24
+ /\[Description\]/g,
25
+ /\[Your Name\]/g,
26
+ /\[Repository URL\]/g,
27
+ ];
28
+ async function countLines(filePath) {
29
+ try {
30
+ const content = await readFile(filePath, 'utf-8');
31
+ return content.split('\n').length;
32
+ }
33
+ catch {
34
+ return 0;
35
+ }
36
+ }
37
+ async function scanForPlaceholders(filePath) {
38
+ try {
39
+ const content = await readFile(filePath, 'utf-8');
40
+ const found = [];
41
+ for (const pattern of PLACEHOLDER_PATTERNS) {
42
+ const matches = content.match(pattern);
43
+ if (matches) {
44
+ found.push(...matches);
45
+ }
46
+ }
47
+ return {
48
+ found: found.length > 0,
49
+ placeholders: [...new Set(found)],
50
+ };
51
+ }
52
+ catch {
53
+ return { found: false, placeholders: [] };
54
+ }
55
+ }
56
+ async function countCompletedTasks(filePath) {
57
+ try {
58
+ const content = await readFile(filePath, 'utf-8');
59
+ const doneMatches = content.match(/\|\s*โœ…\s*(Done|Complete)\s*\|/gi);
60
+ return doneMatches ? doneMatches.length : 0;
61
+ }
62
+ catch {
63
+ return 0;
64
+ }
65
+ }
66
+ function hasArchiveDirectory(cwd) {
67
+ return existsSync(join(cwd, 'docs/archive'));
68
+ }
69
+ export async function validateFileSizes(cwd, limits = DEFAULT_LINE_LIMITS) {
70
+ const checks = [];
71
+ for (const [filename, limit] of Object.entries(limits)) {
72
+ const filePath = join(cwd, filename);
73
+ if (!existsSync(filePath)) {
74
+ continue;
75
+ }
76
+ const lineCount = await countLines(filePath);
77
+ if (lineCount > limit) {
78
+ checks.push({
79
+ name: `File Size: ${filename}`,
80
+ passed: false,
81
+ level: 'warning',
82
+ message: `${filename} exceeds recommended line limit`,
83
+ details: `Current: ${lineCount} lines | Limit: ${limit} lines | Overage: ${lineCount - limit} lines`,
84
+ file: filename,
85
+ });
86
+ }
87
+ else {
88
+ checks.push({
89
+ name: `File Size: ${filename}`,
90
+ passed: true,
91
+ level: 'info',
92
+ message: `${filename} is within size limits`,
93
+ details: `${lineCount}/${limit} lines`,
94
+ file: filename,
95
+ });
96
+ }
97
+ }
98
+ return checks;
99
+ }
100
+ export function validateMandatoryFiles(cwd) {
101
+ const checks = [];
102
+ for (const file of MANDATORY_FILES) {
103
+ const filePath = join(cwd, file);
104
+ const exists = existsSync(filePath);
105
+ checks.push({
106
+ name: `Mandatory File: ${file}`,
107
+ passed: exists,
108
+ level: exists ? 'info' : 'error',
109
+ message: exists
110
+ ? `${file} exists`
111
+ : `${file} is missing (required for TMS)`,
112
+ file,
113
+ });
114
+ }
115
+ return checks;
116
+ }
117
+ export async function validatePlaceholders(cwd, ignoreFiles = []) {
118
+ const checks = [];
119
+ const filesToScan = [
120
+ 'README.md',
121
+ 'NEXT-TASKS.md',
122
+ 'CLAUDE.md',
123
+ 'FUTURE-ENHANCEMENTS.md',
124
+ 'docs/core/ARCHITECTURE.md',
125
+ 'docs/core/PATTERNS.md',
126
+ 'docs/core/DOMAIN-LOGIC.md',
127
+ ];
128
+ for (const file of filesToScan) {
129
+ if (ignoreFiles.includes(file)) {
130
+ continue;
131
+ }
132
+ const filePath = join(cwd, file);
133
+ if (!existsSync(filePath)) {
134
+ continue;
135
+ }
136
+ const { found, placeholders } = await scanForPlaceholders(filePath);
137
+ if (found) {
138
+ checks.push({
139
+ name: `Placeholders: ${file}`,
140
+ passed: false,
141
+ level: 'warning',
142
+ message: `${file} contains unreplaced placeholders`,
143
+ details: `Found: ${placeholders.join(', ')}`,
144
+ file,
145
+ });
146
+ }
147
+ else {
148
+ checks.push({
149
+ name: `Placeholders: ${file}`,
150
+ passed: true,
151
+ level: 'info',
152
+ message: `${file} has no unreplaced placeholders`,
153
+ file,
154
+ });
155
+ }
156
+ }
157
+ return checks;
158
+ }
159
+ export async function validateArchiveStatus(cwd) {
160
+ const checks = [];
161
+ const nextTasksPath = join(cwd, 'NEXT-TASKS.md');
162
+ if (!existsSync(nextTasksPath)) {
163
+ return checks;
164
+ }
165
+ const completedCount = await countCompletedTasks(nextTasksPath);
166
+ const hasArchive = hasArchiveDirectory(cwd);
167
+ if (completedCount > 10) {
168
+ checks.push({
169
+ name: 'Archive Status',
170
+ passed: false,
171
+ level: 'warning',
172
+ message: 'Too many completed tasks in NEXT-TASKS.md',
173
+ details: `${completedCount} completed tasks should be archived to docs/archive/`,
174
+ file: 'NEXT-TASKS.md',
175
+ });
176
+ }
177
+ else if (completedCount > 5) {
178
+ checks.push({
179
+ name: 'Archive Status',
180
+ passed: true,
181
+ level: 'info',
182
+ message: 'Consider archiving completed tasks soon',
183
+ details: `${completedCount} completed tasks in NEXT-TASKS.md`,
184
+ file: 'NEXT-TASKS.md',
185
+ });
186
+ }
187
+ else {
188
+ checks.push({
189
+ name: 'Archive Status',
190
+ passed: true,
191
+ level: 'info',
192
+ message: 'Active task list is healthy',
193
+ details: `${completedCount} completed tasks`,
194
+ file: 'NEXT-TASKS.md',
195
+ });
196
+ }
197
+ if (!hasArchive && completedCount > 0) {
198
+ checks.push({
199
+ name: 'Archive Directory',
200
+ passed: false,
201
+ level: 'warning',
202
+ message: 'No archive directory found',
203
+ details: 'Create docs/archive/ to store completed sprint history',
204
+ });
205
+ }
206
+ return checks;
207
+ }
208
+ export async function validateProject(cwd, options = {}) {
209
+ const { strict = false } = options;
210
+ const userConfig = await loadConfig(cwd);
211
+ const config = mergeConfig(userConfig);
212
+ const limits = options.limits || getEffectiveLineLimits(config);
213
+ const ignoreFiles = config.validation?.ignoreFiles || [];
214
+ const [fileSizeChecks, mandatoryChecks, placeholderChecks, archiveChecks] = await Promise.all([
215
+ validateFileSizes(cwd, limits),
216
+ Promise.resolve(validateMandatoryFiles(cwd)),
217
+ validatePlaceholders(cwd, ignoreFiles),
218
+ validateArchiveStatus(cwd),
219
+ ]);
220
+ const checks = [
221
+ ...mandatoryChecks,
222
+ ...fileSizeChecks,
223
+ ...placeholderChecks,
224
+ ...archiveChecks,
225
+ ];
226
+ const summary = {
227
+ total: checks.length,
228
+ passed: checks.filter((c) => c.passed).length,
229
+ warnings: checks.filter((c) => c.level === 'warning').length,
230
+ errors: checks.filter((c) => c.level === 'error').length,
231
+ };
232
+ const hasErrors = summary.errors > 0;
233
+ const hasWarnings = summary.warnings > 0;
234
+ const passed = strict ? !hasErrors && !hasWarnings : !hasErrors;
235
+ return {
236
+ passed,
237
+ checks,
238
+ summary,
239
+ };
240
+ }
241
+ //# sourceMappingURL=validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/utils/validator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAO5B,OAAO,EACL,UAAU,EACV,WAAW,EACX,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAMrB,MAAM,CAAC,MAAM,mBAAmB,GAAe;IAC7C,eAAe,EAAE,GAAG;IACpB,wBAAwB,EAAE,GAAG;IAC7B,iBAAiB,EAAE,GAAG;IACtB,aAAa,EAAE,GAAG;IAClB,iBAAiB,EAAE,GAAG;IACtB,cAAc,EAAE,GAAG;IACnB,aAAa,EAAE,GAAG;IAClB,WAAW,EAAE,GAAG;IAChB,oBAAoB,EAAE,GAAG;CAC1B,CAAC;AAKF,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,eAAe;IACf,iCAAiC;IACjC,WAAW;CACZ,CAAC;AAKF,MAAM,oBAAoB,GAAG;IAC3B,mBAAmB;IACnB,mBAAmB;IACnB,kBAAkB;IAClB,gBAAgB;IAChB,qBAAqB;CACtB,CAAC;AAKF,KAAK,UAAU,UAAU,CAAC,QAAgB;IACxC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EA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AG,EAAE,WAAW,CAAC;QACtC,qBAAqB,CAAC,GAAG,CAAC;KAC3B,CAAC,CAAC;IAEL,MAAM,MAAM,GAAG;QACb,GAAG,eAAe;QAClB,GAAG,cAAc;QACjB,GAAG,iBAAiB;QACpB,GAAG,aAAa;KACjB,CAAC;IAGF,MAAM,OAAO,GAAG;QACd,KAAK,EAAE,MAAM,CAAC,MAAM;QACpB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM;QAC7C,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,MAAM;QAC5D,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,MAAM;KACzD,CAAC;IAGF,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEhE,OAAO;QACL,MAAM;QACN,MAAM;QACN,OAAO;KACR,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "cortex-tms",
3
+ "version": "2.1.0",
4
+ "description": "The Universal AI-Optimized Project Boilerplate - CLI tool for bootstrapping TMS-structured projects",
5
+ "type": "module",
6
+ "bin": {
7
+ "cortex-tms": "./bin/cortex-tms.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "dist/",
12
+ "templates/",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18.0.0"
18
+ },
19
+ "scripts": {
20
+ "build": "pnpm run cli:build",
21
+ "prepublishOnly": "pnpm run build",
22
+ "cli:dev": "tsx src/cli.ts",
23
+ "cli:build": "tsc -p tsconfig.cli.json",
24
+ "cli:test": "node bin/cortex-tms.js --help",
25
+ "test": "vitest run",
26
+ "test:watch": "vitest",
27
+ "test:coverage": "vitest run --coverage",
28
+ "lint": "eslint src/**/*.ts",
29
+ "format": "prettier --write \"src/**/*.ts\""
30
+ },
31
+ "keywords": [
32
+ "documentation",
33
+ "boilerplate",
34
+ "ai",
35
+ "copilot",
36
+ "claude",
37
+ "tms",
38
+ "cli",
39
+ "generator",
40
+ "template"
41
+ ],
42
+ "author": "Cortex TMS Contributors",
43
+ "license": "MIT",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/cortex-tms/cortex-tms.git"
47
+ },
48
+ "bugs": {
49
+ "url": "https://github.com/cortex-tms/cortex-tms/issues"
50
+ },
51
+ "homepage": "https://github.com/cortex-tms/cortex-tms#readme",
52
+ "dependencies": {
53
+ "chalk": "^5.3.0",
54
+ "commander": "^12.1.0",
55
+ "fs-extra": "^11.2.0",
56
+ "inquirer": "^10.2.2",
57
+ "ora": "^8.1.0"
58
+ },
59
+ "devDependencies": {
60
+ "@types/fs-extra": "^11.0.4",
61
+ "@types/inquirer": "^9.0.7",
62
+ "@types/node": "^20.17.10",
63
+ "eslint": "^9.17.0",
64
+ "prettier": "^3.4.2",
65
+ "tsx": "^4.19.2",
66
+ "typescript": "^5.7.3",
67
+ "vitest": "^4.0.17"
68
+ }
69
+ }
@@ -0,0 +1,28 @@
1
+ # AI Pair Programmer: Collaboration Protocol (TMS v2.0)
2
+
3
+ ## โšก Critical Rules (Always Apply)
4
+
5
+ - **Tech Stack**: [e.g., Next.js 15, TypeScript Strict, Tailwind CSS].
6
+ - **Conventions**: Favor functional programming and composition over inheritance.
7
+ - **Types**: ALWAYS use strict TypeScript. No `any`. No `@ts-ignore`.
8
+ - **Logic**: Before implementing business logic, check `docs/core/DOMAIN-LOGIC.md`.
9
+
10
+ ## ๐Ÿ—๏ธ Technical Map (Read Order)
11
+
12
+ AI agents MUST follow this order before proposing code:
13
+
14
+ 1. `NEXT-TASKS.md` (Current context)
15
+ 2. `docs/core/DOMAIN-LOGIC.md` (Project rules)
16
+ 3. `docs/core/PATTERNS.md` (Coding standards)
17
+
18
+ ## ๐Ÿšซ Prohibitions
19
+
20
+ - Never store secrets or API keys in code.
21
+ - Never bypass linting or type-checking.
22
+ - Never implement features not listed in `NEXT-TASKS.md` without asking.
23
+
24
+ ## โœ”๏ธ Pre-Submission Checklist
25
+
26
+ - [ ] Logic verified against DOMAIN-LOGIC.md.
27
+ - [ ] Tests added/updated and passing.
28
+ - [ ] No `console.log` statements remaining.
@@ -0,0 +1,18 @@
1
+ # ๐Ÿค– Agent Workflow & Persona
2
+
3
+ ## ๐ŸŽฏ Role
4
+
5
+ Expert Senior Developer. Follow the **"Propose, Justify, Recommend"** framework.
6
+
7
+ ## ๐Ÿ’ป CLI Commands
8
+
9
+ - **Test**: `npm test` or `pnpm test`
10
+ - **Lint**: `npm run lint`
11
+ - **Build**: `npm run build`
12
+
13
+ ## ๐Ÿ›  Operational Loop
14
+
15
+ 1. Read `NEXT-TASKS.md` to understand the current objective.
16
+ 2. Cross-reference `docs/core/PATTERNS.md` for existing code conventions.
17
+ 3. If unsure of a term, check `docs/core/GLOSSARY.md`.
18
+ 4. Execute TDD (Test-Driven Development).
@@ -0,0 +1,79 @@
1
+ # FUTURE: Planned Enhancements
2
+
3
+ This is the **living backlog** for [Project Name]. Tasks move from here to `NEXT-TASKS.md` when they become active in the current sprint.
4
+
5
+ **Purpose**: Keep `NEXT-TASKS.md` focused (< 200 lines) by storing future work here.
6
+
7
+ ---
8
+
9
+ ## ๐Ÿ”ด High Priority (Next 1-2 Months)
10
+
11
+ ### [Feature Category 1]
12
+
13
+ - **[Feature Name]**: [Brief description of what needs to be built]
14
+ - **Why**: [User value or technical necessity]
15
+ - **Effort**: [Estimated time - e.g., 4h, 2 days]
16
+ - **Dependencies**: [What must be done first - e.g., "Requires auth system"]
17
+ - **Ref**: [Optional external ticket - e.g., [#42], [PROJ-123]]
18
+
19
+ - **[Feature Name]**: [Brief description]
20
+ - **Why**: [User value or technical necessity]
21
+ - **Effort**: [Estimated time]
22
+ - **Dependencies**: [What must be done first]
23
+ - **Ref**: [Optional external ticket]
24
+
25
+ ---
26
+
27
+ ## ๐ŸŸก Medium Priority (Next 3-6 Months)
28
+
29
+ ### [Feature Category 2]
30
+
31
+ - **[Feature Name]**: [Brief description]
32
+ - **Why**: [User value or technical necessity]
33
+ - **Effort**: [Estimated time]
34
+ - **Impact**: [High | Medium | Low]
35
+ - **Ref**: [Optional external ticket]
36
+
37
+ ---
38
+
39
+ ## ๐ŸŸข Low Priority (Backlog / "Someday")
40
+
41
+ ### [Feature Category 3]
42
+
43
+ - **[Feature Name]**: [Brief description]
44
+ - **Why**: [User value or technical necessity]
45
+ - **Effort**: [Estimated time]
46
+ - **Blocker**: [Why it's not high priority - e.g., "Waiting for Next.js 16 stable"]
47
+ - **Ref**: [Optional external ticket]
48
+
49
+ ---
50
+
51
+ ## ๐Ÿงช Experimental Ideas (R&D)
52
+
53
+ ### [Research Topic 1]
54
+
55
+ - **[Idea Name]**: [Brief description of what we'd explore]
56
+ - **Hypothesis**: [What we think might work]
57
+ - **Success Criteria**: [How we'd know if it's valuable]
58
+ - **Effort**: [Research time estimate]
59
+ - **Risk**: [What could go wrong]
60
+
61
+ ---
62
+
63
+ ## โœ… Promotion Criteria
64
+
65
+ A task moves from FUTURE โ†’ NEXT when:
66
+ 1. **User Approval**: Explicitly prioritized by project lead
67
+ 2. **Dependencies Met**: All blocking tasks are complete
68
+ 3. **Capacity Available**: `NEXT-TASKS.md` has < 5 active tasks
69
+ 4. **Sprint Alignment**: Fits within current sprint theme
70
+
71
+ **See**: `docs/core/DOMAIN-LOGIC.md#rule-6-archive-promote` for full protocol
72
+
73
+ ---
74
+
75
+ ## ๐Ÿ—‘๏ธ Archive (Rejected / No Longer Relevant)
76
+
77
+ ### [YYYY-MM-DD] - [Rejected Idea Name]
78
+ **Why Rejected**: [Reason - e.g., "User research showed low demand", "Technical complexity too high"]
79
+ **Alternative**: [What we did instead - e.g., "Built simplified version in Sprint 3"]
@@ -0,0 +1,20 @@
1
+ # NEXT: Upcoming Tasks
2
+
3
+ ## Active Sprint: [Feature Name]
4
+
5
+ **Why this matters**: [Briefly describe user value or technical necessity]
6
+
7
+ | Task | Ref | Effort | Priority | Status |
8
+ | :--- | :--- | :----- | :------- | :----- |
9
+ | **Feature Setup** - Initial scaffold | - | 2h | ๐ŸŸก MED | โฌœ Todo |
10
+
11
+ **Ref Column**:
12
+ - `[#123]` = GitHub Issue
13
+ - `[PROJ-123]` = Jira/other PM tool
14
+ - `-` = No external reference
15
+
16
+ ## ๐ŸŽฏ Definition of Done
17
+
18
+ - [ ] Tests passing
19
+ - [ ] Documentation updated in `docs/core/`
20
+ - [ ] Code follows `docs/core/PATTERNS.md`
@@ -0,0 +1,172 @@
1
+ # [Project Name]
2
+
3
+ **[One-line description of what this project does]**
4
+
5
+ [2-3 sentence overview explaining the problem this project solves and who it's for]
6
+
7
+ ---
8
+
9
+ ## ๐Ÿš€ Quick Start
10
+
11
+ ### Prerequisites
12
+ - [e.g., Node.js 20+]
13
+ - [e.g., PostgreSQL 15+]
14
+ - [e.g., Package manager: pnpm, npm, yarn]
15
+
16
+ ### Installation
17
+
18
+ ```bash
19
+ # Clone the repository
20
+ git clone [repository-url]
21
+ cd [project-name]
22
+
23
+ # Install dependencies
24
+ [package-manager] install
25
+
26
+ # Set up environment variables
27
+ cp .env.example .env
28
+ # Edit .env with your configuration
29
+
30
+ # Run database migrations (if applicable)
31
+ [migration-command]
32
+
33
+ # Start development server
34
+ [dev-command]
35
+ ```
36
+
37
+ ---
38
+
39
+ ## ๐Ÿ“‚ Project Structure
40
+
41
+ ```
42
+ .
43
+ โ”œโ”€โ”€ [folder-name]/ # [Description]
44
+ โ”œโ”€โ”€ [folder-name]/ # [Description]
45
+ โ”œโ”€โ”€ docs/
46
+ โ”‚ โ”œโ”€โ”€ core/ # WARM tier - Technical documentation
47
+ โ”‚ โ””โ”€โ”€ archive/ # COLD tier - Historical context
48
+ โ”œโ”€โ”€ NEXT-TASKS.md # HOT tier - Current sprint
49
+ โ””โ”€โ”€ CLAUDE.md # HOT tier - AI agent workflow
50
+ ```
51
+
52
+ **See**: `docs/core/ARCHITECTURE.md` for detailed system design
53
+
54
+ ---
55
+
56
+ ## ๐ŸŽฏ Features
57
+
58
+ - **[Feature 1]**: [Brief description and user value]
59
+ - **[Feature 2]**: [Brief description and user value]
60
+ - **[Feature 3]**: [Brief description and user value]
61
+
62
+ ---
63
+
64
+ ## ๐Ÿ› ๏ธ Development
65
+
66
+ ### Available Commands
67
+
68
+ | Command | Description |
69
+ |:--------|:------------|
70
+ | `[dev-command]` | Start development server |
71
+ | `[build-command]` | Build for production |
72
+ | `[test-command]` | Run test suite |
73
+ | `[lint-command]` | Lint and format code |
74
+
75
+ ### Tech Stack
76
+
77
+ - **Frontend**: [e.g., Next.js 15, React 18, Tailwind CSS]
78
+ - **Backend**: [e.g., Express, tRPC, Prisma]
79
+ - **Database**: [e.g., PostgreSQL, Redis]
80
+ - **Testing**: [e.g., Vitest, Playwright]
81
+ - **Deployment**: [e.g., Vercel, Railway, Docker]
82
+
83
+ **See**: `docs/core/DECISIONS.md` for technology choices and rationale
84
+
85
+ ---
86
+
87
+ ## ๐Ÿ“– Documentation
88
+
89
+ This project uses the [Cortex TMS](https://github.com/[your-org]/cortex-tms) documentation structure:
90
+
91
+ - **`NEXT-TASKS.md`**: Current sprint and active tasks
92
+ - **`docs/core/ARCHITECTURE.md`**: System design and component map
93
+ - **`docs/core/PATTERNS.md`**: Code conventions and best practices
94
+ - **`docs/core/DOMAIN-LOGIC.md`**: Business rules and constraints
95
+ - **`docs/core/GLOSSARY.md`**: Project terminology
96
+ - **`docs/core/DECISIONS.md`**: Architecture Decision Records (ADRs)
97
+
98
+ ---
99
+
100
+ ## ๐Ÿงช Testing
101
+
102
+ ```bash
103
+ # Run all tests
104
+ [test-command]
105
+
106
+ # Run tests in watch mode
107
+ [test-watch-command]
108
+
109
+ # Run tests with coverage
110
+ [test-coverage-command]
111
+ ```
112
+
113
+ **Coverage Target**: [e.g., 80% for core modules]
114
+
115
+ ---
116
+
117
+ ## ๐Ÿšข Deployment
118
+
119
+ ### Environment Variables
120
+
121
+ | Variable | Description | Required | Example |
122
+ |:---------|:------------|:---------|:--------|
123
+ | `[VAR_NAME]` | [Description] | Yes/No | `[example-value]` |
124
+ | `[VAR_NAME]` | [Description] | Yes/No | `[example-value]` |
125
+
126
+ ### Production Build
127
+
128
+ ```bash
129
+ # Build for production
130
+ [build-command]
131
+
132
+ # Start production server
133
+ [start-command]
134
+ ```
135
+
136
+ **See**: `docs/core/ARCHITECTURE.md#deployment-infrastructure` for deployment guide
137
+
138
+ ---
139
+
140
+ ## ๐Ÿค Contributing
141
+
142
+ This project follows conventional commit standards and uses AI-assisted development workflows.
143
+
144
+ ### Workflow
145
+
146
+ 1. Check `NEXT-TASKS.md` for current priorities
147
+ 2. Create a branch: `[type]/[description]` (see `docs/core/GIT-STANDARDS.md`)
148
+ 3. Make your changes following `docs/core/PATTERNS.md`
149
+ 4. Run tests and linting
150
+ 5. Commit with conventional format: `type(scope): subject`
151
+ 6. Open a PR using `.github/PULL_REQUEST_TEMPLATE.md`
152
+
153
+ **See**: `CLAUDE.md` for AI agent collaboration protocol
154
+
155
+ ---
156
+
157
+ ## ๐Ÿ“ License
158
+
159
+ [License Type - e.g., MIT License]
160
+
161
+ ---
162
+
163
+ ## ๐Ÿ”— Links
164
+
165
+ - **Documentation**: [Link to full docs]
166
+ - **Issue Tracker**: [Link to issues]
167
+ - **Changelog**: `docs/archive/` (organized by sprint)
168
+ - **Roadmap**: `FUTURE-ENHANCEMENTS.md`
169
+
170
+ ---
171
+
172
+ **Built with [Cortex TMS](https://github.com/[your-org]/cortex-tms) - AI-Optimized Project Documentation**
File without changes