@shrkcrft/presets 0.1.0-alpha.8 → 0.1.0-alpha.9
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 +1 -1
- package/dist/builtin/builtin-presets.d.ts.map +1 -1
- package/dist/builtin/builtin-presets.js +19 -40
- package/dist/builtin/r26-presets.d.ts +3 -1
- package/dist/builtin/r26-presets.d.ts.map +1 -1
- package/dist/builtin/r26-presets.js +33 -5
- package/dist/builtin/r26-snippets.d.ts +2 -0
- package/dist/builtin/r26-snippets.d.ts.map +1 -1
- package/dist/builtin/r26-snippets.js +16 -0
- package/dist/builtin/r45-presets.d.ts +1 -1
- package/dist/builtin/r45-presets.d.ts.map +1 -1
- package/dist/builtin/r45-presets.js +5 -5
- package/dist/builtin/r47-presets.d.ts +1 -1
- package/dist/builtin/r47-presets.d.ts.map +1 -1
- package/dist/builtin/r47-presets.js +4 -4
- package/dist/builtin/shared-snippets.d.ts +3 -25
- package/dist/builtin/shared-snippets.d.ts.map +1 -1
- package/dist/builtin/shared-snippets.js +0 -265
- package/dist/emit/synthesize-files.d.ts.map +1 -1
- package/dist/emit/synthesize-files.js +17 -76
- package/package.json +8 -9
- package/dist/builtin/angular21-presets.d.ts +0 -9
- package/dist/builtin/angular21-presets.d.ts.map +0 -1
- package/dist/builtin/angular21-presets.js +0 -218
- package/dist/builtin/angular21-snippets.d.ts +0 -28
- package/dist/builtin/angular21-snippets.d.ts.map +0 -1
- package/dist/builtin/angular21-snippets.js +0 -243
- package/dist/builtin/nest11-presets.d.ts +0 -11
- package/dist/builtin/nest11-presets.d.ts.map +0 -1
- package/dist/builtin/nest11-presets.js +0 -257
- package/dist/builtin/nest11-snippets.d.ts +0 -32
- package/dist/builtin/nest11-snippets.d.ts.map +0 -1
- package/dist/builtin/nest11-snippets.js +0 -270
- package/dist/builtin/react19-presets.d.ts +0 -12
- package/dist/builtin/react19-presets.d.ts.map +0 -1
- package/dist/builtin/react19-presets.js +0 -299
- package/dist/builtin/react19-snippets.d.ts +0 -43
- package/dist/builtin/react19-snippets.d.ts.map +0 -1
- package/dist/builtin/react19-snippets.js +0 -363
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
SharkCraft presets: reusable project setups (knowledge/rules/paths/templates/pipelines/docs) that can be applied to a target repo through the CLI.
|
|
4
4
|
|
|
5
|
-
Part of [SharkCraft](https://github.com/
|
|
5
|
+
Part of [SharkCraft](https://github.com/sharkcraft/sharkcraft) — a deterministic, local-first toolkit that gives AI coding agents durable project context. See the main repo for documentation, examples, and the `shrk` CLI.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/builtin-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"builtin-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/builtin-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA6iBlD,eAAO,MAAM,eAAe,EAAE,SAAS,OAAO,EA0B5C,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { WorkspaceProfile } from '@shrkcrft/workspace';
|
|
2
2
|
import { definePreset } from "../define/define-preset.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ANGULAR_21_PRESETS } from "./angular21-presets.js";
|
|
8
|
-
import { NEST_11_PRESETS } from "./nest11-presets.js";
|
|
9
|
-
import { REACT_19_PRESETS } from "./react19-presets.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";
|
|
10
7
|
const GENERIC = definePreset({
|
|
11
8
|
id: 'generic',
|
|
12
9
|
title: 'Generic SharkCraft setup',
|
|
@@ -136,7 +133,7 @@ const ANGULAR_APP = definePreset({
|
|
|
136
133
|
includes: {
|
|
137
134
|
knowledge: [COMMON_AGENT_BRIEFING],
|
|
138
135
|
rules: [COMMON_SAFETY_RULE, COMMON_RULE_ONE_EXPORT],
|
|
139
|
-
paths: [
|
|
136
|
+
paths: [COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
140
137
|
templates: [COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
141
138
|
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV],
|
|
142
139
|
docs: {
|
|
@@ -153,7 +150,7 @@ const ANGULAR_APP = definePreset({
|
|
|
153
150
|
const NX_MONOREPO = definePreset({
|
|
154
151
|
id: 'nx-monorepo',
|
|
155
152
|
title: 'Nx monorepo',
|
|
156
|
-
description: 'Conventions for Nx workspaces: public entrypoints, no relative cross-lib imports, affected build/test commands.',
|
|
153
|
+
description: 'Conventions for Nx workspaces: layer order, public entrypoints, no relative cross-lib imports, affected build/test commands.',
|
|
157
154
|
tags: ['nx', 'monorepo'],
|
|
158
155
|
appliesTo: [WorkspaceProfile.HasNx, WorkspaceProfile.IsMonorepo],
|
|
159
156
|
weight: 8,
|
|
@@ -161,13 +158,13 @@ const NX_MONOREPO = definePreset({
|
|
|
161
158
|
knowledge: [
|
|
162
159
|
COMMON_AGENT_BRIEFING,
|
|
163
160
|
`defineKnowledgeEntry({
|
|
164
|
-
id: 'nx.
|
|
165
|
-
title: '
|
|
161
|
+
id: 'nx.layer-order',
|
|
162
|
+
title: 'Nx layers: lower layers do not import higher',
|
|
166
163
|
type: KnowledgeType.Rule,
|
|
167
164
|
priority: KnowledgePriority.Critical,
|
|
168
165
|
tags: ['nx', 'architecture'],
|
|
169
166
|
appliesWhen: ['generate-code', 'refactor'],
|
|
170
|
-
content: 'Respect the
|
|
167
|
+
content: 'Respect the documented layer order. Lower layers must never import higher ones.',
|
|
171
168
|
})`,
|
|
172
169
|
`defineKnowledgeEntry({
|
|
173
170
|
id: 'nx.public-entrypoints',
|
|
@@ -180,11 +177,11 @@ const NX_MONOREPO = definePreset({
|
|
|
180
177
|
})`,
|
|
181
178
|
],
|
|
182
179
|
rules: [COMMON_SAFETY_RULE, COMMON_RULE_INTERFACE_PREFIX, COMMON_RULE_ONE_EXPORT],
|
|
183
|
-
paths: [
|
|
180
|
+
paths: [COMMON_PATH_SERVICES, COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
184
181
|
templates: [COMMON_TEMPLATE_SERVICE, COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
185
182
|
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST],
|
|
186
183
|
docs: {
|
|
187
|
-
'overview.md': OVERVIEW_DOC('Nx monorepo', 'Many libraries. Layer order is enforced.
|
|
184
|
+
'overview.md': OVERVIEW_DOC('Nx monorepo', 'Many libraries. Layer order is enforced.'),
|
|
188
185
|
},
|
|
189
186
|
},
|
|
190
187
|
recommendedNextCommands: [
|
|
@@ -377,7 +374,7 @@ const JAVA_MAVEN_SERVICE = definePreset({
|
|
|
377
374
|
includes: {
|
|
378
375
|
knowledge: [COMMON_AGENT_BRIEFING],
|
|
379
376
|
rules: [COMMON_SAFETY_RULE],
|
|
380
|
-
paths: [
|
|
377
|
+
paths: [],
|
|
381
378
|
templates: [],
|
|
382
379
|
pipelines: [],
|
|
383
380
|
docs: {
|
|
@@ -395,7 +392,7 @@ const JAVA_GRADLE_SERVICE = definePreset({
|
|
|
395
392
|
includes: {
|
|
396
393
|
knowledge: [COMMON_AGENT_BRIEFING],
|
|
397
394
|
rules: [COMMON_SAFETY_RULE],
|
|
398
|
-
paths: [
|
|
395
|
+
paths: [],
|
|
399
396
|
templates: [],
|
|
400
397
|
pipelines: [],
|
|
401
398
|
docs: {
|
|
@@ -431,7 +428,7 @@ const PYTHON_SERVICE = definePreset({
|
|
|
431
428
|
includes: {
|
|
432
429
|
knowledge: [COMMON_AGENT_BRIEFING],
|
|
433
430
|
rules: [COMMON_SAFETY_RULE],
|
|
434
|
-
paths: [
|
|
431
|
+
paths: [],
|
|
435
432
|
templates: [],
|
|
436
433
|
pipelines: [],
|
|
437
434
|
docs: {
|
|
@@ -449,7 +446,7 @@ const GO_MODULE = definePreset({
|
|
|
449
446
|
includes: {
|
|
450
447
|
knowledge: [COMMON_AGENT_BRIEFING],
|
|
451
448
|
rules: [COMMON_SAFETY_RULE],
|
|
452
|
-
paths: [
|
|
449
|
+
paths: [],
|
|
453
450
|
templates: [],
|
|
454
451
|
pipelines: [],
|
|
455
452
|
docs: {
|
|
@@ -467,7 +464,7 @@ const RUST_CRATE = definePreset({
|
|
|
467
464
|
includes: {
|
|
468
465
|
knowledge: [COMMON_AGENT_BRIEFING],
|
|
469
466
|
rules: [COMMON_SAFETY_RULE],
|
|
470
|
-
paths: [
|
|
467
|
+
paths: [],
|
|
471
468
|
templates: [],
|
|
472
469
|
pipelines: [],
|
|
473
470
|
docs: {
|
|
@@ -515,27 +512,9 @@ export const BUILTIN_PRESETS = Object.freeze([
|
|
|
515
512
|
RUST_CRATE,
|
|
516
513
|
POLYGLOT_MONOREPO,
|
|
517
514
|
// Modern Angular, strict TypeScript, frontend/backend/testing variants
|
|
518
|
-
...
|
|
515
|
+
...R26_PRESETS,
|
|
519
516
|
// Universal adoption: next-app, turborepo, package-workspace, clean-architecture-ts
|
|
520
|
-
...
|
|
517
|
+
...R45_PRESETS,
|
|
521
518
|
// Universal adoption top-5: nest-service, angular-app canonical aliases
|
|
522
|
-
...
|
|
523
|
-
// Angular 18 / 19 / 20 / 21 — signal queries, signal I/O, zoneless,
|
|
524
|
-
// @if/@for/@defer/@let, resource() / httpResource(), inject(), no
|
|
525
|
-
// NgModules. Weight 11-12 so the recommender prefers these over
|
|
526
|
-
// R26 `modern-angular` (weight 9) when the workspace is Angular.
|
|
527
|
-
...ANGULAR_21_PRESETS,
|
|
528
|
-
// NestJS 11+ — thin controllers, global ValidationPipe + class-validator,
|
|
529
|
-
// async lifecycle, Fastify + cache + throttler, helmet + JWT guards,
|
|
530
|
-
// structured logging + terminus health, TestingModule + supertest e2e.
|
|
531
|
-
// Weight 11-12 so the recommender prefers these over R26 `nestjs-service`
|
|
532
|
-
// (weight 7) and R47 `nest-service` (weight 9) when the workspace is Nest.
|
|
533
|
-
...NEST_11_PRESETS,
|
|
534
|
-
// React 19+ — function components + ref-as-prop, hooks discipline,
|
|
535
|
-
// Actions / useActionState / useOptimistic, TanStack Query for server
|
|
536
|
-
// state, React Compiler + lazy + virtualization, useTransition /
|
|
537
|
-
// Suspense, Vitest + RTL + userEvent + MSW, RSC + 'use client' +
|
|
538
|
-
// Server Actions. Weight 11-12 so the recommender prefers these over
|
|
539
|
-
// the legacy `frontend-app` (weight 6) when the workspace is React.
|
|
540
|
-
...REACT_19_PRESETS,
|
|
519
|
+
...R47_PRESETS,
|
|
541
520
|
]);
|
|
@@ -14,8 +14,10 @@ export declare const ANGULAR_PERFORMANCE: IPreset;
|
|
|
14
14
|
export declare const ANGULAR_TESTING: IPreset;
|
|
15
15
|
export declare const ANGULAR_ACCESSIBILITY: IPreset;
|
|
16
16
|
export declare const ANGULAR_SECURITY: IPreset;
|
|
17
|
+
export declare const ANGULAR_PLUGIN_PLATFORM: IPreset;
|
|
17
18
|
export declare const ANGULAR_ENTERPRISE_APP: IPreset;
|
|
18
19
|
export declare const ANGULAR_LIBRARY: IPreset;
|
|
20
|
+
export declare const ANGULAR_SMART_UI_PLATFORM: IPreset;
|
|
19
21
|
export declare const VITEST_FOCUSED: IPreset;
|
|
20
22
|
export declare const JEST_FOCUSED: IPreset;
|
|
21
23
|
export declare const PLAYWRIGHT_FOCUSED: IPreset;
|
|
@@ -25,5 +27,5 @@ export declare const WEB_COMPONENT_LIBRARY: IPreset;
|
|
|
25
27
|
export declare const NESTJS_SERVICE: IPreset;
|
|
26
28
|
export declare const EXPRESS_SERVICE: IPreset;
|
|
27
29
|
export declare const FASTIFY_SERVICE: IPreset;
|
|
28
|
-
export declare const
|
|
30
|
+
export declare const R26_PRESETS: readonly IPreset[];
|
|
29
31
|
//# sourceMappingURL=r26-presets.d.ts.map
|
|
@@ -1 +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;
|
|
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,OAmC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ARDS_SMALL, NG_LAZY_ROUTES, NG_LIFECYCLE_SAFE_CLEANUP, NG_NO_BUSINESS_LOGIC_IN_TEMPLATE, NG_NO_DEEP_LIB_IMPORTS, NG_NO_GOD_SERVICES, NG_ON_PUSH, NG_RXJS_NO_NESTED_SUBSCRIBE, NG_SIGNALS_FIRST, NG_STANDALONE_COMPONENTS, NG_TRACK_BY, NG_TYPED_REACTIVE_FORMS, TS_AGENT_SMALL_DIFFS, TS_BRANDED_IDS, TS_DISCRIMINATED_UNIONS, TS_ERROR_HANDLING, TS_NO_ANY, TS_NO_CIRCULAR_IMPORTS, TS_NO_DEEP_IMPORTS, TS_NO_FLOATING_PROMISES, TS_PREFER_SATISFIES, TS_PUBLIC_RETURN_TYPES, TS_READONLY_DEFAULT, TS_VALIDATE_BOUNDARY_INPUT, } from "./r26-snippets.js";
|
|
3
|
+
import { COMMON_AGENT_BRIEFING, 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, OVERVIEW_DOC, } from "./shared-snippets.js";
|
|
4
|
+
import { NG_ACCESSIBLE, NG_AVOID_BYPASS_SECURITY, NG_DOMAIN_NO_UI_IMPORTS, NG_FEATURE_FOLDERS, NG_GUARDS_SMALL, NG_LAZY_ROUTES, NG_LIFECYCLE_SAFE_CLEANUP, NG_NO_BUSINESS_LOGIC_IN_TEMPLATE, NG_NO_DEEP_LIB_IMPORTS, NG_NO_GOD_SERVICES, NG_ON_PUSH, NG_PLUGIN_NO_DEEP_IMPORTS, NG_PLUGIN_STABLE_CONTRACT, NG_RXJS_NO_NESTED_SUBSCRIBE, NG_SIGNALS_FIRST, NG_STANDALONE_COMPONENTS, NG_TRACK_BY, NG_TYPED_REACTIVE_FORMS, TS_AGENT_SMALL_DIFFS, TS_BRANDED_IDS, TS_DISCRIMINATED_UNIONS, TS_ERROR_HANDLING, TS_NO_ANY, TS_NO_CIRCULAR_IMPORTS, TS_NO_DEEP_IMPORTS, TS_NO_FLOATING_PROMISES, TS_PREFER_SATISFIES, TS_PUBLIC_RETURN_TYPES, TS_READONLY_DEFAULT, TS_VALIDATE_BOUNDARY_INPUT, } from "./r26-snippets.js";
|
|
5
5
|
// ─── Core ──────────────────────────────────────────────────────────────────
|
|
6
6
|
export const GENERIC_SAFE_REPO = definePreset({
|
|
7
7
|
id: 'generic-safe-repo',
|
|
@@ -156,7 +156,7 @@ export const MODERN_ANGULAR = definePreset({
|
|
|
156
156
|
NG_ACCESSIBLE,
|
|
157
157
|
NG_AVOID_BYPASS_SECURITY,
|
|
158
158
|
],
|
|
159
|
-
paths: [
|
|
159
|
+
paths: [],
|
|
160
160
|
templates: [],
|
|
161
161
|
pipelines: [COMMON_PIPELINE_FEATURE_DEV],
|
|
162
162
|
docs: { 'overview.md': OVERVIEW_DOC('Modern Angular', 'Signals-first reactivity, RxJS used deliberately, standalone components, OnPush CD, lazy routes, typed forms, Nx-style boundaries.') },
|
|
@@ -292,6 +292,22 @@ export const ANGULAR_SECURITY = definePreset({
|
|
|
292
292
|
docs: { 'overview.md': OVERVIEW_DOC('Angular security', 'Avoid bypassSecurityTrust*. Sanitize user HTML. Validate route params.') },
|
|
293
293
|
},
|
|
294
294
|
});
|
|
295
|
+
export const ANGULAR_PLUGIN_PLATFORM = definePreset({
|
|
296
|
+
id: 'angular-plugin-platform',
|
|
297
|
+
title: 'Angular — plugin platform',
|
|
298
|
+
description: 'Plugin contracts, lifecycle, capability tokens, isolation.',
|
|
299
|
+
tags: ['angular', 'plugins'],
|
|
300
|
+
appliesTo: [WorkspaceProfile.HasAngular],
|
|
301
|
+
weight: 5,
|
|
302
|
+
includes: {
|
|
303
|
+
knowledge: [],
|
|
304
|
+
rules: [NG_PLUGIN_STABLE_CONTRACT, NG_PLUGIN_NO_DEEP_IMPORTS],
|
|
305
|
+
paths: [],
|
|
306
|
+
templates: [],
|
|
307
|
+
pipelines: [],
|
|
308
|
+
docs: { 'overview.md': OVERVIEW_DOC('Angular plugin platform', 'Plugin contracts are stable. No plugin-to-plugin deep imports. Lifecycle is deterministic.') },
|
|
309
|
+
},
|
|
310
|
+
});
|
|
295
311
|
export const ANGULAR_ENTERPRISE_APP = definePreset({
|
|
296
312
|
id: 'angular-enterprise-app',
|
|
297
313
|
title: 'Angular enterprise app',
|
|
@@ -312,6 +328,16 @@ export const ANGULAR_LIBRARY = definePreset({
|
|
|
312
328
|
composes: ['modern-angular', 'npm-package'],
|
|
313
329
|
includes: { knowledge: [], rules: [], paths: [], templates: [], pipelines: [], docs: {} },
|
|
314
330
|
});
|
|
331
|
+
export const ANGULAR_SMART_UI_PLATFORM = definePreset({
|
|
332
|
+
id: 'angular-smart-ui-platform',
|
|
333
|
+
title: 'Angular smart UI platform',
|
|
334
|
+
description: 'Smart/dumb component split, deliberate state ownership, large-app organisation.',
|
|
335
|
+
tags: ['angular', 'ui-platform'],
|
|
336
|
+
appliesTo: [WorkspaceProfile.HasAngular],
|
|
337
|
+
weight: 6,
|
|
338
|
+
composes: ['modern-angular'],
|
|
339
|
+
includes: { knowledge: [], rules: [], paths: [], templates: [], pipelines: [], docs: {} },
|
|
340
|
+
});
|
|
315
341
|
// ─── Testing presets ───────────────────────────────────────────────────────
|
|
316
342
|
export const VITEST_FOCUSED = definePreset({
|
|
317
343
|
id: 'vitest-focused',
|
|
@@ -378,7 +404,7 @@ export const NESTJS_SERVICE = definePreset({
|
|
|
378
404
|
appliesTo: [WorkspaceProfile.HasNestJS, WorkspaceProfile.IsBackend],
|
|
379
405
|
weight: 7,
|
|
380
406
|
composes: ['node-service'],
|
|
381
|
-
includes: { knowledge: [], rules: [TS_VALIDATE_BOUNDARY_INPUT], paths: [
|
|
407
|
+
includes: { knowledge: [], rules: [TS_VALIDATE_BOUNDARY_INPUT], paths: [], templates: [], pipelines: [], docs: { 'overview.md': OVERVIEW_DOC('NestJS service', 'Validate DTOs at controllers. Keep services thin. Use modules to enforce layers.') } },
|
|
382
408
|
});
|
|
383
409
|
export const EXPRESS_SERVICE = definePreset({
|
|
384
410
|
id: 'express-service',
|
|
@@ -400,7 +426,7 @@ export const FASTIFY_SERVICE = definePreset({
|
|
|
400
426
|
composes: ['node-service'],
|
|
401
427
|
includes: { knowledge: [], rules: [], paths: [], templates: [], pipelines: [], docs: { 'overview.md': OVERVIEW_DOC('Fastify service', 'Schema-validate routes. Encapsulate features as plugins. Keep startup ordering deterministic.') } },
|
|
402
428
|
});
|
|
403
|
-
export const
|
|
429
|
+
export const R26_PRESETS = Object.freeze([
|
|
404
430
|
GENERIC_SAFE_REPO,
|
|
405
431
|
AI_AGENT_SAFE_DEVELOPMENT,
|
|
406
432
|
ENTERPRISE_REVIEW_GATED,
|
|
@@ -416,8 +442,10 @@ export const MULTI_STACK_PRESETS = Object.freeze([
|
|
|
416
442
|
ANGULAR_TESTING,
|
|
417
443
|
ANGULAR_ACCESSIBILITY,
|
|
418
444
|
ANGULAR_SECURITY,
|
|
445
|
+
ANGULAR_PLUGIN_PLATFORM,
|
|
419
446
|
ANGULAR_ENTERPRISE_APP,
|
|
420
447
|
ANGULAR_LIBRARY,
|
|
448
|
+
ANGULAR_SMART_UI_PLATFORM,
|
|
421
449
|
VITEST_FOCUSED,
|
|
422
450
|
JEST_FOCUSED,
|
|
423
451
|
PLAYWRIGHT_FOCUSED,
|
|
@@ -34,4 +34,6 @@ export declare const NG_NO_GOD_SERVICES: string;
|
|
|
34
34
|
export declare const NG_DOMAIN_NO_UI_IMPORTS: string;
|
|
35
35
|
export declare const NG_ACCESSIBLE: string;
|
|
36
36
|
export declare const NG_AVOID_BYPASS_SECURITY: string;
|
|
37
|
+
export declare const NG_PLUGIN_STABLE_CONTRACT: string;
|
|
38
|
+
export declare const NG_PLUGIN_NO_DEEP_IMPORTS: string;
|
|
37
39
|
//# sourceMappingURL=r26-snippets.d.ts.map
|
|
@@ -1 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AgB,QAO3B,CAAC;AAEH,eAAO,MAAM,2BAA2B,QAOtC,CAAC;AAEH,eAAO,MAAM,yBAAyB,QAOpC,CAAC;AAEH,eAAO,MAAM,WAAW,QAOtB,CAAC;AAEH,eAAO,MAAM,gCAAgC,QAO3C,CAAC;AAEH,eAAO,MAAM,uBAAuB,QAOlC,CAAC;AAEH,eAAO,MAAM,cAAc,QAOzB,CAAC;AAEH,eAAO,MAAM,eAAe,QAO1B,CAAC;AAEH,eAAO,MAAM,sBAAsB,QAOjC,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAO7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAO7B,CAAC;AAEH,eAAO,MAAM,uBAAuB,QAOlC,CAAC;AAEH,eAAO,MAAM,aAAa,QAOxB,CAAC;AAEH,eAAO,MAAM,wBAAwB,QAOnC,CAAC;AAEH,eAAO,MAAM,yBAAyB,QAOpC,CAAC;AAEH,eAAO,MAAM,yBAAyB,QAOpC,CAAC"}
|
|
@@ -239,3 +239,19 @@ export const NG_AVOID_BYPASS_SECURITY = ruleSnippet({
|
|
|
239
239
|
appliesWhen: ['generate-code', 'review'],
|
|
240
240
|
content: '`DomSanitizer.bypassSecurityTrust*` opens an XSS hole. Only use it with reviewed, trusted inputs — sanitize otherwise.',
|
|
241
241
|
});
|
|
242
|
+
export const NG_PLUGIN_STABLE_CONTRACT = ruleSnippet({
|
|
243
|
+
id: 'angular.plugin.stable-contract',
|
|
244
|
+
title: 'Plugin contracts are stable',
|
|
245
|
+
priority: 'critical',
|
|
246
|
+
tags: ['angular', 'plugins'],
|
|
247
|
+
appliesWhen: ['generate-code', 'review'],
|
|
248
|
+
content: 'Plugin manifests, lifecycle hooks, and capability tokens are public API. Breaking changes require a migration note and a major-version bump.',
|
|
249
|
+
});
|
|
250
|
+
export const NG_PLUGIN_NO_DEEP_IMPORTS = ruleSnippet({
|
|
251
|
+
id: 'angular.plugin.no-deep-imports',
|
|
252
|
+
title: 'Plugins cannot deep-import each other',
|
|
253
|
+
priority: 'critical',
|
|
254
|
+
tags: ['angular', 'plugins', 'boundaries'],
|
|
255
|
+
appliesWhen: ['generate-code', 'review'],
|
|
256
|
+
content: 'Plugin-to-plugin communication must use the documented event/token contract. Direct imports between plugin packages are forbidden.',
|
|
257
|
+
});
|
|
@@ -3,5 +3,5 @@ export declare const NEXT_APP_PRESET: IPreset;
|
|
|
3
3
|
export declare const TURBOREPO_PRESET: IPreset;
|
|
4
4
|
export declare const PACKAGE_WORKSPACE_PRESET: IPreset;
|
|
5
5
|
export declare const CLEAN_ARCHITECTURE_TS_PRESET: IPreset;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const R45_PRESETS: readonly IPreset[];
|
|
7
7
|
//# sourceMappingURL=r45-presets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"r45-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/r45-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"r45-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/r45-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAwBlD,eAAO,MAAM,eAAe,EAAE,OA+C5B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,OA+C7B,CAAC;AAEH,eAAO,MAAM,wBAAwB,EAAE,OAuCrC,CAAC;AAEH,eAAO,MAAM,4BAA4B,EAAE,OAoDzC,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,SAAS,OAAO,EAKxC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkspaceProfile } from '@shrkcrft/workspace';
|
|
2
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,
|
|
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
4
|
// Universal adoption — fills four Phase-1 preset gaps:
|
|
5
5
|
// next-app, turborepo, package-workspace, clean-architecture-ts.
|
|
6
6
|
// Each preset is generic — no project-specific anchors, no per-stack jargon
|
|
@@ -52,7 +52,7 @@ export const NEXT_APP_PRESET = definePreset({
|
|
|
52
52
|
export const TURBOREPO_PRESET = definePreset({
|
|
53
53
|
id: 'turborepo',
|
|
54
54
|
title: 'Turborepo monorepo',
|
|
55
|
-
description: 'Conventions for Turborepo workspaces: public entry points, no relative cross-package imports, run via the affected task graph.',
|
|
55
|
+
description: 'Conventions for Turborepo workspaces: package layer order, public entry points, no relative cross-package imports, run via the affected task graph.',
|
|
56
56
|
tags: ['turborepo', 'monorepo'],
|
|
57
57
|
appliesTo: [WorkspaceProfile.HasTurborepo, WorkspaceProfile.IsMonorepo],
|
|
58
58
|
weight: 8,
|
|
@@ -80,7 +80,7 @@ export const TURBOREPO_PRESET = definePreset({
|
|
|
80
80
|
})`,
|
|
81
81
|
],
|
|
82
82
|
rules: [COMMON_SAFETY_RULE, COMMON_RULE_INTERFACE_PREFIX, COMMON_RULE_ONE_EXPORT],
|
|
83
|
-
paths: [
|
|
83
|
+
paths: [COMMON_PATH_SERVICES, COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
84
84
|
templates: [COMMON_TEMPLATE_SERVICE, COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
85
85
|
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST],
|
|
86
86
|
docs: {
|
|
@@ -116,7 +116,7 @@ export const PACKAGE_WORKSPACE_PRESET = definePreset({
|
|
|
116
116
|
})`,
|
|
117
117
|
],
|
|
118
118
|
rules: [COMMON_SAFETY_RULE, COMMON_RULE_INTERFACE_PREFIX, COMMON_RULE_ONE_EXPORT],
|
|
119
|
-
paths: [
|
|
119
|
+
paths: [COMMON_PATH_SERVICES, COMMON_PATH_UTILS, COMMON_PATH_TESTS],
|
|
120
120
|
templates: [COMMON_TEMPLATE_SERVICE, COMMON_TEMPLATE_UTILITY, COMMON_TEMPLATE_TEST],
|
|
121
121
|
pipelines: [COMMON_PIPELINE_CONTEXT_ONLY, COMMON_PIPELINE_FEATURE_DEV, COMMON_PIPELINE_UNIT_TEST],
|
|
122
122
|
docs: {
|
|
@@ -178,7 +178,7 @@ export const CLEAN_ARCHITECTURE_TS_PRESET = definePreset({
|
|
|
178
178
|
'shrk task "<task>"',
|
|
179
179
|
],
|
|
180
180
|
});
|
|
181
|
-
export const
|
|
181
|
+
export const R45_PRESETS = Object.freeze([
|
|
182
182
|
NEXT_APP_PRESET,
|
|
183
183
|
TURBOREPO_PRESET,
|
|
184
184
|
PACKAGE_WORKSPACE_PRESET,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IPreset } from '../model/preset.js';
|
|
2
2
|
export declare const NEST_SERVICE_PRESET: IPreset;
|
|
3
3
|
export declare const ANGULAR_APP_PRESET: IPreset;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const R47_PRESETS: readonly IPreset[];
|
|
5
5
|
//# sourceMappingURL=r47-presets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"r47-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/r47-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"r47-presets.d.ts","sourceRoot":"","sources":["../../src/builtin/r47-presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAclD,eAAO,MAAM,mBAAmB,EAAE,OA2BhC,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAE,OA2B/B,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,SAAS,OAAO,EAGxC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkspaceProfile } from '@shrkcrft/workspace';
|
|
2
2
|
import { definePreset } from "../define/define-preset.js";
|
|
3
|
-
import {
|
|
3
|
+
import { COMMON_AGENT_BRIEFING, COMMON_SAFETY_RULE, OVERVIEW_DOC } from "./shared-snippets.js";
|
|
4
4
|
// Universal adoption (top 5) — canonical-id aliases.
|
|
5
5
|
//
|
|
6
6
|
// Why: canonical preset ids are `nest-service` and `angular-app`. The
|
|
@@ -22,7 +22,7 @@ export const NEST_SERVICE_PRESET = definePreset({
|
|
|
22
22
|
includes: {
|
|
23
23
|
knowledge: [COMMON_AGENT_BRIEFING],
|
|
24
24
|
rules: [COMMON_SAFETY_RULE],
|
|
25
|
-
paths: [
|
|
25
|
+
paths: [],
|
|
26
26
|
templates: [],
|
|
27
27
|
pipelines: [],
|
|
28
28
|
docs: {
|
|
@@ -46,7 +46,7 @@ export const ANGULAR_APP_PRESET = definePreset({
|
|
|
46
46
|
includes: {
|
|
47
47
|
knowledge: [COMMON_AGENT_BRIEFING],
|
|
48
48
|
rules: [COMMON_SAFETY_RULE],
|
|
49
|
-
paths: [
|
|
49
|
+
paths: [],
|
|
50
50
|
templates: [],
|
|
51
51
|
pipelines: [],
|
|
52
52
|
docs: {
|
|
@@ -59,7 +59,7 @@ export const ANGULAR_APP_PRESET = definePreset({
|
|
|
59
59
|
'shrk task "<task>"',
|
|
60
60
|
],
|
|
61
61
|
});
|
|
62
|
-
export const
|
|
62
|
+
export const R47_PRESETS = Object.freeze([
|
|
63
63
|
NEST_SERVICE_PRESET,
|
|
64
64
|
ANGULAR_APP_PRESET,
|
|
65
65
|
]);
|
|
@@ -7,31 +7,9 @@ export declare const COMMON_TEMPLATE_SERVICE = "defineTemplate({\n id: 'types
|
|
|
7
7
|
export declare const COMMON_TEMPLATE_UTILITY = "defineTemplate({\n id: 'typescript.utility',\n name: 'typescript-utility',\n description: 'A pure utility module (one exported function per file).',\n tags: ['typescript', 'utility'],\n scope: ['app'],\n appliesWhen: ['generate-utility'],\n variables: [\n {\n name: 'functionName',\n required: true,\n description: 'camelCase function name (e.g. formatDate).',\n pattern: /^[a-z][A-Za-z0-9]+$/,\n },\n ],\n targetPath: (v) => `src/utils/${v.functionName}.ts`,\n content: (v) => `export function ${v.functionName}(): void {\\n // TODO\\n}\\n`,\n })";
|
|
8
8
|
export declare const COMMON_TEMPLATE_TEST = "defineTemplate({\n id: 'typescript.unit-test',\n name: 'typescript-unit-test',\n description: 'A bun:test unit-test skeleton for an existing module.',\n tags: ['typescript', 'testing'],\n scope: ['app'],\n appliesWhen: ['generate-test'],\n variables: [\n {\n name: 'subject',\n required: true,\n description: 'Subject name (used in describe + filename).',\n pattern: /^[A-Za-z][A-Za-z0-9]+$/,\n },\n ],\n targetPath: (v) => `tests/${v.subject}.spec.ts`,\n content: (v) =>\n `import { describe, expect, test } from 'bun:test';\\n\\ndescribe('${v.subject}', () => {\\n test('placeholder', () => {\\n expect(true).toBe(true);\\n });\\n});\\n`,\n })";
|
|
9
9
|
export declare const TEMPLATE_HELPERS = "function kebab(s: string): string {\n return s\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/[^A-Za-z0-9]+/g, '-')\n .toLowerCase();\n}";
|
|
10
|
-
export declare const COMMON_PATH_SERVICES = "defineKnowledgeEntry({\n id: 'paths.services',\n title: 'Services live in src/services/',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'services'],\n scope: ['app'],\n appliesWhen: ['generate-service'],\n content: 'Service classes live in src/services/. One service per file.',\n
|
|
11
|
-
export declare const COMMON_PATH_UTILS = "defineKnowledgeEntry({\n id: 'paths.utils',\n title: 'Utilities live in src/utils/',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'utils'],\n appliesWhen: ['generate-utility'],\n content: 'Pure helpers live in src/utils/. One function per file.',\n
|
|
12
|
-
export declare const COMMON_PATH_TESTS = "defineKnowledgeEntry({\n id: 'paths.tests',\n title: 'Tests live in tests/',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'tests'],\n appliesWhen: ['generate-test'],\n content: 'Unit tests live under tests/, mirroring src/. Use *.spec.ts.',\n
|
|
13
|
-
export declare const NX_PATH_LIBS = "defineKnowledgeEntry({\n id: 'paths.nx.libs',\n title: 'Nx libs root',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'nx', 'libs'],\n scope: ['nx', 'monorepo'],\n appliesWhen: ['generate-service', 'generate-utility', 'create-feature'],\n content: 'Shared library code lives under libs/<area>/src/lib/. Each lib has a public index.ts; cross-lib imports go through the package name, never relative paths into src/.',\n metadata: { path: 'libs' },\n })";
|
|
14
|
-
export declare const NX_PATH_APPS = "defineKnowledgeEntry({\n id: 'paths.nx.apps',\n title: 'Nx apps root',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'nx', 'apps'],\n scope: ['nx', 'monorepo'],\n appliesWhen: ['create-feature', 'create-app'],\n content: 'Applications live under apps/<app>/. Frontends use apps/<app>/src/app/; backends use apps/<app>/src/. Keep app-specific code here and shared code in libs/.',\n metadata: { path: 'apps' },\n })";
|
|
15
|
-
export declare const WORKSPACE_PATH_PACKAGES = "defineKnowledgeEntry({\n id: 'paths.workspace.packages',\n title: 'Workspace packages root',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'workspaces', 'monorepo'],\n scope: ['monorepo', 'turborepo', 'workspaces'],\n appliesWhen: ['generate-code', 'create-feature'],\n content: 'Shared packages live under packages/<name>/. Each package exposes a stable public entry (package.json main/exports); cross-package imports go through the package name, never relative paths into src/.',\n metadata: { path: 'packages' },\n })";
|
|
16
|
-
export declare const WORKSPACE_PATH_APPS = "defineKnowledgeEntry({\n id: 'paths.workspace.apps',\n title: 'Workspace apps root',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'workspaces', 'monorepo'],\n scope: ['monorepo', 'turborepo', 'workspaces'],\n appliesWhen: ['create-feature', 'create-app'],\n content: 'Applications live under apps/<app>/. Each app has its own src/ root and depends on shared packages by name.',\n metadata: { path: 'apps' },\n })";
|
|
17
|
-
export declare const ANGULAR_PATH_APP = "defineKnowledgeEntry({\n id: 'paths.angular.app',\n title: 'Angular app root',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Critical,\n tags: ['paths', 'angular', 'app'],\n scope: ['angular'],\n appliesWhen: ['create-feature', 'generate-code'],\n content: 'Angular workspace source lives under src/app/. Components, services, pipes and modules sit under here. Tests are co-located as *.spec.ts beside the unit under test.',\n metadata: { path: 'src/app' },\n })";
|
|
18
|
-
export declare const ANGULAR_PATH_COMPONENTS = "defineKnowledgeEntry({\n id: 'paths.angular.components',\n title: 'Angular components',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'angular', 'components'],\n scope: ['angular'],\n appliesWhen: ['generate-component'],\n content: 'Components live under src/app/components/ or src/app/<feature>/. Use the .component.ts suffix. Pair each component with a co-located *.spec.ts test.',\n metadata: { path: 'src/app/components' },\n })";
|
|
19
|
-
export declare const ANGULAR_PATH_SERVICES = "defineKnowledgeEntry({\n id: 'paths.angular.services',\n title: 'Angular services',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'angular', 'services'],\n scope: ['angular'],\n appliesWhen: ['generate-service'],\n content: 'Injectable services live under src/app/services/ (or alongside their feature folder). Use the .service.ts suffix. Provide via providedIn root unless feature-scoped.',\n metadata: { path: 'src/app/services' },\n })";
|
|
20
|
-
export declare const REACT_PATH_COMPONENTS = "defineKnowledgeEntry({\n id: 'paths.react.components',\n title: 'React components',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'react', 'components'],\n scope: ['react'],\n appliesWhen: ['generate-component'],\n content: 'Components live under src/components/ (cross-feature shared) or under their feature folder. Keep each component in its own file; pair with a co-located *.test.tsx beside it.',\n metadata: { path: 'src/components' },\n })";
|
|
21
|
-
export declare const REACT_PATH_HOOKS = "defineKnowledgeEntry({\n id: 'paths.react.hooks',\n title: 'React custom hooks',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'react', 'hooks'],\n scope: ['react'],\n appliesWhen: ['generate-hook'],\n content: 'Custom hooks live under src/hooks/ (cross-feature) or under their feature folder. File and exported function are both named useX. Co-locate the test as useX.test.ts beside the hook.',\n metadata: { path: 'src/hooks' },\n })";
|
|
22
|
-
export declare const REACT_PATH_PAGES = "defineKnowledgeEntry({\n id: 'paths.react.pages',\n title: 'React route / page components',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'react', 'pages', 'routing'],\n scope: ['react'],\n appliesWhen: ['create-feature', 'add-route'],\n content: 'Top-level route components live under src/pages/ (React Router / TanStack Router convention) or under src/routes/. For Next.js app router, see src/app/<segment>/page.tsx instead \u2014 adjust this entry if your project uses that layout.',\n metadata: { path: 'src/pages' },\n })";
|
|
23
|
-
export declare const REACT_PATH_LIB = "defineKnowledgeEntry({\n id: 'paths.react.lib',\n title: 'React app utilities + clients',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'react', 'lib'],\n scope: ['react'],\n appliesWhen: ['generate-utility', 'generate-code'],\n content: 'Framework-agnostic helpers (formatters, validators, API clients) live under src/lib/. Keep them pure \u2014 no React imports unless the helper is a hook (in which case it belongs under src/hooks/).',\n metadata: { path: 'src/lib' },\n })";
|
|
24
|
-
export declare const NEST_PATH_SRC = "defineKnowledgeEntry({\n id: 'paths.nest.src',\n title: 'Nest module roots',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Critical,\n tags: ['paths', 'nest', 'modules'],\n scope: ['nestjs'],\n appliesWhen: ['create-feature', 'generate-service', 'generate-code'],\n content: 'Nest source lives under src/. Each feature gets a folder src/<feature>/ containing controller, service, module, and DTOs (one construct per file). Controllers stay thin; business logic lives in services.',\n metadata: { path: 'src' },\n })";
|
|
25
|
-
export declare const NEST_PATH_E2E = "defineKnowledgeEntry({\n id: 'paths.nest.e2e',\n title: 'Nest e2e tests',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'nest', 'testing'],\n scope: ['nestjs'],\n appliesWhen: ['generate-test'],\n content: 'End-to-end tests live under test/ (Nest convention, not tests/). Unit tests can be co-located as *.spec.ts next to the unit.',\n metadata: { path: 'test' },\n })";
|
|
26
|
-
export declare const JAVA_MAVEN_PATH_MAIN = "defineKnowledgeEntry({\n id: 'paths.java.maven.main',\n title: 'Java Maven main source',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Critical,\n tags: ['paths', 'java', 'maven'],\n scope: ['java', 'maven'],\n appliesWhen: ['generate-code'],\n content: 'Main Java source lives under src/main/java/<package>/. Resources under src/main/resources/. Mirror tests under src/test/java/.',\n metadata: { path: 'src/main/java' },\n })";
|
|
27
|
-
export declare const JAVA_MAVEN_PATH_TESTS = "defineKnowledgeEntry({\n id: 'paths.java.maven.tests',\n title: 'Java Maven tests',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'java', 'maven', 'tests'],\n scope: ['java', 'maven'],\n appliesWhen: ['generate-test'],\n content: 'JUnit / Spring tests live under src/test/java/. Run via mvn test.',\n metadata: { path: 'src/test/java' },\n })";
|
|
28
|
-
export declare const PYTHON_PATH_SRC = "defineKnowledgeEntry({\n id: 'paths.python.src',\n title: 'Python source root',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Critical,\n tags: ['paths', 'python'],\n scope: ['python'],\n appliesWhen: ['generate-code'],\n content: 'Source lives under src/<package>/ (PEP 517 src layout) or directly under <package>/ at the repo root. Pick one and stay consistent.',\n metadata: { path: 'src' },\n })";
|
|
29
|
-
export declare const PYTHON_PATH_TESTS = "defineKnowledgeEntry({\n id: 'paths.python.tests',\n title: 'Python tests',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'python', 'tests'],\n scope: ['python'],\n appliesWhen: ['generate-test'],\n content: 'Pytest tests live under tests/. Each test_*.py mirrors a module under src/.',\n metadata: { path: 'tests' },\n })";
|
|
30
|
-
export declare const GO_PATH_CMD = "defineKnowledgeEntry({\n id: 'paths.go.cmd',\n title: 'Go entry points',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'go'],\n scope: ['go'],\n appliesWhen: ['create-app'],\n content: 'Binary entry points live under cmd/<name>/main.go. Shared library code under pkg/ (public) or internal/ (module-private).',\n metadata: { path: 'cmd' },\n })";
|
|
31
|
-
export declare const GO_PATH_PKG = "defineKnowledgeEntry({\n id: 'paths.go.pkg',\n title: 'Go shared packages',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'go'],\n scope: ['go'],\n appliesWhen: ['generate-code'],\n content: 'Public packages live under pkg/<name>/. Tests are co-located as <name>_test.go. Run via go test ./...',\n metadata: { path: 'pkg' },\n })";
|
|
32
|
-
export declare const GO_PATH_INTERNAL = "defineKnowledgeEntry({\n id: 'paths.go.internal',\n title: 'Go internal packages',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'go'],\n scope: ['go'],\n appliesWhen: ['generate-code'],\n content: 'Module-private packages live under internal/<name>/. The Go compiler enforces that only the parent module can import these.',\n metadata: { path: 'internal' },\n })";
|
|
33
|
-
export declare const RUST_PATH_SRC = "defineKnowledgeEntry({\n id: 'paths.rust.src',\n title: 'Rust crate source',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Critical,\n tags: ['paths', 'rust'],\n scope: ['rust'],\n appliesWhen: ['generate-code'],\n content: 'Crate source lives under src/. The entry point is src/lib.rs (library) or src/main.rs (binary). Modules nest as src/<mod>/mod.rs or src/<mod>.rs.',\n metadata: { path: 'src' },\n })";
|
|
34
|
-
export declare const RUST_PATH_TESTS = "defineKnowledgeEntry({\n id: 'paths.rust.tests',\n title: 'Rust integration tests',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'rust', 'tests'],\n scope: ['rust'],\n appliesWhen: ['generate-test'],\n content: 'Integration tests live under tests/<name>.rs. Unit tests live inline with #[cfg(test)] modules inside src/. Run via cargo test.',\n metadata: { path: 'tests' },\n })";
|
|
10
|
+
export declare const COMMON_PATH_SERVICES = "defineKnowledgeEntry({\n id: 'paths.services',\n title: 'Services live in src/services/',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.High,\n tags: ['paths', 'services'],\n scope: ['app'],\n appliesWhen: ['generate-service'],\n content: 'Service classes live in src/services/. One service per file.',\n })";
|
|
11
|
+
export declare const COMMON_PATH_UTILS = "defineKnowledgeEntry({\n id: 'paths.utils',\n title: 'Utilities live in src/utils/',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'utils'],\n appliesWhen: ['generate-utility'],\n content: 'Pure helpers live in src/utils/. One function per file.',\n })";
|
|
12
|
+
export declare const COMMON_PATH_TESTS = "defineKnowledgeEntry({\n id: 'paths.tests',\n title: 'Tests live in tests/',\n type: KnowledgeType.Path,\n priority: KnowledgePriority.Medium,\n tags: ['paths', 'tests'],\n appliesWhen: ['generate-test'],\n content: 'Unit tests live under tests/, mirroring src/. Use *.spec.ts.',\n })";
|
|
35
13
|
export declare const COMMON_RULE_INTERFACE_PREFIX = "defineKnowledgeEntry({\n id: 'typescript.interfaces.i-prefix',\n title: 'Prefix interfaces with I',\n type: KnowledgeType.Rule,\n priority: KnowledgePriority.High,\n tags: ['typescript', 'naming'],\n appliesWhen: ['generate-code', 'refactor'],\n content: 'Interfaces use an I-prefix (IUser, IConfig). Enums are preferred over unions for closed sets.',\n })";
|
|
36
14
|
export declare const COMMON_RULE_ONE_EXPORT = "defineKnowledgeEntry({\n id: 'typescript.files.one-export',\n title: 'One exported construct per file',\n type: KnowledgeType.Rule,\n priority: KnowledgePriority.High,\n tags: ['typescript', 'structure'],\n appliesWhen: ['generate-code'],\n content: 'Each TypeScript file exports exactly one top-level construct. Helpers live in their own file.',\n })";
|
|
37
15
|
export declare const COMMON_RULE_NO_LOGIC_CONSTRUCTORS = "defineKnowledgeEntry({\n id: 'typescript.constructors.no-logic',\n title: 'No business logic in constructors',\n type: KnowledgeType.Rule,\n priority: KnowledgePriority.High,\n tags: ['typescript'],\n appliesWhen: ['generate-code'],\n content: 'Constructors wire dependencies only. Initialization belongs in init().',\n })";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-snippets.d.ts","sourceRoot":"","sources":["../../src/builtin/shared-snippets.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,m9BAuB7B,CAAC;AAEN,eAAO,MAAM,kBAAkB,45BAoB1B,CAAC;AAEN,eAAO,MAAM,2BAA2B,s9CA6CnC,CAAC;AAEN,eAAO,MAAM,4BAA4B,s5BA6BpC,CAAC;AAEN,eAAO,MAAM,yBAAyB,yVAajC,CAAC;AAEN,eAAO,MAAM,uBAAuB,mtBAkB/B,CAAC;AAEN,eAAO,MAAM,u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