@triedotdev/mcp 1.0.169 → 1.0.171
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/README.md +62 -540
- package/dist/chunk-2YXOBNKW.js +619 -0
- package/dist/chunk-2YXOBNKW.js.map +1 -0
- package/dist/chunk-QR64Y5TI.js +363 -0
- package/dist/chunk-QR64Y5TI.js.map +1 -0
- package/dist/cli/main.d.ts +0 -15
- package/dist/cli/main.js +356 -3098
- package/dist/cli/main.js.map +1 -1
- package/dist/index.js +2 -34
- package/dist/index.js.map +1 -1
- package/dist/server/mcp-server.js +2 -34
- package/package.json +8 -31
- package/dist/autonomy-config-FSERX3O3.js +0 -30
- package/dist/autonomy-config-FSERX3O3.js.map +0 -1
- package/dist/chat-store-JNGNTDSN.js +0 -15
- package/dist/chat-store-JNGNTDSN.js.map +0 -1
- package/dist/chunk-2HF65EHQ.js +0 -311
- package/dist/chunk-2HF65EHQ.js.map +0 -1
- package/dist/chunk-3XR6WVAW.js +0 -4011
- package/dist/chunk-3XR6WVAW.js.map +0 -1
- package/dist/chunk-43X6JBEM.js +0 -36
- package/dist/chunk-43X6JBEM.js.map +0 -1
- package/dist/chunk-6NLHFIYA.js +0 -344
- package/dist/chunk-6NLHFIYA.js.map +0 -1
- package/dist/chunk-7IO4YUI3.js +0 -1827
- package/dist/chunk-7IO4YUI3.js.map +0 -1
- package/dist/chunk-AHD2CBQ7.js +0 -846
- package/dist/chunk-AHD2CBQ7.js.map +0 -1
- package/dist/chunk-BUTOP5EB.js +0 -931
- package/dist/chunk-BUTOP5EB.js.map +0 -1
- package/dist/chunk-DGUM43GV.js +0 -11
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-EFWVF6TI.js +0 -267
- package/dist/chunk-EFWVF6TI.js.map +0 -1
- package/dist/chunk-F6WFNUAY.js +0 -216
- package/dist/chunk-F6WFNUAY.js.map +0 -1
- package/dist/chunk-FBNURWRY.js +0 -662
- package/dist/chunk-FBNURWRY.js.map +0 -1
- package/dist/chunk-FQ45QP5A.js +0 -361
- package/dist/chunk-FQ45QP5A.js.map +0 -1
- package/dist/chunk-FVRO5RN3.js +0 -1306
- package/dist/chunk-FVRO5RN3.js.map +0 -1
- package/dist/chunk-G2TGF6TR.js +0 -573
- package/dist/chunk-G2TGF6TR.js.map +0 -1
- package/dist/chunk-G3I7SZLW.js +0 -354
- package/dist/chunk-G3I7SZLW.js.map +0 -1
- package/dist/chunk-GTKYBOXL.js +0 -700
- package/dist/chunk-GTKYBOXL.js.map +0 -1
- package/dist/chunk-HVCDY3AK.js +0 -850
- package/dist/chunk-HVCDY3AK.js.map +0 -1
- package/dist/chunk-I2O5OYQT.js +0 -727
- package/dist/chunk-I2O5OYQT.js.map +0 -1
- package/dist/chunk-JVMBCWKS.js +0 -348
- package/dist/chunk-JVMBCWKS.js.map +0 -1
- package/dist/chunk-KCUOWRPX.js +0 -816
- package/dist/chunk-KCUOWRPX.js.map +0 -1
- package/dist/chunk-KDHN2ZQE.js +0 -313
- package/dist/chunk-KDHN2ZQE.js.map +0 -1
- package/dist/chunk-ME2OERF5.js +0 -345
- package/dist/chunk-ME2OERF5.js.map +0 -1
- package/dist/chunk-OBQ74FOU.js +0 -27
- package/dist/chunk-OBQ74FOU.js.map +0 -1
- package/dist/chunk-Q5EKA5YA.js +0 -254
- package/dist/chunk-Q5EKA5YA.js.map +0 -1
- package/dist/chunk-Q63FFI6D.js +0 -132
- package/dist/chunk-Q63FFI6D.js.map +0 -1
- package/dist/chunk-SASNMSB5.js +0 -12597
- package/dist/chunk-SASNMSB5.js.map +0 -1
- package/dist/chunk-T63OHG4Q.js +0 -440
- package/dist/chunk-T63OHG4Q.js.map +0 -1
- package/dist/chunk-TN5WEKWI.js +0 -173
- package/dist/chunk-TN5WEKWI.js.map +0 -1
- package/dist/chunk-VUL52BQL.js +0 -402
- package/dist/chunk-VUL52BQL.js.map +0 -1
- package/dist/chunk-VVITXIHN.js +0 -189
- package/dist/chunk-VVITXIHN.js.map +0 -1
- package/dist/chunk-WCN7S3EI.js +0 -14
- package/dist/chunk-WCN7S3EI.js.map +0 -1
- package/dist/chunk-XPZZFPBZ.js +0 -491
- package/dist/chunk-XPZZFPBZ.js.map +0 -1
- package/dist/chunk-ZJF5FTBX.js +0 -1396
- package/dist/chunk-ZJF5FTBX.js.map +0 -1
- package/dist/chunk-ZV2K6M7T.js +0 -74
- package/dist/chunk-ZV2K6M7T.js.map +0 -1
- package/dist/cli/create-agent.d.ts +0 -1
- package/dist/cli/create-agent.js +0 -1050
- package/dist/cli/create-agent.js.map +0 -1
- package/dist/cli/yolo-daemon.d.ts +0 -1
- package/dist/cli/yolo-daemon.js +0 -421
- package/dist/cli/yolo-daemon.js.map +0 -1
- package/dist/client-NJPZE5JT.js +0 -28
- package/dist/client-NJPZE5JT.js.map +0 -1
- package/dist/codebase-index-VAPF32XX.js +0 -12
- package/dist/codebase-index-VAPF32XX.js.map +0 -1
- package/dist/fast-analyzer-3GCCZMLK.js +0 -216
- package/dist/fast-analyzer-3GCCZMLK.js.map +0 -1
- package/dist/git-EO5SRFMN.js +0 -28
- package/dist/git-EO5SRFMN.js.map +0 -1
- package/dist/github-ingester-ZOKK6GRS.js +0 -11
- package/dist/github-ingester-ZOKK6GRS.js.map +0 -1
- package/dist/goal-manager-QUKX2W6C.js +0 -25
- package/dist/goal-manager-QUKX2W6C.js.map +0 -1
- package/dist/goal-validator-2SFSKKVU.js +0 -24
- package/dist/goal-validator-2SFSKKVU.js.map +0 -1
- package/dist/graph-B3NA4S7I.js +0 -10
- package/dist/graph-B3NA4S7I.js.map +0 -1
- package/dist/hypothesis-KCPBR652.js +0 -23
- package/dist/hypothesis-KCPBR652.js.map +0 -1
- package/dist/incident-index-EFNUSGWL.js +0 -11
- package/dist/incident-index-EFNUSGWL.js.map +0 -1
- package/dist/insight-store-EC4PLSAW.js +0 -22
- package/dist/insight-store-EC4PLSAW.js.map +0 -1
- package/dist/issue-store-YAXTNRRY.js +0 -36
- package/dist/issue-store-YAXTNRRY.js.map +0 -1
- package/dist/ledger-TWZTGDFA.js +0 -58
- package/dist/ledger-TWZTGDFA.js.map +0 -1
- package/dist/linear-ingester-XXPAZZRW.js +0 -11
- package/dist/linear-ingester-XXPAZZRW.js.map +0 -1
- package/dist/output-manager-RVJ37XKA.js +0 -13
- package/dist/output-manager-RVJ37XKA.js.map +0 -1
- package/dist/parse-goal-violation-SACGFG3C.js +0 -8
- package/dist/parse-goal-violation-SACGFG3C.js.map +0 -1
- package/dist/pattern-discovery-F7LU5K6E.js +0 -8
- package/dist/pattern-discovery-F7LU5K6E.js.map +0 -1
- package/dist/progress-SRQ2V3BP.js +0 -18
- package/dist/progress-SRQ2V3BP.js.map +0 -1
- package/dist/project-state-AHPA77SM.js +0 -28
- package/dist/project-state-AHPA77SM.js.map +0 -1
- package/dist/sync-M2FSWPBC.js +0 -12
- package/dist/sync-M2FSWPBC.js.map +0 -1
- package/dist/terminal-spawn-5YXDMUCF.js +0 -157
- package/dist/terminal-spawn-5YXDMUCF.js.map +0 -1
- package/dist/tiered-storage-DYNC5CQ6.js +0 -13
- package/dist/tiered-storage-DYNC5CQ6.js.map +0 -1
- package/dist/trie-agent-I3HAHY2G.js +0 -26
- package/dist/trie-agent-I3HAHY2G.js.map +0 -1
- package/dist/ui/chat.html +0 -1014
- package/dist/ui/goals.html +0 -967
- package/dist/ui/hypotheses.html +0 -1011
- package/dist/ui/ledger.html +0 -954
- package/dist/ui/nudges.html +0 -995
- package/dist/vibe-code-signatures-5ZULYP3D.js +0 -987
- package/dist/vibe-code-signatures-5ZULYP3D.js.map +0 -1
- package/dist/vulnerability-signatures-2URZSXAQ.js +0 -983
- package/dist/vulnerability-signatures-2URZSXAQ.js.map +0 -1
package/dist/chunk-HVCDY3AK.js
DELETED
|
@@ -1,850 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getTrieDirectory,
|
|
3
|
-
getWorkingDirectory
|
|
4
|
-
} from "./chunk-VVITXIHN.js";
|
|
5
|
-
|
|
6
|
-
// src/utils/project-info.ts
|
|
7
|
-
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
8
|
-
import { existsSync } from "fs";
|
|
9
|
-
import { join } from "path";
|
|
10
|
-
var PROJECT_MD_PATH = "PROJECT.md";
|
|
11
|
-
function getProjectTemplate() {
|
|
12
|
-
return `# Project Information
|
|
13
|
-
|
|
14
|
-
> This file stores important project context for AI assistants.
|
|
15
|
-
> Edit freely - this file is yours, not auto-generated.
|
|
16
|
-
> Available via MCP resource: \`trie://project\`
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Project Overview
|
|
21
|
-
|
|
22
|
-
<!-- Describe your project's purpose and goals -->
|
|
23
|
-
|
|
24
|
-
[Add project description here]
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Technology Stack
|
|
29
|
-
|
|
30
|
-
<!-- List frameworks, languages, databases, cloud services, etc. -->
|
|
31
|
-
|
|
32
|
-
- **Language:**
|
|
33
|
-
- **Framework:**
|
|
34
|
-
- **Database:**
|
|
35
|
-
- **Hosting:**
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Architecture
|
|
40
|
-
|
|
41
|
-
<!-- Key patterns, architectural decisions, and system design -->
|
|
42
|
-
|
|
43
|
-
[Describe your architecture here]
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Coding Conventions
|
|
48
|
-
|
|
49
|
-
<!-- Style guidelines, naming conventions, patterns to follow -->
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Environment
|
|
58
|
-
|
|
59
|
-
<!-- URLs, API endpoints, deployment info -->
|
|
60
|
-
|
|
61
|
-
| Environment | URL | Notes |
|
|
62
|
-
|-------------|-----|-------|
|
|
63
|
-
| Development | | |
|
|
64
|
-
| Staging | | |
|
|
65
|
-
| Production | | |
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Team
|
|
70
|
-
|
|
71
|
-
<!-- Ownership, contacts, responsibilities -->
|
|
72
|
-
|
|
73
|
-
- **Owner:**
|
|
74
|
-
- **Team:**
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Compliance
|
|
79
|
-
|
|
80
|
-
<!-- HIPAA, SOC2, GDPR, PCI-DSS requirements if applicable -->
|
|
81
|
-
|
|
82
|
-
- [ ] GDPR
|
|
83
|
-
- [ ] SOC2
|
|
84
|
-
- [ ] HIPAA
|
|
85
|
-
- [ ] PCI-DSS
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## AI Instructions
|
|
90
|
-
|
|
91
|
-
<!-- Special instructions for AI assistants working on this project -->
|
|
92
|
-
|
|
93
|
-
When working on this project, AI assistants should:
|
|
94
|
-
|
|
95
|
-
1.
|
|
96
|
-
2.
|
|
97
|
-
3.
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
*This file is read by Trie agents and exposed via \`trie://project\` MCP resource.*
|
|
102
|
-
*Edit this file to provide context to Claude Code, Cursor, GitHub Actions, and other AI tools.*
|
|
103
|
-
`;
|
|
104
|
-
}
|
|
105
|
-
function projectInfoExists(workDir) {
|
|
106
|
-
const dir = workDir || getWorkingDirectory(void 0, true);
|
|
107
|
-
const projectPath = join(getTrieDirectory(dir), PROJECT_MD_PATH);
|
|
108
|
-
return existsSync(projectPath);
|
|
109
|
-
}
|
|
110
|
-
async function loadProjectInfo(workDir) {
|
|
111
|
-
const dir = workDir || getWorkingDirectory(void 0, true);
|
|
112
|
-
const projectPath = join(getTrieDirectory(dir), PROJECT_MD_PATH);
|
|
113
|
-
try {
|
|
114
|
-
if (!existsSync(projectPath)) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
return await readFile(projectPath, "utf-8");
|
|
118
|
-
} catch {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
async function saveProjectInfo(content, workDir) {
|
|
123
|
-
const dir = workDir || getWorkingDirectory(void 0, true);
|
|
124
|
-
const trieDir = getTrieDirectory(dir);
|
|
125
|
-
const projectPath = join(trieDir, PROJECT_MD_PATH);
|
|
126
|
-
await mkdir(trieDir, { recursive: true });
|
|
127
|
-
await writeFile(projectPath, content, "utf-8");
|
|
128
|
-
}
|
|
129
|
-
async function initProjectInfo(workDir) {
|
|
130
|
-
const dir = workDir || getWorkingDirectory(void 0, true);
|
|
131
|
-
const projectPath = join(getTrieDirectory(dir), PROJECT_MD_PATH);
|
|
132
|
-
if (existsSync(projectPath)) {
|
|
133
|
-
return { created: false, path: projectPath };
|
|
134
|
-
}
|
|
135
|
-
await saveProjectInfo(getProjectTemplate(), dir);
|
|
136
|
-
return { created: true, path: projectPath };
|
|
137
|
-
}
|
|
138
|
-
async function getProjectSection(sectionName, workDir) {
|
|
139
|
-
const content = await loadProjectInfo(workDir);
|
|
140
|
-
if (!content) return null;
|
|
141
|
-
const sectionRegex = new RegExp(
|
|
142
|
-
`## ${escapeRegex(sectionName)}\\s*\\n([\\s\\S]*?)(?=\\n## |\\n---\\s*$|$)`,
|
|
143
|
-
"i"
|
|
144
|
-
);
|
|
145
|
-
const match = content.match(sectionRegex);
|
|
146
|
-
if (match?.[1]) {
|
|
147
|
-
return match[1].trim();
|
|
148
|
-
}
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
async function updateProjectSection(sectionName, newContent, workDir) {
|
|
152
|
-
let content = await loadProjectInfo(workDir);
|
|
153
|
-
if (!content) {
|
|
154
|
-
await initProjectInfo(workDir);
|
|
155
|
-
content = await loadProjectInfo(workDir);
|
|
156
|
-
if (!content) return false;
|
|
157
|
-
}
|
|
158
|
-
const sectionRegex = new RegExp(
|
|
159
|
-
`(## ${escapeRegex(sectionName)}\\s*\\n)([\\s\\S]*?)((?=\\n## )|(?=\\n---\\s*$)|$)`,
|
|
160
|
-
"i"
|
|
161
|
-
);
|
|
162
|
-
if (content.match(sectionRegex)) {
|
|
163
|
-
const updatedContent = content.replace(sectionRegex, `$1
|
|
164
|
-
${newContent}
|
|
165
|
-
|
|
166
|
-
$3`);
|
|
167
|
-
await saveProjectInfo(updatedContent, workDir);
|
|
168
|
-
return true;
|
|
169
|
-
}
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
async function appendToSection(sectionName, contentToAdd, workDir) {
|
|
173
|
-
const currentContent = await getProjectSection(sectionName, workDir);
|
|
174
|
-
if (currentContent === null) return false;
|
|
175
|
-
const newContent = currentContent + "\n" + contentToAdd;
|
|
176
|
-
return updateProjectSection(sectionName, newContent, workDir);
|
|
177
|
-
}
|
|
178
|
-
async function getProjectSections(workDir) {
|
|
179
|
-
const content = await loadProjectInfo(workDir);
|
|
180
|
-
if (!content) return [];
|
|
181
|
-
const sectionRegex = /^## (.+)$/gm;
|
|
182
|
-
const sections = [];
|
|
183
|
-
let match;
|
|
184
|
-
while ((match = sectionRegex.exec(content)) !== null) {
|
|
185
|
-
if (match[1]) {
|
|
186
|
-
sections.push(match[1].trim());
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return sections;
|
|
190
|
-
}
|
|
191
|
-
async function getProjectInfoStructured(workDir) {
|
|
192
|
-
const dir = workDir || getWorkingDirectory(void 0, true);
|
|
193
|
-
const projectPath = join(getTrieDirectory(dir), PROJECT_MD_PATH);
|
|
194
|
-
const content = await loadProjectInfo(dir);
|
|
195
|
-
if (!content) {
|
|
196
|
-
return {
|
|
197
|
-
exists: false,
|
|
198
|
-
path: projectPath,
|
|
199
|
-
sections: {},
|
|
200
|
-
raw: null
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
const sectionNames = await getProjectSections(dir);
|
|
204
|
-
const sections = {};
|
|
205
|
-
for (const name of sectionNames) {
|
|
206
|
-
const sectionContent = await getProjectSection(name, dir);
|
|
207
|
-
if (sectionContent) {
|
|
208
|
-
sections[name] = sectionContent;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return {
|
|
212
|
-
exists: true,
|
|
213
|
-
path: projectPath,
|
|
214
|
-
sections,
|
|
215
|
-
raw: content
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
function escapeRegex(str) {
|
|
219
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// src/utils/context-state.ts
|
|
223
|
-
import { readFile as readFile2, mkdir as mkdir2 } from "fs/promises";
|
|
224
|
-
import { existsSync as existsSync2 } from "fs";
|
|
225
|
-
import { join as join2, basename } from "path";
|
|
226
|
-
var STATE_JSON_PATH = "state.json";
|
|
227
|
-
async function loadContextState() {
|
|
228
|
-
const workDir = getWorkingDirectory(void 0, true);
|
|
229
|
-
const statePath = join2(getTrieDirectory(workDir), STATE_JSON_PATH);
|
|
230
|
-
const defaults = getDefaultState();
|
|
231
|
-
try {
|
|
232
|
-
if (existsSync2(statePath)) {
|
|
233
|
-
const content = await readFile2(statePath, "utf-8");
|
|
234
|
-
const loaded = JSON.parse(content);
|
|
235
|
-
const { healthScore: _dropped, ...loadedRest } = loaded;
|
|
236
|
-
return {
|
|
237
|
-
...defaults,
|
|
238
|
-
...loadedRest,
|
|
239
|
-
skills: loaded.skills || defaults.skills
|
|
240
|
-
};
|
|
241
|
-
}
|
|
242
|
-
} catch {
|
|
243
|
-
}
|
|
244
|
-
return defaults;
|
|
245
|
-
}
|
|
246
|
-
function getDefaultState() {
|
|
247
|
-
return {
|
|
248
|
-
lastScan: null,
|
|
249
|
-
activePriorities: [
|
|
250
|
-
"Initial setup required - run `trie watch` to start monitoring",
|
|
251
|
-
"Configure agents in `.trie/config.json`",
|
|
252
|
-
"Set up CI/CD integration"
|
|
253
|
-
],
|
|
254
|
-
contextSignals: {},
|
|
255
|
-
agentStatus: {},
|
|
256
|
-
scanHistory: [],
|
|
257
|
-
customAgents: [],
|
|
258
|
-
skills: {},
|
|
259
|
-
environment: detectEnvironment()
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
function detectEnvironment() {
|
|
263
|
-
if (process.env.GITHUB_ACTIONS) return "github-actions";
|
|
264
|
-
if (process.env.GITLAB_CI) return "gitlab-ci";
|
|
265
|
-
if (process.env.CI) return "ci";
|
|
266
|
-
const parent = process.env._ || "";
|
|
267
|
-
if (parent.includes("cursor")) return "cursor";
|
|
268
|
-
if (parent.includes("claude")) return "claude-code";
|
|
269
|
-
return "cli";
|
|
270
|
-
}
|
|
271
|
-
async function getContextForAI() {
|
|
272
|
-
const state = await loadContextState();
|
|
273
|
-
const workDir = getWorkingDirectory(void 0, true);
|
|
274
|
-
const lines = [];
|
|
275
|
-
if (projectInfoExists(workDir)) {
|
|
276
|
-
const projectInfo = await loadProjectInfo(workDir);
|
|
277
|
-
if (projectInfo) {
|
|
278
|
-
lines.push(projectInfo);
|
|
279
|
-
lines.push("");
|
|
280
|
-
lines.push("---");
|
|
281
|
-
lines.push("");
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
lines.push(
|
|
285
|
-
"## Trie Scan Context",
|
|
286
|
-
"",
|
|
287
|
-
`**Last Scan:** ${state.lastScan ? new Date(state.lastScan.timestamp).toLocaleString() : "Never"}`,
|
|
288
|
-
"",
|
|
289
|
-
"**Active Priorities:**",
|
|
290
|
-
...state.activePriorities.map((p) => `- ${p}`),
|
|
291
|
-
""
|
|
292
|
-
);
|
|
293
|
-
if (state.lastScan) {
|
|
294
|
-
lines.push(
|
|
295
|
-
"**Recent Issues:**",
|
|
296
|
-
`- Critical: ${state.lastScan.issues.critical}`,
|
|
297
|
-
`- Serious: ${state.lastScan.issues.serious}`,
|
|
298
|
-
`- Moderate: ${state.lastScan.issues.moderate}`,
|
|
299
|
-
`- Low: ${state.lastScan.issues.low}`,
|
|
300
|
-
""
|
|
301
|
-
);
|
|
302
|
-
if (state.lastScan.hotFiles.length > 0) {
|
|
303
|
-
lines.push(
|
|
304
|
-
"**Hot Files (most issues):**",
|
|
305
|
-
...state.lastScan.hotFiles.slice(0, 5).map((f) => `- ${f.file}: ${f.issueCount} issues`),
|
|
306
|
-
""
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
return lines.join("\n");
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// src/bootstrap/files.ts
|
|
314
|
-
import { readFile as readFile4, writeFile as writeFile2, unlink, mkdir as mkdir3 } from "fs/promises";
|
|
315
|
-
import { existsSync as existsSync4 } from "fs";
|
|
316
|
-
import { join as join4 } from "path";
|
|
317
|
-
|
|
318
|
-
// src/bootstrap/stack-detector.ts
|
|
319
|
-
import { readFile as readFile3 } from "fs/promises";
|
|
320
|
-
import { existsSync as existsSync3 } from "fs";
|
|
321
|
-
import { join as join3 } from "path";
|
|
322
|
-
var SKILL_MAPPINGS = {
|
|
323
|
-
// Frontend Frameworks - React/Next.js
|
|
324
|
-
"next": [
|
|
325
|
-
"vercel-labs/agent-skills vercel-react-best-practices",
|
|
326
|
-
"vercel-labs/agent-skills web-design-guidelines",
|
|
327
|
-
"anthropics/skills frontend-design",
|
|
328
|
-
"wshobson/agents nextjs-app-router-patterns"
|
|
329
|
-
],
|
|
330
|
-
"react": [
|
|
331
|
-
"vercel-labs/agent-skills vercel-react-best-practices",
|
|
332
|
-
"anthropics/skills frontend-design",
|
|
333
|
-
"wshobson/agents react-state-management"
|
|
334
|
-
],
|
|
335
|
-
// Vue/Nuxt Ecosystem
|
|
336
|
-
"vue": [
|
|
337
|
-
"hyf0/vue-skills vue-best-practices",
|
|
338
|
-
"hyf0/vue-skills pinia-best-practices",
|
|
339
|
-
"hyf0/vue-skills vueuse-best-practices",
|
|
340
|
-
"onmax/nuxt-skills vue"
|
|
341
|
-
],
|
|
342
|
-
"nuxt": [
|
|
343
|
-
"onmax/nuxt-skills nuxt",
|
|
344
|
-
"onmax/nuxt-skills nuxt-ui",
|
|
345
|
-
"onmax/nuxt-skills nuxt-content",
|
|
346
|
-
"onmax/nuxt-skills nuxt-modules",
|
|
347
|
-
"onmax/nuxt-skills nuxt-better-auth",
|
|
348
|
-
"onmax/nuxt-skills nuxthub"
|
|
349
|
-
],
|
|
350
|
-
"pinia": [
|
|
351
|
-
"hyf0/vue-skills pinia-best-practices"
|
|
352
|
-
],
|
|
353
|
-
"@vueuse/core": [
|
|
354
|
-
"hyf0/vue-skills vueuse-best-practices",
|
|
355
|
-
"onmax/nuxt-skills vueuse"
|
|
356
|
-
],
|
|
357
|
-
// Mobile - Expo
|
|
358
|
-
"expo": [
|
|
359
|
-
"expo/skills building-native-ui",
|
|
360
|
-
"expo/skills upgrading-expo",
|
|
361
|
-
"expo/skills native-data-fetching",
|
|
362
|
-
"expo/skills expo-dev-client",
|
|
363
|
-
"expo/skills expo-deployment",
|
|
364
|
-
"expo/skills expo-api-routes",
|
|
365
|
-
"expo/skills expo-tailwind-setup",
|
|
366
|
-
"expo/skills expo-cicd-workflows",
|
|
367
|
-
"expo/skills use-dom"
|
|
368
|
-
],
|
|
369
|
-
// Mobile - React Native
|
|
370
|
-
"react-native": [
|
|
371
|
-
"callstackincubator/agent-skills react-native-best-practices",
|
|
372
|
-
"wshobson/agents react-native-architecture"
|
|
373
|
-
],
|
|
374
|
-
// Backend Frameworks
|
|
375
|
-
"@nestjs/core": [
|
|
376
|
-
"kadajett/agent-nestjs-skills nestjs-best-practices"
|
|
377
|
-
],
|
|
378
|
-
"nestjs": [
|
|
379
|
-
"kadajett/agent-nestjs-skills nestjs-best-practices"
|
|
380
|
-
],
|
|
381
|
-
"elysia": [
|
|
382
|
-
"elysiajs/skills elysiajs"
|
|
383
|
-
],
|
|
384
|
-
"hono": [
|
|
385
|
-
"elysiajs/skills elysiajs"
|
|
386
|
-
],
|
|
387
|
-
// Database/BaaS
|
|
388
|
-
"@supabase/supabase-js": [
|
|
389
|
-
"supabase/agent-skills supabase-postgres-best-practices"
|
|
390
|
-
],
|
|
391
|
-
"convex": [
|
|
392
|
-
"waynesutton/convexskills convex-best-practices"
|
|
393
|
-
],
|
|
394
|
-
"pg": [
|
|
395
|
-
"wshobson/agents postgresql-table-design"
|
|
396
|
-
],
|
|
397
|
-
"postgres": [
|
|
398
|
-
"wshobson/agents postgresql-table-design"
|
|
399
|
-
],
|
|
400
|
-
// Auth
|
|
401
|
-
"better-auth": [
|
|
402
|
-
"better-auth/skills better-auth-best-practices",
|
|
403
|
-
"better-auth/skills create-auth-skill"
|
|
404
|
-
],
|
|
405
|
-
// Payments
|
|
406
|
-
"stripe": [
|
|
407
|
-
"stripe/ai stripe-best-practices"
|
|
408
|
-
],
|
|
409
|
-
"@stripe/stripe-js": [
|
|
410
|
-
"stripe/ai stripe-best-practices"
|
|
411
|
-
],
|
|
412
|
-
// Media/Graphics
|
|
413
|
-
"remotion": [
|
|
414
|
-
"remotion-dev/skills remotion-best-practices"
|
|
415
|
-
],
|
|
416
|
-
"three": [
|
|
417
|
-
"cloudai-x/threejs-skills threejs-fundamentals",
|
|
418
|
-
"cloudai-x/threejs-skills threejs-animation",
|
|
419
|
-
"cloudai-x/threejs-skills threejs-materials",
|
|
420
|
-
"cloudai-x/threejs-skills threejs-shaders",
|
|
421
|
-
"cloudai-x/threejs-skills threejs-lighting",
|
|
422
|
-
"cloudai-x/threejs-skills threejs-geometry",
|
|
423
|
-
"cloudai-x/threejs-skills threejs-textures",
|
|
424
|
-
"cloudai-x/threejs-skills threejs-loaders",
|
|
425
|
-
"cloudai-x/threejs-skills threejs-interaction",
|
|
426
|
-
"cloudai-x/threejs-skills threejs-postprocessing"
|
|
427
|
-
],
|
|
428
|
-
// UI Libraries
|
|
429
|
-
"tailwindcss": [
|
|
430
|
-
"wshobson/agents tailwind-design-system",
|
|
431
|
-
"jezweb/claude-skills tailwind-v4-shadcn",
|
|
432
|
-
"wshobson/agents responsive-design"
|
|
433
|
-
],
|
|
434
|
-
"@shadcn/ui": [
|
|
435
|
-
"giuseppe-trisciuoglio/developer-kit shadcn-ui"
|
|
436
|
-
],
|
|
437
|
-
"shadcn": [
|
|
438
|
-
"giuseppe-trisciuoglio/developer-kit shadcn-ui"
|
|
439
|
-
],
|
|
440
|
-
"@radix-ui/react-slot": [
|
|
441
|
-
"onmax/nuxt-skills reka-ui"
|
|
442
|
-
],
|
|
443
|
-
// State Management
|
|
444
|
-
"@tanstack/react-query": [
|
|
445
|
-
"jezweb/claude-skills tanstack-query"
|
|
446
|
-
],
|
|
447
|
-
// Testing
|
|
448
|
-
"playwright": [
|
|
449
|
-
"anthropics/skills webapp-testing",
|
|
450
|
-
"wshobson/agents e2e-testing-patterns"
|
|
451
|
-
],
|
|
452
|
-
"puppeteer": [
|
|
453
|
-
"anthropics/skills webapp-testing"
|
|
454
|
-
],
|
|
455
|
-
"vitest": [
|
|
456
|
-
"wshobson/agents e2e-testing-patterns"
|
|
457
|
-
],
|
|
458
|
-
"jest": [
|
|
459
|
-
"wshobson/agents e2e-testing-patterns"
|
|
460
|
-
],
|
|
461
|
-
// DevTools/MCP
|
|
462
|
-
"@modelcontextprotocol/sdk": [
|
|
463
|
-
"anthropics/skills mcp-builder"
|
|
464
|
-
],
|
|
465
|
-
// Security
|
|
466
|
-
"semgrep": [
|
|
467
|
-
"trailofbits/skills semgrep"
|
|
468
|
-
],
|
|
469
|
-
// Monorepos
|
|
470
|
-
"turbo": [
|
|
471
|
-
"wshobson/agents monorepo-management"
|
|
472
|
-
],
|
|
473
|
-
"nx": [
|
|
474
|
-
"wshobson/agents monorepo-management"
|
|
475
|
-
],
|
|
476
|
-
"lerna": [
|
|
477
|
-
"wshobson/agents monorepo-management"
|
|
478
|
-
],
|
|
479
|
-
// TypeScript (handled separately based on tsconfig.json)
|
|
480
|
-
"typescript": [
|
|
481
|
-
"wshobson/agents typescript-advanced-types"
|
|
482
|
-
]
|
|
483
|
-
};
|
|
484
|
-
async function detectStack(projectDir) {
|
|
485
|
-
const stack = {
|
|
486
|
-
suggestedSkills: [],
|
|
487
|
-
suggestedAgents: ["security", "bugs"],
|
|
488
|
-
dependencies: /* @__PURE__ */ new Set()
|
|
489
|
-
};
|
|
490
|
-
if (existsSync3(join3(projectDir, "tsconfig.json"))) {
|
|
491
|
-
stack.language = "TypeScript";
|
|
492
|
-
stack.suggestedSkills.push("wshobson/agents typescript-advanced-types");
|
|
493
|
-
} else if (existsSync3(join3(projectDir, "package.json"))) {
|
|
494
|
-
stack.language = "JavaScript";
|
|
495
|
-
} else if (existsSync3(join3(projectDir, "requirements.txt")) || existsSync3(join3(projectDir, "pyproject.toml"))) {
|
|
496
|
-
stack.language = "Python";
|
|
497
|
-
} else if (existsSync3(join3(projectDir, "go.mod"))) {
|
|
498
|
-
stack.language = "Go";
|
|
499
|
-
} else if (existsSync3(join3(projectDir, "Cargo.toml"))) {
|
|
500
|
-
stack.language = "Rust";
|
|
501
|
-
}
|
|
502
|
-
if (existsSync3(join3(projectDir, "Package.swift")) || existsSync3(join3(projectDir, "project.pbxproj")) || existsSync3(join3(projectDir, "*.xcodeproj"))) {
|
|
503
|
-
stack.language = "Swift";
|
|
504
|
-
stack.suggestedSkills.push("dimillian/skills swiftui-ui-patterns");
|
|
505
|
-
stack.suggestedSkills.push("dimillian/skills swiftui-liquid-glass");
|
|
506
|
-
}
|
|
507
|
-
if (existsSync3(join3(projectDir, "pnpm-lock.yaml"))) {
|
|
508
|
-
stack.packageManager = "pnpm";
|
|
509
|
-
} else if (existsSync3(join3(projectDir, "yarn.lock"))) {
|
|
510
|
-
stack.packageManager = "yarn";
|
|
511
|
-
} else if (existsSync3(join3(projectDir, "bun.lockb"))) {
|
|
512
|
-
stack.packageManager = "bun";
|
|
513
|
-
} else if (existsSync3(join3(projectDir, "package-lock.json"))) {
|
|
514
|
-
stack.packageManager = "npm";
|
|
515
|
-
}
|
|
516
|
-
if (existsSync3(join3(projectDir, ".github", "workflows"))) {
|
|
517
|
-
stack.suggestedSkills.push("wshobson/agents github-actions-templates");
|
|
518
|
-
}
|
|
519
|
-
try {
|
|
520
|
-
const pkgPath = join3(projectDir, "package.json");
|
|
521
|
-
if (existsSync3(pkgPath)) {
|
|
522
|
-
const pkgContent = await readFile3(pkgPath, "utf-8");
|
|
523
|
-
const pkg = JSON.parse(pkgContent);
|
|
524
|
-
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
525
|
-
for (const dep of Object.keys(deps)) {
|
|
526
|
-
stack.dependencies.add(dep);
|
|
527
|
-
}
|
|
528
|
-
for (const dep of Object.keys(deps)) {
|
|
529
|
-
const skills = SKILL_MAPPINGS[dep];
|
|
530
|
-
if (skills) {
|
|
531
|
-
stack.suggestedSkills.push(...skills);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
if (deps["next"]) {
|
|
535
|
-
stack.framework = `Next.js ${deps["next"].replace("^", "")}`;
|
|
536
|
-
stack.suggestedAgents.push("accessibility", "design");
|
|
537
|
-
} else if (deps["react"]) {
|
|
538
|
-
stack.framework = `React ${deps["react"].replace("^", "")}`;
|
|
539
|
-
stack.suggestedAgents.push("accessibility");
|
|
540
|
-
} else if (deps["vue"]) {
|
|
541
|
-
stack.framework = `Vue ${deps["vue"].replace("^", "")}`;
|
|
542
|
-
} else if (deps["nuxt"]) {
|
|
543
|
-
stack.framework = `Nuxt ${deps["nuxt"].replace("^", "")}`;
|
|
544
|
-
} else if (deps["svelte"]) {
|
|
545
|
-
stack.framework = "Svelte";
|
|
546
|
-
} else if (deps["express"]) {
|
|
547
|
-
stack.framework = "Express.js";
|
|
548
|
-
} else if (deps["fastify"]) {
|
|
549
|
-
stack.framework = "Fastify";
|
|
550
|
-
} else if (deps["hono"]) {
|
|
551
|
-
stack.framework = "Hono";
|
|
552
|
-
} else if (deps["elysia"]) {
|
|
553
|
-
stack.framework = "Elysia";
|
|
554
|
-
} else if (deps["@nestjs/core"]) {
|
|
555
|
-
stack.framework = "NestJS";
|
|
556
|
-
}
|
|
557
|
-
if (deps["next-auth"] || deps["@auth/core"]) {
|
|
558
|
-
stack.auth = "NextAuth.js";
|
|
559
|
-
} else if (deps["passport"]) {
|
|
560
|
-
stack.auth = "Passport.js";
|
|
561
|
-
} else if (deps["@clerk/nextjs"] || deps["@clerk/clerk-react"]) {
|
|
562
|
-
stack.auth = "Clerk";
|
|
563
|
-
} else if (deps["better-auth"]) {
|
|
564
|
-
stack.auth = "Better Auth";
|
|
565
|
-
}
|
|
566
|
-
if (deps["prisma"] || deps["@prisma/client"]) {
|
|
567
|
-
stack.database = "Prisma ORM";
|
|
568
|
-
} else if (deps["drizzle-orm"]) {
|
|
569
|
-
stack.database = "Drizzle ORM";
|
|
570
|
-
} else if (deps["@supabase/supabase-js"]) {
|
|
571
|
-
stack.database = "Supabase";
|
|
572
|
-
} else if (deps["mongoose"]) {
|
|
573
|
-
stack.database = "MongoDB (Mongoose)";
|
|
574
|
-
} else if (deps["pg"]) {
|
|
575
|
-
stack.database = "PostgreSQL";
|
|
576
|
-
} else if (deps["convex"]) {
|
|
577
|
-
stack.database = "Convex";
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
} catch {
|
|
581
|
-
}
|
|
582
|
-
if (!stack.database) {
|
|
583
|
-
if (existsSync3(join3(projectDir, "prisma", "schema.prisma"))) {
|
|
584
|
-
stack.database = "Prisma ORM";
|
|
585
|
-
} else if (existsSync3(join3(projectDir, "drizzle.config.ts"))) {
|
|
586
|
-
stack.database = "Drizzle ORM";
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
stack.suggestedSkills = [...new Set(stack.suggestedSkills)];
|
|
590
|
-
stack.suggestedAgents = [...new Set(stack.suggestedAgents)];
|
|
591
|
-
return stack;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
// src/bootstrap/files.ts
|
|
595
|
-
var BOOTSTRAP_FILES = [
|
|
596
|
-
{ name: "PROJECT.md", type: "user", description: "Project overview and conventions" },
|
|
597
|
-
{ name: "RULES.md", type: "user", description: "Coding standards agents enforce" },
|
|
598
|
-
{ name: "TEAM.md", type: "user", description: "Team ownership and escalation" },
|
|
599
|
-
{ name: "BOOTSTRAP.md", type: "one-time", description: "First-run setup (deleted after)" },
|
|
600
|
-
{ name: "AGENTS.md", type: "auto", description: "Auto-generated scan context" }
|
|
601
|
-
];
|
|
602
|
-
async function loadBootstrapContext(workDir) {
|
|
603
|
-
const projectDir = workDir || getWorkingDirectory(void 0, true);
|
|
604
|
-
const trieDir = getTrieDirectory(projectDir);
|
|
605
|
-
const files = [];
|
|
606
|
-
const contentParts = [];
|
|
607
|
-
let needsBootstrap2 = false;
|
|
608
|
-
for (const file of BOOTSTRAP_FILES) {
|
|
609
|
-
const filePath = join4(trieDir, file.name);
|
|
610
|
-
const exists = existsSync4(filePath);
|
|
611
|
-
if (file.name === "BOOTSTRAP.md" && exists) {
|
|
612
|
-
needsBootstrap2 = true;
|
|
613
|
-
}
|
|
614
|
-
let content;
|
|
615
|
-
if (exists) {
|
|
616
|
-
try {
|
|
617
|
-
content = await readFile4(filePath, "utf-8");
|
|
618
|
-
if (content.trim() && file.type !== "one-time") {
|
|
619
|
-
contentParts.push(`<!-- ${file.name} -->
|
|
620
|
-
${content}`);
|
|
621
|
-
}
|
|
622
|
-
} catch {
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
const fileEntry = {
|
|
626
|
-
name: file.name,
|
|
627
|
-
path: filePath,
|
|
628
|
-
type: file.type,
|
|
629
|
-
exists
|
|
630
|
-
};
|
|
631
|
-
if (content) fileEntry.content = content;
|
|
632
|
-
files.push(fileEntry);
|
|
633
|
-
}
|
|
634
|
-
return {
|
|
635
|
-
files,
|
|
636
|
-
injectedContent: contentParts.join("\n\n---\n\n"),
|
|
637
|
-
needsBootstrap: needsBootstrap2
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
async function initializeBootstrapFiles(options = {}) {
|
|
641
|
-
const projectDir = options.workDir || getWorkingDirectory(void 0, true);
|
|
642
|
-
const trieDir = getTrieDirectory(projectDir);
|
|
643
|
-
await mkdir3(trieDir, { recursive: true });
|
|
644
|
-
const created = [];
|
|
645
|
-
const skipped = [];
|
|
646
|
-
const stack = await detectStack(projectDir);
|
|
647
|
-
for (const file of BOOTSTRAP_FILES) {
|
|
648
|
-
const filePath = join4(trieDir, file.name);
|
|
649
|
-
const exists = existsSync4(filePath);
|
|
650
|
-
if (exists && !options.force) {
|
|
651
|
-
skipped.push(file.name);
|
|
652
|
-
continue;
|
|
653
|
-
}
|
|
654
|
-
if (file.name === "BOOTSTRAP.md" && options.skipBootstrap) {
|
|
655
|
-
skipped.push(file.name);
|
|
656
|
-
continue;
|
|
657
|
-
}
|
|
658
|
-
if (file.name === "AGENTS.md") {
|
|
659
|
-
skipped.push(file.name);
|
|
660
|
-
continue;
|
|
661
|
-
}
|
|
662
|
-
const template = getFileTemplate(file.name, stack);
|
|
663
|
-
if (template) {
|
|
664
|
-
await writeFile2(filePath, template);
|
|
665
|
-
created.push(file.name);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
return { created, skipped, stack };
|
|
669
|
-
}
|
|
670
|
-
async function completeBootstrap(workDir) {
|
|
671
|
-
const projectDir = workDir || getWorkingDirectory(void 0, true);
|
|
672
|
-
const bootstrapPath = join4(getTrieDirectory(projectDir), "BOOTSTRAP.md");
|
|
673
|
-
try {
|
|
674
|
-
await unlink(bootstrapPath);
|
|
675
|
-
return true;
|
|
676
|
-
} catch {
|
|
677
|
-
return false;
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
function needsBootstrap(workDir) {
|
|
681
|
-
const projectDir = workDir || getWorkingDirectory(void 0, true);
|
|
682
|
-
const bootstrapPath = join4(getTrieDirectory(projectDir), "BOOTSTRAP.md");
|
|
683
|
-
return existsSync4(bootstrapPath);
|
|
684
|
-
}
|
|
685
|
-
async function loadRules(workDir) {
|
|
686
|
-
const projectDir = workDir || getWorkingDirectory(void 0, true);
|
|
687
|
-
const rulesPath = join4(getTrieDirectory(projectDir), "RULES.md");
|
|
688
|
-
try {
|
|
689
|
-
if (existsSync4(rulesPath)) {
|
|
690
|
-
return await readFile4(rulesPath, "utf-8");
|
|
691
|
-
}
|
|
692
|
-
} catch {
|
|
693
|
-
}
|
|
694
|
-
return null;
|
|
695
|
-
}
|
|
696
|
-
async function loadTeamInfo(workDir) {
|
|
697
|
-
const projectDir = workDir || getWorkingDirectory(void 0, true);
|
|
698
|
-
const teamPath = join4(getTrieDirectory(projectDir), "TEAM.md");
|
|
699
|
-
try {
|
|
700
|
-
if (existsSync4(teamPath)) {
|
|
701
|
-
return await readFile4(teamPath, "utf-8");
|
|
702
|
-
}
|
|
703
|
-
} catch {
|
|
704
|
-
}
|
|
705
|
-
return null;
|
|
706
|
-
}
|
|
707
|
-
function getFileTemplate(fileName, stack) {
|
|
708
|
-
switch (fileName) {
|
|
709
|
-
case "PROJECT.md":
|
|
710
|
-
return getProjectTemplate2(stack);
|
|
711
|
-
case "RULES.md":
|
|
712
|
-
return getRulesTemplate(stack);
|
|
713
|
-
case "TEAM.md":
|
|
714
|
-
return getTeamTemplate();
|
|
715
|
-
case "BOOTSTRAP.md":
|
|
716
|
-
return getBootstrapTemplate(stack);
|
|
717
|
-
default:
|
|
718
|
-
return null;
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
function getProjectTemplate2(stack) {
|
|
722
|
-
const lines = ["# Project Overview", "", "> Define your project context here. AI assistants read this first.", ""];
|
|
723
|
-
lines.push("## Description", "", "[Describe what this project does and who it's for]", "");
|
|
724
|
-
lines.push("## Technology Stack", "");
|
|
725
|
-
if (stack.framework) lines.push(`- **Framework:** ${stack.framework}`);
|
|
726
|
-
if (stack.language) lines.push(`- **Language:** ${stack.language}`);
|
|
727
|
-
if (stack.database) lines.push(`- **Database:** ${stack.database}`);
|
|
728
|
-
if (stack.auth) lines.push(`- **Auth:** ${stack.auth}`);
|
|
729
|
-
if (!stack.framework && !stack.language && !stack.database) {
|
|
730
|
-
lines.push("[Add your technology stack]");
|
|
731
|
-
}
|
|
732
|
-
lines.push("");
|
|
733
|
-
lines.push("## Architecture", "", "[Key patterns and design decisions]", "");
|
|
734
|
-
lines.push("## Coding Conventions", "", "[Style rules agents should follow]", "");
|
|
735
|
-
lines.push("## AI Instructions", "", "When working on this project:", "1. [Instruction 1]", "2. [Instruction 2]", "3. [Instruction 3]", "");
|
|
736
|
-
lines.push("---", "", "*Edit this file to provide project context to AI assistants.*");
|
|
737
|
-
return lines.join("\n");
|
|
738
|
-
}
|
|
739
|
-
function getRulesTemplate(stack) {
|
|
740
|
-
const packageManager = stack.packageManager || "npm";
|
|
741
|
-
return `# Project Rules
|
|
742
|
-
|
|
743
|
-
> These rules are enforced by Trie agents during scans.
|
|
744
|
-
> Violations appear as issues with [RULES] prefix.
|
|
745
|
-
|
|
746
|
-
## Code Style
|
|
747
|
-
|
|
748
|
-
1. Use named exports, not default exports
|
|
749
|
-
2. Prefer \`${packageManager}\` for package management
|
|
750
|
-
3. Maximum file length: 300 lines
|
|
751
|
-
4. Use TypeScript strict mode
|
|
752
|
-
|
|
753
|
-
## Testing Requirements
|
|
754
|
-
|
|
755
|
-
1. Critical paths require unit tests
|
|
756
|
-
2. API endpoints require integration tests
|
|
757
|
-
3. Minimum coverage: 70%
|
|
758
|
-
|
|
759
|
-
## Security Rules
|
|
760
|
-
|
|
761
|
-
1. Never log sensitive data (passwords, tokens, PII)
|
|
762
|
-
2. All API routes require authentication
|
|
763
|
-
3. Rate limiting required on public endpoints
|
|
764
|
-
4. SQL queries must use parameterized statements
|
|
765
|
-
|
|
766
|
-
## Review Requirements
|
|
767
|
-
|
|
768
|
-
1. All PRs require at least 1 reviewer
|
|
769
|
-
2. Security-sensitive changes require security review
|
|
770
|
-
3. Database migrations require review
|
|
771
|
-
|
|
772
|
-
---
|
|
773
|
-
|
|
774
|
-
*Edit this file to define your project's coding standards.*
|
|
775
|
-
`;
|
|
776
|
-
}
|
|
777
|
-
function getTeamTemplate() {
|
|
778
|
-
return `# Team Structure
|
|
779
|
-
|
|
780
|
-
## Code Ownership
|
|
781
|
-
|
|
782
|
-
| Area | Owner | Backup | Review Required |
|
|
783
|
-
|------|-------|--------|-----------------|
|
|
784
|
-
| \`/src/api/\` | @backend-team | - | 1 approver |
|
|
785
|
-
| \`/src/ui/\` | @frontend-team | - | 1 approver |
|
|
786
|
-
| \`/src/auth/\` | @security-team | - | Security review |
|
|
787
|
-
|
|
788
|
-
## Escalation
|
|
789
|
-
|
|
790
|
-
| Severity | First Contact | Escalate To | SLA |
|
|
791
|
-
|----------|--------------|-------------|-----|
|
|
792
|
-
| Critical | Team lead | CTO | 1 hour |
|
|
793
|
-
| Serious | PR reviewer | Team lead | 4 hours |
|
|
794
|
-
| Moderate | Self-serve | - | 1 day |
|
|
795
|
-
|
|
796
|
-
## Contacts
|
|
797
|
-
|
|
798
|
-
- **Security:** [email/slack]
|
|
799
|
-
- **Privacy:** [email/slack]
|
|
800
|
-
- **Emergencies:** [phone/pager]
|
|
801
|
-
|
|
802
|
-
---
|
|
803
|
-
|
|
804
|
-
*Edit this file to define your team structure.*
|
|
805
|
-
`;
|
|
806
|
-
}
|
|
807
|
-
function getBootstrapTemplate(stack) {
|
|
808
|
-
const skillCommands = stack.suggestedSkills.map((s) => `trie skills add ${s}`).join("\n");
|
|
809
|
-
const agentList = stack.suggestedAgents.join(", ");
|
|
810
|
-
const lines = [
|
|
811
|
-
"# Trie Bootstrap Checklist",
|
|
812
|
-
"",
|
|
813
|
-
"This file guides your first scan setup. **Delete when complete.**",
|
|
814
|
-
"",
|
|
815
|
-
"## Auto-Detected Stack",
|
|
816
|
-
"",
|
|
817
|
-
"Based on your project, Trie detected:"
|
|
818
|
-
];
|
|
819
|
-
if (stack.framework) lines.push(`- **Framework:** ${stack.framework}`);
|
|
820
|
-
if (stack.language) lines.push(`- **Language:** ${stack.language}`);
|
|
821
|
-
if (stack.database) lines.push(`- **Database:** ${stack.database}`);
|
|
822
|
-
if (stack.auth) lines.push(`- **Auth:** ${stack.auth}`);
|
|
823
|
-
lines.push("", "## Recommended Actions", "", "### 1. Skills to Install", "Based on your stack, consider installing:", "```bash");
|
|
824
|
-
lines.push(skillCommands || "# No specific skills detected - browse https://skills.sh");
|
|
825
|
-
lines.push("```", "", "### 2. Agents to Enable", `Your stack suggests these agents: ${agentList || "security, bugs"}`, "");
|
|
826
|
-
lines.push("### 3. Configure Rules", "Add your coding standards to `.trie/RULES.md`.", "");
|
|
827
|
-
lines.push("### 4. Start Monitoring", "```bash", "trie watch", "```", "");
|
|
828
|
-
lines.push("---", "", "**Delete this file after completing setup.** Run:", "```bash", "rm .trie/BOOTSTRAP.md", "```");
|
|
829
|
-
return lines.join("\n");
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
export {
|
|
833
|
-
projectInfoExists,
|
|
834
|
-
loadProjectInfo,
|
|
835
|
-
initProjectInfo,
|
|
836
|
-
getProjectSection,
|
|
837
|
-
updateProjectSection,
|
|
838
|
-
appendToSection,
|
|
839
|
-
getProjectSections,
|
|
840
|
-
getProjectInfoStructured,
|
|
841
|
-
loadBootstrapContext,
|
|
842
|
-
initializeBootstrapFiles,
|
|
843
|
-
completeBootstrap,
|
|
844
|
-
needsBootstrap,
|
|
845
|
-
loadRules,
|
|
846
|
-
loadTeamInfo,
|
|
847
|
-
loadContextState,
|
|
848
|
-
getContextForAI
|
|
849
|
-
};
|
|
850
|
-
//# sourceMappingURL=chunk-HVCDY3AK.js.map
|