create-claude-workspace 1.1.72 → 1.1.74

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.
@@ -112,6 +112,7 @@ What this task covers and what it does NOT cover.
112
112
 
113
113
  ### FILES
114
114
  List of all files to create/modify, with full paths.
115
+ **Feature-first library organization (STRICT):** Every distinct feature/domain MUST have its own library group (`libs/[feature]/domain/`, `libs/[feature]/business/`, `libs/[feature]/infrastructure/`, etc.). NEVER put multiple features' types/logic into a single shared library (e.g. `shared/types` with `scan.ts`, `streak.ts`, `achievement.ts` is WRONG — each gets `libs/scan/domain/`, `libs/streak/domain/`, `libs/achievement/domain/`). `libs/shared/` is ONLY for truly cross-domain code (generic utilities, DI infrastructure).
115
116
  **For new libraries**: specify the `nx generate` command (e.g., `nx g @nx/js:library --directory=libs/auth/domain --no-interactive`).
116
117
  - **Internal monorepo libs** (consumed only within the workspace): omit `--bundler` — they don't need a build step. TypeScript path aliases handle resolution.
117
118
  - **Publishable libs** (npm packages): use `--bundler=tsc` (or `--bundler=esbuild`/`--bundler=rollup` if needed) + `--publishable --importPath=@scope/name`. The generator creates the build target.
@@ -115,6 +115,7 @@ What this task covers and what it does NOT cover.
115
115
 
116
116
  ### FILES
117
117
  List of all files to create/modify, with full paths.
118
+ **Feature-first library organization (STRICT):** Every distinct feature/domain MUST have its own library group (`libs/[feature]/domain/`, `libs/[feature]/ui/`, `libs/[feature]/feature/`, `libs/[feature]/data-access/`, etc.). NEVER put multiple features' types/components into a single shared library (e.g. `shared/types` with `scan.ts`, `streak.ts` is WRONG — each gets `libs/scan/domain/`, `libs/streak/domain/`). `libs/shared/ui/` is ONLY for truly generic UI primitives (buttons, modals, layout) used across multiple features.
118
119
  **For new libraries/components**: specify the generator command from the frontend profile (e.g., `nx g @nx/angular:library ...` or `nx g @nx/react:component ...`). Test runner, linter, and style defaults are configured in `nx.json` — do not repeat them. The orchestrator will run these commands before writing code.
119
120
  **NEVER manually configure build tools** (tsup, esbuild, rollup, webpack, vite for build). Do NOT create config files for these — Nx generators handle build configuration. Internal monorepo libs don't need a build step; publishable libs get `--bundler` from the generator.
120
121
 
@@ -264,22 +264,55 @@ npx themecraft generate # generates type-safe SCSS from tokens.json
264
264
  4. `@themecraft/core/themes` → `variables()` mixin emits CSS custom properties at `:root`
265
265
  5. `@themecraft/angular` → `provideTheme()` for runtime switching, `provideThemeServer()` for SSR (no FOUC)
266
266
 
267
- **Component SCSS** — import generated variables, NEVER call `color-var()`/`size-var()` directly:
267
+ **Component SCSS** — import via package name, NEVER use relative paths, NEVER call `color-var()`/`size-var()` directly:
268
268
  ```scss
269
- @use 'generated/theme/colors' as colors;
270
- @use 'generated/theme/sizes' as sizes;
271
- @use 'generated/theme/typography' as typo;
272
- @use '@themecraft/core/theming' as theming;
269
+ // Import via package name (configured in tsconfig/package.json paths)
270
+ // SCSS @use automatically uses the last path segment as namespace — no `as` needed
271
+ @use 'theme/colors';
272
+ @use 'theme/sizes';
273
+ @use 'theme/typography';
274
+ @use '@themecraft/core/theming';
273
275
 
274
276
  .card {
275
277
  background: colors.$surface;
276
278
  color: colors.$on-surface;
277
279
  padding: sizes.$card-padding;
278
- @include typo.body-primary();
280
+ @include typography.body-primary();
279
281
  @include theming.theme-transition(); // smooth theme switch
280
282
  }
281
283
  ```
