@archetypeai/ds-cli 0.3.9 → 0.3.11

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 (29) hide show
  1. package/bin.js +4 -0
  2. package/commands/create.js +76 -33
  3. package/commands/init.js +49 -19
  4. package/files/AGENTS.md +19 -3
  5. package/files/CLAUDE.md +21 -3
  6. package/files/rules/accessibility.md +49 -0
  7. package/files/rules/frontend-architecture.md +77 -0
  8. package/files/skills/apply-ds/SKILL.md +86 -82
  9. package/files/skills/apply-ds/scripts/audit.sh +169 -0
  10. package/files/skills/apply-ds/scripts/setup.sh +48 -166
  11. package/files/skills/create-dashboard/SKILL.md +12 -0
  12. package/files/skills/embedding-from-file/SKILL.md +415 -0
  13. package/files/skills/embedding-from-sensor/SKILL.md +406 -0
  14. package/files/skills/embedding-upload/SKILL.md +414 -0
  15. package/files/skills/fix-accessibility/SKILL.md +57 -9
  16. package/files/skills/newton-activity-monitor-lens-on-video/SKILL.md +817 -0
  17. package/files/skills/newton-camera-frame-analysis/SKILL.md +611 -0
  18. package/files/skills/newton-camera-frame-analysis/scripts/activity-monitor-frame.py +165 -0
  19. package/files/skills/newton-camera-frame-analysis/scripts/captures/logs/api_responses_20260206_105610.json +62 -0
  20. package/files/skills/newton-camera-frame-analysis/scripts/continuous_monitor.py +119 -0
  21. package/files/skills/newton-direct-query/SKILL.md +212 -0
  22. package/files/skills/newton-direct-query/scripts/direct_query.py +129 -0
  23. package/files/skills/newton-machine-state-from-file/SKILL.md +545 -0
  24. package/files/skills/newton-machine-state-from-sensor/SKILL.md +707 -0
  25. package/files/skills/newton-machine-state-upload/SKILL.md +986 -0
  26. package/lib/add-ds-config-codeagent.js +5 -1
  27. package/lib/is-interactive.js +19 -0
  28. package/lib/scaffold-ds-svelte-project.js +117 -0
  29. package/package.json +1 -1
