@bamptee/aia-code 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/prompt-builder.js +14 -6
- package/src/services/scaffold.js +30 -0
package/package.json
CHANGED
package/src/prompt-builder.js
CHANGED
|
@@ -93,25 +93,33 @@ export async function buildPrompt(feature, step, { description, root = process.c
|
|
|
93
93
|
|
|
94
94
|
const parts = [];
|
|
95
95
|
|
|
96
|
+
parts.push('IMPORTANT: You are working on a feature development pipeline. Everything you need is provided below in this prompt. Do NOT attempt to read, search for, or reference any external files. Do NOT say files are missing. Work exclusively with the content given below.\n');
|
|
97
|
+
|
|
96
98
|
if (description) {
|
|
97
99
|
parts.push('=== DESCRIPTION ===\n');
|
|
98
100
|
parts.push(description);
|
|
99
101
|
parts.push('');
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
if (context) {
|
|
105
|
+
parts.push('=== CONTEXT ===\n');
|
|
106
|
+
parts.push(context);
|
|
107
|
+
}
|
|
104
108
|
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
if (knowledge) {
|
|
110
|
+
parts.push('\n\n=== KNOWLEDGE ===\n');
|
|
111
|
+
parts.push(knowledge);
|
|
112
|
+
}
|
|
107
113
|
|
|
108
114
|
if (initSpecs) {
|
|
109
115
|
parts.push('\n\n=== INITIAL SPECS ===\n');
|
|
110
116
|
parts.push(initSpecs);
|
|
111
117
|
}
|
|
112
118
|
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
if (featureContent) {
|
|
120
|
+
parts.push('\n\n=== FEATURE ===\n');
|
|
121
|
+
parts.push(featureContent);
|
|
122
|
+
}
|
|
115
123
|
|
|
116
124
|
if (previousOutput) {
|
|
117
125
|
parts.push('\n\n=== PREVIOUS OUTPUT ===\n');
|
package/src/services/scaffold.js
CHANGED
|
@@ -2,8 +2,38 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import { AIA_DIR, AIA_FOLDERS } from '../constants.js';
|
|
4
4
|
|
|
5
|
+
const CONTEXT_TEMPLATES = {
|
|
6
|
+
'context/project.md': `# Project
|
|
7
|
+
|
|
8
|
+
<!-- Describe your project here. This is injected into every AI prompt. -->
|
|
9
|
+
|
|
10
|
+
## Stack
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
`,
|
|
16
|
+
'context/architecture.md': `# Architecture
|
|
17
|
+
|
|
18
|
+
<!-- Describe your architecture here. -->
|
|
19
|
+
|
|
20
|
+
## Overview
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Key decisions
|
|
24
|
+
|
|
25
|
+
`,
|
|
26
|
+
};
|
|
27
|
+
|
|
5
28
|
export async function createAiaStructure(root = process.cwd()) {
|
|
6
29
|
for (const folder of AIA_FOLDERS) {
|
|
7
30
|
await fs.ensureDir(path.join(root, AIA_DIR, folder));
|
|
8
31
|
}
|
|
32
|
+
|
|
33
|
+
for (const [file, content] of Object.entries(CONTEXT_TEMPLATES)) {
|
|
34
|
+
const filePath = path.join(root, AIA_DIR, file);
|
|
35
|
+
if (!(await fs.pathExists(filePath))) {
|
|
36
|
+
await fs.writeFile(filePath, content, 'utf-8');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
9
39
|
}
|