fathom-cli 0.2.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -38
- package/dist/chunk-FILMHRDQ.js +2055 -0
- package/dist/chunk-FILMHRDQ.js.map +1 -0
- package/dist/chunk-MNGU6SI4.js +6680 -0
- package/dist/chunk-MNGU6SI4.js.map +1 -0
- package/dist/chunk-SEGVTWSK.js +44 -0
- package/dist/chunk-SEGVTWSK.js.map +1 -0
- package/dist/chunk-TXIC6BY4.js +169 -0
- package/dist/chunk-TXIC6BY4.js.map +1 -0
- package/dist/dist-KXBSLOHP.js +506 -0
- package/dist/dist-KXBSLOHP.js.map +1 -0
- package/dist/dist-XKZLNUDU.js +34 -0
- package/dist/dist-XKZLNUDU.js.map +1 -0
- package/dist/fileFromPath-AY5NHOFK.js +131 -0
- package/dist/fileFromPath-AY5NHOFK.js.map +1 -0
- package/dist/index.js +14079 -18029
- package/dist/index.js.map +1 -1
- package/dist/openai-CLPZFCUS.js +10933 -0
- package/dist/openai-CLPZFCUS.js.map +1 -0
- package/package.json +9 -4
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
resolveGuardrails
|
|
4
|
+
} from "./chunk-TXIC6BY4.js";
|
|
5
|
+
import "./chunk-MNGU6SI4.js";
|
|
6
|
+
import "./chunk-SEGVTWSK.js";
|
|
7
|
+
|
|
8
|
+
// ../projections/dist/index.js
|
|
9
|
+
import { mkdirSync, writeFileSync } from "fs";
|
|
10
|
+
import { dirname, resolve } from "path";
|
|
11
|
+
function generateClaudeSkill(intent, guardrails, context) {
|
|
12
|
+
const sections = [];
|
|
13
|
+
sections.push(`# ${intent.project}`);
|
|
14
|
+
sections.push(buildProjectContext(intent));
|
|
15
|
+
if (intent.values.length > 0) {
|
|
16
|
+
sections.push(buildValues(intent));
|
|
17
|
+
}
|
|
18
|
+
const budgetSection = buildBudget(intent, context);
|
|
19
|
+
if (budgetSection) {
|
|
20
|
+
sections.push(budgetSection);
|
|
21
|
+
}
|
|
22
|
+
const guardrailSection = buildGuardrails(guardrails);
|
|
23
|
+
if (guardrailSection) {
|
|
24
|
+
sections.push(guardrailSection);
|
|
25
|
+
}
|
|
26
|
+
const techSection = buildTech(intent);
|
|
27
|
+
if (techSection) {
|
|
28
|
+
sections.push(techSection);
|
|
29
|
+
}
|
|
30
|
+
const registrySection = buildRegistry(context);
|
|
31
|
+
if (registrySection) {
|
|
32
|
+
sections.push(registrySection);
|
|
33
|
+
}
|
|
34
|
+
return sections.join("\n\n") + "\n";
|
|
35
|
+
}
|
|
36
|
+
function buildProjectContext(intent) {
|
|
37
|
+
const lines = ["## Project Context"];
|
|
38
|
+
lines.push("");
|
|
39
|
+
lines.push(intent.description);
|
|
40
|
+
if (intent.audience) {
|
|
41
|
+
lines.push("");
|
|
42
|
+
lines.push(`**Audience:** ${intent.audience}`);
|
|
43
|
+
}
|
|
44
|
+
return lines.join("\n");
|
|
45
|
+
}
|
|
46
|
+
function buildValues(intent) {
|
|
47
|
+
const lines = ["## What Matters"];
|
|
48
|
+
lines.push("");
|
|
49
|
+
lines.push(
|
|
50
|
+
"These are the project's core values, ordered by priority. Let them guide your decisions."
|
|
51
|
+
);
|
|
52
|
+
lines.push("");
|
|
53
|
+
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
54
|
+
const sorted = [...intent.values].sort(
|
|
55
|
+
(a, b) => priorityOrder[a.priority] - priorityOrder[b.priority]
|
|
56
|
+
);
|
|
57
|
+
for (const value of sorted) {
|
|
58
|
+
const tag = value.priority === "critical" ? " **(CRITICAL)**" : value.priority === "high" ? " **(high priority)**" : "";
|
|
59
|
+
lines.push(`- **${value.name}**${tag} \u2014 ${value.description}`);
|
|
60
|
+
if (value.details) {
|
|
61
|
+
lines.push(` - ${value.details}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return lines.join("\n");
|
|
65
|
+
}
|
|
66
|
+
function buildBudget(intent, context) {
|
|
67
|
+
if (!intent.budget) return null;
|
|
68
|
+
const { budget } = intent;
|
|
69
|
+
const lines = ["## Budget Awareness"];
|
|
70
|
+
lines.push("");
|
|
71
|
+
lines.push(
|
|
72
|
+
`This project has a monthly budget of **${budget.currency} ${budget.monthly_limit.toLocaleString()}**.`
|
|
73
|
+
);
|
|
74
|
+
lines.push(
|
|
75
|
+
`Alert threshold: ${Math.round(budget.alert_threshold * 100)}% of budget.`
|
|
76
|
+
);
|
|
77
|
+
if (budget.prefer_batch) {
|
|
78
|
+
lines.push("");
|
|
79
|
+
lines.push(
|
|
80
|
+
"**Prefer batch operations** where possible to reduce API costs."
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
if (context?.trackingSummary) {
|
|
84
|
+
const { totalCost, monthlySpend, totalTokens } = context.trackingSummary;
|
|
85
|
+
const pct = budget.monthly_limit > 0 ? Math.round(monthlySpend / budget.monthly_limit * 100) : 0;
|
|
86
|
+
lines.push("");
|
|
87
|
+
lines.push("### Current Spend");
|
|
88
|
+
lines.push(`- Monthly spend so far: ${budget.currency} ${monthlySpend.toFixed(2)} (${pct}% of budget)`);
|
|
89
|
+
lines.push(`- Total project cost: ${budget.currency} ${totalCost.toFixed(2)}`);
|
|
90
|
+
lines.push(`- Total tokens used: ${totalTokens.toLocaleString()}`);
|
|
91
|
+
if (pct >= budget.alert_threshold * 100) {
|
|
92
|
+
lines.push("");
|
|
93
|
+
lines.push(
|
|
94
|
+
`> **Warning:** Monthly spend has reached ${pct}% of the budget. Be especially mindful of token usage.`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return lines.join("\n");
|
|
99
|
+
}
|
|
100
|
+
function buildGuardrails(guardrails) {
|
|
101
|
+
const hasAny = guardrails.security.length > 0 || guardrails.quality.length > 0 || guardrails.process.length > 0;
|
|
102
|
+
if (!hasAny) return null;
|
|
103
|
+
const lines = ["## Guardrails"];
|
|
104
|
+
lines.push("");
|
|
105
|
+
lines.push("These rules are non-negotiable. Follow them in every change.");
|
|
106
|
+
if (guardrails.security.length > 0) {
|
|
107
|
+
lines.push("");
|
|
108
|
+
lines.push("### Security");
|
|
109
|
+
for (const rule of guardrails.security) {
|
|
110
|
+
lines.push(`- ${rule}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (guardrails.quality.length > 0) {
|
|
114
|
+
lines.push("");
|
|
115
|
+
lines.push("### Quality");
|
|
116
|
+
for (const rule of guardrails.quality) {
|
|
117
|
+
lines.push(`- ${rule}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (guardrails.process.length > 0) {
|
|
121
|
+
lines.push("");
|
|
122
|
+
lines.push("### Process");
|
|
123
|
+
for (const rule of guardrails.process) {
|
|
124
|
+
lines.push(`- ${rule}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return lines.join("\n");
|
|
128
|
+
}
|
|
129
|
+
function buildTech(intent) {
|
|
130
|
+
if (!intent.tech) return null;
|
|
131
|
+
const { stack, opinions } = intent.tech;
|
|
132
|
+
if (stack.length === 0 && opinions.length === 0) return null;
|
|
133
|
+
const lines = ["## Tech Context"];
|
|
134
|
+
if (stack.length > 0) {
|
|
135
|
+
lines.push("");
|
|
136
|
+
lines.push(`**Stack:** ${stack.join(", ")}`);
|
|
137
|
+
}
|
|
138
|
+
if (opinions.length > 0) {
|
|
139
|
+
lines.push("");
|
|
140
|
+
lines.push("### Conventions");
|
|
141
|
+
for (const opinion of opinions) {
|
|
142
|
+
lines.push(`- ${opinion}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return lines.join("\n");
|
|
146
|
+
}
|
|
147
|
+
function buildRegistry(context) {
|
|
148
|
+
if (!context?.registry || context.registry.length === 0) return null;
|
|
149
|
+
const lines = ["## Feature Registry"];
|
|
150
|
+
lines.push("");
|
|
151
|
+
lines.push("Current features being tracked:");
|
|
152
|
+
lines.push("");
|
|
153
|
+
const statusIcon = {
|
|
154
|
+
active: "\u{1F7E2}",
|
|
155
|
+
planned: "\u{1F535}",
|
|
156
|
+
completed: "\u2705",
|
|
157
|
+
paused: "\u23F8\uFE0F"
|
|
158
|
+
};
|
|
159
|
+
for (const feature of context.registry) {
|
|
160
|
+
const icon = statusIcon[feature.status] ?? "\u26AA";
|
|
161
|
+
const tokens = feature.estimatedTokens ? ` (~${Math.round(feature.estimatedTokens / 1e3)}K tokens)` : "";
|
|
162
|
+
lines.push(`- ${icon} **${feature.name}** [${feature.status}]${tokens}`);
|
|
163
|
+
}
|
|
164
|
+
return lines.join("\n");
|
|
165
|
+
}
|
|
166
|
+
function generateCursorRules(intent, guardrails, context) {
|
|
167
|
+
const sections = [];
|
|
168
|
+
sections.push(`# ${intent.project}`);
|
|
169
|
+
sections.push("");
|
|
170
|
+
sections.push(intent.description);
|
|
171
|
+
if (intent.audience) {
|
|
172
|
+
sections.push(`Audience: ${intent.audience}`);
|
|
173
|
+
}
|
|
174
|
+
if (intent.values.length > 0) {
|
|
175
|
+
sections.push("");
|
|
176
|
+
sections.push("## Values");
|
|
177
|
+
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
178
|
+
const sorted = [...intent.values].sort(
|
|
179
|
+
(a, b) => priorityOrder[a.priority] - priorityOrder[b.priority]
|
|
180
|
+
);
|
|
181
|
+
for (const value of sorted) {
|
|
182
|
+
const priority = value.priority === "critical" || value.priority === "high" ? ` [${value.priority}]` : "";
|
|
183
|
+
sections.push(`- ${value.name}${priority}: ${value.description}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (intent.budget) {
|
|
187
|
+
sections.push("");
|
|
188
|
+
sections.push("## Budget");
|
|
189
|
+
sections.push(
|
|
190
|
+
`- Monthly limit: ${intent.budget.currency} ${intent.budget.monthly_limit.toLocaleString()}`
|
|
191
|
+
);
|
|
192
|
+
if (intent.budget.prefer_batch) {
|
|
193
|
+
sections.push("- Prefer batch operations to reduce costs");
|
|
194
|
+
}
|
|
195
|
+
if (context?.trackingSummary) {
|
|
196
|
+
const pct = Math.round(
|
|
197
|
+
context.trackingSummary.monthlySpend / intent.budget.monthly_limit * 100
|
|
198
|
+
);
|
|
199
|
+
sections.push(
|
|
200
|
+
`- Current monthly spend: ${intent.budget.currency} ${context.trackingSummary.monthlySpend.toFixed(2)} (${pct}%)`
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const allRules = [
|
|
205
|
+
...guardrails.security.map((r) => `[security] ${r}`),
|
|
206
|
+
...guardrails.quality.map((r) => `[quality] ${r}`),
|
|
207
|
+
...guardrails.process.map((r) => `[process] ${r}`)
|
|
208
|
+
];
|
|
209
|
+
if (allRules.length > 0) {
|
|
210
|
+
sections.push("");
|
|
211
|
+
sections.push("## Rules");
|
|
212
|
+
for (const rule of allRules) {
|
|
213
|
+
sections.push(`- ${rule}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (intent.tech) {
|
|
217
|
+
const { stack, opinions } = intent.tech;
|
|
218
|
+
if (stack.length > 0 || opinions.length > 0) {
|
|
219
|
+
sections.push("");
|
|
220
|
+
sections.push("## Tech Stack");
|
|
221
|
+
if (stack.length > 0) {
|
|
222
|
+
sections.push(`Stack: ${stack.join(", ")}`);
|
|
223
|
+
}
|
|
224
|
+
if (opinions.length > 0) {
|
|
225
|
+
for (const opinion of opinions) {
|
|
226
|
+
sections.push(`- ${opinion}`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (context?.registry && context.registry.length > 0) {
|
|
232
|
+
sections.push("");
|
|
233
|
+
sections.push("## Features");
|
|
234
|
+
for (const feature of context.registry) {
|
|
235
|
+
const tokens = feature.estimatedTokens ? ` (~${Math.round(feature.estimatedTokens / 1e3)}K tokens)` : "";
|
|
236
|
+
sections.push(`- ${feature.name} [${feature.status}]${tokens}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return sections.join("\n") + "\n";
|
|
240
|
+
}
|
|
241
|
+
function generateSystemPrompt(intent, guardrails, context) {
|
|
242
|
+
const parts = [];
|
|
243
|
+
parts.push(
|
|
244
|
+
`You are an AI assistant working on ${intent.project}. ${intent.description}`
|
|
245
|
+
);
|
|
246
|
+
if (intent.audience) {
|
|
247
|
+
parts.push(`The target audience is: ${intent.audience}.`);
|
|
248
|
+
}
|
|
249
|
+
if (intent.values.length > 0) {
|
|
250
|
+
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
251
|
+
const sorted = [...intent.values].sort(
|
|
252
|
+
(a, b) => priorityOrder[a.priority] - priorityOrder[b.priority]
|
|
253
|
+
);
|
|
254
|
+
const valueList = sorted.map((v) => {
|
|
255
|
+
const tag = v.priority === "critical" ? " (CRITICAL)" : "";
|
|
256
|
+
return `${v.name}${tag}: ${v.description}`;
|
|
257
|
+
}).join("; ");
|
|
258
|
+
parts.push(`Core values: ${valueList}.`);
|
|
259
|
+
}
|
|
260
|
+
if (intent.budget) {
|
|
261
|
+
let budgetLine = `Budget: ${intent.budget.currency} ${intent.budget.monthly_limit.toLocaleString()}/month.`;
|
|
262
|
+
if (context?.trackingSummary) {
|
|
263
|
+
const pct = Math.round(
|
|
264
|
+
context.trackingSummary.monthlySpend / intent.budget.monthly_limit * 100
|
|
265
|
+
);
|
|
266
|
+
budgetLine += ` Current spend: ${pct}%.`;
|
|
267
|
+
}
|
|
268
|
+
if (intent.budget.prefer_batch) {
|
|
269
|
+
budgetLine += " Prefer batch operations.";
|
|
270
|
+
}
|
|
271
|
+
parts.push(budgetLine);
|
|
272
|
+
}
|
|
273
|
+
const allRules = [
|
|
274
|
+
...guardrails.security,
|
|
275
|
+
...guardrails.quality,
|
|
276
|
+
...guardrails.process
|
|
277
|
+
];
|
|
278
|
+
if (allRules.length > 0) {
|
|
279
|
+
parts.push("Mandatory rules:");
|
|
280
|
+
for (const rule of allRules) {
|
|
281
|
+
parts.push(`- ${rule}`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (intent.tech) {
|
|
285
|
+
const { stack, opinions } = intent.tech;
|
|
286
|
+
if (stack.length > 0) {
|
|
287
|
+
parts.push(`Tech stack: ${stack.join(", ")}.`);
|
|
288
|
+
}
|
|
289
|
+
if (opinions.length > 0) {
|
|
290
|
+
parts.push(`Conventions: ${opinions.join("; ")}.`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return parts.join("\n") + "\n";
|
|
294
|
+
}
|
|
295
|
+
function generateCopilotInstructions(intent, guardrails, context) {
|
|
296
|
+
const sections = [];
|
|
297
|
+
sections.push(`# ${intent.project}`);
|
|
298
|
+
sections.push("");
|
|
299
|
+
sections.push(intent.description);
|
|
300
|
+
if (intent.audience) {
|
|
301
|
+
sections.push(`Audience: ${intent.audience}`);
|
|
302
|
+
}
|
|
303
|
+
if (intent.values.length > 0) {
|
|
304
|
+
sections.push("");
|
|
305
|
+
sections.push("## Values");
|
|
306
|
+
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
307
|
+
const sorted = [...intent.values].sort(
|
|
308
|
+
(a, b) => priorityOrder[a.priority] - priorityOrder[b.priority]
|
|
309
|
+
);
|
|
310
|
+
for (const value of sorted) {
|
|
311
|
+
const priority = value.priority === "critical" || value.priority === "high" ? ` [${value.priority}]` : "";
|
|
312
|
+
sections.push(`- ${value.name}${priority}: ${value.description}`);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (intent.budget) {
|
|
316
|
+
sections.push("");
|
|
317
|
+
sections.push("## Budget");
|
|
318
|
+
sections.push(
|
|
319
|
+
`- Monthly limit: ${intent.budget.currency} ${intent.budget.monthly_limit.toLocaleString()}`
|
|
320
|
+
);
|
|
321
|
+
if (intent.budget.prefer_batch) {
|
|
322
|
+
sections.push("- Prefer batch operations to reduce costs");
|
|
323
|
+
}
|
|
324
|
+
if (context?.trackingSummary) {
|
|
325
|
+
const pct = Math.round(
|
|
326
|
+
context.trackingSummary.monthlySpend / intent.budget.monthly_limit * 100
|
|
327
|
+
);
|
|
328
|
+
sections.push(
|
|
329
|
+
`- Current monthly spend: ${intent.budget.currency} ${context.trackingSummary.monthlySpend.toFixed(2)} (${pct}%)`
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
const allRules = [
|
|
334
|
+
...guardrails.security.map((r) => `[security] ${r}`),
|
|
335
|
+
...guardrails.quality.map((r) => `[quality] ${r}`),
|
|
336
|
+
...guardrails.process.map((r) => `[process] ${r}`)
|
|
337
|
+
];
|
|
338
|
+
if (allRules.length > 0) {
|
|
339
|
+
sections.push("");
|
|
340
|
+
sections.push("## Rules");
|
|
341
|
+
for (const rule of allRules) {
|
|
342
|
+
sections.push(`- ${rule}`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (intent.tech) {
|
|
346
|
+
const { stack, opinions } = intent.tech;
|
|
347
|
+
if (stack.length > 0 || opinions.length > 0) {
|
|
348
|
+
sections.push("");
|
|
349
|
+
sections.push("## Tech Stack");
|
|
350
|
+
if (stack.length > 0) {
|
|
351
|
+
sections.push(`Stack: ${stack.join(", ")}`);
|
|
352
|
+
}
|
|
353
|
+
if (opinions.length > 0) {
|
|
354
|
+
for (const opinion of opinions) {
|
|
355
|
+
sections.push(`- ${opinion}`);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (context?.registry && context.registry.length > 0) {
|
|
361
|
+
sections.push("");
|
|
362
|
+
sections.push("## Features");
|
|
363
|
+
for (const feature of context.registry) {
|
|
364
|
+
const tokens = feature.estimatedTokens ? ` (~${Math.round(feature.estimatedTokens / 1e3)}K tokens)` : "";
|
|
365
|
+
sections.push(`- ${feature.name} [${feature.status}]${tokens}`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return sections.join("\n") + "\n";
|
|
369
|
+
}
|
|
370
|
+
function generateWindsurfRules(intent, guardrails, context) {
|
|
371
|
+
const sections = [];
|
|
372
|
+
sections.push(`# ${intent.project}`);
|
|
373
|
+
sections.push("");
|
|
374
|
+
sections.push(intent.description);
|
|
375
|
+
if (intent.audience) {
|
|
376
|
+
sections.push(`Audience: ${intent.audience}`);
|
|
377
|
+
}
|
|
378
|
+
if (intent.values.length > 0) {
|
|
379
|
+
sections.push("");
|
|
380
|
+
sections.push("## Values");
|
|
381
|
+
const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
382
|
+
const sorted = [...intent.values].sort(
|
|
383
|
+
(a, b) => priorityOrder[a.priority] - priorityOrder[b.priority]
|
|
384
|
+
);
|
|
385
|
+
for (const value of sorted) {
|
|
386
|
+
const priority = value.priority === "critical" || value.priority === "high" ? ` [${value.priority}]` : "";
|
|
387
|
+
sections.push(`- ${value.name}${priority}: ${value.description}`);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (intent.budget) {
|
|
391
|
+
sections.push("");
|
|
392
|
+
sections.push("## Budget");
|
|
393
|
+
sections.push(
|
|
394
|
+
`- Monthly limit: ${intent.budget.currency} ${intent.budget.monthly_limit.toLocaleString()}`
|
|
395
|
+
);
|
|
396
|
+
if (intent.budget.prefer_batch) {
|
|
397
|
+
sections.push("- Prefer batch operations to reduce costs");
|
|
398
|
+
}
|
|
399
|
+
if (context?.trackingSummary) {
|
|
400
|
+
const pct = Math.round(
|
|
401
|
+
context.trackingSummary.monthlySpend / intent.budget.monthly_limit * 100
|
|
402
|
+
);
|
|
403
|
+
sections.push(
|
|
404
|
+
`- Current monthly spend: ${intent.budget.currency} ${context.trackingSummary.monthlySpend.toFixed(2)} (${pct}%)`
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
const allRules = [
|
|
409
|
+
...guardrails.security.map((r) => `[security] ${r}`),
|
|
410
|
+
...guardrails.quality.map((r) => `[quality] ${r}`),
|
|
411
|
+
...guardrails.process.map((r) => `[process] ${r}`)
|
|
412
|
+
];
|
|
413
|
+
if (allRules.length > 0) {
|
|
414
|
+
sections.push("");
|
|
415
|
+
sections.push("## Rules");
|
|
416
|
+
for (const rule of allRules) {
|
|
417
|
+
sections.push(`- ${rule}`);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
if (intent.tech) {
|
|
421
|
+
const { stack, opinions } = intent.tech;
|
|
422
|
+
if (stack.length > 0 || opinions.length > 0) {
|
|
423
|
+
sections.push("");
|
|
424
|
+
sections.push("## Tech Stack");
|
|
425
|
+
if (stack.length > 0) {
|
|
426
|
+
sections.push(`Stack: ${stack.join(", ")}`);
|
|
427
|
+
}
|
|
428
|
+
if (opinions.length > 0) {
|
|
429
|
+
for (const opinion of opinions) {
|
|
430
|
+
sections.push(`- ${opinion}`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if (context?.registry && context.registry.length > 0) {
|
|
436
|
+
sections.push("");
|
|
437
|
+
sections.push("## Features");
|
|
438
|
+
for (const feature of context.registry) {
|
|
439
|
+
const tokens = feature.estimatedTokens ? ` (~${Math.round(feature.estimatedTokens / 1e3)}K tokens)` : "";
|
|
440
|
+
sections.push(`- ${feature.name} [${feature.status}]${tokens}`);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return sections.join("\n") + "\n";
|
|
444
|
+
}
|
|
445
|
+
var ALL_TARGETS = ["claude", "cursor", "generic", "copilot", "windsurf"];
|
|
446
|
+
function generateProjections(intent, context, targets) {
|
|
447
|
+
const guardrails = resolveGuardrails(intent);
|
|
448
|
+
const activeTargets = targets ?? ALL_TARGETS;
|
|
449
|
+
const files = /* @__PURE__ */ new Map();
|
|
450
|
+
for (const target of activeTargets) {
|
|
451
|
+
switch (target) {
|
|
452
|
+
case "claude":
|
|
453
|
+
files.set(
|
|
454
|
+
"projections/claude/SKILL.md",
|
|
455
|
+
generateClaudeSkill(intent, guardrails, context)
|
|
456
|
+
);
|
|
457
|
+
break;
|
|
458
|
+
case "cursor":
|
|
459
|
+
files.set(
|
|
460
|
+
"projections/cursor/.cursorrules",
|
|
461
|
+
generateCursorRules(intent, guardrails, context)
|
|
462
|
+
);
|
|
463
|
+
break;
|
|
464
|
+
case "generic":
|
|
465
|
+
files.set(
|
|
466
|
+
"projections/generic/SYSTEM_PROMPT.md",
|
|
467
|
+
generateSystemPrompt(intent, guardrails, context)
|
|
468
|
+
);
|
|
469
|
+
break;
|
|
470
|
+
case "copilot":
|
|
471
|
+
files.set(
|
|
472
|
+
"projections/copilot/copilot-instructions.md",
|
|
473
|
+
generateCopilotInstructions(intent, guardrails, context)
|
|
474
|
+
);
|
|
475
|
+
break;
|
|
476
|
+
case "windsurf":
|
|
477
|
+
files.set(
|
|
478
|
+
"projections/windsurf/.windsurfrules",
|
|
479
|
+
generateWindsurfRules(intent, guardrails, context)
|
|
480
|
+
);
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return { files };
|
|
485
|
+
}
|
|
486
|
+
async function writeProjections(dir, intent, context, targets) {
|
|
487
|
+
const output = generateProjections(intent, context, targets);
|
|
488
|
+
const written = [];
|
|
489
|
+
for (const [relativePath, content] of output.files) {
|
|
490
|
+
const absPath = resolve(dir, ".fathom", relativePath);
|
|
491
|
+
mkdirSync(dirname(absPath), { recursive: true });
|
|
492
|
+
writeFileSync(absPath, content, "utf-8");
|
|
493
|
+
written.push(absPath);
|
|
494
|
+
}
|
|
495
|
+
return written;
|
|
496
|
+
}
|
|
497
|
+
export {
|
|
498
|
+
generateClaudeSkill,
|
|
499
|
+
generateCopilotInstructions,
|
|
500
|
+
generateCursorRules,
|
|
501
|
+
generateProjections,
|
|
502
|
+
generateSystemPrompt,
|
|
503
|
+
generateWindsurfRules,
|
|
504
|
+
writeProjections
|
|
505
|
+
};
|
|
506
|
+
//# sourceMappingURL=dist-KXBSLOHP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../projections/src/templates/claude.ts","../../projections/src/templates/cursor.ts","../../projections/src/templates/generic.ts","../../projections/src/templates/copilot.ts","../../projections/src/templates/windsurf.ts","../../projections/src/generator.ts","../../projections/src/writer.ts"],"sourcesContent":["import type { IntentConfig, ResolvedGuardrails } from \"@fathom/intent\";\nimport type { ProjectionContext } from \"../types.js\";\n\n/**\n * Generate a Claude Code SKILL.md file from intent and guardrails.\n *\n * This is the primary projection — it should be thorough, well-structured,\n * and read naturally as instructions for an AI coding assistant.\n */\nexport function generateClaudeSkill(\n intent: IntentConfig,\n guardrails: ResolvedGuardrails,\n context?: ProjectionContext,\n): string {\n const sections: string[] = [];\n\n // Header\n sections.push(`# ${intent.project}`);\n\n // ── Project Context ────────────────────────────────────────\n sections.push(buildProjectContext(intent));\n\n // ── What Matters ───────────────────────────────────────────\n if (intent.values.length > 0) {\n sections.push(buildValues(intent));\n }\n\n // ── Budget Awareness ───────────────────────────────────────\n const budgetSection = buildBudget(intent, context);\n if (budgetSection) {\n sections.push(budgetSection);\n }\n\n // ── Guardrails ─────────────────────────────────────────────\n const guardrailSection = buildGuardrails(guardrails);\n if (guardrailSection) {\n sections.push(guardrailSection);\n }\n\n // ── Tech Context ───────────────────────────────────────────\n const techSection = buildTech(intent);\n if (techSection) {\n sections.push(techSection);\n }\n\n // ── Feature Registry ───────────────────────────────────────\n const registrySection = buildRegistry(context);\n if (registrySection) {\n sections.push(registrySection);\n }\n\n return sections.join(\"\\n\\n\") + \"\\n\";\n}\n\nfunction buildProjectContext(intent: IntentConfig): string {\n const lines: string[] = [\"## Project Context\"];\n lines.push(\"\");\n lines.push(intent.description);\n if (intent.audience) {\n lines.push(\"\");\n lines.push(`**Audience:** ${intent.audience}`);\n }\n return lines.join(\"\\n\");\n}\n\nfunction buildValues(intent: IntentConfig): string {\n const lines: string[] = [\"## What Matters\"];\n lines.push(\"\");\n lines.push(\n \"These are the project's core values, ordered by priority. Let them guide your decisions.\",\n );\n lines.push(\"\");\n\n // Sort by priority weight\n const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };\n const sorted = [...intent.values].sort(\n (a, b) => priorityOrder[a.priority] - priorityOrder[b.priority],\n );\n\n for (const value of sorted) {\n const tag =\n value.priority === \"critical\"\n ? \" **(CRITICAL)**\"\n : value.priority === \"high\"\n ? \" **(high priority)**\"\n : \"\";\n lines.push(`- **${value.name}**${tag} — ${value.description}`);\n if (value.details) {\n lines.push(` - ${value.details}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction buildBudget(\n intent: IntentConfig,\n context?: ProjectionContext,\n): string | null {\n if (!intent.budget) return null;\n\n const { budget } = intent;\n const lines: string[] = [\"## Budget Awareness\"];\n lines.push(\"\");\n lines.push(\n `This project has a monthly budget of **${budget.currency} ${budget.monthly_limit.toLocaleString()}**.`,\n );\n lines.push(\n `Alert threshold: ${Math.round(budget.alert_threshold * 100)}% of budget.`,\n );\n\n if (budget.prefer_batch) {\n lines.push(\"\");\n lines.push(\n \"**Prefer batch operations** where possible to reduce API costs.\",\n );\n }\n\n if (context?.trackingSummary) {\n const { totalCost, monthlySpend, totalTokens } = context.trackingSummary;\n const pct =\n budget.monthly_limit > 0\n ? Math.round((monthlySpend / budget.monthly_limit) * 100)\n : 0;\n lines.push(\"\");\n lines.push(\"### Current Spend\");\n lines.push(`- Monthly spend so far: ${budget.currency} ${monthlySpend.toFixed(2)} (${pct}% of budget)`);\n lines.push(`- Total project cost: ${budget.currency} ${totalCost.toFixed(2)}`);\n lines.push(`- Total tokens used: ${totalTokens.toLocaleString()}`);\n\n if (pct >= budget.alert_threshold * 100) {\n lines.push(\"\");\n lines.push(\n `> **Warning:** Monthly spend has reached ${pct}% of the budget. Be especially mindful of token usage.`,\n );\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction buildGuardrails(guardrails: ResolvedGuardrails): string | null {\n const hasAny =\n guardrails.security.length > 0 ||\n guardrails.quality.length > 0 ||\n guardrails.process.length > 0;\n\n if (!hasAny) return null;\n\n const lines: string[] = [\"## Guardrails\"];\n lines.push(\"\");\n lines.push(\"These rules are non-negotiable. Follow them in every change.\");\n\n if (guardrails.security.length > 0) {\n lines.push(\"\");\n lines.push(\"### Security\");\n for (const rule of guardrails.security) {\n lines.push(`- ${rule}`);\n }\n }\n\n if (guardrails.quality.length > 0) {\n lines.push(\"\");\n lines.push(\"### Quality\");\n for (const rule of guardrails.quality) {\n lines.push(`- ${rule}`);\n }\n }\n\n if (guardrails.process.length > 0) {\n lines.push(\"\");\n lines.push(\"### Process\");\n for (const rule of guardrails.process) {\n lines.push(`- ${rule}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction buildTech(intent: IntentConfig): string | null {\n if (!intent.tech) return null;\n const { stack, opinions } = intent.tech;\n if (stack.length === 0 && opinions.length === 0) return null;\n\n const lines: string[] = [\"## Tech Context\"];\n\n if (stack.length > 0) {\n lines.push(\"\");\n lines.push(`**Stack:** ${stack.join(\", \")}`);\n }\n\n if (opinions.length > 0) {\n lines.push(\"\");\n lines.push(\"### Conventions\");\n for (const opinion of opinions) {\n lines.push(`- ${opinion}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction buildRegistry(context?: ProjectionContext): string | null {\n if (!context?.registry || context.registry.length === 0) return null;\n\n const lines: string[] = [\"## Feature Registry\"];\n lines.push(\"\");\n lines.push(\"Current features being tracked:\");\n lines.push(\"\");\n\n const statusIcon: Record<string, string> = {\n active: \"🟢\",\n planned: \"🔵\",\n completed: \"✅\",\n paused: \"⏸️\",\n };\n\n for (const feature of context.registry) {\n const icon = statusIcon[feature.status] ?? \"⚪\";\n const tokens = feature.estimatedTokens\n ? ` (~${Math.round(feature.estimatedTokens / 1000)}K tokens)`\n : \"\";\n lines.push(`- ${icon} **${feature.name}** [${feature.status}]${tokens}`);\n }\n\n return lines.join(\"\\n\");\n}\n","import type { IntentConfig, ResolvedGuardrails } from \"@fathom/intent\";\nimport type { ProjectionContext } from \"../types.js\";\n\n/**\n * Generate a .cursorrules file from intent and guardrails.\n *\n * Cursor rules are plain text/markdown — no frontmatter.\n * More concise than the Claude skill, focused on actionable rules.\n */\nexport function generateCursorRules(\n intent: IntentConfig,\n guardrails: ResolvedGuardrails,\n context?: ProjectionContext,\n): string {\n const sections: string[] = [];\n\n // Project overview\n sections.push(`# ${intent.project}`);\n sections.push(\"\");\n sections.push(intent.description);\n if (intent.audience) {\n sections.push(`Audience: ${intent.audience}`);\n }\n\n // Values as rules\n if (intent.values.length > 0) {\n sections.push(\"\");\n sections.push(\"## Values\");\n const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };\n const sorted = [...intent.values].sort(\n (a, b) => priorityOrder[a.priority] - priorityOrder[b.priority],\n );\n for (const value of sorted) {\n const priority =\n value.priority === \"critical\" || value.priority === \"high\"\n ? ` [${value.priority}]`\n : \"\";\n sections.push(`- ${value.name}${priority}: ${value.description}`);\n }\n }\n\n // Budget\n if (intent.budget) {\n sections.push(\"\");\n sections.push(\"## Budget\");\n sections.push(\n `- Monthly limit: ${intent.budget.currency} ${intent.budget.monthly_limit.toLocaleString()}`,\n );\n if (intent.budget.prefer_batch) {\n sections.push(\"- Prefer batch operations to reduce costs\");\n }\n if (context?.trackingSummary) {\n const pct = Math.round(\n (context.trackingSummary.monthlySpend / intent.budget.monthly_limit) *\n 100,\n );\n sections.push(\n `- Current monthly spend: ${intent.budget.currency} ${context.trackingSummary.monthlySpend.toFixed(2)} (${pct}%)`,\n );\n }\n }\n\n // Guardrails — all as flat rules\n const allRules = [\n ...guardrails.security.map((r) => `[security] ${r}`),\n ...guardrails.quality.map((r) => `[quality] ${r}`),\n ...guardrails.process.map((r) => `[process] ${r}`),\n ];\n\n if (allRules.length > 0) {\n sections.push(\"\");\n sections.push(\"## Rules\");\n for (const rule of allRules) {\n sections.push(`- ${rule}`);\n }\n }\n\n // Tech\n if (intent.tech) {\n const { stack, opinions } = intent.tech;\n if (stack.length > 0 || opinions.length > 0) {\n sections.push(\"\");\n sections.push(\"## Tech Stack\");\n if (stack.length > 0) {\n sections.push(`Stack: ${stack.join(\", \")}`);\n }\n if (opinions.length > 0) {\n for (const opinion of opinions) {\n sections.push(`- ${opinion}`);\n }\n }\n }\n }\n\n // Registry\n if (context?.registry && context.registry.length > 0) {\n sections.push(\"\");\n sections.push(\"## Features\");\n for (const feature of context.registry) {\n const tokens = feature.estimatedTokens\n ? ` (~${Math.round(feature.estimatedTokens / 1000)}K tokens)`\n : \"\";\n sections.push(`- ${feature.name} [${feature.status}]${tokens}`);\n }\n }\n\n return sections.join(\"\\n\") + \"\\n\";\n}\n","import type { IntentConfig, ResolvedGuardrails } from \"@fathom/intent\";\nimport type { ProjectionContext } from \"../types.js\";\n\n/**\n * Generate a generic system prompt suitable for any LLM API call.\n *\n * More concise than the other projections — focused on the essential\n * context and hard rules an LLM needs to follow.\n */\nexport function generateSystemPrompt(\n intent: IntentConfig,\n guardrails: ResolvedGuardrails,\n context?: ProjectionContext,\n): string {\n const parts: string[] = [];\n\n // Identity + context\n parts.push(\n `You are an AI assistant working on ${intent.project}. ${intent.description}`,\n );\n if (intent.audience) {\n parts.push(`The target audience is: ${intent.audience}.`);\n }\n\n // Values — keep concise\n if (intent.values.length > 0) {\n const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };\n const sorted = [...intent.values].sort(\n (a, b) => priorityOrder[a.priority] - priorityOrder[b.priority],\n );\n const valueList = sorted\n .map((v) => {\n const tag = v.priority === \"critical\" ? \" (CRITICAL)\" : \"\";\n return `${v.name}${tag}: ${v.description}`;\n })\n .join(\"; \");\n parts.push(`Core values: ${valueList}.`);\n }\n\n // Budget — one line\n if (intent.budget) {\n let budgetLine = `Budget: ${intent.budget.currency} ${intent.budget.monthly_limit.toLocaleString()}/month.`;\n if (context?.trackingSummary) {\n const pct = Math.round(\n (context.trackingSummary.monthlySpend / intent.budget.monthly_limit) *\n 100,\n );\n budgetLine += ` Current spend: ${pct}%.`;\n }\n if (intent.budget.prefer_batch) {\n budgetLine += \" Prefer batch operations.\";\n }\n parts.push(budgetLine);\n }\n\n // Guardrails — mandatory rules\n const allRules = [\n ...guardrails.security,\n ...guardrails.quality,\n ...guardrails.process,\n ];\n if (allRules.length > 0) {\n parts.push(\"Mandatory rules:\");\n for (const rule of allRules) {\n parts.push(`- ${rule}`);\n }\n }\n\n // Tech — one line\n if (intent.tech) {\n const { stack, opinions } = intent.tech;\n if (stack.length > 0) {\n parts.push(`Tech stack: ${stack.join(\", \")}.`);\n }\n if (opinions.length > 0) {\n parts.push(`Conventions: ${opinions.join(\"; \")}.`);\n }\n }\n\n return parts.join(\"\\n\") + \"\\n\";\n}\n","import type { IntentConfig, ResolvedGuardrails } from \"@fathom/intent\";\nimport type { ProjectionContext } from \"../types.js\";\n\n/**\n * Generate a copilot-instructions.md file from intent and guardrails.\n *\n * GitHub Copilot reads .github/copilot-instructions.md for project-level\n * instructions. Format is plain markdown, similar to Cursor rules.\n */\nexport function generateCopilotInstructions(\n intent: IntentConfig,\n guardrails: ResolvedGuardrails,\n context?: ProjectionContext,\n): string {\n const sections: string[] = [];\n\n // Project overview\n sections.push(`# ${intent.project}`);\n sections.push(\"\");\n sections.push(intent.description);\n if (intent.audience) {\n sections.push(`Audience: ${intent.audience}`);\n }\n\n // Values as instructions\n if (intent.values.length > 0) {\n sections.push(\"\");\n sections.push(\"## Values\");\n const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };\n const sorted = [...intent.values].sort(\n (a, b) => priorityOrder[a.priority] - priorityOrder[b.priority],\n );\n for (const value of sorted) {\n const priority =\n value.priority === \"critical\" || value.priority === \"high\"\n ? ` [${value.priority}]`\n : \"\";\n sections.push(`- ${value.name}${priority}: ${value.description}`);\n }\n }\n\n // Budget\n if (intent.budget) {\n sections.push(\"\");\n sections.push(\"## Budget\");\n sections.push(\n `- Monthly limit: ${intent.budget.currency} ${intent.budget.monthly_limit.toLocaleString()}`,\n );\n if (intent.budget.prefer_batch) {\n sections.push(\"- Prefer batch operations to reduce costs\");\n }\n if (context?.trackingSummary) {\n const pct = Math.round(\n (context.trackingSummary.monthlySpend / intent.budget.monthly_limit) *\n 100,\n );\n sections.push(\n `- Current monthly spend: ${intent.budget.currency} ${context.trackingSummary.monthlySpend.toFixed(2)} (${pct}%)`,\n );\n }\n }\n\n // Guardrails — flat list with category tags\n const allRules = [\n ...guardrails.security.map((r) => `[security] ${r}`),\n ...guardrails.quality.map((r) => `[quality] ${r}`),\n ...guardrails.process.map((r) => `[process] ${r}`),\n ];\n\n if (allRules.length > 0) {\n sections.push(\"\");\n sections.push(\"## Rules\");\n for (const rule of allRules) {\n sections.push(`- ${rule}`);\n }\n }\n\n // Tech stack\n if (intent.tech) {\n const { stack, opinions } = intent.tech;\n if (stack.length > 0 || opinions.length > 0) {\n sections.push(\"\");\n sections.push(\"## Tech Stack\");\n if (stack.length > 0) {\n sections.push(`Stack: ${stack.join(\", \")}`);\n }\n if (opinions.length > 0) {\n for (const opinion of opinions) {\n sections.push(`- ${opinion}`);\n }\n }\n }\n }\n\n // Features\n if (context?.registry && context.registry.length > 0) {\n sections.push(\"\");\n sections.push(\"## Features\");\n for (const feature of context.registry) {\n const tokens = feature.estimatedTokens\n ? ` (~${Math.round(feature.estimatedTokens / 1000)}K tokens)`\n : \"\";\n sections.push(`- ${feature.name} [${feature.status}]${tokens}`);\n }\n }\n\n return sections.join(\"\\n\") + \"\\n\";\n}\n","import type { IntentConfig, ResolvedGuardrails } from \"@fathom/intent\";\nimport type { ProjectionContext } from \"../types.js\";\n\n/**\n * Generate a .windsurfrules file from intent and guardrails.\n *\n * Windsurf reads .windsurfrules from the project root.\n * Format is plain text with rules, similar to .cursorrules.\n */\nexport function generateWindsurfRules(\n intent: IntentConfig,\n guardrails: ResolvedGuardrails,\n context?: ProjectionContext,\n): string {\n const sections: string[] = [];\n\n // Project overview\n sections.push(`# ${intent.project}`);\n sections.push(\"\");\n sections.push(intent.description);\n if (intent.audience) {\n sections.push(`Audience: ${intent.audience}`);\n }\n\n // Values\n if (intent.values.length > 0) {\n sections.push(\"\");\n sections.push(\"## Values\");\n const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };\n const sorted = [...intent.values].sort(\n (a, b) => priorityOrder[a.priority] - priorityOrder[b.priority],\n );\n for (const value of sorted) {\n const priority =\n value.priority === \"critical\" || value.priority === \"high\"\n ? ` [${value.priority}]`\n : \"\";\n sections.push(`- ${value.name}${priority}: ${value.description}`);\n }\n }\n\n // Budget\n if (intent.budget) {\n sections.push(\"\");\n sections.push(\"## Budget\");\n sections.push(\n `- Monthly limit: ${intent.budget.currency} ${intent.budget.monthly_limit.toLocaleString()}`,\n );\n if (intent.budget.prefer_batch) {\n sections.push(\"- Prefer batch operations to reduce costs\");\n }\n if (context?.trackingSummary) {\n const pct = Math.round(\n (context.trackingSummary.monthlySpend / intent.budget.monthly_limit) *\n 100,\n );\n sections.push(\n `- Current monthly spend: ${intent.budget.currency} ${context.trackingSummary.monthlySpend.toFixed(2)} (${pct}%)`,\n );\n }\n }\n\n // Guardrails — flat rules\n const allRules = [\n ...guardrails.security.map((r) => `[security] ${r}`),\n ...guardrails.quality.map((r) => `[quality] ${r}`),\n ...guardrails.process.map((r) => `[process] ${r}`),\n ];\n\n if (allRules.length > 0) {\n sections.push(\"\");\n sections.push(\"## Rules\");\n for (const rule of allRules) {\n sections.push(`- ${rule}`);\n }\n }\n\n // Tech stack\n if (intent.tech) {\n const { stack, opinions } = intent.tech;\n if (stack.length > 0 || opinions.length > 0) {\n sections.push(\"\");\n sections.push(\"## Tech Stack\");\n if (stack.length > 0) {\n sections.push(`Stack: ${stack.join(\", \")}`);\n }\n if (opinions.length > 0) {\n for (const opinion of opinions) {\n sections.push(`- ${opinion}`);\n }\n }\n }\n }\n\n // Features\n if (context?.registry && context.registry.length > 0) {\n sections.push(\"\");\n sections.push(\"## Features\");\n for (const feature of context.registry) {\n const tokens = feature.estimatedTokens\n ? ` (~${Math.round(feature.estimatedTokens / 1000)}K tokens)`\n : \"\";\n sections.push(`- ${feature.name} [${feature.status}]${tokens}`);\n }\n }\n\n return sections.join(\"\\n\") + \"\\n\";\n}\n","import type { IntentConfig } from \"@fathom/intent\";\nimport { resolveGuardrails } from \"@fathom/intent\";\nimport type { ProjectionContext, ProjectionOutput, ProjectionTarget } from \"./types.js\";\nimport { generateClaudeSkill } from \"./templates/claude.js\";\nimport { generateCursorRules } from \"./templates/cursor.js\";\nimport { generateSystemPrompt } from \"./templates/generic.js\";\nimport { generateCopilotInstructions } from \"./templates/copilot.js\";\nimport { generateWindsurfRules } from \"./templates/windsurf.js\";\n\nconst ALL_TARGETS: ProjectionTarget[] = [\"claude\", \"cursor\", \"generic\", \"copilot\", \"windsurf\"];\n\n/**\n * Generate projection files from intent config.\n *\n * Returns a map of relative paths (within .fathom/) to file contents.\n * If `targets` is specified, only generates for those tools.\n */\nexport function generateProjections(\n intent: IntentConfig,\n context?: ProjectionContext,\n targets?: ProjectionTarget[],\n): ProjectionOutput {\n const guardrails = resolveGuardrails(intent);\n const activeTargets = targets ?? ALL_TARGETS;\n const files = new Map<string, string>();\n\n for (const target of activeTargets) {\n switch (target) {\n case \"claude\":\n files.set(\n \"projections/claude/SKILL.md\",\n generateClaudeSkill(intent, guardrails, context),\n );\n break;\n case \"cursor\":\n files.set(\n \"projections/cursor/.cursorrules\",\n generateCursorRules(intent, guardrails, context),\n );\n break;\n case \"generic\":\n files.set(\n \"projections/generic/SYSTEM_PROMPT.md\",\n generateSystemPrompt(intent, guardrails, context),\n );\n break;\n case \"copilot\":\n files.set(\n \"projections/copilot/copilot-instructions.md\",\n generateCopilotInstructions(intent, guardrails, context),\n );\n break;\n case \"windsurf\":\n files.set(\n \"projections/windsurf/.windsurfrules\",\n generateWindsurfRules(intent, guardrails, context),\n );\n break;\n }\n }\n\n return { files };\n}\n","import { mkdirSync, writeFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport type { IntentConfig } from \"@fathom/intent\";\nimport type { ProjectionContext, ProjectionTarget } from \"./types.js\";\nimport { generateProjections } from \"./generator.js\";\n\n/**\n * Generate and write projection files to disk.\n *\n * Files are written under `${dir}/.fathom/projections/`.\n * Creates directories as needed, overwrites existing files.\n *\n * @returns List of absolute paths that were written.\n */\nexport async function writeProjections(\n dir: string,\n intent: IntentConfig,\n context?: ProjectionContext,\n targets?: ProjectionTarget[],\n): Promise<string[]> {\n const output = generateProjections(intent, context, targets);\n const written: string[] = [];\n\n for (const [relativePath, content] of output.files) {\n const absPath = resolve(dir, \".fathom\", relativePath);\n mkdirSync(dirname(absPath), { recursive: true });\n writeFileSync(absPath, content, \"utf-8\");\n written.push(absPath);\n }\n\n return written;\n}\n"],"mappings":";;;;;;;;AMAA,SAAS,WAAW,qBAAqB;AACzC,SAAS,SAAS,eAAe;ANQ1B,SAAS,oBACd,QACA,YACA,SACQ;AACR,QAAM,WAAqB,CAAC;AAG5B,WAAS,KAAK,KAAK,OAAO,OAAO,EAAE;AAGnC,WAAS,KAAK,oBAAoB,MAAM,CAAC;AAGzC,MAAI,OAAO,OAAO,SAAS,GAAG;AAC5B,aAAS,KAAK,YAAY,MAAM,CAAC;EACnC;AAGA,QAAM,gBAAgB,YAAY,QAAQ,OAAO;AACjD,MAAI,eAAe;AACjB,aAAS,KAAK,aAAa;EAC7B;AAGA,QAAM,mBAAmB,gBAAgB,UAAU;AACnD,MAAI,kBAAkB;AACpB,aAAS,KAAK,gBAAgB;EAChC;AAGA,QAAM,cAAc,UAAU,MAAM;AACpC,MAAI,aAAa;AACf,aAAS,KAAK,WAAW;EAC3B;AAGA,QAAM,kBAAkB,cAAc,OAAO;AAC7C,MAAI,iBAAiB;AACnB,aAAS,KAAK,eAAe;EAC/B;AAEA,SAAO,SAAS,KAAK,MAAM,IAAI;AACjC;AAEA,SAAS,oBAAoB,QAA8B;AACzD,QAAM,QAAkB,CAAC,oBAAoB;AAC7C,QAAM,KAAK,EAAE;AACb,QAAM,KAAK,OAAO,WAAW;AAC7B,MAAI,OAAO,UAAU;AACnB,UAAM,KAAK,EAAE;AACb,UAAM,KAAK,iBAAiB,OAAO,QAAQ,EAAE;EAC/C;AAC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AAM,UAAU,QAAQ,KAAK,WAAW,YAAY;AACpD,cAAU,QAAQ,OAAO,GAAG,EAAE,WAAW,KAAK,CAAC;AAC/C,kBAAc,SAAS,SAAS,OAAO;AACvC,YAAQ,KAAK,OAAO;EACtB;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
BudgetSchema,
|
|
4
|
+
GuardrailTemplateSchema,
|
|
5
|
+
GuardrailsSchema,
|
|
6
|
+
IntentSchema,
|
|
7
|
+
ProvidersSchema,
|
|
8
|
+
TechSchema,
|
|
9
|
+
ValueSchema,
|
|
10
|
+
detectIntent,
|
|
11
|
+
listTemplates,
|
|
12
|
+
loadIntent,
|
|
13
|
+
loadTemplate,
|
|
14
|
+
resolveGuardrails,
|
|
15
|
+
saveIntent
|
|
16
|
+
} from "./chunk-TXIC6BY4.js";
|
|
17
|
+
import "./chunk-MNGU6SI4.js";
|
|
18
|
+
import "./chunk-SEGVTWSK.js";
|
|
19
|
+
export {
|
|
20
|
+
BudgetSchema,
|
|
21
|
+
GuardrailTemplateSchema,
|
|
22
|
+
GuardrailsSchema,
|
|
23
|
+
IntentSchema,
|
|
24
|
+
ProvidersSchema,
|
|
25
|
+
TechSchema,
|
|
26
|
+
ValueSchema,
|
|
27
|
+
detectIntent,
|
|
28
|
+
listTemplates,
|
|
29
|
+
loadIntent,
|
|
30
|
+
loadTemplate,
|
|
31
|
+
resolveGuardrails,
|
|
32
|
+
saveIntent
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=dist-XKZLNUDU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|