@@ -120,12 +120,16 @@ Usage:
120
120
  } else if (isClaude) {
121
121
  agent = 'claude';
122
122
  } else {
123
+ if (!process.stdin.isTTY) {
124
+ p.log.error('Specify --cursor or --claude in non-interactive mode.');
125
+ process.exit(1);
126
+ }
123
127
  // interactive prompt when no flag is passed
124
128
  agent = await p.select({
125
129
  message: 'Which agent configuration?',
126
130
  options: [
127
131
  { value: 'cursor', label: 'Cursor', hint: 'AGENTS.md + skills + rules' },
128
- { value: 'claude', label: 'Claude Code', hint: 'CLAUDE.md + skills + rules' }
132
+ { value: 'claude', label: 'Claude Code', hint: 'CLAUDE.md + skills + rules, default' }
129
133
  ]
130
134
  });
131
135
  if (p.isCancel(agent)) {
@@ -0,0 +1,19 @@
1
+ import * as p from '@clack/prompts';
2
+
3
+ export const DEFAULTS = {
4
+ framework: 'svelte',
5
+ pm: 'npm',
6
+ agent: 'claude'
7
+ };
8
+
9
+ export function isInteractive(flags) {
10
+ if (flags.defaults) return false;
11
+ return !!process.stdin.isTTY;
12
+ }
13
+
14
+ export function logDefaultsNotice(applied) {
15
+ const parts = Object.entries(applied).map(([k, v]) => `${k}=${v}`);
16
+ if (parts.length > 0) {
17
+ p.log.info(`Non-interactive mode: using defaults (${parts.join(', ')})`);
18
+ }
19
+ }
@@ -259,6 +259,123 @@ export function createDemoPage(projectPath) {
259
259
  p.log.success('Demo page created');
260
260
  }
261
261
 
262
+ // install linting and formatting
263
+ export async function installLinting(pm, projectPath) {
264
+ const s = p.spinner();
265
+ s.start('Setting up linting and formatting');
266
+ try {
267
+ // install dev dependencies
268
+ const [cmd, ...baseArgs] = splitCmd(pm.install);
269
+ await run(
270
+ cmd,
271
+ [
272
+ ...baseArgs,
273
+ '-D',
274
+ '@eslint/js',
275
+ 'eslint',
276
+ 'prettier',
277
+ 'eslint-plugin-svelte',
278
+ 'eslint-config-prettier',
279
+ 'prettier-plugin-svelte',
280
+ 'prettier-plugin-tailwindcss',
281
+ 'globals'
282
+ ],
283
+ { cwd: projectPath }
284
+ );
285
+
286
+ // detect CSS file for Prettier Tailwind plugin
287
+ let cssFile = '';
288
+ for (const candidate of ['src/app.css', 'src/routes/layout.css', 'src/app.pcss']) {
289
+ if (existsSync(join(projectPath, candidate))) {
290
+ cssFile = candidate;
291
+ break;
292
+ }
293
+ }
294
+
295
+ // create eslint.config.js
296
+ const eslintPath = join(projectPath, 'eslint.config.js');
297
+ if (!existsSync(eslintPath)) {
298
+ writeFile(
299
+ eslintPath,
300
+ `import js from '@eslint/js';
301
+ import svelte from 'eslint-plugin-svelte';
302
+ import globals from 'globals';
303
+ import svelteConfig from './svelte.config.js';
304
+
305
+ export default [
306
+ \tjs.configs.recommended,
307
+ \t...svelte.configs.recommended,
308
+ \t...svelte.configs['flat/prettier'],
309
+ \t{
310
+ \t\tlanguageOptions: {
311
+ \t\t\tglobals: { ...globals.browser, ...globals.node }
312
+ \t\t}
313
+ \t},
314
+ \t{
315
+ \t\tfiles: ['**/*.svelte', '**/*.svelte.js'],
316
+ \t\tlanguageOptions: {
317
+ \t\t\tparserOptions: { svelteConfig }
318
+ \t\t}
319
+ \t},
320
+ \t{
321
+ \t\tignores: ['.svelte-kit/', 'build/', 'dist/', 'node_modules/']
322
+ \t}
323
+ ];
324
+ `
325
+ );
326
+ }
327
+
328
+ // create .prettierrc
329
+ const prettierrcPath = join(projectPath, '.prettierrc');
330
+ if (!existsSync(prettierrcPath)) {
331
+ const prettierrc = {
332
+ useTabs: true,
333
+ singleQuote: true,
334
+ trailingComma: 'none',
335
+ printWidth: 100,
336
+ plugins: ['prettier-plugin-svelte', 'prettier-plugin-tailwindcss']
337
+ };
338
+ if (cssFile) {
339
+ prettierrc.tailwindStylesheet = `./${cssFile}`;
340
+ }
341
+ writeFile(prettierrcPath, JSON.stringify(prettierrc, null, '\t') + '\n');
342
+ }
343
+
344
+ // create .prettierignore
345
+ const prettierignorePath = join(projectPath, '.prettierignore');
346
+ if (!existsSync(prettierignorePath)) {
347
+ writeFile(
348
+ prettierignorePath,
349
+ `.svelte-kit
350
+ .claude
351
+ .cursor
352
+ build
353
+ dist
354
+ node_modules
355
+ package-lock.json
356
+ `
357
+ );
358
+ }
359
+
360
+ // add lint/format scripts to package.json
361
+ const pkgPath = join(projectPath, 'package.json');
362
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
363
+ pkg.scripts = pkg.scripts || {};
364
+ pkg.scripts.lint = 'eslint .';
365
+ pkg.scripts['lint:fix'] = 'eslint . --fix';
366
+ pkg.scripts.format = 'prettier --write .';
367
+ pkg.scripts['format:check'] = 'prettier --check .';
368
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, '\t') + '\n');
369
+
370
+ s.stop('Linting and formatting configured');
371
+ return true;
372
+ } catch (error) {
373
+ s.stop('Failed to set up linting');
374
+ p.log.error(error.stderr?.toString() || error.message);
375
+ return false;
376
+ }
377
+ }
378
+
262
379
  // install agent configuration
263
380
  export function installAgentConfig(projectPath, agentType) {
264
381
  const s = p.spinner();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archetypeai/ds-cli",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "Archetype AI Design System CLI Tool",
5
5
  "type": "module",
6
6
  "bin": {