@codedrifters/configulator 0.0.246 → 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
@@ -502,6 +502,129 @@ var createPackageSkill = {
502
502
  " `sites/<scope>/<name>`."
503
503
  ].join("\n")
504
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
+ };
505
628
  var createRuleSkill = {
506
629
  name: "create-rule",
507
630
  description: "Guide for creating new agent rules in this project using configulator",
@@ -560,7 +683,7 @@ var baseBundle = {
560
683
  name: "base",
561
684
  description: "Core rules: project overview, interaction style, and general coding conventions",
562
685
  appliesWhen: () => true,
563
- skills: [createPackageSkill, createRuleSkill],
686
+ skills: [createPackageSkill, createAppSkill, createRuleSkill],
564
687
  rules: [
565
688
  {
566
689
  name: "project-overview",