forgecraft-mcp 0.1.0 → 0.2.1
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 +41 -19
- package/dist/analyzers/completeness.js +29 -1
- package/dist/analyzers/completeness.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/registry/composer.d.ts +6 -2
- package/dist/registry/composer.d.ts.map +1 -1
- package/dist/registry/composer.js +16 -7
- package/dist/registry/composer.js.map +1 -1
- package/dist/registry/loader.d.ts.map +1 -1
- package/dist/registry/loader.js +41 -9
- package/dist/registry/loader.js.map +1 -1
- package/dist/registry/mcp-discovery.d.ts +82 -0
- package/dist/registry/mcp-discovery.d.ts.map +1 -0
- package/dist/registry/mcp-discovery.js +202 -0
- package/dist/registry/mcp-discovery.js.map +1 -0
- package/dist/registry/renderer.d.ts +14 -4
- package/dist/registry/renderer.d.ts.map +1 -1
- package/dist/registry/renderer.js +41 -12
- package/dist/registry/renderer.js.map +1 -1
- package/dist/shared/errors/index.d.ts +4 -0
- package/dist/shared/errors/index.d.ts.map +1 -1
- package/dist/shared/errors/index.js +6 -0
- package/dist/shared/errors/index.js.map +1 -1
- package/dist/shared/types.d.ts +98 -8
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +77 -0
- package/dist/shared/types.js.map +1 -1
- package/dist/tools/audit.js +2 -2
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/configure-mcp.d.ts +21 -0
- package/dist/tools/configure-mcp.d.ts.map +1 -1
- package/dist/tools/configure-mcp.js +86 -24
- package/dist/tools/configure-mcp.js.map +1 -1
- package/dist/tools/convert.js +2 -2
- package/dist/tools/convert.js.map +1 -1
- package/dist/tools/generate-claude-md.d.ts +29 -3
- package/dist/tools/generate-claude-md.d.ts.map +1 -1
- package/dist/tools/generate-claude-md.js +58 -27
- package/dist/tools/generate-claude-md.js.map +1 -1
- package/dist/tools/list.d.ts.map +1 -1
- package/dist/tools/list.js +24 -0
- package/dist/tools/list.js.map +1 -1
- package/dist/tools/refresh-project.d.ts +3 -0
- package/dist/tools/refresh-project.d.ts.map +1 -1
- package/dist/tools/refresh-project.js +22 -10
- package/dist/tools/refresh-project.js.map +1 -1
- package/dist/tools/scaffold.d.ts +3 -0
- package/dist/tools/scaffold.d.ts.map +1 -1
- package/dist/tools/scaffold.js +20 -8
- package/dist/tools/scaffold.js.map +1 -1
- package/dist/tools/setup-project.d.ts +3 -0
- package/dist/tools/setup-project.d.ts.map +1 -1
- package/dist/tools/setup-project.js +58 -31
- package/dist/tools/setup-project.js.map +1 -1
- package/package.json +7 -3
- package/templates/analytics/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/analytics/mcp-servers.yaml +10 -0
- package/templates/api/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/api/mcp-servers.yaml +12 -0
- package/templates/cli/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/cli/mcp-servers.yaml +10 -0
- package/templates/data-lineage/instructions.yaml +28 -0
- package/templates/data-lineage/mcp-servers.yaml +20 -0
- package/templates/data-pipeline/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/data-pipeline/mcp-servers.yaml +12 -0
- package/templates/fintech/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/fintech/mcp-servers.yaml +12 -0
- package/templates/game/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/game/mcp-servers.yaml +10 -0
- package/templates/healthcare/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/healthcare/mcp-servers.yaml +12 -0
- package/templates/hipaa/instructions.yaml +41 -0
- package/templates/hipaa/mcp-servers.yaml +12 -0
- package/templates/infra/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/infra/mcp-servers.yaml +18 -0
- package/templates/library/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/library/mcp-servers.yaml +18 -0
- package/templates/medallion-architecture/instructions.yaml +41 -0
- package/templates/medallion-architecture/mcp-servers.yaml +20 -0
- package/templates/ml/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/ml/mcp-servers.yaml +10 -0
- package/templates/mobile/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/mobile/mcp-servers.yaml +10 -0
- package/templates/observability-xray/instructions.yaml +40 -0
- package/templates/observability-xray/mcp-servers.yaml +14 -0
- package/templates/realtime/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/realtime/mcp-servers.yaml +12 -0
- package/templates/soc2/instructions.yaml +41 -0
- package/templates/soc2/mcp-servers.yaml +22 -0
- package/templates/social/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/social/mcp-servers.yaml +22 -0
- package/templates/state-machine/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/state-machine/mcp-servers.yaml +10 -0
- package/templates/universal/hooks.yaml +1 -1
- package/templates/universal/{claude-md.yaml → instructions.yaml} +3 -3
- package/templates/universal/mcp-servers.yaml +26 -0
- package/templates/web-react/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/web-react/mcp-servers.yaml +18 -0
- package/templates/web-static/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/web-static/mcp-servers.yaml +18 -0
- package/templates/web3/{claude-md.yaml → instructions.yaml} +1 -1
- package/templates/web3/mcp-servers.yaml +10 -0
- package/templates/zero-trust/instructions.yaml +41 -0
- package/templates/zero-trust/mcp-servers.yaml +14 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Discovery Service.
|
|
3
|
+
*
|
|
4
|
+
* Discovers recommended MCP servers for a set of project tags by:
|
|
5
|
+
* 1. Loading curated entries from mcp-servers.yaml template files (built-in + community).
|
|
6
|
+
* 2. Optionally fetching from a remote registry URL for dynamic recommendations.
|
|
7
|
+
*
|
|
8
|
+
* Results are deduplicated by server name, with local (built-in/community)
|
|
9
|
+
* entries taking priority over remote ones.
|
|
10
|
+
*/
|
|
11
|
+
import type { Tag, McpServerRecommendation, McpDiscoveryOptions } from "../shared/types.js";
|
|
12
|
+
/**
|
|
13
|
+
* Contract for MCP server discovery.
|
|
14
|
+
* Implementations resolve a set of tags into recommended MCP servers.
|
|
15
|
+
*/
|
|
16
|
+
export interface McpDiscoveryService {
|
|
17
|
+
/**
|
|
18
|
+
* Discover recommended MCP servers for the given tags.
|
|
19
|
+
*
|
|
20
|
+
* @param tags - Active project classification tags
|
|
21
|
+
* @param options - Optional discovery configuration
|
|
22
|
+
* @returns Deduplicated list of server recommendations
|
|
23
|
+
*/
|
|
24
|
+
discoverServers(tags: Tag[], options?: McpDiscoveryOptions): Promise<McpServerRecommendation[]>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Default MCP discovery service.
|
|
28
|
+
*
|
|
29
|
+
* Loads curated servers from YAML templates, optionally augments
|
|
30
|
+
* with servers from a remote JSON registry.
|
|
31
|
+
*/
|
|
32
|
+
export declare class DefaultMcpDiscoveryService implements McpDiscoveryService {
|
|
33
|
+
private readonly templatesDirOverride?;
|
|
34
|
+
private readonly extraDirs?;
|
|
35
|
+
/**
|
|
36
|
+
* @param templatesDirOverride - Override built-in templates directory (testing)
|
|
37
|
+
* @param extraDirs - Additional community template directories
|
|
38
|
+
*/
|
|
39
|
+
constructor(templatesDirOverride?: string, extraDirs?: string[]);
|
|
40
|
+
/**
|
|
41
|
+
* Discover MCP servers for the given tags.
|
|
42
|
+
*
|
|
43
|
+
* @param tags - Active project classification tags
|
|
44
|
+
* @param options - Discovery options
|
|
45
|
+
* @returns Deduplicated recommendations sorted by relevance
|
|
46
|
+
*/
|
|
47
|
+
discoverServers(tags: Tag[], options?: McpDiscoveryOptions): Promise<McpServerRecommendation[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Load MCP server entries from local YAML templates for the given tags.
|
|
50
|
+
* Collects from all matching tag template sets.
|
|
51
|
+
*/
|
|
52
|
+
private loadLocalServers;
|
|
53
|
+
/**
|
|
54
|
+
* Fetch MCP server entries from a remote JSON registry.
|
|
55
|
+
*
|
|
56
|
+
* Expected remote format:
|
|
57
|
+
* ```json
|
|
58
|
+
* {
|
|
59
|
+
* "servers": [
|
|
60
|
+
* {
|
|
61
|
+
* "name": "some-server",
|
|
62
|
+
* "description": "...",
|
|
63
|
+
* "command": "npx",
|
|
64
|
+
* "args": ["-y", "some-package"],
|
|
65
|
+
* "tags": ["API", "UNIVERSAL"],
|
|
66
|
+
* "category": "testing",
|
|
67
|
+
* "url": "https://..."
|
|
68
|
+
* }
|
|
69
|
+
* ]
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* Only servers whose tags overlap with the requested tags are returned.
|
|
74
|
+
*/
|
|
75
|
+
private fetchRemoteServers;
|
|
76
|
+
/**
|
|
77
|
+
* Deduplicate server lists. Local entries take priority over remote.
|
|
78
|
+
* Sorts by: number of matching tags (desc), then alphabetically.
|
|
79
|
+
*/
|
|
80
|
+
private deduplicateServers;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=mcp-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-discovery.d.ts","sourceRoot":"","sources":["../../src/registry/mcp-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EACV,GAAG,EACH,uBAAuB,EACvB,mBAAmB,EAGpB,MAAM,oBAAoB,CAAC;AAM5B;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,eAAe,CACb,IAAI,EAAE,GAAG,EAAE,EACX,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAAC;CACvC;AAaD;;;;;GAKG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IACpE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAS;IAC/C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAW;IAEtC;;;OAGG;gBACS,oBAAoB,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE;IAK/D;;;;;;OAMG;IACG,eAAe,CACnB,IAAI,EAAE,GAAG,EAAE,EACX,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAoCrC;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA2BxB;;;;;;;;;;;;;;;;;;;;;OAqBG;YACW,kBAAkB;IA0DhC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;CA6B3B"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Discovery Service.
|
|
3
|
+
*
|
|
4
|
+
* Discovers recommended MCP servers for a set of project tags by:
|
|
5
|
+
* 1. Loading curated entries from mcp-servers.yaml template files (built-in + community).
|
|
6
|
+
* 2. Optionally fetching from a remote registry URL for dynamic recommendations.
|
|
7
|
+
*
|
|
8
|
+
* Results are deduplicated by server name, with local (built-in/community)
|
|
9
|
+
* entries taking priority over remote ones.
|
|
10
|
+
*/
|
|
11
|
+
import { createLogger } from "../shared/logger/index.js";
|
|
12
|
+
import { DiscoveryError } from "../shared/errors/index.js";
|
|
13
|
+
import { loadAllTemplatesWithExtras } from "./loader.js";
|
|
14
|
+
const logger = createLogger("registry/mcp-discovery");
|
|
15
|
+
// ── Constants ────────────────────────────────────────────────────────
|
|
16
|
+
/** Default remote registry URL. Configurable via FORGECRAFT_MCP_REGISTRY_URL. */
|
|
17
|
+
const DEFAULT_REMOTE_REGISTRY_URL = process.env["FORGECRAFT_MCP_REGISTRY_URL"] ?? "";
|
|
18
|
+
/** Default timeout for remote registry fetches in milliseconds. */
|
|
19
|
+
const DEFAULT_REMOTE_TIMEOUT_MS = 5_000;
|
|
20
|
+
// ── Implementation ───────────────────────────────────────────────────
|
|
21
|
+
/**
|
|
22
|
+
* Default MCP discovery service.
|
|
23
|
+
*
|
|
24
|
+
* Loads curated servers from YAML templates, optionally augments
|
|
25
|
+
* with servers from a remote JSON registry.
|
|
26
|
+
*/
|
|
27
|
+
export class DefaultMcpDiscoveryService {
|
|
28
|
+
templatesDirOverride;
|
|
29
|
+
extraDirs;
|
|
30
|
+
/**
|
|
31
|
+
* @param templatesDirOverride - Override built-in templates directory (testing)
|
|
32
|
+
* @param extraDirs - Additional community template directories
|
|
33
|
+
*/
|
|
34
|
+
constructor(templatesDirOverride, extraDirs) {
|
|
35
|
+
this.templatesDirOverride = templatesDirOverride;
|
|
36
|
+
this.extraDirs = extraDirs;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Discover MCP servers for the given tags.
|
|
40
|
+
*
|
|
41
|
+
* @param tags - Active project classification tags
|
|
42
|
+
* @param options - Discovery options
|
|
43
|
+
* @returns Deduplicated recommendations sorted by relevance
|
|
44
|
+
*/
|
|
45
|
+
async discoverServers(tags, options) {
|
|
46
|
+
const localServers = this.loadLocalServers(tags);
|
|
47
|
+
logger.info("Loaded local MCP server recommendations", {
|
|
48
|
+
count: localServers.length,
|
|
49
|
+
tags,
|
|
50
|
+
});
|
|
51
|
+
let remoteServers = [];
|
|
52
|
+
if (options?.includeRemote) {
|
|
53
|
+
const registryUrl = options.remoteRegistryUrl ?? DEFAULT_REMOTE_REGISTRY_URL;
|
|
54
|
+
if (registryUrl) {
|
|
55
|
+
remoteServers = await this.fetchRemoteServers(tags, registryUrl, options.remoteTimeoutMs ?? DEFAULT_REMOTE_TIMEOUT_MS);
|
|
56
|
+
logger.info("Fetched remote MCP server recommendations", {
|
|
57
|
+
count: remoteServers.length,
|
|
58
|
+
url: registryUrl,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
logger.warn("Remote discovery requested but no registry URL configured. " +
|
|
63
|
+
"Set FORGECRAFT_MCP_REGISTRY_URL or pass remoteRegistryUrl.");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return this.deduplicateServers(localServers, remoteServers);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Load MCP server entries from local YAML templates for the given tags.
|
|
70
|
+
* Collects from all matching tag template sets.
|
|
71
|
+
*/
|
|
72
|
+
loadLocalServers(tags) {
|
|
73
|
+
const templates = loadAllTemplatesWithExtras(this.templatesDirOverride, this.extraDirs);
|
|
74
|
+
const seen = new Set();
|
|
75
|
+
const results = [];
|
|
76
|
+
for (const tag of tags) {
|
|
77
|
+
const templateSet = templates.get(tag);
|
|
78
|
+
if (!templateSet?.mcpServers) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
for (const entry of templateSet.mcpServers.servers) {
|
|
82
|
+
if (seen.has(entry.name)) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
seen.add(entry.name);
|
|
86
|
+
results.push(entryToRecommendation(entry, "built-in"));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return results;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Fetch MCP server entries from a remote JSON registry.
|
|
93
|
+
*
|
|
94
|
+
* Expected remote format:
|
|
95
|
+
* ```json
|
|
96
|
+
* {
|
|
97
|
+
* "servers": [
|
|
98
|
+
* {
|
|
99
|
+
* "name": "some-server",
|
|
100
|
+
* "description": "...",
|
|
101
|
+
* "command": "npx",
|
|
102
|
+
* "args": ["-y", "some-package"],
|
|
103
|
+
* "tags": ["API", "UNIVERSAL"],
|
|
104
|
+
* "category": "testing",
|
|
105
|
+
* "url": "https://..."
|
|
106
|
+
* }
|
|
107
|
+
* ]
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* Only servers whose tags overlap with the requested tags are returned.
|
|
112
|
+
*/
|
|
113
|
+
async fetchRemoteServers(tags, registryUrl, timeoutMs) {
|
|
114
|
+
try {
|
|
115
|
+
const controller = new AbortController();
|
|
116
|
+
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
117
|
+
const response = await fetch(registryUrl, {
|
|
118
|
+
signal: controller.signal,
|
|
119
|
+
headers: { Accept: "application/json" },
|
|
120
|
+
});
|
|
121
|
+
clearTimeout(timeoutId);
|
|
122
|
+
if (!response.ok) {
|
|
123
|
+
throw new DiscoveryError(`Remote registry returned HTTP ${response.status}`, registryUrl);
|
|
124
|
+
}
|
|
125
|
+
const data = (await response.json());
|
|
126
|
+
if (!Array.isArray(data.servers)) {
|
|
127
|
+
throw new DiscoveryError("Remote registry response missing 'servers' array", registryUrl);
|
|
128
|
+
}
|
|
129
|
+
const tagSet = new Set(tags);
|
|
130
|
+
return data.servers
|
|
131
|
+
.filter((entry) => entry.tags.some((t) => tagSet.has(t)))
|
|
132
|
+
.map((entry) => entryToRecommendation(entry, "remote"));
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
if (error instanceof DiscoveryError) {
|
|
136
|
+
logger.warn("Remote MCP registry error", {
|
|
137
|
+
url: registryUrl,
|
|
138
|
+
error: error.message,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
143
|
+
logger.warn("Failed to fetch remote MCP registry", {
|
|
144
|
+
url: registryUrl,
|
|
145
|
+
error: message,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Remote failures are non-fatal — return empty and rely on local
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Deduplicate server lists. Local entries take priority over remote.
|
|
154
|
+
* Sorts by: number of matching tags (desc), then alphabetically.
|
|
155
|
+
*/
|
|
156
|
+
deduplicateServers(local, remote) {
|
|
157
|
+
const seen = new Set();
|
|
158
|
+
const merged = [];
|
|
159
|
+
// Local first (higher priority)
|
|
160
|
+
for (const server of local) {
|
|
161
|
+
if (!seen.has(server.name)) {
|
|
162
|
+
seen.add(server.name);
|
|
163
|
+
merged.push(server);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// Remote fills gaps
|
|
167
|
+
for (const server of remote) {
|
|
168
|
+
if (!seen.has(server.name)) {
|
|
169
|
+
seen.add(server.name);
|
|
170
|
+
merged.push(server);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return merged.sort((a, b) => {
|
|
174
|
+
const tagDiff = b.relevantTags.length - a.relevantTags.length;
|
|
175
|
+
if (tagDiff !== 0)
|
|
176
|
+
return tagDiff;
|
|
177
|
+
return a.name.localeCompare(b.name);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// ── Helpers ──────────────────────────────────────────────────────────
|
|
182
|
+
/**
|
|
183
|
+
* Convert a raw McpServerEntry to a McpServerRecommendation.
|
|
184
|
+
*
|
|
185
|
+
* @param entry - Raw entry from YAML or remote
|
|
186
|
+
* @param source - Where this entry was discovered
|
|
187
|
+
* @returns Normalized recommendation
|
|
188
|
+
*/
|
|
189
|
+
function entryToRecommendation(entry, source) {
|
|
190
|
+
return {
|
|
191
|
+
name: entry.name,
|
|
192
|
+
description: entry.description,
|
|
193
|
+
command: entry.command,
|
|
194
|
+
args: entry.args,
|
|
195
|
+
env: entry.env,
|
|
196
|
+
relevantTags: entry.tags,
|
|
197
|
+
category: entry.category,
|
|
198
|
+
url: entry.url,
|
|
199
|
+
source,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=mcp-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-discovery.js","sourceRoot":"","sources":["../../src/registry/mcp-discovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AASzD,MAAM,MAAM,GAAG,YAAY,CAAC,wBAAwB,CAAC,CAAC;AAsBtD,wEAAwE;AAExE,iFAAiF;AACjF,MAAM,2BAA2B,GAC/B,OAAO,CAAC,GAAG,C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AC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,YAAY,EAAE,KAAK,CAAC,IAAI;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Template renderer.
|
|
3
3
|
*
|
|
4
4
|
* Renders composed template content with project-specific variable substitution.
|
|
5
|
+
* Supports multiple output targets (Claude, Cursor, Copilot, Windsurf, Cline, Aider).
|
|
5
6
|
* Handles {{variable}} and {{variable | default: value}} syntax.
|
|
6
7
|
*/
|
|
7
|
-
import type {
|
|
8
|
+
import type { InstructionBlock, NfrBlock, ReviewBlock, Tag, OutputTarget } from "../shared/types.js";
|
|
8
9
|
/** Variables available for template rendering. */
|
|
9
10
|
export interface RenderContext {
|
|
10
11
|
readonly projectName: string;
|
|
@@ -17,10 +18,19 @@ export interface RenderContext {
|
|
|
17
18
|
readonly [key: string]: unknown;
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
|
-
* Render
|
|
21
|
-
*
|
|
21
|
+
* Render an instruction file from composed blocks and project context.
|
|
22
|
+
* Supports all output targets (Claude, Cursor, Copilot, Windsurf, Cline, Aider).
|
|
23
|
+
*
|
|
24
|
+
* @param blocks - Composed instruction blocks
|
|
25
|
+
* @param context - Project context for variable substitution
|
|
26
|
+
* @param target - Output target (defaults to "claude")
|
|
27
|
+
* @returns Full instruction file content as a string
|
|
28
|
+
*/
|
|
29
|
+
export declare function renderInstructionFile(blocks: InstructionBlock[], context: RenderContext, target?: OutputTarget): string;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use renderInstructionFile instead. Kept for backward compatibility.
|
|
22
32
|
*/
|
|
23
|
-
export declare function renderClaudeMd(blocks:
|
|
33
|
+
export declare function renderClaudeMd(blocks: InstructionBlock[], context: RenderContext): string;
|
|
24
34
|
/**
|
|
25
35
|
* Render NFR sections from composed blocks.
|
|
26
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/registry/renderer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/registry/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAChB,QAAQ,EACR,WAAW,EAEX,GAAG,EACH,YAAY,EAEb,MAAM,oBAAoB,CAAC;AAQ5B,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;IACrB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,gBAAgB,EAAE,EAC1B,OAAO,EAAE,aAAa,EACtB,MAAM,GAAE,YAAoC,GAC3C,MAAM,CAmBR;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,gBAAgB,EAAE,EAC1B,OAAO,EAAE,aAAa,GACrB,MAAM,CAER;AAsCD;;GAEG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,QAAQ,EAAE,EAClB,OAAO,EAAE,aAAa,GACrB,MAAM,CAQR;AAkBD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,WAAW,EAAE,EACrB,KAAK,EAAE,eAAe,GAAG,SAAS,GACjC,MAAM,CAuDR;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAsC7D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CA6BhE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CA+BrE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,GACrB,MAAM,CA2BR"}
|
|
@@ -2,17 +2,31 @@
|
|
|
2
2
|
* Template renderer.
|
|
3
3
|
*
|
|
4
4
|
* Renders composed template content with project-specific variable substitution.
|
|
5
|
+
* Supports multiple output targets (Claude, Cursor, Copilot, Windsurf, Cline, Aider).
|
|
5
6
|
* Handles {{variable}} and {{variable | default: value}} syntax.
|
|
6
7
|
*/
|
|
7
8
|
import { createLogger } from "../shared/logger/index.js";
|
|
9
|
+
import { OUTPUT_TARGET_CONFIGS, DEFAULT_OUTPUT_TARGET, } from "../shared/types.js";
|
|
8
10
|
const logger = createLogger("registry/renderer");
|
|
9
11
|
/**
|
|
10
|
-
* Render
|
|
11
|
-
*
|
|
12
|
+
* Render an instruction file from composed blocks and project context.
|
|
13
|
+
* Supports all output targets (Claude, Cursor, Copilot, Windsurf, Cline, Aider).
|
|
14
|
+
*
|
|
15
|
+
* @param blocks - Composed instruction blocks
|
|
16
|
+
* @param context - Project context for variable substitution
|
|
17
|
+
* @param target - Output target (defaults to "claude")
|
|
18
|
+
* @returns Full instruction file content as a string
|
|
12
19
|
*/
|
|
13
|
-
export function
|
|
14
|
-
const
|
|
15
|
-
const
|
|
20
|
+
export function renderInstructionFile(blocks, context, target = DEFAULT_OUTPUT_TARGET) {
|
|
21
|
+
const targetConfig = OUTPUT_TARGET_CONFIGS[target];
|
|
22
|
+
const header = buildHeader(context, targetConfig);
|
|
23
|
+
const sections = [];
|
|
24
|
+
// Cursor .mdc files use frontmatter
|
|
25
|
+
if (targetConfig.usesFrontmatter) {
|
|
26
|
+
sections.push(buildCursorFrontmatter(context));
|
|
27
|
+
}
|
|
28
|
+
sections.push(`${targetConfig.heading}\n`);
|
|
29
|
+
sections.push(header);
|
|
16
30
|
for (const block of blocks) {
|
|
17
31
|
const rendered = renderTemplate(block.content, context);
|
|
18
32
|
sections.push(rendered);
|
|
@@ -20,19 +34,24 @@ export function renderClaudeMd(blocks, context) {
|
|
|
20
34
|
return sections.join("\n");
|
|
21
35
|
}
|
|
22
36
|
/**
|
|
23
|
-
*
|
|
24
|
-
* This section tells Claude that the project is managed by ForgeCraft
|
|
25
|
-
* and what tools are available for maintenance.
|
|
37
|
+
* @deprecated Use renderInstructionFile instead. Kept for backward compatibility.
|
|
26
38
|
*/
|
|
27
|
-
function
|
|
39
|
+
export function renderClaudeMd(blocks, context) {
|
|
40
|
+
return renderInstructionFile(blocks, context, "claude");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Build the ForgeCraft metadata header for the instruction file.
|
|
44
|
+
* Adapts messaging based on the output target.
|
|
45
|
+
*/
|
|
46
|
+
function buildHeader(context, targetConfig) {
|
|
28
47
|
const date = new Date().toISOString().split("T")[0];
|
|
29
48
|
const tagList = context.tags.map((t) => `\`${t}\``).join(", ");
|
|
30
|
-
return (`<!-- ForgeCraft managed | ${date} -->\n` +
|
|
31
|
-
`> **This project is managed by [ForgeCraft](https://github.com/jghiringhelli/forgecraft-mcp)
|
|
49
|
+
return (`<!-- ForgeCraft managed | ${date} | target: ${targetConfig.target} -->\n` +
|
|
50
|
+
`> **This project is managed by [ForgeCraft](https://github.com/jghiringhelli/forgecraft-mcp).** Generated for ${targetConfig.displayName}.\n` +
|
|
32
51
|
`> Tags: ${tagList}\n` +
|
|
33
52
|
`>\n` +
|
|
34
53
|
`> Available commands:\n` +
|
|
35
|
-
`> - \`setup_project\` — re-run full setup (detects tags, generates
|
|
54
|
+
`> - \`setup_project\` — re-run full setup (detects tags, generates instruction files)\n` +
|
|
36
55
|
`> - \`refresh_project\` — detect drift, update tags/tier after project scope changes\n` +
|
|
37
56
|
`> - \`audit_project\` — score compliance, find gaps\n` +
|
|
38
57
|
`> - \`review_project\` — structured code review checklist\n` +
|
|
@@ -40,6 +59,16 @@ function buildForgeCraftHeader(context) {
|
|
|
40
59
|
`>\n` +
|
|
41
60
|
`> Config: \`forgecraft.yaml\` | Tier system: core → recommended → optional\n`);
|
|
42
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Build Cursor-specific MDC frontmatter.
|
|
64
|
+
*/
|
|
65
|
+
function buildCursorFrontmatter(context) {
|
|
66
|
+
return (`---\n` +
|
|
67
|
+
`description: Engineering standards for ${context.projectName}\n` +
|
|
68
|
+
`globs:\n` +
|
|
69
|
+
`alwaysApply: true\n` +
|
|
70
|
+
`---\n`);
|
|
71
|
+
}
|
|
43
72
|
/**
|
|
44
73
|
* Render NFR sections from composed blocks.
|
|
45
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/registry/renderer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/registry/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAUzD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAcjD;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAA0B,EAC1B,OAAsB,EACtB,SAAuB,qBAAqB;IAE5C,MAAM,YAAY,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,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,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;IAED,yCAAyC;IACzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,MAAc,EAAE,EAAE,CAChE,MAAM,CAAC,WAAW,EAAE,CACrB,CAAC;IAEF,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;QACzB,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI,IAAI,OAAO,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACjE,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -27,4 +27,8 @@ export declare class AnalysisError extends ForgeError {
|
|
|
27
27
|
export declare class TemplateParseError extends ForgeError {
|
|
28
28
|
constructor(filePath: string, reason: string);
|
|
29
29
|
}
|
|
30
|
+
/** Remote MCP server discovery failed. */
|
|
31
|
+
export declare class DiscoveryError extends ForgeError {
|
|
32
|
+
constructor(message: string, url?: string);
|
|
33
|
+
}
|
|
30
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/errors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4CAA4C;AAC5C,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAgB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAErC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,O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AC1C,qBAAa,aAAc,SAAQ,UAAU;gBAC/B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAG/D;AAED,kDAAkD;AAClD,qBAAa,kBAAmB,SAAQ,UAAU;gBACpC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAG7C;AAED,0CAA0C;AAC1C,qBAAa,cAAe,SAAQ,UAAU;gBAChC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;CAG1C"}
|
|
@@ -41,4 +41,10 @@ export class TemplateParseError extends ForgeError {
|
|
|
41
41
|
super(`Failed to parse template: ${reason}`, { filePath, reason });
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
/** Remote MCP server discovery failed. */
|
|
45
|
+
export class DiscoveryError extends ForgeError {
|
|
46
|
+
constructor(message, url) {
|
|
47
|
+
super(message, { url });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
44
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/shared/errors/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4CAA4C;AAC5C,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnB,OAAO,CAA0B;IAEjD,YAAY,OAAe,EAAE,UAAmC,EAAE;QAChE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED,iEAAiE;AACjE,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IACnD,YAAY,GAAW,EAAE,OAAgB;QACvC,KAAK,CACH,2BAA2B,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EACxE,EAAE,GA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AC,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EACxE,EAAE,GAAG,EAAE,OAAO,EAAE,CACjB,CAAC;IACJ,CAAC;CACF;AAED,+CAA+C;AAC/C,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,YAAY,OAAe,EAAE,KAAc;QACzC,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5B,CAAC;CACF;AAED,oCAAoC;AACpC,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,YAAY,OAAe,EAAE,QAAgB;QAC3C,KAAK,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,0CAA0C;AAC1C,MAAM,OAAO,aAAc,SAAQ,UAAU;IAC3C,YAAY,OAAe,EAAE,OAAiC;QAC5D,KAAK,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IAChC,CAAC;CACF;AAED,kDAAkD;AAClD,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAChD,YAAY,QAAgB,EAAE,MAAc;QAC1C,KAAK,CAAC,6BAA6B,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACrE,CAAC;CACF;AAED,0CAA0C;AAC1C,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC5C,YAAY,OAAe,EAAE,GAAY;QACvC,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1B,CAAC;CACF"}
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* structures are defined here as the single source of truth.
|
|
6
6
|
*/
|
|
7
7
|
/** All supported project classification tags. */
|
|
8
|
-
export declare const ALL_TAGS: readonly ["UNIVERSAL", "WEB-REACT", "WEB-STATIC", "API", "DATA-PIPELINE", "ML", "HEALTHCARE", "FINTECH", "WEB3", "REALTIME", "STATE-MACHINE", "GAME", "SOCIAL", "CLI", "LIBRARY", "INFRA", "MOBILE", "ANALYTICS"];
|
|
8
|
+
export declare const ALL_TAGS: readonly ["UNIVERSAL", "WEB-REACT", "WEB-STATIC", "API", "DATA-PIPELINE", "ML", "HEALTHCARE", "FINTECH", "WEB3", "REALTIME", "STATE-MACHINE", "GAME", "SOCIAL", "CLI", "LIBRARY", "INFRA", "MOBILE", "ANALYTICS", "HIPAA", "SOC2", "DATA-LINEAGE", "OBSERVABILITY-XRAY", "MEDALLION-ARCHITECTURE", "ZERO-TRUST"];
|
|
9
9
|
export type Tag = (typeof ALL_TAGS)[number];
|
|
10
10
|
/** Description metadata for a single tag. */
|
|
11
11
|
export interface TagInfo {
|
|
@@ -73,19 +73,60 @@ export interface HookInfo {
|
|
|
73
73
|
export type ContentTier = "core" | "recommended" | "optional";
|
|
74
74
|
/** All valid content tiers as a constant array for schema validation. */
|
|
75
75
|
export declare const CONTENT_TIERS: readonly ContentTier[];
|
|
76
|
-
/**
|
|
77
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Supported AI assistant output targets.
|
|
78
|
+
* Each target maps to a specific instruction file format.
|
|
79
|
+
*/
|
|
80
|
+
export declare const ALL_OUTPUT_TARGETS: readonly ["claude", "cursor", "copilot", "windsurf", "cline", "aider"];
|
|
81
|
+
export type OutputTarget = (typeof ALL_OUTPUT_TARGETS)[number];
|
|
82
|
+
/** Configuration for a specific output target. */
|
|
83
|
+
export interface OutputTargetConfig {
|
|
84
|
+
/** Target identifier. */
|
|
85
|
+
readonly target: OutputTarget;
|
|
86
|
+
/** Output filename (e.g., "CLAUDE.md", ".cursorrules"). */
|
|
87
|
+
readonly filename: string;
|
|
88
|
+
/** Subdirectory relative to project root, if any (e.g., ".github" for copilot, ".cursor/rules" for cursor). */
|
|
89
|
+
readonly directory?: string;
|
|
90
|
+
/** Heading used at the top of the generated file. */
|
|
91
|
+
readonly heading: string;
|
|
92
|
+
/** Human-readable display name for the AI tool. */
|
|
93
|
+
readonly displayName: string;
|
|
94
|
+
/** Whether the target uses frontmatter metadata (e.g., Cursor .mdc files). */
|
|
95
|
+
readonly usesFrontmatter?: boolean;
|
|
96
|
+
}
|
|
97
|
+
/** Registry of all supported output target configurations. */
|
|
98
|
+
export declare const OUTPUT_TARGET_CONFIGS: Record<OutputTarget, OutputTargetConfig>;
|
|
99
|
+
/** Default output target when none specified. */
|
|
100
|
+
export declare const DEFAULT_OUTPUT_TARGET: OutputTarget;
|
|
101
|
+
/**
|
|
102
|
+
* Resolve the full output file path for a target relative to project root.
|
|
103
|
+
*
|
|
104
|
+
* @param projectDir - Absolute path to project root
|
|
105
|
+
* @param target - The output target
|
|
106
|
+
* @returns Absolute path to the instruction file
|
|
107
|
+
*/
|
|
108
|
+
export declare function resolveOutputPath(projectDir: string, target: OutputTarget): string;
|
|
109
|
+
/** An instruction content block from a template. */
|
|
110
|
+
export interface InstructionBlock {
|
|
78
111
|
readonly id: string;
|
|
79
112
|
readonly title: string;
|
|
80
113
|
readonly content: string;
|
|
81
114
|
readonly tier?: ContentTier;
|
|
82
115
|
}
|
|
83
|
-
/** A template YAML file structure for
|
|
84
|
-
export interface
|
|
116
|
+
/** A template YAML file structure for instruction content. */
|
|
117
|
+
export interface InstructionTemplate {
|
|
85
118
|
readonly tag: Tag;
|
|
86
|
-
readonly section: "
|
|
87
|
-
readonly blocks:
|
|
119
|
+
readonly section: "instructions";
|
|
120
|
+
readonly blocks: InstructionBlock[];
|
|
88
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated Use InstructionBlock instead. Alias kept for backward compatibility.
|
|
124
|
+
*/
|
|
125
|
+
export type ClaudeMdBlock = InstructionBlock;
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated Use InstructionTemplate instead. Alias kept for backward compatibility.
|
|
128
|
+
*/
|
|
129
|
+
export type ClaudeMdTemplate = InstructionTemplate;
|
|
89
130
|
/** A folder/file entry in a structure template. */
|
|
90
131
|
export interface StructureEntry {
|
|
91
132
|
readonly path: string;
|
|
@@ -160,11 +201,16 @@ export interface ReviewDimensionOutput {
|
|
|
160
201
|
/** Complete template set for a tag. */
|
|
161
202
|
export interface TagTemplateSet {
|
|
162
203
|
readonly tag: Tag;
|
|
163
|
-
readonly
|
|
204
|
+
readonly instructions?: InstructionTemplate;
|
|
164
205
|
readonly nfr?: NfrTemplate;
|
|
165
206
|
readonly structure?: StructureTemplate;
|
|
166
207
|
readonly hooks?: HookTemplate[];
|
|
167
208
|
readonly review?: ReviewTemplate;
|
|
209
|
+
readonly mcpServers?: McpServersTemplate;
|
|
210
|
+
/**
|
|
211
|
+
* @deprecated Use `instructions` instead. Alias kept for backward compatibility.
|
|
212
|
+
*/
|
|
213
|
+
readonly claudeMd?: InstructionTemplate;
|
|
168
214
|
}
|
|
169
215
|
/** Module scaffold configuration. */
|
|
170
216
|
export interface ModuleConfig {
|
|
@@ -178,6 +224,48 @@ export interface McpServerConfig {
|
|
|
178
224
|
readonly args: string[];
|
|
179
225
|
readonly env?: Record<string, string>;
|
|
180
226
|
}
|
|
227
|
+
/** Category grouping for MCP server recommendations. */
|
|
228
|
+
export type McpServerCategory = "scaffolding" | "code-search" | "testing" | "debugging" | "devtools" | "deployment" | "database" | "documentation" | "game-engine" | "ai-ml" | "monitoring" | "general";
|
|
229
|
+
/** An MCP server entry in a curated registry YAML file. */
|
|
230
|
+
export interface McpServerEntry {
|
|
231
|
+
readonly name: string;
|
|
232
|
+
readonly description: string;
|
|
233
|
+
readonly command: string;
|
|
234
|
+
readonly args: string[];
|
|
235
|
+
readonly env?: Record<string, string>;
|
|
236
|
+
readonly tags: Tag[];
|
|
237
|
+
readonly category: McpServerCategory;
|
|
238
|
+
readonly url?: string;
|
|
239
|
+
}
|
|
240
|
+
/** Shape of the mcp-servers.yaml template file. */
|
|
241
|
+
export interface McpServersTemplate {
|
|
242
|
+
readonly tag: Tag;
|
|
243
|
+
readonly section: "mcp-servers";
|
|
244
|
+
readonly servers: McpServerEntry[];
|
|
245
|
+
}
|
|
246
|
+
/** Source of a discovered MCP server recommendation. */
|
|
247
|
+
export type McpServerSource = "built-in" | "community" | "remote";
|
|
248
|
+
/** A recommended MCP server with discovery metadata. */
|
|
249
|
+
export interface McpServerRecommendation {
|
|
250
|
+
readonly name: string;
|
|
251
|
+
readonly description: string;
|
|
252
|
+
readonly command: string;
|
|
253
|
+
readonly args: string[];
|
|
254
|
+
readonly env?: Record<string, string>;
|
|
255
|
+
readonly relevantTags: Tag[];
|
|
256
|
+
readonly category: McpServerCategory;
|
|
257
|
+
readonly url?: string;
|
|
258
|
+
readonly source: McpServerSource;
|
|
259
|
+
}
|
|
260
|
+
/** Options for controlling MCP server discovery behavior. */
|
|
261
|
+
export interface McpDiscoveryOptions {
|
|
262
|
+
/** Whether to also fetch from a remote registry. Defaults to false. */
|
|
263
|
+
readonly includeRemote?: boolean;
|
|
264
|
+
/** Override the default remote registry URL. */
|
|
265
|
+
readonly remoteRegistryUrl?: string;
|
|
266
|
+
/** Request timeout in milliseconds for remote fetches. Defaults to 5000. */
|
|
267
|
+
readonly remoteTimeoutMs?: number;
|
|
268
|
+
}
|
|
181
269
|
/** User override configuration from forgecraft.yaml / .forgecraft.json. */
|
|
182
270
|
export interface ForgeCraftConfig {
|
|
183
271
|
/** Human-readable project name. */
|
|
@@ -186,6 +274,8 @@ export interface ForgeCraftConfig {
|
|
|
186
274
|
readonly tags?: Tag[];
|
|
187
275
|
/** Content tier preference: which tiers to auto-include. */
|
|
188
276
|
readonly tier?: ContentTier;
|
|
277
|
+
/** Output targets: which AI assistant instruction files to generate. Defaults to ['claude']. */
|
|
278
|
+
readonly outputTargets?: OutputTarget[];
|
|
189
279
|
/** Specific block IDs to always include regardless of tier. */
|
|
190
280
|
readonly include?: string[];
|
|
191
281
|
/** Specific block IDs to always exclude regardless of tier. */
|