@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
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 - 2026-07-08
4
+
5
+ - Initial React-focused release of node-boost.
6
+ - Added stack detection for Next.js and Vite React projects.
7
+ - Added generated `.ai/guidelines/**` and `.ai/skills/**` resources for React, Next, Vite, React Router, Tailwind CSS, TypeScript, zod, React Query, Zustand, Vitest, and Playwright.
8
+ - Added 13 architecture guidance patterns and feature-modules boundary variants.
9
+ - Added CLI commands: `install`, `update`, `doctor`, `audit`, `guard`, `explain`, and `mcp`.
10
+ - Added MCP tools: `application_info`, `list_routes`, `doctor`, `audit`, and `explain_finding`.
11
+ - Added 14 audit rules (`NB-ARCH-001` through `NB-ARCH-014`) with suppression and machine-readable reports.
12
+ - Added Claude Code, Codex, and Cursor agent integration, including optional guard hooks.
13
+ - Added GitHub Actions CI for package checks.
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 node-boost contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,196 @@
1
+ # node-boost
2
+
3
+ node-boost is Boost for the Node ecosystem: a CLI and MCP guidance layer that installs project-specific AI instructions, agent skills, audit rules, and guard hooks. v0.1 targets React apps, with first-class support for Next.js and Vite React projects.
4
+
5
+ No telemetry. node-boost reads your local project, writes local files, and does not phone home.
6
+
7
+ ## Quick Start
8
+
9
+ ```sh
10
+ npm i -D @node-boost/node-boost
11
+ npx node-boost install
12
+ ```
13
+
14
+ The npm package is published as `@node-boost/node-boost`; the installed CLI binary is `node-boost`.
15
+
16
+ The installer detects your stack, writes `node-boost.json`, composes `.ai/guidelines/**` and `.ai/skills/**`, and configures selected agents:
17
+
18
+ - Claude Code: `CLAUDE.md`, `.claude/skills/**`, `.mcp.json`, optional `.claude/settings.json` hooks.
19
+ - Codex: `AGENTS.md`, `.agents/skills/**`, `.codex/config.toml`, optional `.codex/hooks.json`.
20
+ - Cursor: `.cursor/rules/node-boost.mdc`, `.cursor/mcp.json`, optional `.cursor/hooks.json`.
21
+
22
+ ## CLI
23
+
24
+ | Command | Purpose |
25
+ | --- | --- |
26
+ | `node-boost install` | Generate guidelines, skills, config, MCP, and optional hook files. |
27
+ | `node-boost update` | Regenerate from `node-boost.json` without prompts. |
28
+ | `node-boost doctor` | Check config, generated resources, agent files, hooks, overrides, and TS strictness. |
29
+ | `node-boost audit` | Scan source files against enabled architecture rules. |
30
+ | `node-boost guard` | Run `audit --changed --agent` as a hard CI/agent gate. |
31
+ | `node-boost explain NB-ARCH-005` | Explain a finding and link it back to the generated guideline. |
32
+ | `node-boost mcp` | Start the MCP server over stdio. |
33
+
34
+ Machine-readable commands use `--agent`:
35
+
36
+ ```sh
37
+ npx node-boost audit --all --agent
38
+ npx node-boost doctor --agent
39
+ ```
40
+
41
+ ## MCP Tools
42
+
43
+ | Tool | Purpose |
44
+ | --- | --- |
45
+ | `application_info` | Return detected stack, package manager, packages, routes, and node-boost config summary. |
46
+ | `list_routes` | List Next app routes, including route handlers and parallel slots. |
47
+ | `doctor` | Run the same full checks as `node-boost doctor`. |
48
+ | `audit` | Run `node-boost audit --all` and return JSON. |
49
+ | `explain_finding` | Explain a rule such as `NB-ARCH-005`. |
50
+
51
+ ## Architecture Patterns
52
+
53
+ | Pattern | What it protects |
54
+ | --- | --- |
55
+ | `feature-modules` | Feature boundaries. Variant `public-api` allows imports through `index.ts`; variant `forbid` blocks all cross-feature imports. |
56
+ | `server-first-components` | Next app entries stay server-first; client code moves into child boundaries. |
57
+ | `data-access-layer` | Components call data functions or query hooks instead of raw network clients. |
58
+ | `typed-contracts` | Env and JSON boundaries are centralized and validated. |
59
+ | `state-management` | Client stores hold UI state, not fetched server state. |
60
+ | `custom-hooks` | Hooks are extracted only for real reuse, readability, or testability. |
61
+ | `component-composition` | UI composition stays explicit and testable. |
62
+ | `styling-tailwind` | Tailwind version-specific conventions stay current. |
63
+ | `testing-strategy` | Tests target user-visible behavior and high-risk boundaries. |
64
+ | `error-loading-boundaries` | Async Next segments have loading/error boundaries. |
65
+ | `secure-by-default` | Public env names and HTML injection are checked. |
66
+ | `modern-typescript` | Strict TS and no explicit `any` in source. |
67
+ | `ui-states` | Loading, empty, error, disabled, and optimistic states are represented deliberately. |
68
+
69
+ ## Audit And Guard
70
+
71
+ `audit` reads enabled architectures from `node-boost.json`.
72
+
73
+ ```sh
74
+ npx node-boost audit --all
75
+ npx node-boost audit --changed --agent
76
+ npx node-boost audit --base origin/main --agent
77
+ ```
78
+
79
+ Suppress a finding only with a reason:
80
+
81
+ ```ts
82
+ // nb-disable NB-ARCH-005 -- legacy SDK must be wrapped in a follow-up
83
+ ```
84
+
85
+ Suppression without `-- reason` is reported as `NB-META-001`.
86
+
87
+ ## Hooks
88
+
89
+ When `features.hooks` is enabled, node-boost wires `guard --hook <agent>` into each selected agent:
90
+
91
+ - Claude Code: `Stop` hook in `.claude/settings.json`.
92
+ - Codex: `Stop` hook in `.codex/hooks.json`.
93
+ - Cursor: `stop` hook in `.cursor/hooks.json`.
94
+
95
+ The hook audits changed files. Error findings block or continue the agent in that agent's native protocol. Disable hooks by setting:
96
+
97
+ ```json
98
+ {
99
+ "features": {
100
+ "hooks": false
101
+ }
102
+ }
103
+ ```
104
+
105
+ Then run:
106
+
107
+ ```sh
108
+ npx node-boost update
109
+ ```
110
+
111
+ ## Configuration
112
+
113
+ `node-boost.json` is the source of truth:
114
+
115
+ ```json
116
+ {
117
+ "version": 1,
118
+ "generatedWith": "0.1.0",
119
+ "stack": "next",
120
+ "agents": ["claude-code", "codex", "cursor"],
121
+ "features": {
122
+ "guidelines": true,
123
+ "skills": true,
124
+ "mcp": true,
125
+ "architecture": true,
126
+ "hooks": false
127
+ },
128
+ "architectures": [
129
+ { "name": "feature-modules", "boundary": "public-api" },
130
+ "server-first-components",
131
+ "data-access-layer"
132
+ ],
133
+ "audit": {
134
+ "exclude": [],
135
+ "rules": {
136
+ "NB-ARCH-007": "off",
137
+ "NB-ARCH-002": "warn"
138
+ },
139
+ "ruleOptions": {
140
+ "NB-ARCH-005": {
141
+ "dataLayerGlobs": ["**/api/**", "src/orval/**"]
142
+ }
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ Project overrides live under `.node-boost/**` and shadow built-in resources during `install` and `update`.
149
+
150
+ ## CI
151
+
152
+ Example pull request guard:
153
+
154
+ ```yaml
155
+ name: Node Boost Guard
156
+
157
+ on:
158
+ pull_request:
159
+ push:
160
+ branches: [main]
161
+
162
+ jobs:
163
+ check:
164
+ runs-on: ubuntu-latest
165
+ steps:
166
+ - uses: actions/checkout@v7.0.0
167
+ with:
168
+ fetch-depth: 0
169
+ - uses: actions/setup-node@v6.4.0
170
+ with:
171
+ node-version: 20
172
+ cache: npm
173
+ - run: npm ci
174
+ - run: npm run check
175
+ - run: npx node-boost guard --base origin/main
176
+ ```
177
+
178
+ This repository also ships a package CI workflow in `.github/workflows/ci.yml`.
179
+
180
+ ## Git Ignore
181
+
182
+ Keep implementation planning local unless your team wants to publish it:
183
+
184
+ ```gitignore
185
+ implementation-plans/
186
+ ```
187
+
188
+ Generated `.ai/**`, agent files, and `node-boost.json` are intended to be committed in consumer projects.
189
+
190
+ ## Roadmap
191
+
192
+ - third-party package guidelines beyond the current React stack,
193
+ - Angular,
194
+ - Vue,
195
+ - React Native,
196
+ - additional architecture patterns from the v1 backlog.