@node-boost/node-boost 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +196 -0
  4. package/dist/cli.js +3000 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/index.d.ts +380 -0
  7. package/dist/index.js +2708 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +82 -0
  10. package/resources/react/architectures/component-composition/guideline.md +42 -0
  11. package/resources/react/architectures/component-composition/skill/SKILL.md +19 -0
  12. package/resources/react/architectures/custom-hooks/guideline.md +38 -0
  13. package/resources/react/architectures/custom-hooks/skill/SKILL.md +22 -0
  14. package/resources/react/architectures/data-access-layer/guideline.md +43 -0
  15. package/resources/react/architectures/data-access-layer/skill/SKILL.md +26 -0
  16. package/resources/react/architectures/error-loading-boundaries/guideline.md +36 -0
  17. package/resources/react/architectures/error-loading-boundaries/skill/SKILL.md +18 -0
  18. package/resources/react/architectures/feature-modules/guideline.md +34 -0
  19. package/resources/react/architectures/feature-modules/skill/SKILL.md +28 -0
  20. package/resources/react/architectures/feature-modules/variants/forbid.md +36 -0
  21. package/resources/react/architectures/feature-modules/variants/public-api.md +37 -0
  22. package/resources/react/architectures/modern-typescript/guideline.md +47 -0
  23. package/resources/react/architectures/modern-typescript/skill/SKILL.md +23 -0
  24. package/resources/react/architectures/secure-by-default/guideline.md +38 -0
  25. package/resources/react/architectures/secure-by-default/skill/SKILL.md +22 -0
  26. package/resources/react/architectures/server-first-components/guideline.md +34 -0
  27. package/resources/react/architectures/server-first-components/skill/SKILL.md +23 -0
  28. package/resources/react/architectures/state-management/guideline.md +34 -0
  29. package/resources/react/architectures/state-management/skill/SKILL.md +21 -0
  30. package/resources/react/architectures/styling-tailwind/guideline.md +33 -0
  31. package/resources/react/architectures/styling-tailwind/skill/SKILL.md +18 -0
  32. package/resources/react/architectures/testing-strategy/guideline.md +33 -0
  33. package/resources/react/architectures/testing-strategy/skill/SKILL.md +19 -0
  34. package/resources/react/architectures/typed-contracts/guideline.md +31 -0
  35. package/resources/react/architectures/typed-contracts/skill/SKILL.md +23 -0
  36. package/resources/react/architectures/ui-states/guideline.md +45 -0
  37. package/resources/react/architectures/ui-states/skill/SKILL.md +19 -0
  38. package/resources/react/guidelines/core.md +15 -0
  39. package/resources/react/guidelines/next/15.md +9 -0
  40. package/resources/react/guidelines/next/16.md +18 -0
  41. package/resources/react/guidelines/next/core.md +8 -0
  42. package/resources/react/guidelines/react/18.md +8 -0
  43. package/resources/react/guidelines/react/19.md +10 -0
  44. package/resources/react/guidelines/react/core.md +9 -0
  45. package/resources/react/guidelines/react-query/core.md +8 -0
  46. package/resources/react/guidelines/react-router/7.md +9 -0
  47. package/resources/react/guidelines/react-router/core.md +7 -0
  48. package/resources/react/guidelines/tailwindcss/3.md +8 -0
  49. package/resources/react/guidelines/tailwindcss/4.md +9 -0
  50. package/resources/react/guidelines/tailwindcss/core.md +8 -0
  51. package/resources/react/guidelines/testing/playwright.md +8 -0
  52. package/resources/react/guidelines/testing/vitest.md +8 -0
  53. package/resources/react/guidelines/typescript/core.md +7 -0
  54. package/resources/react/guidelines/vite/core.md +8 -0
  55. package/resources/react/guidelines/zod/3.md +8 -0
  56. package/resources/react/guidelines/zod/4.md +10 -0
  57. package/resources/react/guidelines/zod/core.md +7 -0
  58. package/resources/react/guidelines/zustand/core.md +8 -0
  59. package/resources/react/skills/next-development/SKILL.md +19 -0
  60. package/resources/react/skills/react-development/SKILL.md +18 -0
  61. package/resources/react/skills/spa-routing/SKILL.md +18 -0
  62. package/resources/react/skills/tailwindcss-development/SKILL.md +17 -0
  63. package/resources/react/skills/testing-frontend/SKILL.md +18 -0
  64. package/schema.json +216 -0