282
284
 
285
+ **SCSS import rules:**
286
+ - ALWAYS import via package/library name (e.g. `@use 'theme/colors'`)
287
+ - NEVER use relative paths (`../../theme/src/generated/...`) — they break on refactoring and are unreadable
288
+ - NEVER use redundant `as` aliases that match the last path segment (`@use 'theme/colors' as colors` → just `@use 'theme/colors'`). Only use `as` when you need a different name.
289
+
290
+ **Making theme resolvable by package name (priority order):**
291
+ 1. **Workspace dependency in package.json** (preferred) — add the theme library as a workspace dependency so SCSS resolves it from `node_modules`:
292
+ ```jsonc
293
+ // package.json (root or consuming app)
294
+ {
295
+ "dependencies": {
296
+ "@[prefix]/theme": "workspace:./libs/shared/ui/theme" // bun/pnpm
297
+ // or "file:./libs/shared/ui/theme" for npm
298
+ }
299
+ }
300
+ ```
301
+ Then `<PM> install` creates the link. SCSS `@use '@[prefix]/theme/colors'` resolves automatically.
302
+ 2. **`stylePreprocessorOptions.includePaths`** (fallback) — if workspace dependency is not feasible:
303
+ ```jsonc
304
+ // project.json or angular.json
305
+ {
306
+ "build": {
307
+ "options": {
308
+ "stylePreprocessorOptions": {
309
+ "includePaths": ["libs/shared/ui/theme/src"]
310
+ }
311
+ }
312
+ }
313
+ }
314
+ ```
315
+
283
316
  **How it works:** `npx themecraft generate` reads `tokens.json` and produces typed SCSS files (`generated/theme/colors.scss`, `sizes.scss`, `typography.scss`) that wrap `color-var()`/`size-var()` internally. Components consume these generated variables — never the raw accessor functions.
284
317
 
285
318
  **Token source (pick one):**
@@ -410,6 +443,7 @@ When reviewing Angular code, check:
410
443
  - Resource disposal (ImageBitmap.close(), stream.stop(), BroadcastChannel.close())
411
444
  - No memory leaks in effects or event listeners
412
445
  - Theme compliance: generated @themecraft SCSS variables — no hardcoded colors/sizes, no direct `color-var()`/`size-var()` calls
446
+ - SCSS imports: via package name (no relative paths), no redundant `as` aliases
413
447
  - Lazy loading via loadComponent/loadChildren, no eager page imports
414
448
  - @defer for heavy below-fold components
415
449
  - Naming: PascalCase components, lib- selectors, kebab-case files
@@ -167,22 +167,42 @@ npx themecraft generate # generates type-safe SCSS from tokens.json
167
167
  4. `@themecraft/core/themes` → `variables()` mixin emits CSS custom properties at `:root`
168
168
  5. `ThemeManager` (from `@themecraft/core/runtime`) — runtime theme switching, storage persistence, FOUC prevention
169
169
 
170
- **Component SCSS** (`.module.scss`) — import generated variables, NEVER call `color-var()`/`size-var()` directly:
170
+ **Component SCSS** (`.module.scss`) — import via package name, NEVER use relative paths, NEVER call `color-var()`/`size-var()` directly:
171
171
  ```scss
172
- @use 'generated/theme/colors' as colors;
173
- @use 'generated/theme/sizes' as sizes;
174
- @use 'generated/theme/typography' as typo;
175
- @use '@themecraft/core/theming' as theming;
172
+ // Import via package name — SCSS @use uses last path segment as namespace automatically
173
+ @use 'theme/colors';
174
+ @use 'theme/sizes';
175
+ @use 'theme/typography';
176
+ @use '@themecraft/core/theming';
176
177
 
177
178
  .card {
178
179
  background: colors.$surface;
179
180
  color: colors.$on-surface;
180
181
  padding: sizes.$card-padding;
181
- @include typo.body-primary();
182
+ @include typography.body-primary();
182
183
  @include theming.theme-transition();
183
184
  }
184
185
  ```
