create-modoock-app 1.0.1 → 2.0.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 (75) hide show
  1. package/README.md +68 -237
  2. package/dist/cli.js +112 -43
  3. package/package.json +22 -22
  4. package/template/.cursor/hooks/gate-ui-pack.mjs +108 -0
  5. package/template/.cursor/hooks.json +18 -0
  6. package/template/.cursor/rules/honey.mdc +11 -3
  7. package/template/AGENTS.md +13 -12
  8. package/template/README.md +225 -175
  9. package/template/app/(local)/components/page.tsx +3 -3
  10. package/template/app/(local)/design-system/page.tsx +2 -2
  11. package/template/components/layout/app-layout.tsx +16 -5
  12. package/template/components/layout/header.tsx +19 -1
  13. package/template/components/layout/side-nav.tsx +103 -30
  14. package/template/postcss.config.mjs +7 -7
  15. package/template/public/identity/full_logo_black.svg +26 -26
  16. package/template/public/identity/full_logo_color.svg +37 -37
  17. package/template/public/identity/full_logo_white.svg +33 -33
  18. package/template/public/identity/logo_icon_black.svg +5 -5
  19. package/template/public/identity/logo_icon_color.svg +12 -12
  20. package/template/public/identity/logo_icon_white.svg +12 -12
  21. package/template/components/ui/action-stack.tsx +0 -42
  22. package/template/components/ui/badge.tsx +0 -43
  23. package/template/components/ui/button.tsx +0 -104
  24. package/template/components/ui/icon.tsx +0 -78
  25. package/template/components/ui/index.ts +0 -28
  26. package/template/components/ui/input.tsx +0 -376
  27. package/template/components/ui/loader.tsx +0 -78
  28. package/template/components/ui/metric-bar.tsx +0 -49
  29. package/template/components/ui/modal.tsx +0 -177
  30. package/template/components/ui/select.tsx +0 -458
  31. package/template/components/ui/stepper.tsx +0 -96
  32. package/template/components/ui/tab.tsx +0 -85
  33. package/template/components/ui/user-table.tsx +0 -806
  34. package/template/knowledge-base/design-system/components/action-stack.mdc +0 -17
  35. package/template/knowledge-base/design-system/components/badges.mdc +0 -16
  36. package/template/knowledge-base/design-system/components/buttons.mdc +0 -21
  37. package/template/knowledge-base/design-system/components/detail-header.mdc +0 -17
  38. package/template/knowledge-base/design-system/components/dropdowns.mdc +0 -12
  39. package/template/knowledge-base/design-system/components/info-list.mdc +0 -17
  40. package/template/knowledge-base/design-system/components/inputs.mdc +0 -23
  41. package/template/knowledge-base/design-system/components/menu.mdc +0 -20
  42. package/template/knowledge-base/design-system/components/modals.mdc +0 -24
  43. package/template/knowledge-base/design-system/components/selects.mdc +0 -39
  44. package/template/knowledge-base/design-system/components/stepper.mdc +0 -18
  45. package/template/knowledge-base/design-system/components/tables.mdc +0 -59
  46. package/template/knowledge-base/design-system/components/tabs.mdc +0 -17
  47. package/template/knowledge-base/design-system/components.mdc +0 -91
  48. package/template/knowledge-base/design-system/tokens.mdc +0 -24
  49. package/template/knowledge-base/examples/bad/README.md +0 -8
  50. package/template/knowledge-base/examples/good/README.md +0 -13
  51. package/template/knowledge-base/metadata/catalog.yaml +0 -245
  52. package/template/knowledge-base/patterns/components/reuse-existing.mdc +0 -26
  53. package/template/knowledge-base/patterns/data-fetching/local-data.mdc +0 -20
  54. package/template/knowledge-base/patterns/layouts/app-shell.mdc +0 -20
  55. package/template/knowledge-base/patterns/pages/data-table-page.mdc +0 -31
  56. package/template/knowledge-base/patterns/pages/workflow-page.mdc +0 -27
  57. package/template/knowledge-base/rules/accessibility/responsive.mdc +0 -31
  58. package/template/knowledge-base/rules/architecture/layout.mdc +0 -52
  59. package/template/knowledge-base/rules/architecture/single-screen.mdc +0 -62
  60. package/template/knowledge-base/rules/code-quality/jsx.mdc +0 -19
  61. package/template/knowledge-base/rules/global/naming.mdc +0 -12
  62. package/template/knowledge-base/rules/global/technology.mdc +0 -19
  63. package/template/knowledge-base/rules/global/ui-copy.mdc +0 -20
  64. package/template/knowledge-base/rules/performance/client.mdc +0 -20
  65. package/template/knowledge-base/rules/ui/information-density.mdc +0 -36
  66. package/template/knowledge-base/rules/ui/interaction.mdc +0 -47
  67. package/template/knowledge-base/rules/ui/simple-ui.mdc +0 -58
  68. package/template/knowledge-base/validation/accessibility.mdc +0 -13
  69. package/template/knowledge-base/validation/architecture.mdc +0 -10
  70. package/template/knowledge-base/validation/ast-grep/do-what-brooooooklyn-said.yml +0 -15
  71. package/template/knowledge-base/validation/ast-grep/no-nested-links.yml +0 -12
  72. package/template/knowledge-base/validation/ast-grep/rewrite-svg-attribute.yml +0 -19
  73. package/template/knowledge-base/validation/code-quality.mdc +0 -18
  74. package/template/knowledge-base/validation/performance.mdc +0 -11
  75. package/template/knowledge-base/validation/ui.mdc +0 -26
