@shrkcrft/presets 0.1.0-alpha.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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/apply/preview-apply.d.ts +52 -0
- package/dist/apply/preview-apply.d.ts.map +1 -0
- package/dist/apply/preview-apply.js +85 -0
- package/dist/builtin/builtin-presets.d.ts +3 -0
- package/dist/builtin/builtin-presets.d.ts.map +1 -0
- package/dist/builtin/builtin-presets.js +520 -0
- package/dist/builtin/r26-presets.d.ts +31 -0
- package/dist/builtin/r26-presets.d.ts.map +1 -0
- package/dist/builtin/r26-presets.js +458 -0
- package/dist/builtin/r26-snippets.d.ts +39 -0
- package/dist/builtin/r26-snippets.d.ts.map +1 -0
- package/dist/builtin/r26-snippets.js +257 -0
- package/dist/builtin/r45-presets.d.ts +7 -0
- package/dist/builtin/r45-presets.d.ts.map +1 -0
- package/dist/builtin/r45-presets.js +186 -0
- package/dist/builtin/r47-presets.d.ts +5 -0
- package/dist/builtin/r47-presets.d.ts.map +1 -0
- package/dist/builtin/r47-presets.js +65 -0
- package/dist/builtin/shared-snippets.d.ts +17 -0
- package/dist/builtin/shared-snippets.d.ts.map +1 -0
- package/dist/builtin/shared-snippets.js +264 -0
- package/dist/define/define-preset.d.ts +4 -0
- package/dist/define/define-preset.d.ts.map +1 -0
- package/dist/define/define-preset.js +4 -0
- package/dist/emit/synthesize-files.d.ts +26 -0
- package/dist/emit/synthesize-files.d.ts.map +1 -0
- package/dist/emit/synthesize-files.js +172 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/model/preset.d.ts +83 -0
- package/dist/model/preset.d.ts.map +1 -0
- package/dist/model/preset.js +21 -0
- package/dist/registry/load-presets.d.ts +12 -0
- package/dist/registry/load-presets.d.ts.map +1 -0
- package/dist/registry/load-presets.js +33 -0
- package/dist/registry/preset-registry.d.ts +11 -0
- package/dist/registry/preset-registry.d.ts.map +1 -0
- package/dist/registry/preset-registry.js +22 -0
- package/dist/registry/recommend.d.ts +30 -0
- package/dist/registry/recommend.d.ts.map +1 -0
- package/dist/registry/recommend.js +59 -0
- package/dist/registry/resolve-preset.d.ts +75 -0
- package/dist/registry/resolve-preset.d.ts.map +1 -0
- package/dist/registry/resolve-preset.js +207 -0
- package/dist/registry/resolve-references.d.ts +49 -0
- package/dist/registry/resolve-references.d.ts.map +1 -0
- package/dist/registry/resolve-references.js +38 -0
- package/package.json +51 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
import { WorkspaceProfile } from '@shrkcrft/workspace';
|
|
2
|
+
import { definePreset } from "../define/define-preset.js";
|
|
3
|
+
import { COMMON_AGENT_BRIEFING, COMMON_PATH_SERVICES, COMMON_PATH_TESTS, COMMON_PATH_UTILS, COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST, COMMON_RULE_INTERFACE_PREFIX, COMMON_RULE_NO_LOGIC_CONSTRUCTORS, COMMON_RULE_ONE_EXPORT, COMMON_SAFETY_RULE, COMMON_TEMPLATE_SERVICE, COMMON_TEMPLATE_TEST, COMMON_TEMPLATE_UTILITY, OVERVIEW_DOC, } from "./shared-snippets.js";
|
|
4
|
+
import { R26_PRESETS } from "./r26-presets.js";
|
|
5
|
+
import { R45_PRESETS } from "./r45-presets.js";
|
|
6
|
+
import { R47_PRESETS } from "./r47-presets.js";
|
|
7
|
+
const GENERIC = definePreset({
|
|
8
|
+
id: 'generic',
|
|
9
|
+
title: 'Generic SharkCraft setup',
|
|
10
|
+
description: 'Universal SharkCraft starter — safe-codegen rule, basic context/feature pipelines, common path conventions, and an agent briefing.',
|
|
11
|
+
tags: ['generic'],
|
|
12
|
+
weight: 5,
|
|
13
|
+
includes: {
|
|
14
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
15
|
+
rules: [COMMON_SAFETY_RULE],
|
|
16
|
+
paths: [COMMON_PATH_SERVICES, COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
17
|
+
templates: [COMMON_TEMPLATE_SERVICE, COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
18
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST],
|
|
19
|
+
docs: {
|
|
20
|
+
'overview.md': OVERVIEW_DOC('Project overview', 'This repo uses SharkCraft to give AI coding agents structured project intelligence. Run `shrk doctor` to verify the setup.'),
|
|
21
|
+
},
|
|
22
|
+
tasks: {
|
|
23
|
+
'roadmap.md': '# Roadmap\n\n- [ ] First task\n',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
recommendedNextCommands: [
|
|
27
|
+
'shrk doctor',
|
|
28
|
+
'shrk context --task "<task>"',
|
|
29
|
+
'shrk task "<task>"',
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
const TYPESCRIPT_LIBRARY = definePreset({
|
|
33
|
+
id: 'typescript-library',
|
|
34
|
+
title: 'TypeScript library',
|
|
35
|
+
description: 'Rules, templates and pipelines for a generic TypeScript library: I-prefix, one-export-per-file, no-logic constructors, utility template.',
|
|
36
|
+
tags: ['typescript', 'library'],
|
|
37
|
+
appliesTo: [WorkspaceProfile.HasTypeScript, WorkspaceProfile.IsLibrary],
|
|
38
|
+
weight: 7,
|
|
39
|
+
includes: {
|
|
40
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
41
|
+
rules: [
|
|
42
|
+
COMMON_SAFETY_RULE,
|
|
43
|
+
COMMON_RULE_INTERFACE_PREFIX,
|
|
44
|
+
COMMON_RULE_ONE_EXPORT,
|
|
45
|
+
COMMON_RULE_NO_LOGIC_CONSTRUCTORS,
|
|
46
|
+
],
|
|
47
|
+
paths: [COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
48
|
+
templates: [COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
49
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST],
|
|
50
|
+
docs: {
|
|
51
|
+
'overview.md': OVERVIEW_DOC('TypeScript library', 'Strict typing, single-export files, no logic in constructors.'),
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
recommendedNextCommands: [
|
|
55
|
+
'shrk doctor',
|
|
56
|
+
'shrk gen typescript.utility <name> --dry-run',
|
|
57
|
+
'shrk task "<task>"',
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
const BUN_SERVICE = definePreset({
|
|
61
|
+
id: 'bun-service',
|
|
62
|
+
title: 'Bun-native service',
|
|
63
|
+
description: 'Bun-native HTTP service starter: feature-dev + safe-codegen, service/utility/test templates, bun test pipeline.',
|
|
64
|
+
tags: ['bun', 'service'],
|
|
65
|
+
appliesTo: [WorkspaceProfile.HasBun, WorkspaceProfile.IsBackend, WorkspaceProfile.IsService],
|
|
66
|
+
weight: 7,
|
|
67
|
+
includes: {
|
|
68
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
69
|
+
rules: [COMMON_SAFETY_RULE, COMMON_RULE_INTERFACE_PREFIX, COMMON_RULE_ONE_EXPORT],
|
|
70
|
+
paths: [COMMON_PATH_SERVICES, COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
71
|
+
templates: [COMMON_TEMPLATE_SERVICE, COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
72
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST],
|
|
73
|
+
docs: {
|
|
74
|
+
'overview.md': OVERVIEW_DOC('Bun service', 'Bun-native HTTP service. Tests use bun test.'),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
recommendedNextCommands: [
|
|
78
|
+
'shrk doctor',
|
|
79
|
+
'shrk gen typescript.service <name> --dry-run',
|
|
80
|
+
'shrk task "<task>"',
|
|
81
|
+
],
|
|
82
|
+
});
|
|
83
|
+
const NODE_API = definePreset({
|
|
84
|
+
id: 'node-api',
|
|
85
|
+
title: 'Node API',
|
|
86
|
+
description: 'Framework-agnostic Node API setup: HTTP route conventions, service-layer templates, common safety rules.',
|
|
87
|
+
tags: ['node', 'api', 'backend'],
|
|
88
|
+
appliesTo: [WorkspaceProfile.IsBackend, WorkspaceProfile.IsService],
|
|
89
|
+
notAppropriateFor: [WorkspaceProfile.HasBun],
|
|
90
|
+
weight: 6,
|
|
91
|
+
includes: {
|
|
92
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
93
|
+
rules: [COMMON_SAFETY_RULE, COMMON_RULE_ONE_EXPORT],
|
|
94
|
+
paths: [COMMON_PATH_SERVICES, COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
95
|
+
templates: [COMMON_TEMPLATE_SERVICE, COMMON_TEMPLATE_TEST],
|
|
96
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
97
|
+
docs: {
|
|
98
|
+
'overview.md': OVERVIEW_DOC('Node API', 'Routes stay thin. Business logic lives in services.'),
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
recommendedNextCommands: ['shrk doctor', 'shrk task "create a profile service"'],
|
|
102
|
+
});
|
|
103
|
+
const FRONTEND_APP = definePreset({
|
|
104
|
+
id: 'frontend-app',
|
|
105
|
+
title: 'Frontend app',
|
|
106
|
+
description: 'Framework-neutral frontend setup: component / hook / state conventions, safe-codegen, feature-dev pipeline.',
|
|
107
|
+
tags: ['frontend'],
|
|
108
|
+
appliesTo: [WorkspaceProfile.IsFrontend],
|
|
109
|
+
weight: 6,
|
|
110
|
+
includes: {
|
|
111
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
112
|
+
rules: [COMMON_SAFETY_RULE, COMMON_RULE_ONE_EXPORT],
|
|
113
|
+
paths: [COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
114
|
+
templates: [COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
115
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
116
|
+
docs: {
|
|
117
|
+
'overview.md': OVERVIEW_DOC('Frontend app', 'Component-based app. Keep components small; state separate.'),
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
recommendedNextCommands: ['shrk doctor', 'shrk task "create a profile screen"'],
|
|
121
|
+
surfaceProfile: 'small-app',
|
|
122
|
+
});
|
|
123
|
+
// Angular-flavored single-app preset. Selects the small-app surface
|
|
124
|
+
// profile by default so first-time users see the non-monorepo slice
|
|
125
|
+
// of the catalog.
|
|
126
|
+
const ANGULAR_APP = definePreset({
|
|
127
|
+
id: 'angular-app',
|
|
128
|
+
title: 'Angular app',
|
|
129
|
+
description: 'Single Angular workspace: component conventions, safe-codegen pipeline, small-app surface profile.',
|
|
130
|
+
tags: ['frontend', 'angular'],
|
|
131
|
+
appliesTo: [WorkspaceProfile.IsFrontend],
|
|
132
|
+
weight: 7,
|
|
133
|
+
includes: {
|
|
134
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
135
|
+
rules: [COMMON_SAFETY_RULE, COMMON_RULE_ONE_EXPORT],
|
|
136
|
+
paths: [COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
137
|
+
templates: [COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
138
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
139
|
+
docs: {
|
|
140
|
+
'overview.md': OVERVIEW_DOC('Angular app', 'Single Angular workspace. Components small; modules lazy; state colocated.'),
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
recommendedNextCommands: [
|
|
144
|
+
'shrk doctor',
|
|
145
|
+
'shrk surface list # see what is visible (small-app default)',
|
|
146
|
+
'shrk task "create a profile screen"',
|
|
147
|
+
],
|
|
148
|
+
surfaceProfile: 'small-app',
|
|
149
|
+
});
|
|
150
|
+
const NX_MONOREPO = definePreset({
|
|
151
|
+
id: 'nx-monorepo',
|
|
152
|
+
title: 'Nx monorepo',
|
|
153
|
+
description: 'Conventions for Nx workspaces: layer order, public entrypoints, no relative cross-lib imports, affected build/test commands.',
|
|
154
|
+
tags: ['nx', 'monorepo'],
|
|
155
|
+
appliesTo: [WorkspaceProfile.HasNx, WorkspaceProfile.IsMonorepo],
|
|
156
|
+
weight: 8,
|
|
157
|
+
includes: {
|
|
158
|
+
knowledge: [
|
|
159
|
+
COMMON_AGENT_BRIEFING,
|
|
160
|
+
`defineKnowledgeEntry({
|
|
161
|
+
id: 'nx.layer-order',
|
|
162
|
+
title: 'Nx layers: lower layers do not import higher',
|
|
163
|
+
type: KnowledgeType.Rule,
|
|
164
|
+
priority: KnowledgePriority.Critical,
|
|
165
|
+
tags: ['nx', 'architecture'],
|
|
166
|
+
appliesWhen: ['generate-code', 'refactor'],
|
|
167
|
+
content: 'Respect the documented layer order. Lower layers must never import higher ones.',
|
|
168
|
+
})`,
|
|
169
|
+
`defineKnowledgeEntry({
|
|
170
|
+
id: 'nx.public-entrypoints',
|
|
171
|
+
title: 'Import via public entrypoints only',
|
|
172
|
+
type: KnowledgeType.Rule,
|
|
173
|
+
priority: KnowledgePriority.High,
|
|
174
|
+
tags: ['nx', 'imports'],
|
|
175
|
+
appliesWhen: ['generate-code'],
|
|
176
|
+
content: 'Use absolute imports through @scope/<lib>; never reach into internal paths.',
|
|
177
|
+
})`,
|
|
178
|
+
],
|
|
179
|
+
rules: [COMMON_SAFETY_RULE, COMMON_RULE_INTERFACE_PREFIX, COMMON_RULE_ONE_EXPORT],
|
|
180
|
+
paths: [COMMON_PATH_SERVICES, COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
181
|
+
templates: [COMMON_TEMPLATE_SERVICE, COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
182
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST],
|
|
183
|
+
docs: {
|
|
184
|
+
'overview.md': OVERVIEW_DOC('Nx monorepo', 'Many libraries. Layer order is enforced.'),
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
recommendedNextCommands: [
|
|
188
|
+
'shrk doctor',
|
|
189
|
+
'shrk task "create a service in libs/<area>"',
|
|
190
|
+
],
|
|
191
|
+
});
|
|
192
|
+
const MCP_SERVER_PRESET = definePreset({
|
|
193
|
+
id: 'mcp-server',
|
|
194
|
+
title: 'MCP server project',
|
|
195
|
+
description: 'For projects that build MCP servers (tools/resources/prompts). Encodes input-validation, no-write-server, and JSON-RPC framing rules.',
|
|
196
|
+
tags: ['mcp', 'ai-agent'],
|
|
197
|
+
appliesTo: [WorkspaceProfile.HasMcpSdk],
|
|
198
|
+
weight: 8,
|
|
199
|
+
includes: {
|
|
200
|
+
knowledge: [
|
|
201
|
+
COMMON_AGENT_BRIEFING,
|
|
202
|
+
`defineKnowledgeEntry({
|
|
203
|
+
id: 'mcp.no-writes',
|
|
204
|
+
title: 'MCP servers must not write files',
|
|
205
|
+
type: KnowledgeType.Rule,
|
|
206
|
+
priority: KnowledgePriority.Critical,
|
|
207
|
+
tags: ['mcp', 'safety'],
|
|
208
|
+
appliesWhen: ['generate-code'],
|
|
209
|
+
content: 'MCP tools return data only. Writes go through the CLI.',
|
|
210
|
+
actionHints: {
|
|
211
|
+
writePolicy: 'cli-only',
|
|
212
|
+
forbiddenActions: ['Do not introduce file-writing tools to the MCP server.'],
|
|
213
|
+
verificationCommands: ['shrk doctor'],
|
|
214
|
+
},
|
|
215
|
+
})`,
|
|
216
|
+
`defineKnowledgeEntry({
|
|
217
|
+
id: 'mcp.zod-validation',
|
|
218
|
+
title: 'Validate all MCP inputs with zod',
|
|
219
|
+
type: KnowledgeType.Rule,
|
|
220
|
+
priority: KnowledgePriority.High,
|
|
221
|
+
tags: ['mcp', 'security'],
|
|
222
|
+
appliesWhen: ['generate-code'],
|
|
223
|
+
content: 'Every tools/call input is validated at the boundary before reaching the handler.',
|
|
224
|
+
})`,
|
|
225
|
+
],
|
|
226
|
+
rules: [COMMON_SAFETY_RULE, COMMON_RULE_ONE_EXPORT],
|
|
227
|
+
paths: [COMMON_PATH_TESTS],
|
|
228
|
+
templates: [COMMON_TEMPLATE_TEST],
|
|
229
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST],
|
|
230
|
+
docs: {
|
|
231
|
+
'overview.md': OVERVIEW_DOC('MCP server', 'MCP tools are read-only. Inputs are zod-validated.'),
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
recommendedNextCommands: ['shrk doctor', 'shrk task "add a new MCP tool"'],
|
|
235
|
+
});
|
|
236
|
+
const AI_AGENT_READY = definePreset({
|
|
237
|
+
id: 'ai-agent-ready',
|
|
238
|
+
title: 'AI-agent-ready baseline',
|
|
239
|
+
description: 'Strong action-hint coverage, verification commands, forbidden actions — designed to make a repo high-readiness for Claude Code / Cursor.',
|
|
240
|
+
tags: ['ai-agent', 'safety'],
|
|
241
|
+
weight: 6,
|
|
242
|
+
includes: {
|
|
243
|
+
knowledge: [
|
|
244
|
+
COMMON_AGENT_BRIEFING,
|
|
245
|
+
`defineKnowledgeEntry({
|
|
246
|
+
id: 'agent.preferred-flow',
|
|
247
|
+
title: 'Agent preferred flow: pipeline → context → action hints → plan',
|
|
248
|
+
type: KnowledgeType.Workflow,
|
|
249
|
+
priority: KnowledgePriority.High,
|
|
250
|
+
tags: ['agent', 'workflow'],
|
|
251
|
+
appliesWhen: ['generate-code', 'refactor', 'fix-bug'],
|
|
252
|
+
content: \`When starting a task, the agent should:
|
|
253
|
+
1. shrk task "<task>" or list_pipelines + get_pipeline_context
|
|
254
|
+
2. get_action_hints to see commands/forbidden actions
|
|
255
|
+
3. create_generation_plan for any code write
|
|
256
|
+
4. Ask the human to run shrk apply <plan>\`,
|
|
257
|
+
actionHints: {
|
|
258
|
+
mcpTools: ['get_task_packet', 'list_pipelines', 'get_action_hints'],
|
|
259
|
+
commands: ['shrk task "<task>"'],
|
|
260
|
+
preferredFlow: ['pipeline', 'context', 'action-hints', 'plan'],
|
|
261
|
+
verificationCommands: ['shrk doctor'],
|
|
262
|
+
writePolicy: 'cli-only',
|
|
263
|
+
},
|
|
264
|
+
})`,
|
|
265
|
+
],
|
|
266
|
+
rules: [COMMON_SAFETY_RULE],
|
|
267
|
+
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
268
|
+
docs: {
|
|
269
|
+
'overview.md': OVERVIEW_DOC('AI-agent-ready baseline', 'Strong action hints, verification commands, no MCP writes. Pair this with another preset for paths/templates.'),
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
recommendedNextCommands: ['shrk doctor', 'shrk task "<task>"'],
|
|
273
|
+
});
|
|
274
|
+
const SAFE_CODEGEN = definePreset({
|
|
275
|
+
id: 'safe-codegen',
|
|
276
|
+
title: 'Safe code generation',
|
|
277
|
+
description: 'Generation safety baseline: dry-run by default, signed plans, verify-after-apply.',
|
|
278
|
+
tags: ['safety', 'generator'],
|
|
279
|
+
weight: 6,
|
|
280
|
+
includes: {
|
|
281
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
282
|
+
rules: [
|
|
283
|
+
COMMON_SAFETY_RULE,
|
|
284
|
+
`defineKnowledgeEntry({
|
|
285
|
+
id: 'generation.sign-plans',
|
|
286
|
+
title: 'Sign generation plans for the apply path',
|
|
287
|
+
type: KnowledgeType.Rule,
|
|
288
|
+
priority: KnowledgePriority.High,
|
|
289
|
+
tags: ['safety', 'signing'],
|
|
290
|
+
appliesWhen: ['generate-code'],
|
|
291
|
+
content: 'For shared/CI flows, sign plans with --sign and verify with --verify-signature on apply.',
|
|
292
|
+
actionHints: {
|
|
293
|
+
commands: [
|
|
294
|
+
{ command: 'shrk gen <id> <name> --dry-run --sign --save-plan <file>' },
|
|
295
|
+
{ command: 'shrk apply <file> --verify-signature' },
|
|
296
|
+
],
|
|
297
|
+
verificationCommands: ['shrk doctor'],
|
|
298
|
+
writePolicy: 'cli-only',
|
|
299
|
+
},
|
|
300
|
+
})`,
|
|
301
|
+
],
|
|
302
|
+
pipelines: [COMMON_PIPELINE_FEATURE_DEV],
|
|
303
|
+
docs: {
|
|
304
|
+
'overview.md': OVERVIEW_DOC('Safe codegen', 'Plan-first generation with signed plans.'),
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
recommendedNextCommands: [
|
|
308
|
+
'shrk doctor',
|
|
309
|
+
'shrk gen <template> <name> --dry-run --sign --save-plan plan.json',
|
|
310
|
+
],
|
|
311
|
+
});
|
|
312
|
+
const TESTING_FOCUSED = definePreset({
|
|
313
|
+
id: 'testing-focused',
|
|
314
|
+
title: 'Testing-focused setup',
|
|
315
|
+
description: 'Unit / integration / mutation testing guidance, test path conventions, test templates, dedicated test pipeline.',
|
|
316
|
+
tags: ['testing'],
|
|
317
|
+
weight: 5,
|
|
318
|
+
includes: {
|
|
319
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
320
|
+
rules: [
|
|
321
|
+
COMMON_SAFETY_RULE,
|
|
322
|
+
`defineKnowledgeEntry({
|
|
323
|
+
id: 'testing.target-services',
|
|
324
|
+
title: 'Test services, not routes',
|
|
325
|
+
type: KnowledgeType.Rule,
|
|
326
|
+
priority: KnowledgePriority.High,
|
|
327
|
+
tags: ['testing'],
|
|
328
|
+
appliesWhen: ['generate-test'],
|
|
329
|
+
content: 'Unit tests target services and utilities. HTTP routing is thin glue and does not need a dedicated test.',
|
|
330
|
+
})`,
|
|
331
|
+
],
|
|
332
|
+
paths: [COMMON_PATH_TESTS],
|
|
333
|
+
templates: [COMMON_TEMPLATE_TEST],
|
|
334
|
+
pipelines: [
|
|
335
|
+
COMMON_PIPELINE_UNIT_TEST,
|
|
336
|
+
`definePipeline({
|
|
337
|
+
id: 'integration-test',
|
|
338
|
+
title: 'Integration tests (optional)',
|
|
339
|
+
description: 'Spin up real dependencies and run integration tests.',
|
|
340
|
+
tags: ['test', 'integration'],
|
|
341
|
+
steps: [
|
|
342
|
+
{
|
|
343
|
+
id: 'integration',
|
|
344
|
+
type: 'command',
|
|
345
|
+
description: 'Run integration suite.',
|
|
346
|
+
cliCommands: ['bun test tests/integration'],
|
|
347
|
+
required: false,
|
|
348
|
+
},
|
|
349
|
+
],
|
|
350
|
+
})`,
|
|
351
|
+
],
|
|
352
|
+
docs: {
|
|
353
|
+
'overview.md': OVERVIEW_DOC('Testing-focused', 'Unit-test target services. Mirror src/ under tests/.'),
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
recommendedNextCommands: ['shrk doctor', 'shrk gen typescript.unit-test <subject> --dry-run'],
|
|
357
|
+
});
|
|
358
|
+
// ─── Polyglot presets ────────────────────────────────────────────────────
|
|
359
|
+
// These presets are language-specific. They do not depend on `WorkspaceProfile`
|
|
360
|
+
// (which is JS/TS-centric); they are listed and selectable via tags. Each
|
|
361
|
+
// captures the smallest sensible set of rules / paths / pipelines for the
|
|
362
|
+
// language and points the agent at the right verification commands.
|
|
363
|
+
const POLYGLOT_RECOMMENDED_NEXT = [
|
|
364
|
+
'shrk doctor',
|
|
365
|
+
'shrk languages detect',
|
|
366
|
+
'shrk languages commands',
|
|
367
|
+
];
|
|
368
|
+
const JAVA_MAVEN_SERVICE = definePreset({
|
|
369
|
+
id: 'java-maven-service',
|
|
370
|
+
title: 'Java Maven service',
|
|
371
|
+
description: 'Baseline SharkCraft setup for a Java service built with Maven. Verifies via `mvn test`.',
|
|
372
|
+
tags: ['java', 'maven', 'service', 'polyglot'],
|
|
373
|
+
weight: 6,
|
|
374
|
+
includes: {
|
|
375
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
376
|
+
rules: [COMMON_SAFETY_RULE],
|
|
377
|
+
paths: [],
|
|
378
|
+
templates: [],
|
|
379
|
+
pipelines: [],
|
|
380
|
+
docs: {
|
|
381
|
+
'overview.md': OVERVIEW_DOC('Java Maven service', 'Conventional `src/main/java` + `src/test/java`. Run `mvn test` before merging.'),
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
recommendedNextCommands: [...POLYGLOT_RECOMMENDED_NEXT, 'mvn test'],
|
|
385
|
+
});
|
|
386
|
+
const JAVA_GRADLE_SERVICE = definePreset({
|
|
387
|
+
id: 'java-gradle-service',
|
|
388
|
+
title: 'Java Gradle service',
|
|
389
|
+
description: 'Baseline for a Java service built with Gradle. Verifies via `./gradlew test`.',
|
|
390
|
+
tags: ['java', 'gradle', 'service', 'polyglot'],
|
|
391
|
+
weight: 6,
|
|
392
|
+
includes: {
|
|
393
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
394
|
+
rules: [COMMON_SAFETY_RULE],
|
|
395
|
+
paths: [],
|
|
396
|
+
templates: [],
|
|
397
|
+
pipelines: [],
|
|
398
|
+
docs: {
|
|
399
|
+
'overview.md': OVERVIEW_DOC('Java Gradle service', 'Gradle wrapper (`./gradlew`) drives verification. Run `./gradlew test` before merging.'),
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
recommendedNextCommands: [...POLYGLOT_RECOMMENDED_NEXT, './gradlew test'],
|
|
403
|
+
});
|
|
404
|
+
const CSHARP_DOTNET_SERVICE = definePreset({
|
|
405
|
+
id: 'csharp-dotnet-service',
|
|
406
|
+
title: 'C# / .NET service',
|
|
407
|
+
description: 'Baseline for a .NET service. Verifies via `dotnet test`.',
|
|
408
|
+
tags: ['csharp', 'dotnet', 'service', 'polyglot'],
|
|
409
|
+
weight: 6,
|
|
410
|
+
includes: {
|
|
411
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
412
|
+
rules: [COMMON_SAFETY_RULE],
|
|
413
|
+
paths: [],
|
|
414
|
+
templates: [],
|
|
415
|
+
pipelines: [],
|
|
416
|
+
docs: {
|
|
417
|
+
'overview.md': OVERVIEW_DOC('C# / .NET service', '`dotnet restore && dotnet build && dotnet test` is the canonical verification trio.'),
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
recommendedNextCommands: [...POLYGLOT_RECOMMENDED_NEXT, 'dotnet test'],
|
|
421
|
+
});
|
|
422
|
+
const PYTHON_SERVICE = definePreset({
|
|
423
|
+
id: 'python-service',
|
|
424
|
+
title: 'Python service',
|
|
425
|
+
description: 'Baseline for a Python service. Verifies via `pytest`; `ruff` + `mypy` are recommended.',
|
|
426
|
+
tags: ['python', 'service', 'polyglot'],
|
|
427
|
+
weight: 6,
|
|
428
|
+
includes: {
|
|
429
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
430
|
+
rules: [COMMON_SAFETY_RULE],
|
|
431
|
+
paths: [],
|
|
432
|
+
templates: [],
|
|
433
|
+
pipelines: [],
|
|
434
|
+
docs: {
|
|
435
|
+
'overview.md': OVERVIEW_DOC('Python service', 'Source under `src/`, tests under `tests/`. `pytest` is the verification command.'),
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
recommendedNextCommands: [...POLYGLOT_RECOMMENDED_NEXT, 'pytest'],
|
|
439
|
+
});
|
|
440
|
+
const GO_MODULE = definePreset({
|
|
441
|
+
id: 'go-module',
|
|
442
|
+
title: 'Go module',
|
|
443
|
+
description: 'Baseline for a Go module. Verifies via `go test ./...` and `go vet ./...`.',
|
|
444
|
+
tags: ['go', 'golang', 'polyglot'],
|
|
445
|
+
weight: 6,
|
|
446
|
+
includes: {
|
|
447
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
448
|
+
rules: [COMMON_SAFETY_RULE],
|
|
449
|
+
paths: [],
|
|
450
|
+
templates: [],
|
|
451
|
+
pipelines: [],
|
|
452
|
+
docs: {
|
|
453
|
+
'overview.md': OVERVIEW_DOC('Go module', '`cmd/`, `pkg/`, `internal/` layout. `go test ./...` and `go vet ./...` are the gates.'),
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
recommendedNextCommands: [...POLYGLOT_RECOMMENDED_NEXT, 'go test ./...'],
|
|
457
|
+
});
|
|
458
|
+
const RUST_CRATE = definePreset({
|
|
459
|
+
id: 'rust-crate',
|
|
460
|
+
title: 'Rust crate',
|
|
461
|
+
description: 'Baseline for a Rust crate. Verifies via `cargo test`, `cargo clippy`, `cargo fmt --check`.',
|
|
462
|
+
tags: ['rust', 'cargo', 'polyglot'],
|
|
463
|
+
weight: 6,
|
|
464
|
+
includes: {
|
|
465
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
466
|
+
rules: [COMMON_SAFETY_RULE],
|
|
467
|
+
paths: [],
|
|
468
|
+
templates: [],
|
|
469
|
+
pipelines: [],
|
|
470
|
+
docs: {
|
|
471
|
+
'overview.md': OVERVIEW_DOC('Rust crate', '`src/lib.rs` or `src/main.rs`; integration tests under `tests/`. `cargo test` + `cargo clippy` are the gates.'),
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
recommendedNextCommands: [...POLYGLOT_RECOMMENDED_NEXT, 'cargo test'],
|
|
475
|
+
});
|
|
476
|
+
const POLYGLOT_MONOREPO = definePreset({
|
|
477
|
+
id: 'polyglot-monorepo',
|
|
478
|
+
title: 'Polyglot monorepo',
|
|
479
|
+
description: 'Baseline for a repository with multiple language profiles (any of Java / C# / Python / Go / Rust + TS).',
|
|
480
|
+
tags: ['polyglot', 'monorepo'],
|
|
481
|
+
weight: 4,
|
|
482
|
+
includes: {
|
|
483
|
+
knowledge: [COMMON_AGENT_BRIEFING],
|
|
484
|
+
rules: [COMMON_SAFETY_RULE],
|
|
485
|
+
paths: [],
|
|
486
|
+
templates: [],
|
|
487
|
+
pipelines: [],
|
|
488
|
+
docs: {
|
|
489
|
+
'overview.md': OVERVIEW_DOC('Polyglot monorepo', 'Each language has its own verification commands; run `shrk languages commands` to see them.'),
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
recommendedNextCommands: [...POLYGLOT_RECOMMENDED_NEXT],
|
|
493
|
+
});
|
|
494
|
+
export const BUILTIN_PRESETS = Object.freeze([
|
|
495
|
+
GENERIC,
|
|
496
|
+
TYPESCRIPT_LIBRARY,
|
|
497
|
+
BUN_SERVICE,
|
|
498
|
+
NODE_API,
|
|
499
|
+
FRONTEND_APP,
|
|
500
|
+
ANGULAR_APP,
|
|
501
|
+
NX_MONOREPO,
|
|
502
|
+
MCP_SERVER_PRESET,
|
|
503
|
+
AI_AGENT_READY,
|
|
504
|
+
SAFE_CODEGEN,
|
|
505
|
+
TESTING_FOCUSED,
|
|
506
|
+
// Polyglot
|
|
507
|
+
JAVA_MAVEN_SERVICE,
|
|
508
|
+
JAVA_GRADLE_SERVICE,
|
|
509
|
+
CSHARP_DOTNET_SERVICE,
|
|
510
|
+
PYTHON_SERVICE,
|
|
511
|
+
GO_MODULE,
|
|
512
|
+
RUST_CRATE,
|
|
513
|
+
POLYGLOT_MONOREPO,
|
|
514
|
+
// Modern Angular, strict TypeScript, frontend/backend/testing variants
|
|
515
|
+
...R26_PRESETS,
|
|
516
|
+
// Universal adoption: next-app, turborepo, package-workspace, clean-architecture-ts
|
|
517
|
+
...R45_PRESETS,
|
|
518
|
+
// Universal adoption top-5: nest-service, angular-app canonical aliases
|
|
519
|
+
...R47_PRESETS,
|
|
520
|
+
]);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IPreset } from '../model/preset.js';
|
|
2
|
+
export declare const GENERIC_SAFE_REPO: IPreset;
|
|
3
|
+
export declare const AI_AGENT_SAFE_DEVELOPMENT: IPreset;
|
|
4
|
+
export declare const ENTERPRISE_REVIEW_GATED: IPreset;
|
|
5
|
+
export declare const STRICT_TYPESCRIPT: IPreset;
|
|
6
|
+
export declare const NODE_SERVICE: IPreset;
|
|
7
|
+
export declare const NPM_PACKAGE: IPreset;
|
|
8
|
+
export declare const MODERN_ANGULAR: IPreset;
|
|
9
|
+
export declare const ANGULAR_SIGNALS_FIRST: IPreset;
|
|
10
|
+
export declare const ANGULAR_RXJS_DISCIPLINED: IPreset;
|
|
11
|
+
export declare const ANGULAR_STANDALONE_COMPONENTS: IPreset;
|
|
12
|
+
export declare const ANGULAR_ENTERPRISE_ARCHITECTURE: IPreset;
|
|
13
|
+
export declare const ANGULAR_PERFORMANCE: IPreset;
|
|
14
|
+
export declare const ANGULAR_TESTING: IPreset;
|
|
15
|
+
export declare const ANGULAR_ACCESSIBILITY: IPreset;
|
|
16
|
+
export declare const ANGULAR_SECURITY: IPreset;
|
|
17
|
+
export declare const ANGULAR_PLUGIN_PLATFORM: IPreset;
|
|
18
|
+
export declare const ANGULAR_ENTERPRISE_APP: IPreset;
|
|
19
|
+
export declare const ANGULAR_LIBRARY: IPreset;
|
|
20
|
+
export declare const ANGULAR_SMART_UI_PLATFORM: IPreset;
|
|
21
|
+
export declare const VITEST_FOCUSED: IPreset;
|
|
22
|
+
export declare const JEST_FOCUSED: IPreset;
|
|
23
|
+
export declare const PLAYWRIGHT_FOCUSED: IPreset;
|
|
24
|
+
export declare const REACT_APP_PRESET: IPreset;
|
|
25
|
+
export declare const VUE_APP_PRESET: IPreset;
|
|
26
|
+
export declare const WEB_COMPONENT_LIBRARY: IPreset;
|
|
27
|
+
export declare const NESTJS_SERVICE: IPreset;
|
|
28
|
+
export declare const EXPRESS_SERVICE: IPreset;
|
|
29
|
+
export declare const FASTIFY_SERVICE: IPreset;
|
|
30
|
+
export declare const R26_PRESETS: readonly IPreset[];
|
|
31
|
+
//# sourceMappingURL=r26-presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"r26-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/r26-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA+ClD,eAAO,MAAM,iBAAiB,EAAE,OAe9B,CAAC;AAEH,eAAO,MAAM,yBAAyB,EAAE,OAgBtC,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,OAoBpC,CAAC;AAIH,eAAO,MAAM,iBAAiB,EAAE,OAgC9B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,OAiBzB,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,OAiBxB,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,OAmC3B,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,OAelC,CAAC;AAEH,eAAO,MAAM,wBAAwB,EAAE,OAerC,CAAC;AAEH,eAAO,MAAM,6BAA6B,EAAE,OAe1C,CAAC;AAEH,eAAO,MAAM,+BAA+B,EAAE,OAe5C,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,OAehC,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,OAe5B,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,OAelC,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,OAe7B,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,OAepC,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,OASnC,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,OAS5B,CAAC;AAEH,eAAO,MAAM,yBAAyB,EAAE,OAStC,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,OAQ3B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,OAQzB,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,OAO/B,CAAC;AAIH,eAAO,MAAM,gBAAgB,EAAE,OAS7B,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,OAS3B,CAAC;AAEH,eAAO,MAAM,qBAAqB,EAAE,OAQlC,CAAC;AAIH,eAAO,MAAM,cAAc,EAAE,OAS3B,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,OAS5B,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,OAS5B,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,SAAS,OAAO,EA6BxC,CAAC"}
|