185
186
 
187
+ **SCSS import rules:**
188
+ - ALWAYS import via package/library name (e.g. `@use 'theme/colors'`)
189
+ - NEVER use relative paths (`../../theme/src/generated/...`) — they break on refactoring and are unreadable
190
+ - NEVER use redundant `as` aliases that match the last path segment (`@use 'theme/colors' as colors` → just `@use 'theme/colors'`). Only use `as` when you need a different name.
191
+
192
+ **Making theme resolvable by package name (priority order):**
193
+ 1. **Workspace dependency in package.json** (preferred) — add the theme library as a workspace dependency so SCSS resolves it from `node_modules`:
194
+ ```jsonc
195
+ // package.json (root or consuming app)
196
+ {
197
+ "dependencies": {
198
+ "@[prefix]/theme": "workspace:./libs/shared/ui/theme" // bun/pnpm
199
+ // or "file:./libs/shared/ui/theme" for npm
200
+ }
201
+ }
202
+ ```
203
+ Then `<PM> install` creates the link. SCSS `@use '@[prefix]/theme/colors'` resolves automatically.
204
+ 2. **Bundler/framework SCSS config** (fallback) — e.g. `sassOptions.includeDirs` in `next.config.js`, or Vite `css.preprocessorOptions.scss.includePaths`.
205
+
186
206
  **How it works:** `npx themecraft generate` reads `tokens.json` and produces typed SCSS files (`generated/theme/colors.scss`, `sizes.scss`, `typography.scss`) that wrap `color-var()`/`size-var()` internally. Components consume these generated variables — never the raw accessor functions.
187
207
 
188
208
  **Token source (pick one):**
@@ -294,6 +314,7 @@ When reviewing React code, check:
294
314
  - Server/client separation: Flag WARN if a module mixes server and browser logic without clear boundaries
295
315
  - No memory leaks in effects, event listeners, or subscriptions
296
316
  - Theme compliance: generated @themecraft SCSS variables — no hardcoded colors/sizes, no direct `color-var()`/`size-var()` calls
317
+ - SCSS imports: via package name (no relative paths), no redundant `as` aliases
297
318
  - Code splitting: `React.lazy` + `Suspense` for heavy routes/components, no eager imports of page-level components
298
319
  - Dynamic imports for heavy third-party libraries
299
320
  - Naming: PascalCase components, camelCase hooks, kebab-case files
@@ -168,24 +168,44 @@ npx themecraft generate # generates type-safe SCSS from tokens.json
168
168
  4. `@themecraft/core/themes` → `variables()` mixin emits CSS custom properties at `:root`
169
169
  5. `ThemeManager` (from `@themecraft/core/runtime`) — runtime switching, storage, FOUC prevention
170
170
 
171
- **Component SCSS** — import generated variables, NEVER call `color-var()`/`size-var()` directly:
171
+ **Component SCSS** — import via package name, NEVER use relative paths, NEVER call `color-var()`/`size-var()` directly:
172
172
  ```svelte
173
173
  <style lang="scss">
174
- @use 'generated/theme/colors' as colors;
175
- @use 'generated/theme/sizes' as sizes;
176
- @use 'generated/theme/typography' as typo;
177
- @use '@themecraft/core/theming' as theming;
174
+ // Import via package name — SCSS @use uses last path segment as namespace automatically
175
+ @use 'theme/colors';
176
+ @use 'theme/sizes';
177
+ @use 'theme/typography';
178
+ @use '@themecraft/core/theming';
178
179
 
179
180
  .card {
180
181
  background: colors.$surface;
181
182
  color: colors.$on-surface;
182
183
  padding: sizes.$card-padding;
183
- @include typo.body-primary();
184
+ @include typography.body-primary();
184
185
  @include theming.theme-transition();
185
186
  }
186
187
  </style>
187
188
  ```
188
189
 
