fifony 0.1.11
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/FIFONY.md +173 -0
- package/LICENSE +201 -0
- package/NOTICE +23 -0
- package/README.md +175 -0
- package/app/dist/assets/index-BE3a-eEo.js +13 -0
- package/app/dist/icon-maskable.svg +8 -0
- package/app/dist/icon.svg +7 -0
- package/app/dist/index.html +24 -0
- package/app/dist/manifest.webmanifest +49 -0
- package/app/dist/offline.html +86 -0
- package/app/dist/service-worker.js +100 -0
- package/app/public/icon-maskable.svg +8 -0
- package/app/public/icon.svg +7 -0
- package/app/public/manifest.webmanifest +49 -0
- package/app/public/offline.html +86 -0
- package/app/public/service-worker.js +100 -0
- package/bin/fifony.js +54 -0
- package/dist/chunk-LH5V2WV2.js +389 -0
- package/dist/chunk-LH5V2WV2.js.map +1 -0
- package/dist/cli.js +204 -0
- package/dist/cli.js.map +1 -0
- package/dist/mcp/server.js +747 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/runtime/run-local.js +6569 -0
- package/dist/runtime/run-local.js.map +1 -0
- package/package.json +69 -0
- package/src/fixtures/agent-catalog.json +208 -0
- package/src/fixtures/skill-catalog.json +67 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// src/routing/capability-resolver.ts
|
|
9
|
+
function tokenize(issue) {
|
|
10
|
+
const labels = (issue.labels ?? []).filter((label) => !label.startsWith("capability:") && !label.startsWith("overlay:"));
|
|
11
|
+
return [
|
|
12
|
+
issue.identifier ?? "",
|
|
13
|
+
issue.title,
|
|
14
|
+
issue.description ?? "",
|
|
15
|
+
...labels,
|
|
16
|
+
...issue.paths ?? []
|
|
17
|
+
].join(" ").toLowerCase();
|
|
18
|
+
}
|
|
19
|
+
function normalizePath(value) {
|
|
20
|
+
return value.trim().replaceAll("\\", "/").toLowerCase();
|
|
21
|
+
}
|
|
22
|
+
function inferCapabilityPaths(issue) {
|
|
23
|
+
const labels = (issue.labels ?? []).filter((label) => !label.startsWith("capability:") && !label.startsWith("overlay:"));
|
|
24
|
+
const sources = [issue.title, issue.description ?? "", ...labels];
|
|
25
|
+
const matches = /* @__PURE__ */ new Set();
|
|
26
|
+
const pattern = /(?:[A-Za-z0-9._-]+\/)+(?:[A-Za-z0-9._-]+)|(?:[A-Za-z0-9._-]+\.(?:ts|tsx|js|jsx|mjs|cjs|css|scss|sass|less|html|md|mdx|json|yml|yaml|sql|sh))+/g;
|
|
27
|
+
for (const source of sources) {
|
|
28
|
+
for (const match of source.match(pattern) ?? []) {
|
|
29
|
+
matches.add(normalizePath(match));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return [...matches];
|
|
33
|
+
}
|
|
34
|
+
function getIssuePaths(issue) {
|
|
35
|
+
return [.../* @__PURE__ */ new Set([
|
|
36
|
+
...(issue.paths ?? []).filter((value) => typeof value === "string" && value.trim().length > 0).map(normalizePath),
|
|
37
|
+
...inferCapabilityPaths(issue)
|
|
38
|
+
])];
|
|
39
|
+
}
|
|
40
|
+
function hasAny(text, terms) {
|
|
41
|
+
return terms.some((term) => text.includes(term));
|
|
42
|
+
}
|
|
43
|
+
function hasPathMatch(paths, fragments = [], extensions = []) {
|
|
44
|
+
return paths.some((path) => {
|
|
45
|
+
if (fragments.some((fragment) => path.includes(fragment))) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
return extensions.some((extension) => path.endsWith(extension));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function buildResolution(category, rationale, overlays, providers) {
|
|
52
|
+
return {
|
|
53
|
+
category,
|
|
54
|
+
rationale,
|
|
55
|
+
overlays,
|
|
56
|
+
providers
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function uniq(values) {
|
|
60
|
+
return [...new Set(values.filter(Boolean))];
|
|
61
|
+
}
|
|
62
|
+
function matchesOverride(issue, resolution, override) {
|
|
63
|
+
const match = override.match ?? {};
|
|
64
|
+
const issueLabels = new Set((issue.labels ?? []).map((label) => label.toLowerCase()));
|
|
65
|
+
const text = tokenize(issue);
|
|
66
|
+
const paths = getIssuePaths(issue);
|
|
67
|
+
if (match.category && match.category !== resolution.category) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (match.labels?.length) {
|
|
71
|
+
const requiredLabels = match.labels.map((label) => label.toLowerCase());
|
|
72
|
+
if (!requiredLabels.every((label) => issueLabels.has(label))) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (match.terms?.length) {
|
|
77
|
+
if (!match.terms.some((term) => text.includes(term.toLowerCase()))) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (match.paths?.length) {
|
|
82
|
+
const expectedPaths = match.paths.map((path) => normalizePath(path));
|
|
83
|
+
if (!expectedPaths.some((expectedPath) => paths.some((path) => path.includes(expectedPath)))) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return Boolean(match.category || match.labels?.length || match.terms?.length || match.paths?.length);
|
|
88
|
+
}
|
|
89
|
+
function applyOverrides(issue, resolution, options) {
|
|
90
|
+
if (options?.enabled === false) {
|
|
91
|
+
return buildResolution(
|
|
92
|
+
"workflow-disabled",
|
|
93
|
+
["Automatic capability routing was disabled by workflow configuration."],
|
|
94
|
+
[],
|
|
95
|
+
[
|
|
96
|
+
{ provider: "codex", role: "executor", profile: "", reason: "Fallback executor because routing is disabled." }
|
|
97
|
+
]
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
const override = options?.overrides?.find((entry) => matchesOverride(issue, resolution, entry));
|
|
101
|
+
if (!override) {
|
|
102
|
+
return resolution;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
category: override.category ?? resolution.category,
|
|
106
|
+
rationale: uniq([...resolution.rationale ?? [], ...override.rationale ?? [], "Workflow routing override applied."]),
|
|
107
|
+
overlays: uniq([...resolution.overlays ?? [], ...override.overlays ?? []]),
|
|
108
|
+
providers: override.providers?.length ? override.providers : resolution.providers
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function resolveTaskCapabilities(issue, options) {
|
|
112
|
+
const text = tokenize(issue);
|
|
113
|
+
const paths = getIssuePaths(issue);
|
|
114
|
+
const frontendPathMatch = hasPathMatch(
|
|
115
|
+
paths,
|
|
116
|
+
["src/web", "web", "frontend", "ui", "component", "dashboard", "style", "apps/web"],
|
|
117
|
+
[".css", ".scss", ".sass", ".less", ".html", ".tsx", ".jsx", ".vue", ".svelte"]
|
|
118
|
+
);
|
|
119
|
+
const securityPathMatch = hasPathMatch(
|
|
120
|
+
paths,
|
|
121
|
+
["security", "auth", "crypto", "secret", "permission", "token"],
|
|
122
|
+
[".pem", ".key", ".crt"]
|
|
123
|
+
);
|
|
124
|
+
const architecturePathMatch = hasPathMatch(
|
|
125
|
+
paths,
|
|
126
|
+
["workflow.md", "architecture.md", "spec.md", "claude.md", "openspec/"],
|
|
127
|
+
[]
|
|
128
|
+
);
|
|
129
|
+
const devopsPathMatch = hasPathMatch(
|
|
130
|
+
paths,
|
|
131
|
+
[".github/workflows", "docker", "k8s", "helm", "terraform", "infra", "deploy", "release"],
|
|
132
|
+
[".yml", ".yaml", ".tf"]
|
|
133
|
+
);
|
|
134
|
+
const backendPathMatch = hasPathMatch(
|
|
135
|
+
paths,
|
|
136
|
+
["src/api", "api", "src/protocol", "protocol", "server", "persistence", "scanner", "ws", "websocket", "db", "apps/api"],
|
|
137
|
+
[".sql"]
|
|
138
|
+
);
|
|
139
|
+
const docsPathMatch = hasPathMatch(
|
|
140
|
+
paths,
|
|
141
|
+
["docs", "readme", "guide", "tutorial"],
|
|
142
|
+
[".md", ".mdx"]
|
|
143
|
+
);
|
|
144
|
+
let resolution;
|
|
145
|
+
if (frontendPathMatch || hasAny(text, ["frontend", "ui", "ux", "design", "css", "html", "layout", "component", "react", "vue"])) {
|
|
146
|
+
resolution = buildResolution(
|
|
147
|
+
"frontend-ui",
|
|
148
|
+
[
|
|
149
|
+
...frontendPathMatch ? ["Detected frontend-oriented target paths or file extensions."] : [],
|
|
150
|
+
"Detected frontend or design-oriented keywords in the task.",
|
|
151
|
+
"Use Claude to plan and review, Codex to implement.",
|
|
152
|
+
"Apply impeccable-style polish as a review overlay when available."
|
|
153
|
+
],
|
|
154
|
+
["impeccable", "frontend-design"],
|
|
155
|
+
[
|
|
156
|
+
{ provider: "claude", role: "planner", profile: "agency-ui-designer", reason: "UI planning and structure." },
|
|
157
|
+
{ provider: "codex", role: "executor", profile: "agency-frontend-developer", reason: "Frontend implementation." },
|
|
158
|
+
{ provider: "claude", role: "reviewer", profile: "agency-accessibility-auditor", reason: "Critical UX and accessibility review." }
|
|
159
|
+
]
|
|
160
|
+
);
|
|
161
|
+
return applyOverrides(issue, resolution, options);
|
|
162
|
+
}
|
|
163
|
+
if (securityPathMatch || hasAny(text, ["security", "auth", "oauth", "token", "secret", "permission", "compliance", "vulnerability"])) {
|
|
164
|
+
resolution = buildResolution(
|
|
165
|
+
"security",
|
|
166
|
+
[
|
|
167
|
+
...securityPathMatch ? ["Detected security-sensitive target paths or file extensions."] : [],
|
|
168
|
+
"Detected security-sensitive keywords.",
|
|
169
|
+
"Use a security profile to scope the work and keep a strict review pass."
|
|
170
|
+
],
|
|
171
|
+
["security-review"],
|
|
172
|
+
[
|
|
173
|
+
{ provider: "claude", role: "planner", profile: "agency-security-engineer", reason: "Threat and risk framing." },
|
|
174
|
+
{ provider: "codex", role: "executor", profile: "agency-security-engineer", reason: "Implementation with security context." },
|
|
175
|
+
{ provider: "claude", role: "reviewer", profile: "agency-code-reviewer", reason: "Independent correctness review." }
|
|
176
|
+
]
|
|
177
|
+
);
|
|
178
|
+
return applyOverrides(issue, resolution, options);
|
|
179
|
+
}
|
|
180
|
+
if (architecturePathMatch || hasAny(text, ["architecture", "design doc", "spec", "workflow", "orchestr", "roadmap", "plan"])) {
|
|
181
|
+
resolution = buildResolution(
|
|
182
|
+
"architecture",
|
|
183
|
+
[
|
|
184
|
+
...architecturePathMatch ? ["Detected workflow, architecture, or specification files in the targeted paths."] : [],
|
|
185
|
+
"Detected architecture or planning-oriented keywords.",
|
|
186
|
+
"Favor stronger planning and review roles around the executor."
|
|
187
|
+
],
|
|
188
|
+
["spec-review"],
|
|
189
|
+
[
|
|
190
|
+
{ provider: "claude", role: "planner", profile: "agency-software-architect", reason: "Architecture and system framing." },
|
|
191
|
+
{ provider: "codex", role: "executor", profile: "agency-senior-developer", reason: "Translate architecture into implementation." },
|
|
192
|
+
{ provider: "claude", role: "reviewer", profile: "agency-code-reviewer", reason: "Challenge assumptions and regressions." }
|
|
193
|
+
]
|
|
194
|
+
);
|
|
195
|
+
return applyOverrides(issue, resolution, options);
|
|
196
|
+
}
|
|
197
|
+
if (devopsPathMatch || hasAny(text, ["deploy", "release", "ci", "cicd", "github actions", "docker", "terraform", "kubernetes"])) {
|
|
198
|
+
resolution = buildResolution(
|
|
199
|
+
"devops",
|
|
200
|
+
[
|
|
201
|
+
...devopsPathMatch ? ["Detected deployment, infrastructure, or CI/CD paths in the task scope."] : [],
|
|
202
|
+
"Detected release, deployment, or infrastructure keywords.",
|
|
203
|
+
"Use a delivery-focused planner and a stricter reliability review pass."
|
|
204
|
+
],
|
|
205
|
+
["delivery-review"],
|
|
206
|
+
[
|
|
207
|
+
{ provider: "claude", role: "planner", profile: "agency-devops-automator", reason: "CI/CD and deployment framing." },
|
|
208
|
+
{ provider: "codex", role: "executor", profile: "agency-devops-automator", reason: "Implement workflow and release changes." },
|
|
209
|
+
{ provider: "claude", role: "reviewer", profile: "agency-sre-site-reliability-engineer", reason: "Reliability and rollback review." }
|
|
210
|
+
]
|
|
211
|
+
);
|
|
212
|
+
return applyOverrides(issue, resolution, options);
|
|
213
|
+
}
|
|
214
|
+
if (hasAny(text, ["bug", "fix", "regression", "debug", "crash", "broken", "error", "fail"])) {
|
|
215
|
+
resolution = buildResolution(
|
|
216
|
+
"bugfix",
|
|
217
|
+
[
|
|
218
|
+
"Detected bug-fix or debugging keywords.",
|
|
219
|
+
"Use Codex to execute the fix and Claude to frame and verify the change."
|
|
220
|
+
],
|
|
221
|
+
["debug"],
|
|
222
|
+
[
|
|
223
|
+
{ provider: "claude", role: "planner", profile: "agency-code-reviewer", reason: "Clarify failure mode and acceptance criteria." },
|
|
224
|
+
{ provider: "codex", role: "executor", profile: "agency-senior-developer", reason: "Implement and iterate quickly." },
|
|
225
|
+
{ provider: "claude", role: "reviewer", profile: "agency-code-reviewer", reason: "Catch regressions and weak reasoning." }
|
|
226
|
+
]
|
|
227
|
+
);
|
|
228
|
+
return applyOverrides(issue, resolution, options);
|
|
229
|
+
}
|
|
230
|
+
if (backendPathMatch || hasAny(text, ["api", "backend", "database", "protocol", "server", "ws", "websocket", "persistence"])) {
|
|
231
|
+
resolution = buildResolution(
|
|
232
|
+
"backend",
|
|
233
|
+
[
|
|
234
|
+
...backendPathMatch ? ["Detected backend, protocol, or persistence paths in the task scope."] : [],
|
|
235
|
+
"Detected backend, API, protocol, or persistence keywords.",
|
|
236
|
+
"Use backend-oriented planning and critical review around the executor."
|
|
237
|
+
],
|
|
238
|
+
["backend-review"],
|
|
239
|
+
[
|
|
240
|
+
{ provider: "claude", role: "planner", profile: "agency-backend-architect", reason: "API and data-model framing." },
|
|
241
|
+
{ provider: "codex", role: "executor", profile: "agency-senior-developer", reason: "Implement the backend changes." },
|
|
242
|
+
{ provider: "claude", role: "reviewer", profile: "agency-code-reviewer", reason: "Critical regression review." }
|
|
243
|
+
]
|
|
244
|
+
);
|
|
245
|
+
return applyOverrides(issue, resolution, options);
|
|
246
|
+
}
|
|
247
|
+
if (docsPathMatch || hasAny(text, ["docs", "readme", "guide", "documentation", "tutorial"])) {
|
|
248
|
+
resolution = buildResolution(
|
|
249
|
+
"documentation",
|
|
250
|
+
[
|
|
251
|
+
...docsPathMatch ? ["Detected documentation-oriented paths or file extensions."] : [],
|
|
252
|
+
"Detected documentation keywords.",
|
|
253
|
+
"Use writing-oriented planning with an implementation pass that can still edit code and docs together."
|
|
254
|
+
],
|
|
255
|
+
["documentation"],
|
|
256
|
+
[
|
|
257
|
+
{ provider: "claude", role: "planner", profile: "agency-technical-writer", reason: "Structure and narrative." },
|
|
258
|
+
{ provider: "codex", role: "executor", profile: "agency-technical-writer", reason: "Apply documentation edits in repo context." },
|
|
259
|
+
{ provider: "claude", role: "reviewer", profile: "agency-code-reviewer", reason: "Check coherence with the implementation." }
|
|
260
|
+
]
|
|
261
|
+
);
|
|
262
|
+
return applyOverrides(issue, resolution, options);
|
|
263
|
+
}
|
|
264
|
+
resolution = buildResolution(
|
|
265
|
+
"default",
|
|
266
|
+
[
|
|
267
|
+
"No specialized pattern matched strongly.",
|
|
268
|
+
"Default to a balanced planner/executor/reviewer pipeline using both Claude and Codex."
|
|
269
|
+
],
|
|
270
|
+
[],
|
|
271
|
+
[
|
|
272
|
+
{ provider: "claude", role: "planner", profile: "agency-senior-project-manager", reason: "Clarify scope and acceptance criteria." },
|
|
273
|
+
{ provider: "codex", role: "executor", profile: "agency-senior-developer", reason: "Implement the requested change." },
|
|
274
|
+
{ provider: "claude", role: "reviewer", profile: "agency-code-reviewer", reason: "Critical review before closure." }
|
|
275
|
+
]
|
|
276
|
+
);
|
|
277
|
+
return applyOverrides(issue, resolution, options);
|
|
278
|
+
}
|
|
279
|
+
function mergeCapabilityProviders(baseProviders, resolution) {
|
|
280
|
+
return resolution.providers.map((suggestion) => {
|
|
281
|
+
const exact = baseProviders.find((provider) => provider.provider === suggestion.provider && provider.role === suggestion.role);
|
|
282
|
+
const sameRole = baseProviders.find((provider) => provider.role === suggestion.role);
|
|
283
|
+
const sameProvider = baseProviders.find((provider) => provider.provider === suggestion.provider);
|
|
284
|
+
const base = exact ?? sameRole ?? sameProvider;
|
|
285
|
+
return {
|
|
286
|
+
provider: suggestion.provider,
|
|
287
|
+
role: suggestion.role,
|
|
288
|
+
command: base?.command ?? "",
|
|
289
|
+
profile: suggestion.profile || base?.profile || "",
|
|
290
|
+
profilePath: base?.profilePath ?? "",
|
|
291
|
+
profileInstructions: base?.profileInstructions ?? ""
|
|
292
|
+
};
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// src/prompting.ts
|
|
297
|
+
import { TemplateEngine } from "recker";
|
|
298
|
+
|
|
299
|
+
// src/generated/prompts.ts
|
|
300
|
+
var PROMPT_TEMPLATES = {
|
|
301
|
+
"agent-provider-base": '{{#if isPlanner}}\nRole: planner.\nAnalyze the issue and prepare an execution plan for the implementation agents.\nDo not claim the issue is complete unless the plan itself is the deliverable.\n{{else}}\n{{#if isReviewer}}\nRole: reviewer.\nInspect the workspace and review the current implementation critically.\nIf rework is required, emit `FIFONY_STATUS=continue` and provide actionable `nextPrompt` feedback.\nEmit `FIFONY_STATUS=done` only when the work is acceptable.\n{{else}}\nRole: executor.\nImplement the required changes in the workspace.\nUse any planner guidance or prior reviewer feedback already persisted in the workspace.\n{{/if}}\n{{/if}}\n\n{{#if hasImpeccableOverlay}}\nImpeccable overlay is active.\nRaise the bar on UI polish, clarity, responsiveness, visual hierarchy, and interaction quality.\n{{#if isReviewer}}\nReview with a stricter frontend and product-quality standard than a normal correctness-only pass.\n{{else}}\nWhen touching frontend work, do not settle for baseline implementation quality.\n{{/if}}\n{{/if}}\n\n{{#if hasFrontendDesignOverlay}}\nFrontend-design overlay is active.\nPrefer stronger hierarchy, spacing, and readability decisions over generic implementation choices.\n{{/if}}\n\n{{#if profileInstructions}}\n## Agent Profile\n{{profileInstructions}}\n{{/if}}\n\n{{#if skillContext}}\n{{skillContext}}\n{{/if}}\n\n{{#if capabilityCategory}}\nCapability routing: {{capabilityCategory}}.\nSelection reason: {{selectionReason}}\n{{#if overlays.length}}\nOverlays: {{overlays | join ", "}}.\n{{/if}}\n{{/if}}\n\n{{#if targetPaths.length}}\nTarget paths: {{targetPaths | join ", "}}\n{{/if}}\n\nWorkspace: {{workspacePath}}\n\n{{basePrompt}}\n',
|
|
302
|
+
// src/prompts/agent-provider-base.stub.md
|
|
303
|
+
"agent-turn": 'Continue working on {{issueIdentifier}}.\nTurn {{turnIndex}} of {{maxTurns}}.\n\nBase objective:\n{{basePrompt}}\n\nContinuation guidance:\n{{continuation}}\n\nPrevious command output tail:\n```text\n{{outputTail}}\n```\n\nBefore exiting successfully, emit one of the following control markers:\n- `FIFONY_STATUS=continue` if more turns are required.\n- `FIFONY_STATUS=done` if the issue is complete.\n- `FIFONY_STATUS=blocked` if manual intervention is required.\nYou may also write `fifony-result.json` with `{ "status": "...", "summary": "...", "nextPrompt": "..." }`.\n',
|
|
304
|
+
// src/prompts/agent-turn.stub.md
|
|
305
|
+
"compile-execution-claude": '{{#if isPlanner}}\nRole: planner. Analyze the issue and prepare an execution plan.\n{{else}}\n{{#if isReviewer}}\nRole: reviewer. Inspect and review the implementation critically.\n{{else}}\nRole: executor. Implement the required changes.\n{{/if}}\n{{/if}}\n\n{{#if profileInstructions}}\n## Agent Profile\n{{profileInstructions}}\n{{/if}}\n\n{{#if skillContext}}\n{{skillContext}}\n{{/if}}\n\n{{planPrompt}}\n\n{{#if subagentsToUse.length}}\n## Subagent Strategy (Claude-specific)\nYou have access to the Agent tool for spawning subagents. Use them for:\n{{#each subagentsToUse}}\n- **{{name}}** ({{role}}): {{why}}\n{{/each}}\n\nLaunch subagents for independent subtasks to maximize parallelism.\nUse the main thread for coordination and integration.\n{{/if}}\n\n{{#if skillsToUse.length}}\n## Skills to Activate\n{{#each skillsToUse}}\n- Invoke **/{{name}}** - {{why}}\n{{/each}}\n{{/if}}\n\n{{#if suggestedPaths.length}}\nTarget paths: {{suggestedPaths | join ", "}}\n{{/if}}\n\nWorkspace: {{workspacePath}}\n\nIssue: {{issueIdentifier}}\nTitle: {{title}}\nDescription: {{description}}\n\n## Structured Input\nThe file `fifony-execution-payload.json` in the workspace contains the canonical structured data for this task.\nUse it as the source of truth for constraints, success criteria, execution intent, and plan details.\nIf there is any conflict between this prompt and the structured fields in the payload, prioritize the payload.\n\n{{#if validationItems.length}}\n## Pre-completion enforcement\nBefore reporting done, verify:\n{{#each validationItems}}\n- {{value}}\n{{/each}}\n{{/if}}\n',
|
|
306
|
+
// src/prompts/compile-execution-claude.stub.md
|
|
307
|
+
"compile-execution-codex": '{{#if isReviewer}}\nRole: reviewer. Inspect and review the implementation critically.\n{{else}}\n{{#if isPlanner}}\nRole: planner. Analyze and prepare an execution plan.\n{{else}}\nRole: executor. Implement the required changes in the workspace.\n{{/if}}\n{{/if}}\n\n{{#if profileInstructions}}\n## Agent Profile\n{{profileInstructions}}\n{{/if}}\n\n{{#if skillContext}}\n{{skillContext}}\n{{/if}}\n\nIssue: {{issueIdentifier}}\nTitle: {{title}}\nDescription: {{description}}\nWorkspace: {{workspacePath}}\n\n{{planPrompt}}\n\n{{#if phases.length}}\n## Checkpoint Execution (Codex mode)\nExecute in strict phases. After each phase, verify outputs before proceeding.\n{{#each phases}}\n- **{{phaseName}}**: {{goal}}\n{{#if outputs.length}} Checkpoint: verify {{outputs | join ", "}} before next phase.{{/if}}\n{{/each}}\n{{else}}\n## Execution Order\nExecute steps in order. Verify each step\'s `doneWhen` criterion before proceeding.\n{{/if}}\n\n{{#if suggestedPaths.length}}\nTarget paths: {{suggestedPaths | join ", "}}\nFocus changes on these paths. Do not make unnecessary changes elsewhere.\n{{/if}}\n\n{{#if skillsToUse.length}}\n## Specialized Procedures\n{{#each skillsToUse}}\n- Apply **{{name}}** procedure: {{why}}\n{{/each}}\n{{/if}}\n\n{{#if validationItems.length}}\n## Pre-completion checks\nBefore reporting done, run:\n{{#each validationItems}}\n- {{value}}\n{{/each}}\n{{/if}}\n\n## Structured Input\nThe file `fifony-execution-payload.json` in the workspace contains the canonical structured data for this task.\nUse it as the source of truth for constraints, success criteria, execution intent, and plan details.\nIf there is any conflict between this prompt and the structured fields in the payload, prioritize the payload.\n\n## Output Format\n\n{{outputContract}}\n',
|
|
308
|
+
// src/prompts/compile-execution-codex.stub.md
|
|
309
|
+
"compile-review": "Review the work done for {{issueIdentifier}}.\n\nTitle: {{title}}\nDescription: {{description}}\nWorkspace: {{workspacePath}}\n\n{{#if planPrompt}}\n# Original Execution Plan\n\n{{planPrompt}}\n{{/if}}\n\n{{#if successCriteria.length}}\n# Success Criteria (evaluate against these)\n{{#each successCriteria}}\n- [ ] {{value}}\n{{/each}}\n{{/if}}\n\n{{#if deliverables.length}}\n# Expected Deliverables\n{{#each deliverables}}\n- [ ] {{value}}\n{{/each}}\n{{/if}}\n\n{{#if diffSummary}}\n# Changes Made (diff summary)\n```\n{{diffSummary}}\n```\n{{/if}}\n\n# Structured Context\nIf `fifony-execution-payload.json` exists in the workspace, read it for the canonical structured task data.\nUse the `successCriteria`, `constraints`, and `deliverables` fields as your evaluation checklist.\n\n# Review Instructions\n\n1. Verify each success criterion from the plan is met.\n2. Check that all expected deliverables are present.\n3. Review the diff for correctness, security issues, and code quality.\n4. Verify validation checks pass (run commands if specified in the plan).\n5. Check for unintended side effects or regressions.\n\nIf the work is acceptable, emit FIFONY_STATUS=done.\nIf rework is needed, emit FIFONY_STATUS=continue and provide actionable feedback in nextPrompt.\nIf the work is fundamentally broken, emit FIFONY_STATUS=blocked.\n",
|
|
310
|
+
// src/prompts/compile-review.stub.md
|
|
311
|
+
"integrations-agency-agents": '---\nagent:\n providers:\n - provider: claude\n role: planner\n profile: agency-senior-project-manager\n - provider: codex\n role: executor\n profile: agency-senior-developer\n - provider: claude\n role: reviewer\n profile: agency-code-reviewer\ncodex:\n command: "codex"\nclaude:\n command: "claude"\n---\n\nUse local agency agent profiles discovered from workspace or home directories.\nWorkspace: {{workspaceRoot}}\n',
|
|
312
|
+
// src/prompts/integrations-agency-agents.stub.md
|
|
313
|
+
"integrations-impeccable": '# Impeccable integration idea\n\nUse impeccable-oriented skills as a frontend review layer around Fifony issues.\n\nSuggested pattern:\n\n1. Use `agency-senior-developer` or `codex` as executor.\n2. Route UI-heavy issues to a reviewer prompt that explicitly asks for impeccable-style critique.\n3. Expose the resulting review through the Fifony MCP prompts or as a follow-up review issue.\n\nSuggested labels:\n- frontend\n- ui\n- design-system\n\nSuggested reviewer prompt seed:\n"Review this implementation using impeccable standards for frontend quality, polish, hierarchy, spacing, responsiveness, and interaction clarity."\n',
|
|
314
|
+
// src/prompts/integrations-impeccable.stub.md
|
|
315
|
+
"issue-enhancer-description": 'You are helping improve issue metadata for a software execution queue.\nRewrite the description to be clearer, complete, and directly actionable.\nReturn strict JSON only with this schema:\n{ "field": "description", "value": "..." }\n\nCurrent title: {{title}}\nCurrent description: {{description}}\n\nRules:\n- Keep it concise but include meaningful acceptance criteria.\n- Use plain text only, with short paragraphs or bullet style.\n- Avoid markdown wrappers, quotes, and extra explanation.\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\n',
|
|
316
|
+
// src/prompts/issue-enhancer-description.stub.md
|
|
317
|
+
"issue-enhancer-title": 'You are helping improve issue metadata for a software execution queue.\nRewrite the title for clarity, actionability, and specificity.\nReturn strict JSON only with this schema:\n{ "field": "title", "value": "..." }\n\nCurrent title: {{title}}\nDescription context: {{description}}\n\nRules:\n- Keep it concise and suitable as a task title.\n- Use imperative language when possible.\n- Do not include markdown, quotes, or extra explanation.\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\n',
|
|
318
|
+
// src/prompts/issue-enhancer-title.stub.md
|
|
319
|
+
"issue-planner": "You are a senior technical execution planner.\nProduce the best possible plan for the issue below, filling the JSON schema precisely.\n\nIssue title: {{title}}\nIssue description: {{description}}\n\nQuality rules:\n- Be concrete, not generic. No vague phrases like 'implement' or 'improve' without detail.\n- Break work into actionable steps (2-8 steps). Each step describes WHAT, not HOW.\n- Each step must have a clear 'doneWhen' acceptance criterion.\n- Identify assumptions, constraints, unknowns, and risks.\n- For unknowns, specify what question needs answering and how to resolve it.\n- Suggest file paths that are likely relevant to the changes.\n- Suggest labels: bug, feature, frontend, backend, docs, refactor, security, performance, etc.\n\nComplexity estimation:\n- trivial: < 5 min, single-file cosmetic change\n- low: 5-15 min, small focused change\n- medium: 15-60 min, multi-file change with testing\n- high: > 1 hour, architectural change or new feature\n\nTooling reflection (REQUIRED):\n- Evaluate whether the task benefits from using skills (specialized instructions for quality/consistency).\n- Evaluate whether subtasks should use subagents (parallel work, isolated context, specialization).\n- Only recommend skills/agents when there is a concrete justification.\n- For each step, set ownerType: 'agent' for automated work, 'human' for manual review, 'skill' for specialized skills, 'subagent' for delegated work.\n\nEffort suggestion:\n- low: simple fixes, no deep reasoning needed\n- medium: standard development work\n- high: complex architecture, security, or cross-cutting changes\n- Set per-role if different: planner, executor, reviewer\n\nReturn strict JSON. No text outside JSON.\n",
|
|
320
|
+
// src/prompts/issue-planner.stub.md
|
|
321
|
+
"mcp-integrate-client": "Integrate {{client}} with the local Fifony MCP server.\n\nGoal: {{goal}}\n\n{{integrationGuide}}\n\nUse the available Fifony resources and tools instead of inventing your own persistence model.\n",
|
|
322
|
+
// src/prompts/mcp-integrate-client.stub.md
|
|
323
|
+
"mcp-integration-guide": '# Fifony MCP integration\n\nWorkspace root: `{{workspaceRoot}}`\nPersistence root: `{{persistenceRoot}}`\nState root: `{{stateRoot}}`\n\nRecommended MCP client command:\n\n```json\n{\n "mcpServers": {\n "fifony": {\n "command": "npx",\n "args": ["fifony", "mcp", "--workspace", "{{workspaceRoot}}", "--persistence", "{{persistenceRoot}}"]\n }\n }\n}\n```\n\nExpected workflow:\n\n1. Read `fifony://guide/overview` and `fifony://state/summary`.\n2. Use `fifony.list_issues` or read `fifony://issues`.\n3. Create work with `fifony.create_issue`.\n4. Update workflow state with `fifony.update_issue_state`.\n5. Use the prompts exposed by this MCP server to structure planning or execution.\n\nThe MCP server is read-write against the same `s3db` filesystem store used by the Fifony runtime.\n',
|
|
324
|
+
// src/prompts/mcp-integration-guide.stub.md
|
|
325
|
+
"mcp-issue": 'You are integrating with Fifony as the {{role}} using {{provider}}.\n\nIssue ID: {{id}}\nTitle: {{title}}\nState: {{state}}\nCapability category: {{capabilityCategory}}\n{{#if overlays.length}}\nOverlays: {{overlays | join ", "}}\n{{/if}}\n{{#if paths.length}}\nPaths: {{paths | join ", "}}\n{{/if}}\nDescription:\n{{description}}\n\nUse Fifony as the source of truth:\n- Read the workflow contract from WORKFLOW.md if available.\n- Persist transitions through the Fifony tools instead of inventing local state.\n- Keep outputs actionable and aligned with the tracked issue lifecycle.\n',
|
|
326
|
+
// src/prompts/mcp-issue.stub.md
|
|
327
|
+
"mcp-review-workflow": "Review the WORKFLOW.md for this Fifony workspace as {{provider}}.\n\nWorkspace: {{workspaceRoot}}\nWorkflow present: {{workflowPresent}}\n\nFocus on:\n- provider orchestration quality\n- hooks safety\n- prompt clarity\n- issue lifecycle correctness\n- what an MCP client needs in order to integrate cleanly\n",
|
|
328
|
+
// src/prompts/mcp-review-workflow.stub.md
|
|
329
|
+
"mcp-route-task": "Use this routing decision as the execution plan for the task.\n\n{{resolutionJson}}\n",
|
|
330
|
+
// src/prompts/mcp-route-task.stub.md
|
|
331
|
+
"project-analysis": `You are analyzing a software project to help configure an AI-powered development assistant.
|
|
332
|
+
|
|
333
|
+
Look at the project structure, source code, configuration files, and any documentation you can find. Pay special attention to:
|
|
334
|
+
- README, CLAUDE.md, AGENTS.md, or any project documentation
|
|
335
|
+
- Build files: package.json, Cargo.toml, pyproject.toml, build.gradle, Gemfile, go.mod, Makefile, CMakeLists.txt, pom.xml, etc.
|
|
336
|
+
- Source code directories and their contents
|
|
337
|
+
- Configuration files (.env, docker-compose, terraform, etc.)
|
|
338
|
+
- CI/CD pipelines (.github/workflows, .gitlab-ci, Jenkinsfile, etc.)
|
|
339
|
+
|
|
340
|
+
Return a JSON object with exactly these fields:
|
|
341
|
+
|
|
342
|
+
{
|
|
343
|
+
"description": "A concise 2-3 sentence description of what this project does, its purpose, and who it's for.",
|
|
344
|
+
"language": "The primary programming language (e.g. typescript, python, rust, java, kotlin, ruby, go, swift, c++)",
|
|
345
|
+
"domains": ["Array of relevant domain tags that apply to this project"],
|
|
346
|
+
"stack": ["Array of key technologies, frameworks, and tools used"],
|
|
347
|
+
"suggestedAgents": ["Array of specialist agent names that would help develop this project"]
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
For "domains", choose from: frontend, backend, mobile, devops, database, ai-ml, security, testing, games, ecommerce, fintech, healthcare, education, saas, design, product, marketing, embedded, blockchain, spatial-computing, data-engineering.
|
|
351
|
+
|
|
352
|
+
For "suggestedAgents", choose from: frontend-developer, backend-architect, database-optimizer, security-engineer, devops-automator, mobile-app-builder, ai-engineer, ui-designer, ux-architect, code-reviewer, technical-writer, sre, data-engineer, software-architect, game-designer.
|
|
353
|
+
|
|
354
|
+
Return ONLY the JSON object. No markdown fences, no explanation, no extra text.
|
|
355
|
+
`,
|
|
356
|
+
// src/prompts/project-analysis.stub.md
|
|
357
|
+
"workflow-default": "You are working on {{issue.identifier}}.\n\nTitle: {{issue.title}}\nDescription:\n{{issue.description}}\n",
|
|
358
|
+
// src/prompts/workflow-default.stub.md
|
|
359
|
+
"workflow-plan-section": '## Execution Plan\n\nComplexity: {{estimatedComplexity}}\nSummary: {{summary}}\n\nSteps:\n{{#each steps}}\n{{step}}. {{action}}{{#if files.length}} (files: {{files | join ", "}}){{/if}}{{#if details}} - {{details}}{{/if}}\n{{/each}}\n\nFollow this plan. Complete each step in order.\n'
|
|
360
|
+
// src/prompts/workflow-plan-section.stub.md
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
// src/prompting.ts
|
|
364
|
+
var engine = new TemplateEngine({
|
|
365
|
+
cache: true,
|
|
366
|
+
format: "raw",
|
|
367
|
+
strict: false
|
|
368
|
+
});
|
|
369
|
+
function normalizePrompt(text) {
|
|
370
|
+
return text.replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
371
|
+
}
|
|
372
|
+
async function renderPrompt(name, context = {}) {
|
|
373
|
+
return renderPromptString(PROMPT_TEMPLATES[name], context);
|
|
374
|
+
}
|
|
375
|
+
async function renderPromptString(template, context = {}) {
|
|
376
|
+
const rendered = await engine.render(template, context);
|
|
377
|
+
return normalizePrompt(rendered);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export {
|
|
381
|
+
__require,
|
|
382
|
+
inferCapabilityPaths,
|
|
383
|
+
resolveTaskCapabilities,
|
|
384
|
+
mergeCapabilityProviders,
|
|
385
|
+
PROMPT_TEMPLATES,
|
|
386
|
+
renderPrompt,
|
|
387
|
+
renderPromptString
|
|
388
|
+
};
|
|
389
|
+
//# sourceMappingURL=chunk-LH5V2WV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/routing/capability-resolver.ts","../src/prompting.ts","../src/generated/prompts.ts"],"sourcesContent":["export type CapabilityResolverRole = \"planner\" | \"executor\" | \"reviewer\";\n\nexport type CapabilityResolverIssue = {\n id?: string;\n identifier?: string;\n title: string;\n description?: string;\n labels?: string[];\n paths?: string[];\n};\n\nexport type CapabilityResolverBaseProvider = {\n provider: string;\n role: CapabilityResolverRole;\n command: string;\n profile?: string;\n profilePath?: string;\n profileInstructions?: string;\n};\n\nexport type CapabilityResolverSuggestion = {\n provider: string;\n role: CapabilityResolverRole;\n profile: string;\n reason: string;\n};\n\nexport type CapabilityResolution = {\n category: string;\n rationale: string[];\n overlays: string[];\n providers: CapabilityResolverSuggestion[];\n};\n\nexport type CapabilityResolverOverride = {\n match?: {\n labels?: string[];\n terms?: string[];\n category?: string;\n paths?: string[];\n };\n category?: string;\n rationale?: string[];\n overlays?: string[];\n providers?: CapabilityResolverSuggestion[];\n};\n\nexport type CapabilityResolverOptions = {\n enabled?: boolean;\n overrides?: CapabilityResolverOverride[];\n};\n\nfunction tokenize(issue: CapabilityResolverIssue): string {\n const labels = (issue.labels ?? []).filter((label) => !label.startsWith(\"capability:\") && !label.startsWith(\"overlay:\"));\n return [\n issue.identifier ?? \"\",\n issue.title,\n issue.description ?? \"\",\n ...labels,\n ...(issue.paths ?? []),\n ].join(\" \").toLowerCase();\n}\n\nfunction normalizePath(value: string): string {\n return value.trim().replaceAll(\"\\\\\", \"/\").toLowerCase();\n}\n\nexport function inferCapabilityPaths(issue: CapabilityResolverIssue): string[] {\n const labels = (issue.labels ?? []).filter((label) => !label.startsWith(\"capability:\") && !label.startsWith(\"overlay:\"));\n const sources = [issue.title, issue.description ?? \"\", ...labels];\n const matches = new Set<string>();\n const pattern = /(?:[A-Za-z0-9._-]+\\/)+(?:[A-Za-z0-9._-]+)|(?:[A-Za-z0-9._-]+\\.(?:ts|tsx|js|jsx|mjs|cjs|css|scss|sass|less|html|md|mdx|json|yml|yaml|sql|sh))+/g;\n\n for (const source of sources) {\n for (const match of source.match(pattern) ?? []) {\n matches.add(normalizePath(match));\n }\n }\n\n return [...matches];\n}\n\nfunction getIssuePaths(issue: CapabilityResolverIssue): string[] {\n return [...new Set([\n ...(issue.paths ?? [])\n .filter((value): value is string => typeof value === \"string\" && value.trim().length > 0)\n .map(normalizePath),\n ...inferCapabilityPaths(issue),\n ])];\n}\n\nfunction hasAny(text: string, terms: string[]): boolean {\n return terms.some((term) => text.includes(term));\n}\n\nfunction hasPathMatch(paths: string[], fragments: string[] = [], extensions: string[] = []): boolean {\n return paths.some((path) => {\n if (fragments.some((fragment) => path.includes(fragment))) {\n return true;\n }\n\n return extensions.some((extension) => path.endsWith(extension));\n });\n}\n\nfunction buildResolution(\n category: string,\n rationale: string[],\n overlays: string[],\n providers: CapabilityResolverSuggestion[],\n): CapabilityResolution {\n return {\n category,\n rationale,\n overlays,\n providers,\n };\n}\n\nfunction uniq(values: string[]): string[] {\n return [...new Set(values.filter(Boolean))];\n}\n\nfunction matchesOverride(\n issue: CapabilityResolverIssue,\n resolution: CapabilityResolution,\n override: CapabilityResolverOverride,\n): boolean {\n const match = override.match ?? {};\n const issueLabels = new Set((issue.labels ?? []).map((label) => label.toLowerCase()));\n const text = tokenize(issue);\n const paths = getIssuePaths(issue);\n\n if (match.category && match.category !== resolution.category) {\n return false;\n }\n\n if (match.labels?.length) {\n const requiredLabels = match.labels.map((label) => label.toLowerCase());\n if (!requiredLabels.every((label) => issueLabels.has(label))) {\n return false;\n }\n }\n\n if (match.terms?.length) {\n if (!match.terms.some((term) => text.includes(term.toLowerCase()))) {\n return false;\n }\n }\n\n if (match.paths?.length) {\n const expectedPaths = match.paths.map((path) => normalizePath(path));\n if (!expectedPaths.some((expectedPath) => paths.some((path) => path.includes(expectedPath)))) {\n return false;\n }\n }\n\n return Boolean(match.category || match.labels?.length || match.terms?.length || match.paths?.length);\n}\n\nfunction applyOverrides(\n issue: CapabilityResolverIssue,\n resolution: CapabilityResolution,\n options?: CapabilityResolverOptions,\n): CapabilityResolution {\n if (options?.enabled === false) {\n return buildResolution(\n \"workflow-disabled\",\n [\"Automatic capability routing was disabled by workflow configuration.\"],\n [],\n [\n { provider: \"codex\", role: \"executor\", profile: \"\", reason: \"Fallback executor because routing is disabled.\" },\n ],\n );\n }\n\n const override = options?.overrides?.find((entry) => matchesOverride(issue, resolution, entry));\n if (!override) {\n return resolution;\n }\n\n return {\n category: override.category ?? resolution.category,\n rationale: uniq([...(resolution.rationale ?? []), ...(override.rationale ?? []), \"Workflow routing override applied.\"]),\n overlays: uniq([...(resolution.overlays ?? []), ...(override.overlays ?? [])]),\n providers: override.providers?.length ? override.providers : resolution.providers,\n };\n}\n\nexport function resolveTaskCapabilities(\n issue: CapabilityResolverIssue,\n options?: CapabilityResolverOptions,\n): CapabilityResolution {\n const text = tokenize(issue);\n const paths = getIssuePaths(issue);\n const frontendPathMatch = hasPathMatch(\n paths,\n [\"src/web\", \"web\", \"frontend\", \"ui\", \"component\", \"dashboard\", \"style\", \"apps/web\"],\n [\".css\", \".scss\", \".sass\", \".less\", \".html\", \".tsx\", \".jsx\", \".vue\", \".svelte\"],\n );\n const securityPathMatch = hasPathMatch(\n paths,\n [\"security\", \"auth\", \"crypto\", \"secret\", \"permission\", \"token\"],\n [\".pem\", \".key\", \".crt\"],\n );\n const architecturePathMatch = hasPathMatch(\n paths,\n [\"workflow.md\", \"architecture.md\", \"spec.md\", \"claude.md\", \"openspec/\"],\n [],\n );\n const devopsPathMatch = hasPathMatch(\n paths,\n [\".github/workflows\", \"docker\", \"k8s\", \"helm\", \"terraform\", \"infra\", \"deploy\", \"release\"],\n [\".yml\", \".yaml\", \".tf\"],\n );\n const backendPathMatch = hasPathMatch(\n paths,\n [\"src/api\", \"api\", \"src/protocol\", \"protocol\", \"server\", \"persistence\", \"scanner\", \"ws\", \"websocket\", \"db\", \"apps/api\"],\n [\".sql\"],\n );\n const docsPathMatch = hasPathMatch(\n paths,\n [\"docs\", \"readme\", \"guide\", \"tutorial\"],\n [\".md\", \".mdx\"],\n );\n let resolution: CapabilityResolution;\n\n if (frontendPathMatch || hasAny(text, [\"frontend\", \"ui\", \"ux\", \"design\", \"css\", \"html\", \"layout\", \"component\", \"react\", \"vue\"])) {\n resolution = buildResolution(\n \"frontend-ui\",\n [\n ...(frontendPathMatch ? [\"Detected frontend-oriented target paths or file extensions.\"] : []),\n \"Detected frontend or design-oriented keywords in the task.\",\n \"Use Claude to plan and review, Codex to implement.\",\n \"Apply impeccable-style polish as a review overlay when available.\",\n ],\n [\"impeccable\", \"frontend-design\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-ui-designer\", reason: \"UI planning and structure.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-frontend-developer\", reason: \"Frontend implementation.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-accessibility-auditor\", reason: \"Critical UX and accessibility review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (securityPathMatch || hasAny(text, [\"security\", \"auth\", \"oauth\", \"token\", \"secret\", \"permission\", \"compliance\", \"vulnerability\"])) {\n resolution = buildResolution(\n \"security\",\n [\n ...(securityPathMatch ? [\"Detected security-sensitive target paths or file extensions.\"] : []),\n \"Detected security-sensitive keywords.\",\n \"Use a security profile to scope the work and keep a strict review pass.\",\n ],\n [\"security-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-security-engineer\", reason: \"Threat and risk framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-security-engineer\", reason: \"Implementation with security context.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Independent correctness review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (architecturePathMatch || hasAny(text, [\"architecture\", \"design doc\", \"spec\", \"workflow\", \"orchestr\", \"roadmap\", \"plan\"])) {\n resolution = buildResolution(\n \"architecture\",\n [\n ...(architecturePathMatch ? [\"Detected workflow, architecture, or specification files in the targeted paths.\"] : []),\n \"Detected architecture or planning-oriented keywords.\",\n \"Favor stronger planning and review roles around the executor.\",\n ],\n [\"spec-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-software-architect\", reason: \"Architecture and system framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Translate architecture into implementation.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Challenge assumptions and regressions.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (devopsPathMatch || hasAny(text, [\"deploy\", \"release\", \"ci\", \"cicd\", \"github actions\", \"docker\", \"terraform\", \"kubernetes\"])) {\n resolution = buildResolution(\n \"devops\",\n [\n ...(devopsPathMatch ? [\"Detected deployment, infrastructure, or CI/CD paths in the task scope.\"] : []),\n \"Detected release, deployment, or infrastructure keywords.\",\n \"Use a delivery-focused planner and a stricter reliability review pass.\",\n ],\n [\"delivery-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-devops-automator\", reason: \"CI/CD and deployment framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-devops-automator\", reason: \"Implement workflow and release changes.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-sre-site-reliability-engineer\", reason: \"Reliability and rollback review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (hasAny(text, [\"bug\", \"fix\", \"regression\", \"debug\", \"crash\", \"broken\", \"error\", \"fail\"])) {\n resolution = buildResolution(\n \"bugfix\",\n [\n \"Detected bug-fix or debugging keywords.\",\n \"Use Codex to execute the fix and Claude to frame and verify the change.\",\n ],\n [\"debug\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-code-reviewer\", reason: \"Clarify failure mode and acceptance criteria.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement and iterate quickly.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Catch regressions and weak reasoning.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (backendPathMatch || hasAny(text, [\"api\", \"backend\", \"database\", \"protocol\", \"server\", \"ws\", \"websocket\", \"persistence\"])) {\n resolution = buildResolution(\n \"backend\",\n [\n ...(backendPathMatch ? [\"Detected backend, protocol, or persistence paths in the task scope.\"] : []),\n \"Detected backend, API, protocol, or persistence keywords.\",\n \"Use backend-oriented planning and critical review around the executor.\",\n ],\n [\"backend-review\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-backend-architect\", reason: \"API and data-model framing.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement the backend changes.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Critical regression review.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n if (docsPathMatch || hasAny(text, [\"docs\", \"readme\", \"guide\", \"documentation\", \"tutorial\"])) {\n resolution = buildResolution(\n \"documentation\",\n [\n ...(docsPathMatch ? [\"Detected documentation-oriented paths or file extensions.\"] : []),\n \"Detected documentation keywords.\",\n \"Use writing-oriented planning with an implementation pass that can still edit code and docs together.\",\n ],\n [\"documentation\"],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-technical-writer\", reason: \"Structure and narrative.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-technical-writer\", reason: \"Apply documentation edits in repo context.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Check coherence with the implementation.\" },\n ],\n );\n return applyOverrides(issue, resolution, options);\n }\n\n resolution = buildResolution(\n \"default\",\n [\n \"No specialized pattern matched strongly.\",\n \"Default to a balanced planner/executor/reviewer pipeline using both Claude and Codex.\",\n ],\n [],\n [\n { provider: \"claude\", role: \"planner\", profile: \"agency-senior-project-manager\", reason: \"Clarify scope and acceptance criteria.\" },\n { provider: \"codex\", role: \"executor\", profile: \"agency-senior-developer\", reason: \"Implement the requested change.\" },\n { provider: \"claude\", role: \"reviewer\", profile: \"agency-code-reviewer\", reason: \"Critical review before closure.\" },\n ],\n );\n\n return applyOverrides(issue, resolution, options);\n}\n\nexport function mergeCapabilityProviders(\n baseProviders: CapabilityResolverBaseProvider[],\n resolution: CapabilityResolution,\n): CapabilityResolverBaseProvider[] {\n return resolution.providers.map((suggestion) => {\n const exact = baseProviders.find((provider) => provider.provider === suggestion.provider && provider.role === suggestion.role);\n const sameRole = baseProviders.find((provider) => provider.role === suggestion.role);\n const sameProvider = baseProviders.find((provider) => provider.provider === suggestion.provider);\n const base = exact ?? sameRole ?? sameProvider;\n\n return {\n provider: suggestion.provider,\n role: suggestion.role,\n command: base?.command ?? \"\",\n profile: suggestion.profile || base?.profile || \"\",\n profilePath: base?.profilePath ?? \"\",\n profileInstructions: base?.profileInstructions ?? \"\",\n };\n });\n}\n","import { TemplateEngine } from \"recker\";\nimport { PROMPT_TEMPLATES, type PromptTemplateName } from \"./generated/prompts.ts\";\n\nconst engine = new TemplateEngine({\n cache: true,\n format: \"raw\",\n strict: false,\n});\n\nfunction normalizePrompt(text: string): string {\n return text\n .replace(/\\r\\n/g, \"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\")\n .trim();\n}\n\nexport async function renderPrompt(\n name: PromptTemplateName,\n context: Record<string, unknown> = {},\n): Promise<string> {\n return renderPromptString(PROMPT_TEMPLATES[name], context);\n}\n\nexport async function renderPromptString(\n template: string,\n context: Record<string, unknown> = {},\n): Promise<string> {\n const rendered = await engine.render(template, context);\n return normalizePrompt(rendered);\n}\n","// Generated by scripts/generate-prompts.ts. Do not edit directly.\n\nexport const PROMPT_TEMPLATES = {\n \"agent-provider-base\": \"{{#if isPlanner}}\\nRole: planner.\\nAnalyze the issue and prepare an execution plan for the implementation agents.\\nDo not claim the issue is complete unless the plan itself is the deliverable.\\n{{else}}\\n{{#if isReviewer}}\\nRole: reviewer.\\nInspect the workspace and review the current implementation critically.\\nIf rework is required, emit `FIFONY_STATUS=continue` and provide actionable `nextPrompt` feedback.\\nEmit `FIFONY_STATUS=done` only when the work is acceptable.\\n{{else}}\\nRole: executor.\\nImplement the required changes in the workspace.\\nUse any planner guidance or prior reviewer feedback already persisted in the workspace.\\n{{/if}}\\n{{/if}}\\n\\n{{#if hasImpeccableOverlay}}\\nImpeccable overlay is active.\\nRaise the bar on UI polish, clarity, responsiveness, visual hierarchy, and interaction quality.\\n{{#if isReviewer}}\\nReview with a stricter frontend and product-quality standard than a normal correctness-only pass.\\n{{else}}\\nWhen touching frontend work, do not settle for baseline implementation quality.\\n{{/if}}\\n{{/if}}\\n\\n{{#if hasFrontendDesignOverlay}}\\nFrontend-design overlay is active.\\nPrefer stronger hierarchy, spacing, and readability decisions over generic implementation choices.\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\n{{#if capabilityCategory}}\\nCapability routing: {{capabilityCategory}}.\\nSelection reason: {{selectionReason}}\\n{{#if overlays.length}}\\nOverlays: {{overlays | join \\\", \\\"}}.\\n{{/if}}\\n{{/if}}\\n\\n{{#if targetPaths.length}}\\nTarget paths: {{targetPaths | join \\\", \\\"}}\\n{{/if}}\\n\\nWorkspace: {{workspacePath}}\\n\\n{{basePrompt}}\\n\", // src/prompts/agent-provider-base.stub.md\n \"agent-turn\": \"Continue working on {{issueIdentifier}}.\\nTurn {{turnIndex}} of {{maxTurns}}.\\n\\nBase objective:\\n{{basePrompt}}\\n\\nContinuation guidance:\\n{{continuation}}\\n\\nPrevious command output tail:\\n```text\\n{{outputTail}}\\n```\\n\\nBefore exiting successfully, emit one of the following control markers:\\n- `FIFONY_STATUS=continue` if more turns are required.\\n- `FIFONY_STATUS=done` if the issue is complete.\\n- `FIFONY_STATUS=blocked` if manual intervention is required.\\nYou may also write `fifony-result.json` with `{ \\\"status\\\": \\\"...\\\", \\\"summary\\\": \\\"...\\\", \\\"nextPrompt\\\": \\\"...\\\" }`.\\n\", // src/prompts/agent-turn.stub.md\n \"compile-execution-claude\": \"{{#if isPlanner}}\\nRole: planner. Analyze the issue and prepare an execution plan.\\n{{else}}\\n{{#if isReviewer}}\\nRole: reviewer. Inspect and review the implementation critically.\\n{{else}}\\nRole: executor. Implement the required changes.\\n{{/if}}\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\n{{planPrompt}}\\n\\n{{#if subagentsToUse.length}}\\n## Subagent Strategy (Claude-specific)\\nYou have access to the Agent tool for spawning subagents. Use them for:\\n{{#each subagentsToUse}}\\n- **{{name}}** ({{role}}): {{why}}\\n{{/each}}\\n\\nLaunch subagents for independent subtasks to maximize parallelism.\\nUse the main thread for coordination and integration.\\n{{/if}}\\n\\n{{#if skillsToUse.length}}\\n## Skills to Activate\\n{{#each skillsToUse}}\\n- Invoke **/{{name}}** - {{why}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if suggestedPaths.length}}\\nTarget paths: {{suggestedPaths | join \\\", \\\"}}\\n{{/if}}\\n\\nWorkspace: {{workspacePath}}\\n\\nIssue: {{issueIdentifier}}\\nTitle: {{title}}\\nDescription: {{description}}\\n\\n## Structured Input\\nThe file `fifony-execution-payload.json` in the workspace contains the canonical structured data for this task.\\nUse it as the source of truth for constraints, success criteria, execution intent, and plan details.\\nIf there is any conflict between this prompt and the structured fields in the payload, prioritize the payload.\\n\\n{{#if validationItems.length}}\\n## Pre-completion enforcement\\nBefore reporting done, verify:\\n{{#each validationItems}}\\n- {{value}}\\n{{/each}}\\n{{/if}}\\n\", // src/prompts/compile-execution-claude.stub.md\n \"compile-execution-codex\": \"{{#if isReviewer}}\\nRole: reviewer. Inspect and review the implementation critically.\\n{{else}}\\n{{#if isPlanner}}\\nRole: planner. Analyze and prepare an execution plan.\\n{{else}}\\nRole: executor. Implement the required changes in the workspace.\\n{{/if}}\\n{{/if}}\\n\\n{{#if profileInstructions}}\\n## Agent Profile\\n{{profileInstructions}}\\n{{/if}}\\n\\n{{#if skillContext}}\\n{{skillContext}}\\n{{/if}}\\n\\nIssue: {{issueIdentifier}}\\nTitle: {{title}}\\nDescription: {{description}}\\nWorkspace: {{workspacePath}}\\n\\n{{planPrompt}}\\n\\n{{#if phases.length}}\\n## Checkpoint Execution (Codex mode)\\nExecute in strict phases. After each phase, verify outputs before proceeding.\\n{{#each phases}}\\n- **{{phaseName}}**: {{goal}}\\n{{#if outputs.length}} Checkpoint: verify {{outputs | join \\\", \\\"}} before next phase.{{/if}}\\n{{/each}}\\n{{else}}\\n## Execution Order\\nExecute steps in order. Verify each step's `doneWhen` criterion before proceeding.\\n{{/if}}\\n\\n{{#if suggestedPaths.length}}\\nTarget paths: {{suggestedPaths | join \\\", \\\"}}\\nFocus changes on these paths. Do not make unnecessary changes elsewhere.\\n{{/if}}\\n\\n{{#if skillsToUse.length}}\\n## Specialized Procedures\\n{{#each skillsToUse}}\\n- Apply **{{name}}** procedure: {{why}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if validationItems.length}}\\n## Pre-completion checks\\nBefore reporting done, run:\\n{{#each validationItems}}\\n- {{value}}\\n{{/each}}\\n{{/if}}\\n\\n## Structured Input\\nThe file `fifony-execution-payload.json` in the workspace contains the canonical structured data for this task.\\nUse it as the source of truth for constraints, success criteria, execution intent, and plan details.\\nIf there is any conflict between this prompt and the structured fields in the payload, prioritize the payload.\\n\\n## Output Format\\n\\n{{outputContract}}\\n\", // src/prompts/compile-execution-codex.stub.md\n \"compile-review\": \"Review the work done for {{issueIdentifier}}.\\n\\nTitle: {{title}}\\nDescription: {{description}}\\nWorkspace: {{workspacePath}}\\n\\n{{#if planPrompt}}\\n# Original Execution Plan\\n\\n{{planPrompt}}\\n{{/if}}\\n\\n{{#if successCriteria.length}}\\n# Success Criteria (evaluate against these)\\n{{#each successCriteria}}\\n- [ ] {{value}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if deliverables.length}}\\n# Expected Deliverables\\n{{#each deliverables}}\\n- [ ] {{value}}\\n{{/each}}\\n{{/if}}\\n\\n{{#if diffSummary}}\\n# Changes Made (diff summary)\\n```\\n{{diffSummary}}\\n```\\n{{/if}}\\n\\n# Structured Context\\nIf `fifony-execution-payload.json` exists in the workspace, read it for the canonical structured task data.\\nUse the `successCriteria`, `constraints`, and `deliverables` fields as your evaluation checklist.\\n\\n# Review Instructions\\n\\n1. Verify each success criterion from the plan is met.\\n2. Check that all expected deliverables are present.\\n3. Review the diff for correctness, security issues, and code quality.\\n4. Verify validation checks pass (run commands if specified in the plan).\\n5. Check for unintended side effects or regressions.\\n\\nIf the work is acceptable, emit FIFONY_STATUS=done.\\nIf rework is needed, emit FIFONY_STATUS=continue and provide actionable feedback in nextPrompt.\\nIf the work is fundamentally broken, emit FIFONY_STATUS=blocked.\\n\", // src/prompts/compile-review.stub.md\n \"integrations-agency-agents\": \"---\\nagent:\\n providers:\\n - provider: claude\\n role: planner\\n profile: agency-senior-project-manager\\n - provider: codex\\n role: executor\\n profile: agency-senior-developer\\n - provider: claude\\n role: reviewer\\n profile: agency-code-reviewer\\ncodex:\\n command: \\\"codex\\\"\\nclaude:\\n command: \\\"claude\\\"\\n---\\n\\nUse local agency agent profiles discovered from workspace or home directories.\\nWorkspace: {{workspaceRoot}}\\n\", // src/prompts/integrations-agency-agents.stub.md\n \"integrations-impeccable\": \"# Impeccable integration idea\\n\\nUse impeccable-oriented skills as a frontend review layer around Fifony issues.\\n\\nSuggested pattern:\\n\\n1. Use `agency-senior-developer` or `codex` as executor.\\n2. Route UI-heavy issues to a reviewer prompt that explicitly asks for impeccable-style critique.\\n3. Expose the resulting review through the Fifony MCP prompts or as a follow-up review issue.\\n\\nSuggested labels:\\n- frontend\\n- ui\\n- design-system\\n\\nSuggested reviewer prompt seed:\\n\\\"Review this implementation using impeccable standards for frontend quality, polish, hierarchy, spacing, responsiveness, and interaction clarity.\\\"\\n\", // src/prompts/integrations-impeccable.stub.md\n \"issue-enhancer-description\": \"You are helping improve issue metadata for a software execution queue.\\nRewrite the description to be clearer, complete, and directly actionable.\\nReturn strict JSON only with this schema:\\n{ \\\"field\\\": \\\"description\\\", \\\"value\\\": \\\"...\\\" }\\n\\nCurrent title: {{title}}\\nCurrent description: {{description}}\\n\\nRules:\\n- Keep it concise but include meaningful acceptance criteria.\\n- Use plain text only, with short paragraphs or bullet style.\\n- Avoid markdown wrappers, quotes, and extra explanation.\\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\\n\", // src/prompts/issue-enhancer-description.stub.md\n \"issue-enhancer-title\": \"You are helping improve issue metadata for a software execution queue.\\nRewrite the title for clarity, actionability, and specificity.\\nReturn strict JSON only with this schema:\\n{ \\\"field\\\": \\\"title\\\", \\\"value\\\": \\\"...\\\" }\\n\\nCurrent title: {{title}}\\nDescription context: {{description}}\\n\\nRules:\\n- Keep it concise and suitable as a task title.\\n- Use imperative language when possible.\\n- Do not include markdown, quotes, or extra explanation.\\n- The value should be in Portuguese if the input is in Portuguese; otherwise in English.\\n\", // src/prompts/issue-enhancer-title.stub.md\n \"issue-planner\": \"You are a senior technical execution planner.\\nProduce the best possible plan for the issue below, filling the JSON schema precisely.\\n\\nIssue title: {{title}}\\nIssue description: {{description}}\\n\\nQuality rules:\\n- Be concrete, not generic. No vague phrases like 'implement' or 'improve' without detail.\\n- Break work into actionable steps (2-8 steps). Each step describes WHAT, not HOW.\\n- Each step must have a clear 'doneWhen' acceptance criterion.\\n- Identify assumptions, constraints, unknowns, and risks.\\n- For unknowns, specify what question needs answering and how to resolve it.\\n- Suggest file paths that are likely relevant to the changes.\\n- Suggest labels: bug, feature, frontend, backend, docs, refactor, security, performance, etc.\\n\\nComplexity estimation:\\n- trivial: < 5 min, single-file cosmetic change\\n- low: 5-15 min, small focused change\\n- medium: 15-60 min, multi-file change with testing\\n- high: > 1 hour, architectural change or new feature\\n\\nTooling reflection (REQUIRED):\\n- Evaluate whether the task benefits from using skills (specialized instructions for quality/consistency).\\n- Evaluate whether subtasks should use subagents (parallel work, isolated context, specialization).\\n- Only recommend skills/agents when there is a concrete justification.\\n- For each step, set ownerType: 'agent' for automated work, 'human' for manual review, 'skill' for specialized skills, 'subagent' for delegated work.\\n\\nEffort suggestion:\\n- low: simple fixes, no deep reasoning needed\\n- medium: standard development work\\n- high: complex architecture, security, or cross-cutting changes\\n- Set per-role if different: planner, executor, reviewer\\n\\nReturn strict JSON. No text outside JSON.\\n\", // src/prompts/issue-planner.stub.md\n \"mcp-integrate-client\": \"Integrate {{client}} with the local Fifony MCP server.\\n\\nGoal: {{goal}}\\n\\n{{integrationGuide}}\\n\\nUse the available Fifony resources and tools instead of inventing your own persistence model.\\n\", // src/prompts/mcp-integrate-client.stub.md\n \"mcp-integration-guide\": \"# Fifony MCP integration\\n\\nWorkspace root: `{{workspaceRoot}}`\\nPersistence root: `{{persistenceRoot}}`\\nState root: `{{stateRoot}}`\\n\\nRecommended MCP client command:\\n\\n```json\\n{\\n \\\"mcpServers\\\": {\\n \\\"fifony\\\": {\\n \\\"command\\\": \\\"npx\\\",\\n \\\"args\\\": [\\\"fifony\\\", \\\"mcp\\\", \\\"--workspace\\\", \\\"{{workspaceRoot}}\\\", \\\"--persistence\\\", \\\"{{persistenceRoot}}\\\"]\\n }\\n }\\n}\\n```\\n\\nExpected workflow:\\n\\n1. Read `fifony://guide/overview` and `fifony://state/summary`.\\n2. Use `fifony.list_issues` or read `fifony://issues`.\\n3. Create work with `fifony.create_issue`.\\n4. Update workflow state with `fifony.update_issue_state`.\\n5. Use the prompts exposed by this MCP server to structure planning or execution.\\n\\nThe MCP server is read-write against the same `s3db` filesystem store used by the Fifony runtime.\\n\", // src/prompts/mcp-integration-guide.stub.md\n \"mcp-issue\": \"You are integrating with Fifony as the {{role}} using {{provider}}.\\n\\nIssue ID: {{id}}\\nTitle: {{title}}\\nState: {{state}}\\nCapability category: {{capabilityCategory}}\\n{{#if overlays.length}}\\nOverlays: {{overlays | join \\\", \\\"}}\\n{{/if}}\\n{{#if paths.length}}\\nPaths: {{paths | join \\\", \\\"}}\\n{{/if}}\\nDescription:\\n{{description}}\\n\\nUse Fifony as the source of truth:\\n- Read the workflow contract from WORKFLOW.md if available.\\n- Persist transitions through the Fifony tools instead of inventing local state.\\n- Keep outputs actionable and aligned with the tracked issue lifecycle.\\n\", // src/prompts/mcp-issue.stub.md\n \"mcp-review-workflow\": \"Review the WORKFLOW.md for this Fifony workspace as {{provider}}.\\n\\nWorkspace: {{workspaceRoot}}\\nWorkflow present: {{workflowPresent}}\\n\\nFocus on:\\n- provider orchestration quality\\n- hooks safety\\n- prompt clarity\\n- issue lifecycle correctness\\n- what an MCP client needs in order to integrate cleanly\\n\", // src/prompts/mcp-review-workflow.stub.md\n \"mcp-route-task\": \"Use this routing decision as the execution plan for the task.\\n\\n{{resolutionJson}}\\n\", // src/prompts/mcp-route-task.stub.md\n \"project-analysis\": \"You are analyzing a software project to help configure an AI-powered development assistant.\\n\\nLook at the project structure, source code, configuration files, and any documentation you can find. Pay special attention to:\\n- README, CLAUDE.md, AGENTS.md, or any project documentation\\n- Build files: package.json, Cargo.toml, pyproject.toml, build.gradle, Gemfile, go.mod, Makefile, CMakeLists.txt, pom.xml, etc.\\n- Source code directories and their contents\\n- Configuration files (.env, docker-compose, terraform, etc.)\\n- CI/CD pipelines (.github/workflows, .gitlab-ci, Jenkinsfile, etc.)\\n\\nReturn a JSON object with exactly these fields:\\n\\n{\\n \\\"description\\\": \\\"A concise 2-3 sentence description of what this project does, its purpose, and who it's for.\\\",\\n \\\"language\\\": \\\"The primary programming language (e.g. typescript, python, rust, java, kotlin, ruby, go, swift, c++)\\\",\\n \\\"domains\\\": [\\\"Array of relevant domain tags that apply to this project\\\"],\\n \\\"stack\\\": [\\\"Array of key technologies, frameworks, and tools used\\\"],\\n \\\"suggestedAgents\\\": [\\\"Array of specialist agent names that would help develop this project\\\"]\\n}\\n\\nFor \\\"domains\\\", choose from: frontend, backend, mobile, devops, database, ai-ml, security, testing, games, ecommerce, fintech, healthcare, education, saas, design, product, marketing, embedded, blockchain, spatial-computing, data-engineering.\\n\\nFor \\\"suggestedAgents\\\", choose from: frontend-developer, backend-architect, database-optimizer, security-engineer, devops-automator, mobile-app-builder, ai-engineer, ui-designer, ux-architect, code-reviewer, technical-writer, sre, data-engineer, software-architect, game-designer.\\n\\nReturn ONLY the JSON object. No markdown fences, no explanation, no extra text.\\n\", // src/prompts/project-analysis.stub.md\n \"workflow-default\": \"You are working on {{issue.identifier}}.\\n\\nTitle: {{issue.title}}\\nDescription:\\n{{issue.description}}\\n\", // src/prompts/workflow-default.stub.md\n \"workflow-plan-section\": \"## Execution Plan\\n\\nComplexity: {{estimatedComplexity}}\\nSummary: {{summary}}\\n\\nSteps:\\n{{#each steps}}\\n{{step}}. {{action}}{{#if files.length}} (files: {{files | join \\\", \\\"}}){{/if}}{{#if details}} - {{details}}{{/if}}\\n{{/each}}\\n\\nFollow this plan. Complete each step in order.\\n\", // src/prompts/workflow-plan-section.stub.md\n} as const;\n\nexport type PromptTem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