@@ -0,0 +1,380 @@
1
+ import { z } from 'zod';
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+
4
+ declare const architectureSlugSchema: z.ZodEnum<{
5
+ "feature-modules": "feature-modules";
6
+ "server-first-components": "server-first-components";
7
+ "data-access-layer": "data-access-layer";
8
+ "typed-contracts": "typed-contracts";
9
+ "state-management": "state-management";
10
+ "custom-hooks": "custom-hooks";
11
+ "component-composition": "component-composition";
12
+ "styling-tailwind": "styling-tailwind";
13
+ "testing-strategy": "testing-strategy";
14
+ "error-loading-boundaries": "error-loading-boundaries";
15
+ "secure-by-default": "secure-by-default";
16
+ "modern-typescript": "modern-typescript";
17
+ "ui-states": "ui-states";
18
+ }>;
19
+ declare const featureModulesBoundarySchema: z.ZodEnum<{
20
+ "public-api": "public-api";
21
+ forbid: "forbid";
22
+ }>;
23
+ declare const architectureEntrySchema: z.ZodUnion<readonly [z.ZodEnum<{
24
+ "feature-modules": "feature-modules";
25
+ "server-first-components": "server-first-components";
26
+ "data-access-layer": "data-access-layer";
27
+ "typed-contracts": "typed-contracts";
28
+ "state-management": "state-management";
29
+ "custom-hooks": "custom-hooks";
30
+ "component-composition": "component-composition";
31
+ "styling-tailwind": "styling-tailwind";
32
+ "testing-strategy": "testing-strategy";
33
+ "error-loading-boundaries": "error-loading-boundaries";
34
+ "secure-by-default": "secure-by-default";
35
+ "modern-typescript": "modern-typescript";
36
+ "ui-states": "ui-states";
37
+ }>, z.ZodObject<{
38
+ name: z.ZodLiteral<"feature-modules">;
39
+ boundary: z.ZodDefault<z.ZodEnum<{
40
+ "public-api": "public-api";
41
+ forbid: "forbid";
42
+ }>>;
43
+ }, z.core.$strict>, z.ZodObject<{
44
+ name: z.ZodEnum<{
45
+ "server-first-components": "server-first-components";
46
+ "data-access-layer": "data-access-layer";
47
+ "typed-contracts": "typed-contracts";
48
+ "state-management": "state-management";
49
+ "custom-hooks": "custom-hooks";
50
+ "component-composition": "component-composition";
51
+ "styling-tailwind": "styling-tailwind";
52
+ "testing-strategy": "testing-strategy";
53
+ "error-loading-boundaries": "error-loading-boundaries";
54
+ "secure-by-default": "secure-by-default";
55
+ "modern-typescript": "modern-typescript";
56
+ "ui-states": "ui-states";
57
+ }>;
58
+ }, z.core.$strict>]>;
59
+ declare const nodeBoostConfigSchema: z.ZodObject<{
60
+ $schema: z.ZodOptional<z.ZodString>;
61
+ version: z.ZodLiteral<1>;
62
+ generatedWith: z.ZodString;
63
+ stack: z.ZodEnum<{
64
+ next: "next";
65
+ "vite-react": "vite-react";
66
+ "react-generic": "react-generic";
67
+ unknown: "unknown";
68
+ }>;
69
+ agents: z.ZodDefault<z.ZodArray<z.ZodEnum<{
70
+ "claude-code": "claude-code";
71
+ codex: "codex";
72
+ cursor: "cursor";
73
+ }>>>;
74
+ features: z.ZodDefault<z.ZodObject<{
75
+ guidelines: z.ZodDefault<z.ZodBoolean>;
76
+ skills: z.ZodDefault<z.ZodBoolean>;
77
+ mcp: z.ZodDefault<z.ZodBoolean>;
78
+ architecture: z.ZodDefault<z.ZodBoolean>;
79
+ hooks: z.ZodDefault<z.ZodBoolean>;
80
+ }, z.core.$strip>>;
81
+ architectures: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
82
+ "feature-modules": "feature-modules";
83
+ "server-first-components": "server-first-components";
84
+ "data-access-layer": "data-access-layer";
85
+ "typed-contracts": "typed-contracts";
86
+ "state-management": "state-management";
87
+ "custom-hooks": "custom-hooks";
88
+ "component-composition": "component-composition";
89
+ "styling-tailwind": "styling-tailwind";
90
+ "testing-strategy": "testing-strategy";
91
+ "error-loading-boundaries": "error-loading-boundaries";
92
+ "secure-by-default": "secure-by-default";
93
+ "modern-typescript": "modern-typescript";
94
+ "ui-states": "ui-states";
95
+ }>, z.ZodObject<{
96
+ name: z.ZodLiteral<"feature-modules">;
97
+ boundary: z.ZodDefault<z.ZodEnum<{
98
+ "public-api": "public-api";
99
+ forbid: "forbid";
100
+ }>>;
101
+ }, z.core.$strict>, z.ZodObject<{
102
+ name: z.ZodEnum<{
103
+ "server-first-components": "server-first-components";
104
+ "data-access-layer": "data-access-layer";
105
+ "typed-contracts": "typed-contracts";
106
+ "state-management": "state-management";
107
+ "custom-hooks": "custom-hooks";
108
+ "component-composition": "component-composition";
109
+ "styling-tailwind": "styling-tailwind";
110
+ "testing-strategy": "testing-strategy";
111
+ "error-loading-boundaries": "error-loading-boundaries";
112
+ "secure-by-default": "secure-by-default";
113
+ "modern-typescript": "modern-typescript";
114
+ "ui-states": "ui-states";
115
+ }>;
116
+ }, z.core.$strict>]>>>;
117
+ audit: z.ZodDefault<z.ZodObject<{
118
+ exclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
119
+ rules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
120
+ off: "off";
121
+ warn: "warn";
122
+ err: "err";
123
+ }>>>;
124
+ ruleOptions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
125
+ }, z.core.$strip>>;
126
+ }, z.core.$strip>;
127
+ type NodeBoostConfig = z.infer<typeof nodeBoostConfigSchema>;
128
+ interface NormalizedArchitecture$1 {
129
+ name: z.infer<typeof architectureSlugSchema>;
130
+ options: Record<string, unknown>;
131
+ }
132
+ declare function parseNodeBoostConfig(input: unknown): NodeBoostConfig;
133
+ declare function normalizeArchitectures(config: Pick<NodeBoostConfig, "architectures">): NormalizedArchitecture$1[];
134
+
135
+ declare function createNodeBoostJsonSchema(): unknown;
136
+
137
+ type PackageManagerName = "npm" | "pnpm" | "yarn" | "bun";
138
+ interface PackageManagerInfo {
139
+ name: PackageManagerName;
140
+ lockfile: string | null;
141
+ version: string | null;
142
+ source: "lockfile" | "packageManagerField" | "default";
143
+ }
144
+ type StackName = "next" | "vite-react" | "react-generic" | "unknown";
145
+ type RouterKind = "app" | "pages" | "react-router" | "none" | "unknown";
146
+ type LintingKind = "biome" | "eslint-prettier" | "eslint" | "none";
147
+ interface PackageInfo {
148
+ name: string;
149
+ declaredRange: string | null;
150
+ version: string | null;
151
+ major: number | null;
152
+ source: "node_modules" | "range" | "missing";
153
+ }
154
+ interface DetectedStack {
155
+ rootDir: string;
156
+ name: StackName;
157
+ router: RouterKind;
158
+ srcDir: boolean;
159
+ linting: LintingKind;
160
+ packageManager: PackageManagerInfo;
161
+ packages: Record<string, PackageInfo>;
162
+ warnings: string[];
163
+ }
164
+ type AgentName = "claude-code" | "codex" | "cursor";
165
+ type FeatureName = "guidelines" | "skills" | "mcp" | "architecture" | "hooks";
166
+ type ArchitectureSlug = "feature-modules" | "server-first-components" | "data-access-layer" | "typed-contracts" | "state-management" | "custom-hooks" | "component-composition" | "styling-tailwind" | "testing-strategy" | "error-loading-boundaries" | "secure-by-default" | "modern-typescript" | "ui-states";
167
+ type FeatureModulesBoundary = "public-api" | "forbid";
168
+ type ArchitectureConfigEntry = ArchitectureSlug | {
169
+ name: "feature-modules";
170
+ boundary?: FeatureModulesBoundary;
171
+ } | {
172
+ name: Exclude<ArchitectureSlug, "feature-modules">;
173
+ };
174
+ interface NormalizedArchitecture {
175
+ name: ArchitectureSlug;
176
+ options: Record<string, unknown>;
177
+ }
178
+ interface StackAdapter {
179
+ name: StackName;
180
+ label: string;
181
+ supports(stack: DetectedStack): boolean;
182
+ recommendedArchitectures(stack: DetectedStack): ArchitectureSlug[];
183
+ applicableArchitectures(stack: DetectedStack): ArchitectureSlug[];
184
+ }
185
+ interface ResourceSelection {
186
+ kind: "guideline" | "skill";
187
+ sourcePath: string;
188
+ outputPath: string;
189
+ packageName?: string;
190
+ packageMajor?: number;
191
+ }
192
+ interface AgentCapabilities {
193
+ supportsGuidelines: boolean;
194
+ supportsSkills: boolean;
195
+ supportsMcp: boolean;
196
+ supportsHooks: boolean;
197
+ }
198
+ interface Agent {
199
+ name: AgentName;
200
+ capabilities: AgentCapabilities;
201
+ }
202
+
203
+ type AuditSeverity = "err" | "warn";
204
+ interface AuditFinding {
205
+ rule: string;
206
+ sev: AuditSeverity;
207
+ file: string;
208
+ line: number;
209
+ code: string;
210
+ ref?: string;
211
+ }
212
+ interface ExplainEntry {
213
+ rule: string;
214
+ code: string;
215
+ severity: AuditSeverity;
216
+ architecture: ArchitectureSlug;
217
+ description: string;
218
+ rationale: string;
219
+ fix: string;
220
+ guideline: string;
221
+ }
222
+ interface AuditResult {
223
+ v: 1;
224
+ ok: boolean;
225
+ cmd: "audit";
226
+ scope: "all" | "changed" | "base" | "paths";
227
+ err: number;
228
+ warn: number;
229
+ scanned: number;
230
+ skipped: number;
231
+ suppressed: number;
232
+ elapsedMs: number;
233
+ findings: AuditFinding[];
234
+ }
235
+
236
+ interface RunAuditOptions {
237
+ rootDir?: string;
238
+ mode?: "all" | "changed" | "base" | "paths";
239
+ base?: string;
240
+ paths?: string[];
241
+ }
242
+ declare function runAudit(options?: RunAuditOptions): Promise<AuditResult>;
243
+
244
+ declare function explainFinding(ruleId: string): ExplainEntry | null;
245
+
246
+ declare function renderAgentReport(result: AuditResult): string;
247
+
248
+ declare function renderHumanReport(result: AuditResult): string;
249
+
250
+ declare function detectStack(rootDir: string): Promise<DetectedStack>;
251
+ declare function extractVersionFromRange(range: string | null): string | null;
252
+ declare function parseMajor(version: string): number | null;
253
+
254
+ declare function detectPackageManager(rootDir: string): Promise<PackageManagerInfo>;
255
+
256
+ interface NextRouterDetection {
257
+ router: RouterKind;
258
+ srcDir: boolean;
259
+ }
260
+ declare function detectNextRouter(rootDir: string): Promise<NextRouterDetection>;
261
+
262
+ declare function composeGuidelines(rootDir: string, stack: DetectedStack, architectures?: NormalizedArchitecture[]): Promise<ResourceSelection[]>;
263
+
264
+ declare function composeSkills(rootDir: string, stack: DetectedStack, architectures?: NormalizedArchitecture[]): Promise<ResourceSelection[]>;
265
+
266
+ declare function renderGuidelinesIndex(stack: DetectedStack, architectures: NormalizedArchitecture[], guidelines: ResourceSelection[]): string;
267
+
268
+ declare function applyResourceOverrides(projectRoot: string, resources: ResourceSelection[]): Promise<ResourceSelection[]>;
269
+
270
+ interface FileOperation {
271
+ path: string;
272
+ content: string;
273
+ }
274
+
275
+ interface InstallOptions {
276
+ cwd?: string;
277
+ packageRoot?: string;
278
+ noInteraction?: boolean;
279
+ }
280
+ interface UpdateOptions {
281
+ cwd?: string;
282
+ packageRoot?: string;
283
+ }
284
+ interface FileOperationResult extends FileOperation {
285
+ status: "created" | "updated" | "skipped";
286
+ }
287
+ interface InstallResult {
288
+ projectRoot: string;
289
+ stack: DetectedStack;
290
+ config: NodeBoostConfig;
291
+ operations: FileOperationResult[];
292
+ }
293
+ declare function runInstall(options?: InstallOptions): Promise<InstallResult>;
294
+ declare function runUpdate(options?: UpdateOptions): Promise<InstallResult>;
295
+ declare function buildInstallOperations(input: {
296
+ packageRoot: string;
297
+ projectRoot: string;
298
+ stack: DetectedStack;
299
+ config: NodeBoostConfig;
300
+ }): Promise<FileOperation[]>;
301
+ declare function applyFileOperations(projectRoot: string, operations: FileOperation[]): Promise<FileOperationResult[]>;
302
+
303
+ interface NodeBoostMcpServerOptions {
304
+ rootDir?: string;
305
+ packageVersion?: string;
306
+ includeThrowingTestTool?: boolean;
307
+ }
308
+ declare function createNodeBoostMcpServer(options?: NodeBoostMcpServerOptions): McpServer;
309
+ declare function startNodeBoostMcpServer(options?: NodeBoostMcpServerOptions): Promise<void>;
310
+
311
+ interface ApplicationInfo {
312
+ node: string;
313
+ packageManager: string;
314
+ typescript: {
315
+ version: string | null;
316
+ strict: boolean | null;
317
+ };
318
+ stack: {
319
+ name: string;
320
+ version: string | null;
321
+ router: string;
322
+ srcDir: boolean;
323
+ };
324
+ linting: string;
325
+ packages: Record<string, string>;
326
+ boost: {
327
+ version: string;
328
+ generatedWith: string;
329
+ architectures: Array<{
330
+ name: string;
331
+ options: Record<string, unknown>;
332
+ }>;
333
+ } | null;
334
+ hint?: string;
335
+ }
336
+ declare function applicationInfoTool(rootDir: string, boostVersion: string): Promise<ApplicationInfo>;
337
+
338
+ declare function auditTool(rootDir: string): Promise<AuditResult>;
339
+
340
+ type DoctorCheckId = "config-present" | "config-valid" | "generated-with-drift" | "stack-detected" | "resources-fresh" | "agent-files-present" | "overrides-detected" | "hooks-wired" | "lint-strict";
341
+ interface DoctorCheck {
342
+ id: DoctorCheckId;
343
+ status: "pass" | "warn" | "fail";
344
+ message: string;
345
+ details?: string[];
346
+ }
347
+ interface DoctorResult {
348
+ ok: boolean;
349
+ checks: DoctorCheck[];
350
+ }
351
+ declare function doctorTool(rootDir: string, boostVersion: string): Promise<DoctorResult>;
352
+
353
+ declare function explainFindingTool(rule: string): {
354
+ ok: boolean;
355
+ error: string;
356
+ finding?: undefined;
357
+ } | {
358
+ ok: boolean;
359
+ finding: ExplainEntry;
360
+ error?: undefined;
361
+ };
362
+
363
+ type RouteType = "page" | "layout" | "route-handler" | "error" | "loading" | "not-found" | "middleware" | "api-route";
364
+ interface RouteEntry {
365
+ path: string;
366
+ type: RouteType;
367
+ file: string;
368
+ dynamic: string[];
369
+ slot?: string;
370
+ }
371
+ interface UnsupportedRoutes {
372
+ supported: false;
373
+ reason: string;
374
+ }
375
+ declare function listRoutesTool(rootDir: string): Promise<RouteEntry[] | UnsupportedRoutes>;
376
+
377
+ declare const stackAdapters: StackAdapter[];
378
+ declare function getStackAdapter(stack: DetectedStack): StackAdapter | null;
379
+
380
+ export { type Agent, type AgentCapabilities, type AgentName, type ArchitectureConfigEntry, type ArchitectureSlug, type AuditFinding, type AuditResult, type DetectedStack, type DoctorCheck, type DoctorResult, type FeatureModulesBoundary, type FeatureName, type LintingKind, type NormalizedArchitecture, type PackageInfo, type PackageManagerInfo, type PackageManagerName, type ResourceSelection, type RouterKind, type StackAdapter, type StackName, applicationInfoTool, applyFileOperations, applyResourceOverrides, architectureEntrySchema, auditTool, buildInstallOperations, composeGuidelines, composeSkills, createNodeBoostJsonSchema, createNodeBoostMcpServer, detectNextRouter, detectPackageManager, detectStack, doctorTool, explainFinding, explainFindingTool, extractVersionFromRange, featureModulesBoundarySchema, getStackAdapter, listRoutesTool, nodeBoostConfigSchema, normalizeArchitectures, parseMajor, parseNodeBoostConfig, renderAgentReport, renderGuidelinesIndex, renderHumanReport, runAudit, runInstall, runUpdate, stackAdapters, startNodeBoostMcpServer };