190
+ **SCSS import rules:**
191
+ - ALWAYS import via package/library name (e.g. `@use 'theme/colors'`)
192
+ - NEVER use relative paths (`../../theme/src/generated/...`) — they break on refactoring and are unreadable
193
+ - NEVER use redundant `as` aliases that match the last path segment (`@use 'theme/colors' as colors` → just `@use 'theme/colors'`). Only use `as` when you need a different name.
194
+
195
+ **Making theme resolvable by package name (priority order):**
196
+ 1. **Workspace dependency in package.json** (preferred) — add the theme library as a workspace dependency so SCSS resolves it from `node_modules`:
197
+ ```jsonc
198
+ // package.json (root or consuming app)
199
+ {
200
+ "dependencies": {
201
+ "@[prefix]/theme": "workspace:./libs/shared/ui/theme" // bun/pnpm
202
+ // or "file:./libs/shared/ui/theme" for npm
203
+ }
204
+ }
205
+ ```
206
+ Then `<PM> install` creates the link. SCSS `@use '@[prefix]/theme/colors'` resolves automatically.
207
+ 2. **SvelteKit SCSS config** (fallback) — `css.preprocessorOptions.scss.includePaths` in `vite.config.ts`.
208
+
189
209
  **How it works:** `npx themecraft generate` reads `tokens.json` and produces typed SCSS files (`generated/theme/colors.scss`, `sizes.scss`, `typography.scss`) that wrap `color-var()`/`size-var()` internally. Components consume these generated variables — never the raw accessor functions.
190
210
 
191
211
  **Token source (pick one):**
@@ -298,6 +318,7 @@ When reviewing Svelte code, check:
298
318
  - `$lib/` imports — no deep relative paths (`../../../`)
299
319
  - `$lib/server/` for server-only modules — enforced by SvelteKit
300
320
  - Theme compliance: generated @themecraft SCSS variables — no hardcoded colors/sizes, no direct `color-var()`/`size-var()` calls
321
+ - SCSS imports: via package name (no relative paths), no redundant `as` aliases
301
322
  - Lazy loading: routes auto-split, dynamic `import()` for heavy non-route components
302
323
  - Accessibility: all Svelte compiler a11y warnings resolved (not suppressed)
303
324
  - No `{@html}` without sanitization
@@ -193,24 +193,44 @@ npx themecraft generate # generates type-safe SCSS from tokens.json
193
193
  4. `@themecraft/core/themes` → `variables()` mixin emits CSS custom properties at `:root`
194
194
  5. `ThemeManager` (from `@themecraft/core/runtime`) — runtime switching, storage, FOUC prevention
195
195
 
196
- **Component SCSS** — import generated variables, NEVER call `color-var()`/`size-var()` directly:
196
+ **Component SCSS** — import via package name, NEVER use relative paths, NEVER call `color-var()`/`size-var()` directly:
197
197
  ```vue
198
198
  <style scoped lang="scss">
199
- @use 'generated/theme/colors' as colors;
200
- @use 'generated/theme/sizes' as sizes;
201
- @use 'generated/theme/typography' as typo;
202
- @use '@themecraft/core/theming' as theming;
199
+ // Import via package name — SCSS @use uses last path segment as namespace automatically
200
+ @use 'theme/colors';
201
+ @use 'theme/sizes';
202
+ @use 'theme/typography';
203
+ @use '@themecraft/core/theming';
203
204
 
204
205
  .card {
205
206
  background: colors.$surface;
206
207
  color: colors.$on-surface;
207
208
  padding: sizes.$card-padding;
208
- @include typo.body-primary();
209
+ @include typography.body-primary();
209
210
  @include theming.theme-transition();
210
211
  }
211
212
  </style>
212
213
  ```
213
214
 