package/README.md CHANGED
@@ -1,237 +1,68 @@
1
- # create-modoock-app
2
-
3
- A production-ready project boilerplate designed to help you start new applications with a consistent architecture, reusable components, design system, and development guidelines.
4
-
5
- Create a complete project with a single command — the boilerplate and its dependencies are installed automatically.
6
-
7
- ## Getting Started
8
-
9
- Create a new project:
10
-
11
- ```bash
12
- npx create-modoock-app my-project
13
- ```
14
-
15
- Replace `my-project` with the name of your project.
16
-
17
- Once the installation is complete, move into your project:
18
-
19
- ```bash
20
- cd my-project
21
- ```
22
-
23
- Start the development server:
24
-
25
- ```bash
26
- npm run dev
27
- ```
28
-
29
- Your project is now ready for development.
30
-
31
- ## What's Included
32
-
33
- The boilerplate comes with a complete development foundation, including:
34
-
35
- ### UI Components
36
-
37
- A collection of reusable UI components designed to provide a consistent interface across the application.
38
-
39
- Includes components such as:
40
-
41
- - Buttons
42
- - Inputs
43
- - Badges
44
- - Modals
45
- - Selects
46
- - Tabs
47
- - Steppers
48
- - Loaders
49
- - Tables
50
- - Cards
51
- - Icons
52
- - Action stacks
53
- - Timeline lists
54
- - And more
55
-
56
- ### Layout System
57
-
58
- Pre-built layout components for creating consistent application interfaces.
59
-
60
- Includes:
61
-
62
- - Application layout
63
- - Header
64
- - Side navigation
65
- - Shared page structures
66
- - Responsive layout foundations
67
-
68
- ### Design System
69
-
70
- A dedicated design system containing:
71
-
72
- - Typography
73
- - Spacing
74
- - Colors
75
- - Border radius
76
- - Components
77
- - UI patterns
78
- - Design tokens
79
- - Usage guidelines
80
-
81
- ### Development Rules
82
-
83
- The boilerplate includes predefined development rules to help maintain consistent code and UI quality.
84
-
85
- These cover areas such as:
86
-
87
- - Architecture
88
- - Naming conventions
89
- - Accessibility
90
- - Responsive design
91
- - Performance
92
- - Code quality
93
- - UI consistency
94
- - Component reuse
95
- - Interaction patterns
96
-
97
- ### AI Development Support
98
-
99
- The project includes configuration and documentation for AI-assisted development.
100
-
101
- This includes:
102
-
103
- - Cursor rules
104
- - AI agents
105
- - Development guidelines
106
- - Component documentation
107
- - Project knowledge base
108
- - Reusable implementation patterns
109
-
110
- The goal is to make AI-assisted development follow the same architecture and design standards as the project.
111
-
112
- ## Project Structure
113
-
114
- After running the CLI, your project will contain the complete boilerplate structure:
115
-
116
- ```text
117
- my-project/
118
- ├── app/
119
- ├── components/
120
- │ ├── layout/
121
- │ ├── shared/
122
- │ └── ui/
123
- ├── hooks/
124
- ├── knowledge-base/
125
- ├── lib/
126
- ├── providers/
127
- ├── public/
128
- ├── types/
129
- ├── utils/
130
- ├── .cursor/
131
- ├── AGENTS.md
132
- ├── CLAUDE.md
133
- ├── eslint.config.mjs
134
- ├── next.config.ts
135
- ├── package.json
136
- ├── postcss.config.mjs
137
- ├── tsconfig.json
138
- └── ...
139
- ```
140
-
141
- ## Technologies
142
-
143
- The boilerplate is built with:
144
-
145
- - **Next.js**
146
- - **React**
147
- - **TypeScript**
148
- - **Tailwind CSS**
149
- - **Lucide React**
150
- - **ESLint**
151
-
152
- ## Automatic Installation
153
-
154
- You don't need to manually install the boilerplate dependencies.
155
-
156
- Running:
157
-
158
- ```bash
159
- npx create-modoock-app my-project
160
- ```
161
-
162
- will create the project and install its dependencies automatically.
163
-
164
- After that, simply run:
165
-
166
- ```bash
167
- cd my-project
168
- npm run dev
169
- ```
170
-
171
- ## Project Name
172
-
173
- The project name is provided directly when running the CLI:
174
-
175
- ```bash
176
- npx create-modoock-app my-project
177
- ```
178
-
179
- The generated `package.json` will automatically use:
180
-
181
- ```json
182
- {
183
- "name": "my-project"
184
- }
185
- ```
186
-
187
- You can therefore use any valid npm project name.
188
-
189
- ## Available Scripts
190
-
191
- Inside your generated project, you can use:
192
-
193
- ```bash
194
- npm run dev
195
- ```
196
-
197
- Starts the development server.
198
-
199
- ```bash
200
- npm run build
201
- ```
202
-
203
- Creates a production build.
204
-
205
- ```bash
206
- npm run start
207
- ```
208
-
209
- Starts the production server.
210
-
211
- ```bash
212
- npm run lint
213
- ```
214
-
215
- Runs ESLint.
216
-
217
- ```bash
218
- npm run typecheck
219
- ```
220
-
221
- Checks TypeScript types without generating files.
222
-
223
- ## Updating create-modoock-app
224
-
225
- The boilerplate is continuously maintained and updated with improvements, bug fixes, new components, and new development rules.
226
-
227
- To use the latest published version when creating a new project:
228
-
229
- ```bash
230
- npx create-modoock-app@latest my-project
231
- ```
232
-
233
- Existing projects are independent after creation, so updates to the boilerplate do not automatically modify previously generated projects.
234
-
235
- ## License
236
-
237
- MIT
1
+ # create-modoock-app
2
+
3
+ Official Modooock project starter and boilerplate generator.
4
+
5
+ ## Usage
6
+
7
+ Create a new Modooock project:
8
+
9
+ ```bash
10
+ npx create-modoock-app my-project
11
+ ```
12
+
13
+ Then:
14
+
15
+ ```bash
16
+ cd my-project
17
+ npm run dev
18
+ ```
19
+
20
+ ## What It Includes
21
+
22
+ The generator creates a ready-to-develop Modooock project containing:
23
+
24
+ - Modooock project foundation
25
+ - Modooock UI components as local source files
26
+ - Modooock Knowledge Base as an npm dependency
27
+ - Required project dependencies and configuration
28
+
29
+ ## Component Architecture
30
+
31
+ Modooock UI components are copied into the generated project:
32
+
33
+ ```text
34
+ components/
35
+ └── ui/
36
+ ```
37
+
38
+ The generated project owns these source files and can modify them directly.
39
+
40
+ The `@modoock/components` package is used as the upstream source during project creation and is not installed as a dependency in the generated project.
41
+
42
+ ## Knowledge Base
43
+
44
+ The Modooock Knowledge Base is installed as an npm dependency:
45
+
46
+ ```text
47
+ node_modules/
48
+ └── @modoock/
49
+ └── knowledge-base/
50
+ ```
51
+
52
+ ## Development
53
+
54
+ Build the generator:
55
+
56
+ ```bash
57
+ npm run build
58
+ ```
59
+
60
+ The compiled CLI is generated in:
61
+
62
+ ```text
63
+ dist/
64
+ ```
65
+
66
+ ## License
67
+
68
+ MIT
package/dist/cli.js CHANGED
@@ -4,49 +4,118 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const child_process_1 = require("child_process");
10
- const projectName = process.argv[2];
11
- if (!projectName) {
12
- console.error("Usage: npx create-modoock-app <project-name>");
13
- process.exit(1);
14
- }
15
- const templatePath = path_1.default.resolve(__dirname, "../template");
16
- const projectPath = path_1.default.resolve(process.cwd(), projectName);
17
- if (fs_1.default.existsSync(projectPath)) {
18
- console.error(`Error: "${projectName}" already exists.`);
19
- process.exit(1);
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const node_child_process_1 = require("node:child_process");
10
+ const COMPONENTS_PACKAGE = "@modoock/components";
11
+ const COMPONENTS_VERSION = "1.0.0";
12
+ function copyDirectory(source, destination) {
13
+ node_fs_1.default.mkdirSync(destination, { recursive: true });
14
+ for (const entry of node_fs_1.default.readdirSync(source, { withFileTypes: true })) {
15
+ const sourcePath = node_path_1.default.join(source, entry.name);
16
+ const destinationPath = node_path_1.default.join(destination, entry.name);
17
+ if (entry.isDirectory()) {
18
+ copyDirectory(sourcePath, destinationPath);
19
+ }
20
+ else {
21
+ node_fs_1.default.copyFileSync(sourcePath, destinationPath);
22
+ }
23
+ }
20
24
  }
21
- console.log(`\nCreating ${projectName}...`);
22
- // Copy template
23
- fs_1.default.cpSync(templatePath, projectPath, {
24
- recursive: true,
25
- });
26
- // Update package.json
27
- const packageJsonPath = path_1.default.join(projectPath, "package.json");
28
- if (fs_1.default.existsSync(packageJsonPath)) {
29
- const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, "utf-8"));
30
- packageJson.name = projectName;
31
- fs_1.default.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + "\n");
25
+ function getComponentsSource(packageRoot) {
26
+ const temporaryDirectory = node_path_1.default.join(packageRoot, ".modoock-components-temp");
27
+ node_fs_1.default.rmSync(temporaryDirectory, {
28
+ recursive: true,
29
+ force: true,
30
+ });
31
+ node_fs_1.default.mkdirSync(temporaryDirectory, {
32
+ recursive: true,
33
+ });
34
+ console.log(`Getting ${COMPONENTS_PACKAGE}@${COMPONENTS_VERSION}...`);
35
+ (0, node_child_process_1.execSync)(`npm pack ${COMPONENTS_PACKAGE}@${COMPONENTS_VERSION} --pack-destination "${temporaryDirectory}"`, {
36
+ cwd: packageRoot,
37
+ stdio: "inherit",
38
+ });
39
+ const tarball = node_fs_1.default
40
+ .readdirSync(temporaryDirectory)
41
+ .find((file) => file.endsWith(".tgz"));
42
+ if (!tarball) {
43
+ throw new Error("Could not find the components package archive.");
44
+ }
45
+ const extractDirectory = node_path_1.default.join(temporaryDirectory, "package");
46
+ node_fs_1.default.mkdirSync(extractDirectory, {
47
+ recursive: true,
48
+ });
49
+ (0, node_child_process_1.execSync)(`tar -xzf "${node_path_1.default.join(temporaryDirectory, tarball)}" -C "${temporaryDirectory}"`, {
50
+ stdio: "inherit",
51
+ });
52
+ const uiSource = node_path_1.default.join(extractDirectory, "components", "ui");
53
+ if (!node_fs_1.default.existsSync(uiSource)) {
54
+ throw new Error(`Could not find components/ui in ${COMPONENTS_PACKAGE}@${COMPONENTS_VERSION}.`);
55
+ }
56
+ return uiSource;
32
57
  }
