@codedrifters/configulator 0.0.245 → 0.0.247

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.
package/lib/index.mjs CHANGED
@@ -386,6 +386,245 @@ var awsCdkBundle = {
386
386
  };
387
387
 
388
388
  // src/agent/bundles/base.ts
389
+ var createPackageSkill = {
390
+ name: "create-package",
391
+ description: "Scaffold a new TypeScriptProject sub-project under packages/@scope/<name> by emitting the projen block to add to the monorepo config",
392
+ disableModelInvocation: true,
393
+ instructions: [
394
+ "# Create Package",
395
+ "",
396
+ "Scaffold a new shared-library sub-project at",
397
+ "`packages/@scope/<name>` by emitting the projen block to add to the",
398
+ "monorepo's projen configuration. This skill walks the user through",
399
+ "naming, metadata, and placement; it does **not** run projen, install",
400
+ "dependencies, or execute any build commands.",
401
+ "",
402
+ "## Usage",
403
+ "",
404
+ "```",
405
+ "/create-package @<scope>/<name>",
406
+ "```",
407
+ "",
408
+ "Example: `/create-package @codedrifters/my-lib` \u2192 scaffolds a new",
409
+ "`TypeScriptProject` at `packages/@codedrifters/my-lib`.",
410
+ "",
411
+ "## Steps",
412
+ "",
413
+ "1. **Parse and validate the package name.** The argument must be a",
414
+ " **scoped** npm name in the form `@<scope>/<name>`:",
415
+ " - Starts with `@`",
416
+ " - Has exactly one `/` separator",
417
+ " - `<scope>` and `<name>` are lowercase, kebab-case, non-empty",
418
+ " - Unscoped names (e.g. `my-lib`) are **not** allowed \u2014 every",
419
+ " package under `packages/` is scoped by owner.",
420
+ " If the input is missing or invalid, ask the user to supply a",
421
+ " scoped name. Do not guess the scope.",
422
+ "",
423
+ "2. **Collect metadata** \u2014 ask the user for each of the following,",
424
+ " one question at a time:",
425
+ " - **Description** \u2014 one-line summary of what the package does.",
426
+ " - **Publish to npm?** \u2014 `true` or `false`. Workspace-internal",
427
+ " libraries should answer `false`.",
428
+ " Skip any question the user has already answered in the initial",
429
+ " prompt.",
430
+ "",
431
+ "3. **Determine the target outdir.** The sub-project lives at:",
432
+ "",
433
+ " ```",
434
+ " packages/<scope>/<name>",
435
+ " ```",
436
+ "",
437
+ " `<scope>` is everything after `@` and before `/` in the package",
438
+ " name; `<name>` is everything after the `/`. This matches the",
439
+ " default `outdir` that `TypeScriptProject` computes from the",
440
+ " package name, so the emitted block does **not** need to set",
441
+ " `outdir` explicitly.",
442
+ "",
443
+ "4. **Locate the projen config file.** Prefer the monorepo's",
444
+ " `projenrc/` directory \u2014 most monorepos declare sub-projects",
445
+ " there (e.g. `projenrc/root-project.ts` or a dedicated",
446
+ " `projenrc/packages.ts`). Fall back to `.projenrc.ts` only when",
447
+ " no `projenrc/` directory exists.",
448
+ "",
449
+ "5. **Emit the projen block.** Show the TypeScript block to paste",
450
+ " into the chosen projen config file. Example for",
451
+ " `@codedrifters/my-lib`:",
452
+ "",
453
+ " ```typescript",
454
+ " import { TypeScriptProject } from '@codedrifters/configulator';",
455
+ "",
456
+ " // Inside the monorepo's configuration function, alongside",
457
+ " // sibling sub-projects:",
458
+ " new TypeScriptProject({",
459
+ " parent: monorepo,",
460
+ " name: '@codedrifters/my-lib',",
461
+ " description: '<one-line description>',",
462
+ " defaultReleaseBranch: 'main',",
463
+ " publishToNpm: false, // or true if this package publishes",
464
+ " });",
465
+ " ```",
466
+ "",
467
+ " Substitute the user's scope, name, description, and",
468
+ " `publishToNpm` value. Do not hard-code `outdir` \u2014 the default",
469
+ " places the sub-project at `packages/<scope>/<name>`.",
470
+ "",
471
+ "6. **Tell the user how to synthesize.** Instruct them to run, from",
472
+ " the repo root:",
473
+ "",
474
+ " ```",
475
+ " pnpm exec projen",
476
+ " pnpm install",
477
+ " ```",
478
+ "",
479
+ " `pnpm exec projen` regenerates the sub-project tree;",
480
+ " `pnpm install` updates the workspace lockfile. Do **not** run",
481
+ " these commands yourself \u2014 the user runs them.",
482
+ "",
483
+ "## Guardrails",
484
+ "",
485
+ "- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
486
+ " `pnpm test`, or any other package-manager, build, or test command.",
487
+ " Emit the projen block and instructions only.",
488
+ "- Never scaffold outside `packages/`. Deployable apps belong under",
489
+ " `apps/<scope>/<name>` (use `/create-app`); user-facing sites belong",
490
+ " under `sites/<scope>/<name>` (use `/create-site`).",
491
+ "- Never scope by category (e.g. `@libs/foo`, `@packages/foo`). The",
492
+ " scope identifies the **owning party**; the top-level folder",
493
+ " identifies the kind.",
494
+ "- Do not invent an `outdir` \u2014 rely on the `TypeScriptProject`",
495
+ " default that places the sub-project at `packages/<scope>/<name>`.",
496
+ "",
497
+ "## Related Skills",
498
+ "",
499
+ "- `/create-app` \u2014 scaffold a new `AwsCdkProject` under",
500
+ " `apps/<scope>/<name>`.",
501
+ "- `/create-site` \u2014 scaffold a new `AstroProject` under",
502
+ " `sites/<scope>/<name>`."
503
+ ].join("\n")
504
+ };
505
+ var createAppSkill = {
506
+ name: "create-app",
507
+ description: "Scaffold a new AwsCdkProject sub-project under apps/@scope/<name> by emitting the projen block to add to the monorepo config",
508
+ disableModelInvocation: true,
509
+ instructions: [
510
+ "# Create App",
511
+ "",
512
+ "Scaffold a new deployable-application sub-project at",
513
+ "`apps/@scope/<name>` by emitting the projen block to add to the",
514
+ "monorepo's projen configuration. This skill walks the user through",
515
+ "naming, metadata, and placement; it does **not** run projen, install",
516
+ "dependencies, or execute any build commands.",
517
+ "",
518
+ "Today this skill scaffolds AWS CDK applications (`AwsCdkProject`).",
519
+ "The `apps/` folder is also the right home for other deployable",
520
+ "application types (mobile apps, backend services) as configulator",
521
+ "grows support for them \u2014 but at the moment, this skill emits an",
522
+ "`AwsCdkProject` block.",
523
+ "",
524
+ "## Usage",
525
+ "",
526
+ "```",
527
+ "/create-app @<scope>/<name>",
528
+ "```",
529
+ "",
530
+ "Example: `/create-app @codedrifters/my-stack` \u2192 scaffolds a new",
531
+ "`AwsCdkProject` at `apps/@codedrifters/my-stack`.",
532
+ "",
533
+ "## Steps",
534
+ "",
535
+ "1. **Parse and validate the app name.** The argument must be a",
536
+ " **scoped** npm name in the form `@<scope>/<name>`:",
537
+ " - Starts with `@`",
538
+ " - Has exactly one `/` separator",
539
+ " - `<scope>` and `<name>` are lowercase, kebab-case, non-empty",
540
+ " - Unscoped names (e.g. `my-stack`) are **not** allowed \u2014 every",
541
+ " app under `apps/` is scoped by owner.",
542
+ " If the input is missing or invalid, ask the user to supply a",
543
+ " scoped name. Do not guess the scope.",
544
+ "",
545
+ "2. **Collect metadata** \u2014 ask the user for each of the following,",
546
+ " one question at a time:",
547
+ " - **Description** \u2014 one-line summary of what the app does.",
548
+ " - **CDK version** \u2014 the AWS CDK version to pin (e.g. `2.150.0`).",
549
+ " If the user is unsure, suggest they match the CDK version",
550
+ " already in use by sibling `AwsCdkProject` entries in the",
551
+ " monorepo; otherwise pick the latest stable release.",
552
+ " Skip any question the user has already answered in the initial",
553
+ " prompt.",
554
+ "",
555
+ "3. **Determine the target outdir.** The sub-project lives at:",
556
+ "",
557
+ " ```",
558
+ " apps/<scope>/<name>",
559
+ " ```",
560
+ "",
561
+ " `<scope>` is everything after `@` and before `/` in the app",
562
+ " name; `<name>` is everything after the `/`. This matches the",
563
+ " default `outdir` that `AwsCdkProject` computes from the package",
564
+ " name, so the emitted block does **not** need to set `outdir`",
565
+ " explicitly.",
566
+ "",
567
+ "4. **Locate the projen config file.** Prefer the monorepo's",
568
+ " `projenrc/` directory \u2014 most monorepos declare sub-projects",
569
+ " there (e.g. `projenrc/root-project.ts` or a dedicated",
570
+ " `projenrc/apps.ts`). Fall back to `.projenrc.ts` only when",
571
+ " no `projenrc/` directory exists.",
572
+ "",
573
+ "5. **Emit the projen block.** Show the TypeScript block to paste",
574
+ " into the chosen projen config file. Example for",
575
+ " `@codedrifters/my-stack`:",
576
+ "",
577
+ " ```typescript",
578
+ " import { AwsCdkProject } from '@codedrifters/configulator';",
579
+ "",
580
+ " // Inside the monorepo's configuration function, alongside",
581
+ " // sibling sub-projects:",
582
+ " new AwsCdkProject({",
583
+ " parent: monorepo,",
584
+ " name: '@codedrifters/my-stack',",
585
+ " description: '<one-line description>',",
586
+ " cdkVersion: '<cdk-version>',",
587
+ " });",
588
+ " ```",
589
+ "",
590
+ " Substitute the user's scope, name, description, and CDK",
591
+ " version. Do not hard-code `outdir` \u2014 the default places the",
592
+ " sub-project at `apps/<scope>/<name>`.",
593
+ "",
594
+ "6. **Tell the user how to synthesize.** Instruct them to run, from",
595
+ " the repo root:",
596
+ "",
597
+ " ```",
598
+ " pnpm exec projen",
599
+ " pnpm install",
600
+ " ```",
601
+ "",
602
+ " `pnpm exec projen` regenerates the sub-project tree;",
603
+ " `pnpm install` updates the workspace lockfile. Do **not** run",
604
+ " these commands yourself \u2014 the user runs them.",
605
+ "",
606
+ "## Guardrails",
607
+ "",
608
+ "- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
609
+ " `pnpm test`, or any other package-manager, build, or test command.",
610
+ " Emit the projen block and instructions only.",
611
+ "- Never scaffold outside `apps/`. Shared libraries belong under",
612
+ " `packages/<scope>/<name>` (use `/create-package`); user-facing",
613
+ " sites belong under `sites/<scope>/<name>` (use `/create-site`).",
614
+ "- Never scope by category (e.g. `@apps/foo`, `@stacks/foo`). The",
615
+ " scope identifies the **owning party**; the top-level folder",
616
+ " identifies the kind.",
617
+ "- Do not invent an `outdir` \u2014 rely on the `AwsCdkProject` default",
618
+ " that places the sub-project at `apps/<scope>/<name>`.",
619
+ "",
620
+ "## Related Skills",
621
+ "",
622
+ "- `/create-package` \u2014 scaffold a new `TypeScriptProject` under",
623
+ " `packages/<scope>/<name>`.",
624
+ "- `/create-site` \u2014 scaffold a new `AstroProject` under",
625
+ " `sites/<scope>/<name>`."
626
+ ].join("\n")
627
+ };
389
628
  var createRuleSkill = {
390
629
  name: "create-rule",
391
630
  description: "Guide for creating new agent rules in this project using configulator",
@@ -444,7 +683,7 @@ var baseBundle = {
444
683
  name: "base",
445
684
  description: "Core rules: project overview, interaction style, and general coding conventions",
446
685
  appliesWhen: () => true,
447
- skills: [createRuleSkill],
686
+ skills: [createPackageSkill, createAppSkill, createRuleSkill],
448
687
  rules: [
449
688
  {
450
689
  name: "project-overview",