215
+ **SCSS import rules:**
216
+ - ALWAYS import via package/library name (e.g. `@use 'theme/colors'`)
217
+ - NEVER use relative paths (`../../theme/src/generated/...`) — they break on refactoring and are unreadable
218
+ - NEVER use redundant `as` aliases that match the last path segment (`@use 'theme/colors' as colors` → just `@use 'theme/colors'`). Only use `as` when you need a different name.
219
+
220
+ **Making theme resolvable by package name (priority order):**
221
+ 1. **Workspace dependency in package.json** (preferred) — add the theme library as a workspace dependency so SCSS resolves it from `node_modules`:
222
+ ```jsonc
223
+ // package.json (root or consuming app)
224
+ {
225
+ "dependencies": {
226
+ "@[prefix]/theme": "workspace:./libs/shared/ui/theme" // bun/pnpm
227
+ // or "file:./libs/shared/ui/theme" for npm
228
+ }
229
+ }
230
+ ```
231
+ Then `<PM> install` creates the link. SCSS `@use '@[prefix]/theme/colors'` resolves automatically.
232
+ 2. **Vite SCSS config** (fallback) — `css.preprocessorOptions.scss.includePaths` in `vite.config.ts`.
233
+
214
234
  **How it works:** `npx themecraft generate` reads `tokens.json` and produces typed SCSS files (`generated/theme/colors.scss`, `sizes.scss`, `typography.scss`) that wrap `color-var()`/`size-var()` internally. Components consume these generated variables — never the raw accessor functions.
215
235
 
216
236
  **Token source (pick one):**
@@ -324,6 +344,7 @@ When reviewing Vue code, check:
324
344
  - SSR/Client separation: Flag WARN if a composable mixes server and browser logic
325
345
  - `<style scoped>` on all components — no unscoped styles leaking globally
326
346
  - Theme compliance: generated @themecraft SCSS variables — no hardcoded colors/sizes, no direct `color-var()`/`size-var()` calls
347
+ - SCSS imports: via package name (no relative paths), no redundant `as` aliases
327
348
  - Lazy loading: `defineAsyncComponent` for heavy components, dynamic imports for routes
328
349
  - No `v-html` without sanitization (XSS risk)
329
350
  - Props defined with TypeScript types via `defineProps<{ ... }>()` — not runtime-only validation
@@ -56,7 +56,28 @@ When running in autonomous/unattended mode (via `autonomous.mjs` or non-interact
56
56
  ### App Separation Principle
57
57
 
58
58
  - **`apps/` are thin shells** — each app is just configuration + routing + bootstrap. Minimal code.
59
- - **`libs/` contain all logic** — each domain has an **entry point library** that composes and re-exports functionality from its sub-libraries. Apps import only from these entry points.
59
+ - **`libs/` contain all logic** — each domain/feature has its **own library group** with sub-libraries per layer. Apps import only from entry points.
60
+ - **Feature-first library organization (STRICT)** — every distinct feature/domain gets its own group of libraries:
61
+ ```
62
+ libs/
63
+ scan/ # feature: scan
64
+ domain/ # scan types, schemas, interfaces
65
+ ui/ # scan UI components
66
+ feature/ # scan smart components
67
+ data-access/ # scan HTTP/DB services
68
+ streak/ # feature: streak
69
+ domain/
70
+ ui/
71
+ feature/
72
+ achievement/ # feature: achievement
73
+ domain/
74
+ feature/
75
+ shared/ # ONLY truly cross-domain code
76
+ ui/ # generic UI primitives (buttons, modals)
77
+ domain/ # cross-domain types (if any)
78
+ infrastructure/
79
+ ```
80
+ **NEVER dump multiple features into a single library** (e.g. `shared/types` with `scan.ts`, `streak.ts`, `achievement.ts`). Each feature owns its types in its own `domain/` library.
60
81
  - **Frontend and backend are separate apps** with separate build configurations per environment:
61
82
  - `apps/[APP_NAME]/` — Frontend application
62
83
  - `apps/api/` — Backend API (if applicable)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-claude-workspace",
3
- "version": "1.1.72",
3
+ "version": "1.1.74",
4
4
  "description": "Scaffold a project with Claude Code agents for autonomous AI-driven development",
5
5
  "type": "module",
6
6
  "bin": {