33
- // Update package-lock.json
34
- const packageLockPath = path_1.default.join(projectPath, "package-lock.json");
35
- if (fs_1.default.existsSync(packageLockPath)) {
36
- const packageLock = JSON.parse(fs_1.default.readFileSync(packageLockPath, "utf-8"));
37
- packageLock.name = projectName;
38
- if (packageLock.packages?.[""]) {
39
- packageLock.packages[""].name = projectName;
40
- }
41
- fs_1.default.writeFileSync(packageLockPath, JSON.stringify(packageLock, null, 2) + "\n");
58
+ function main() {
59
+ const projectName = process.argv[2];
60
+ if (!projectName) {
61
+ console.error("Usage: npx create-modoock-app <project-name>");
62
+ process.exit(1);
63
+ }
64
+ const targetDirectory = node_path_1.default.resolve(process.cwd(), projectName);
65
+ if (node_fs_1.default.existsSync(targetDirectory)) {
66
+ console.error(`Error: Directory "${projectName}" already exists.`);
67
+ process.exit(1);
68
+ }
69
+ const packageRoot = node_path_1.default.resolve(__dirname, "..");
70
+ const templateDirectory = node_path_1.default.join(packageRoot, "template");
71
+ console.log(`Creating Modooock project: ${node_path_1.default.basename(targetDirectory)}`);
72
+ // Copy the project foundation.
73
+ copyDirectory(templateDirectory, targetDirectory);
74
+ // Get the official UI source package.
75
+ let uiSource;
76
+ try {
77
+ uiSource = getComponentsSource(packageRoot);
78
+ const uiDestination = node_path_1.default.join(targetDirectory, "components", "ui");
79
+ // Copy UI components into the generated project.
80
+ copyDirectory(uiSource, uiDestination);
81
+ }
82
+ finally {
83
+ // Remove the temporary downloaded package.
84
+ node_fs_1.default.rmSync(node_path_1.default.join(packageRoot, ".modoock-components-temp"), {
85
+ recursive: true,
86
+ force: true,
87
+ });
88
+ }
89
+ // Update the generated project's package.json.
90
+ const projectPackageJsonPath = node_path_1.default.join(targetDirectory, "package.json");
91
+ const projectPackageJson = JSON.parse(node_fs_1.default.readFileSync(projectPackageJsonPath, "utf8"));
92
+ // Set the generated project's name.
93
+ projectPackageJson.name =
94
+ node_path_1.default.basename(targetDirectory);
95
+ // Install the Knowledge Base as an npm dependency.
96
+ projectPackageJson.dependencies = {
97
+ ...(projectPackageJson.dependencies ?? {}),
98
+ "@modoock/knowledge-base": "1.0.0",
99
+ };
100
+ // Components are copied into components/ui/,
101
+ // so they must not remain an npm dependency.
102
+ if (projectPackageJson.dependencies["@modoock/components"]) {
103
+ delete projectPackageJson.dependencies["@modoock/components"];
104
+ }
105
+ node_fs_1.default.writeFileSync(projectPackageJsonPath, JSON.stringify(projectPackageJson, null, 2) + "\n");
106
+ // Install generated project dependencies.
107
+ console.log("Installing dependencies...");
108
+ (0, node_child_process_1.execSync)("npm install", {
109
+ cwd: targetDirectory,
110
+ stdio: "inherit",
111
+ });
112
+ console.log("");
113
+ console.log("Done!");
114
+ console.log("");
115
+ console.log(`Project created at: ${targetDirectory}`);
116
+ console.log("");
117
+ console.log("Next steps:");
118
+ console.log(` cd ${projectName}`);
119
+ console.log(" npm run dev");
42
120
  }
43
- // Install dependencies
44
- console.log("\nInstalling dependencies...\n");
45
- (0, child_process_1.execSync)("npm ci", {
46
- cwd: projectPath,
47
- stdio: "inherit",
48
- });
49
- console.log(`\n✓ ${projectName} created successfully!`);
50
- console.log(`\nNext steps:`);
51
- console.log(` cd ${projectName}`);
52
- console.log(` npm run dev\n`);
121
+ main();
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
- {
2
- "name": "create-modoock-app",
3
- "version": "1.0.1",
4
- "description": "Project starter and boilerplate generator",
5
- "main": "dist/cli.js",
6
- "bin": {
7
- "create-modoock-app": "dist/cli.js"
8
- },
9
- "files": [
10
- "dist",
11
- "template",
12
- "README.md"
13
- ],
14
- "scripts": {
15
- "build": "tsc"
16
- },
17
- "devDependencies": {
18
- "@types/node": "^24.0.0",
19
- "typescript": "^5.0.0"
20
- },
21
- "license": "MIT"
22
- }
1
+ {
2
+ "name": "create-modoock-app",
3
+ "version": "2.0.0",
4
+ "description": "Official Modoock project starter and boilerplate generator.",
5
+ "main": "dist/cli.js",
6
+ "bin": {
7
+ "create-modoock-app": "dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "template",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc"
16
+ },
17
+ "devDependencies": {
18
+ "@types/node": "^20",
19
+ "typescript": "^5"
20
+ },
21
+ "license": "MIT"
22
+ }
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env node
2
+ import fs from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
5
+
6
+ const CATALOG = "knowledge-base/metadata/catalog.yaml";
7
+ const allow = { permission: "allow" };
8
+ const emit = (o) => process.stdout.write(JSON.stringify(o));
9
+
10
+ try {
11
+ const raw = process.stdin.isTTY ? "{}" : fs.readFileSync(0, "utf8");
12
+ const p = JSON.parse(raw.trim() || "{}");
13
+ const event = String(p.hook_event_name || "").toLowerCase();
14
+ const root = p.workspace_roots?.[0] || process.cwd();
15
+ const cid = p.conversation_id || p.session_id;
16
+ const stampFile = cid
17
+ ? path.join(
18
+ os.tmpdir(),
19
+ "modoock-ui-pack",
20
+ `${String(cid).replace(/[^a-zA-Z0-9._-]/g, "_")}.json`,
21
+ )
22
+ : "";
23
+
24
+ const rel = (file) => {
25
+ if (!file) return "";
26
+ const r = path.relative(root, path.resolve(root, String(file)));
27
+ if (!r || r.startsWith("..") || path.isAbsolute(r)) return "";
28
+ return r.split(path.sep).join("/");
29
+ };
30
+
31
+ let input = p.tool_input;
32
+ if (typeof input === "string") {
33
+ try {
34
+ input = JSON.parse(input);
35
+ } catch {
36
+ input = {};
37
+ }
38
+ }
39
+ if (!input || typeof input !== "object") input = {};
40
+ const fileRel = rel(input.path || input.file_path || input.filePath);
41
+
42
+ const loadStamp = () => {
43
+ try {
44
+ return new Set(JSON.parse(fs.readFileSync(stampFile, "utf8")).read);
45
+ } catch {
46
+ return new Set();
47
+ }
48
+ };
49
+
50
+ if (event === "precompact") {
51
+ if (stampFile) fs.rmSync(stampFile, { force: true });
52
+ emit({});
53
+ } else if (event === "posttooluse") {
54
+ if (fileRel && input.limit == null && !(input.offset > 1) && stampFile) {
55
+ const s = loadStamp();
56
+ s.add(fileRel);
57
+ fs.mkdirSync(path.dirname(stampFile), { recursive: true });
58
+ fs.writeFileSync(stampFile, JSON.stringify({ read: [...s] }));
59
+ fs.appendFileSync(
60
+ stampFile.replace(/\.json$/, ".jsonl"),
61
+ `${JSON.stringify({ t: new Date().toISOString(), cid, path: fileRel })}\n`,
62
+ );
63
+ }
64
+ emit({});
65
+ } else {
66
+ const ui =
67
+ fileRel === "app" ||
68
+ fileRel === "components" ||
69
+ fileRel.startsWith("app/") ||
70
+ fileRel.startsWith("components/");
71
+ if (!fileRel || !ui || !cid) {
72
+ emit(allow);
73
+ } else {
74
+ const need = [];
75
+ const cat = path.join(root, CATALOG);
76
+ if (fs.existsSync(cat)) {
77
+ need.push(CATALOG);
78
+ let cur;
79
+ for (const line of fs.readFileSync(cat, "utf8").split(/\r?\n/)) {
80
+ const t = line.trim();
81
+ if (!t || t.startsWith("#")) continue;
82
+ const m = t.match(/^(?:-\s+)?path:\s+(.+)$/);
83
+ if (m) cur = m[1].trim().replace(/^['"]|['"]$/g, "");
84
+ else if (/^load:\s*ui\s*$/.test(t) && cur && fs.existsSync(path.join(root, cur)))
85
+ need.push(cur);
86
+ }
87
+ }
88
+ const dir = path.join(root, "components");
89
+ if (fs.existsSync(dir)) {
90
+ for (const d of fs.readdirSync(dir, { withFileTypes: true })) {
91
+ const ip = `components/${d.name}/index.ts`;
92
+ if (d.isDirectory() && fs.existsSync(path.join(root, ip))) need.push(ip);
93
+ }
94
+ }
95
+ const missing = [...new Set(need)].filter((x) => !loadStamp().has(x));
96
+ emit(
97
+ missing.length
98
+ ? {
99
+ permission: "deny",
100
+ agent_message: `Read then retry:\n${missing.map((x) => `- ${x}`).join("\n")}`,
101
+ }
102
+ : allow,
103
+ );
104
+ }
105
+ }
106
+ } catch {
107
+ emit(allow);
108
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "preToolUse": [
5
+ {
6
+ "command": "node .cursor/hooks/gate-ui-pack.mjs",
7
+ "matcher": "Write|StrReplace|Delete|Edit"
8
+ }
9
+ ],
10
+ "postToolUse": [
11
+ {
12
+ "command": "node .cursor/hooks/gate-ui-pack.mjs",
13
+ "matcher": "Read"
14
+ }
15
+ ],
16
+ "preCompact": [{ "command": "node .cursor/hooks/gate-ui-pack.mjs" }]
17
+ }
18
+ }
@@ -39,6 +39,10 @@ naming the main edge case (e.g. "raises `KeyError` on a missing key — use `.ge
39
39
  a tradeoff, a correctness argument, or a learner who needs the explanation. Keep
40
40
  Lever 1, ease Lever 2. Brevity that forces a follow-up round-trip costs more than it saved.
41
41
 
42
+ **Do not invent to stay terse.** An unspecified part, an unclear idea, or a choice
43
+ the prompt did not make is a question (AGENTS.md), not a Honey default. "Implement"
44
+ is not license to fill gaps.
45
+
42
46
  ## Lever 1 — minimum code that needs to exist
43
47
 
44
48
  Understand the problem *before* you climb — read the task and the code it touches,
@@ -60,8 +64,8 @@ Then walk the ladder; stop at the first rung that works:
60
64
  7. **Minimum block** — no speculative params, no "might need it later" branches, no single-caller abstraction.
61
65
 
62
66
  A Design System primitive (generic UI a second page would copy) is not a
63
- single-caller abstraction. Ask per AGENTS.md human validation; if yes, put it
64
- in `components/`. Keeping it page-local to skip the question is waste, not Honey.
67
+ single-caller abstraction. Ask per AGENTS.md; if yes, put it in `components/`.
68
+ Keeping it page-local to skip the question is waste, not Honey.
65
69
 
66
70
  Prefer editing what exists over adding; a new function/file/class/layer must earn
67
71
  its place. Speculative generality is the costliest agent habit — code for imagined
@@ -98,6 +102,8 @@ Never simplify away:
98
102
  trims *structure* (no dead markup, no unused framework), never how it looks.
99
103
  - **Anything the user explicitly asked for.**
100
104
  - **The ask for a Design System primitive** — do not skip it to write less code.
105
+ - **Unspecified parts, unclear ideas, choices, preferences** — do not generate
106
+ them to finish the ticket. Ask (AGENTS.md).
101
107
 
102
108
  Leave one runnable check (test/assert/invocation) behind for non-trivial logic.
103
109
  "Lazy" = no wasted code, not no proof it works.
@@ -108,7 +114,9 @@ Fewest words that stay clear. Cut the scaffolding:
108
114
 
109
115
  - **Drop wind-up/wind-down** — no "Great question!", no "hope this helps!", no
110
116
  restating the prompt, no announcing what you're about to do.
111
- - **Drop hedging** — "use X", not "you might possibly consider perhaps X". State real uncertainty once, briefly.
117
+ - **Drop hedging** — "use X", not "you might possibly consider perhaps X", when
118
+ X is already in the prompt or the repo. A choice the prompt did not make is
119
+ not hedging: ask (AGENTS.md) and wait. Do not pick a default to stay terse.
112
120
  - **Fragments and lists** over paragraphs when they carry the same info faster.
113
121
  - **Don't narrate readable code** — explain the *why* and the non-obvious, skip the *what*.
114
122
  - **Answer first**; context only if load-bearing.