|
39 | 39 | * `--skip-install` there is no resolved version, so the template keeps `latest` |
40 | 40 | * and its comment keeps telling the reader to pin by hand — true in that path. |
41 | 41 | * |
42 | | - * Finally we (best-effort) install the ObjectStack skills bundle via |
43 | | - * `npx skills add objectstack-ai/objectstack/skills --all`. |
44 | | - * The `/skills` subpath scopes discovery to the curated, customer-published |
45 | | - * catalog — repo-internal skills (e.g. under `.claude/skills/`) must never |
46 | | - * reach scaffolded projects. |
| 42 | + * Finally we (best-effort) install the ObjectStack skills bundle, for ONE |
| 43 | + * agent runtime (`skills-install.ts` carries the command and the measurement |
| 44 | + * behind that choice: `--all` writes the same bundle to three destinations and |
| 45 | + * the project then commits all three). The `/skills` subpath scopes discovery |
| 46 | + * to the curated, customer-published catalog — repo-internal skills (e.g. |
| 47 | + * under `.claude/skills/` in THIS repo) must never reach scaffolded projects. |
47 | 48 | * |
48 | 49 | * Only THEN is the "Created files" summary printed, and it is a walk of the |
49 | 50 | * finished project directory rather than a list accumulated during the copy |
@@ -72,6 +73,13 @@ import { |
72 | 73 | import { lookupTemplate, templateNames } from './template-registry.js'; |
73 | 74 | import { readResolvedCliVersion, pinRuntimeImage } from './runtime-image.js'; |
74 | 75 | import { summarizeTree, describeEntry } from './created-summary.js'; |
| 76 | +import { |
| 77 | + DEFAULT_SKILLS_AGENT, |
| 78 | + DEFAULT_SKILLS_DIR, |
| 79 | + EXAMPLE_OTHER_AGENT, |
| 80 | + SKILLS_INSTALL_COMMAND, |
| 81 | + skillsInstallHint, |
| 82 | +} from './skills-install.js'; |
75 | 83 | import { renderVersionBanner } from './banner.js'; |
76 | 84 |
|
77 | 85 | const __filename = fileURLToPath(import.meta.url); |
@@ -521,24 +529,26 @@ const program = new Command() |
521 | 529 | } |
522 | 530 |
|
523 | 531 | // Which top-level paths belong to the skills install is measured, not |
524 | | - // assumed: `skills add --all` fans the catalog out to every agent |
525 | | - // runtime IT knows about (77 at the version measured), so the |
526 | | - // destination set moves with that package's releases. Diffing the |
527 | | - // directory across the call keeps the ⚠ marks correct without this file |
528 | | - // carrying a list it cannot keep current. |
| 532 | + // assumed. Naming one agent makes the destination set small and |
| 533 | + // knowable (`skills-install.ts`), but it is still THEIR path to choose, |
| 534 | + // and it moves with that package's releases — so the ⚠ marks come from |
| 535 | + // diffing the directory across the call rather than from a list this |
| 536 | + // file would have to keep current. |
529 | 537 | const beforeSkills = topLevelNames(targetDir); |
| 538 | + let skillsInstalled = false; |
530 | 539 | if (!options.skipInstall && !options.skipSkills) { |
531 | 540 | printStep('Installing AI skills for your coding agent...'); |
532 | 541 | try { |
533 | | - execSync('npx -y skills add objectstack-ai/objectstack/skills --all', { |
| 542 | + execSync(SKILLS_INSTALL_COMMAND, { |
534 | 543 | stdio: 'inherit', |
535 | 544 | cwd: targetDir, |
536 | 545 | }); |
| 546 | + skillsInstalled = true; |
537 | 547 | console.log(''); |
538 | 548 | } catch { |
539 | 549 | printWarning( |
540 | 550 | 'Skills installation skipped. Run manually:\n' + |
541 | | - ' npx skills add objectstack-ai/objectstack/skills', |
| 551 | + ` ${skillsInstallHint(DEFAULT_SKILLS_AGENT)}`, |
542 | 552 | ); |
543 | 553 | console.log(''); |
544 | 554 | } |
@@ -569,10 +579,29 @@ const program = new Command() |
569 | 579 | console.log(chalk.dim(` ${devLabel.padEnd(labelWidth)}# Start development server`)); |
570 | 580 | console.log(chalk.dim(` ${validateLabel.padEnd(labelWidth)}# Verify metadata: schema + predicates + bindings`)); |
571 | 581 | console.log(chalk.dim(` ${' '.repeat(labelWidth)}# (run after every metadata edit — see AGENTS.md)`)); |
572 | | - if (options.skipInstall || options.skipSkills) { |
573 | | - console.log(''); |
| 582 | + // The skills block is printed on EVERY path, not only the skipped one. |
| 583 | + // The install now targets a single agent runtime, so a run that |
| 584 | + // succeeded still leaves every other runtime uninstalled — and a |
| 585 | + // capability that is absent has to say so, with the remedy, rather than |
| 586 | + // leave the reader to discover the gap. The command printed here is the |
| 587 | + // one this scaffolder ran, with a different agent name. |
| 588 | + console.log(''); |
| 589 | + if (skillsInstalled) { |
| 590 | + console.log(chalk.bold(' AI Skills:')); |
| 591 | + console.log( |
| 592 | + chalk.dim( |
| 593 | + ` Installed for ${DEFAULT_SKILLS_AGENT} → ${DEFAULT_SKILLS_DIR} — commit it with your project.`, |
| 594 | + ), |
| 595 | + ); |
| 596 | + console.log(chalk.dim(' Using a different agent? Add it one runtime at a time:')); |
| 597 | + console.log(chalk.dim(` ${skillsInstallHint(EXAMPLE_OTHER_AGENT)}`)); |
| 598 | + console.log(chalk.dim(' (`npx skills add --help` lists every agent name)')); |
| 599 | + } else { |
574 | 600 | console.log(chalk.bold(' AI Skills (recommended):')); |
575 | | - console.log(chalk.dim(' npx skills add objectstack-ai/objectstack/skills')); |
| 601 | + console.log(chalk.dim(` ${skillsInstallHint(DEFAULT_SKILLS_AGENT)}`)); |
| 602 | + console.log( |
| 603 | + chalk.dim(` Replace \`${DEFAULT_SKILLS_AGENT}\` with your own agent runtime if it differs.`), |
| 604 | + ); |
576 | 605 | } |
577 | 606 | console.log(''); |
578 | 607 | } catch (error) { |
|
0 commit comments