@codedrifters/configulator 0.0.246 → 0.0.248
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.js +293 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +293 -1
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -592,6 +592,293 @@ var createPackageSkill = {
|
|
|
592
592
|
" `sites/<scope>/<name>`."
|
|
593
593
|
].join("\n")
|
|
594
594
|
};
|
|
595
|
+
var createAppSkill = {
|
|
596
|
+
name: "create-app",
|
|
597
|
+
description: "Scaffold a new AwsCdkProject sub-project under apps/@scope/<name> by emitting the projen block to add to the monorepo config",
|
|
598
|
+
disableModelInvocation: true,
|
|
599
|
+
instructions: [
|
|
600
|
+
"# Create App",
|
|
601
|
+
"",
|
|
602
|
+
"Scaffold a new deployable-application sub-project at",
|
|
603
|
+
"`apps/@scope/<name>` by emitting the projen block to add to the",
|
|
604
|
+
"monorepo's projen configuration. This skill walks the user through",
|
|
605
|
+
"naming, metadata, and placement; it does **not** run projen, install",
|
|
606
|
+
"dependencies, or execute any build commands.",
|
|
607
|
+
"",
|
|
608
|
+
"Today this skill scaffolds AWS CDK applications (`AwsCdkProject`).",
|
|
609
|
+
"The `apps/` folder is also the right home for other deployable",
|
|
610
|
+
"application types (mobile apps, backend services) as configulator",
|
|
611
|
+
"grows support for them \u2014 but at the moment, this skill emits an",
|
|
612
|
+
"`AwsCdkProject` block.",
|
|
613
|
+
"",
|
|
614
|
+
"## Usage",
|
|
615
|
+
"",
|
|
616
|
+
"```",
|
|
617
|
+
"/create-app @<scope>/<name>",
|
|
618
|
+
"```",
|
|
619
|
+
"",
|
|
620
|
+
"Example: `/create-app @codedrifters/my-stack` \u2192 scaffolds a new",
|
|
621
|
+
"`AwsCdkProject` at `apps/@codedrifters/my-stack`.",
|
|
622
|
+
"",
|
|
623
|
+
"## Steps",
|
|
624
|
+
"",
|
|
625
|
+
"1. **Parse and validate the app name.** The argument must be a",
|
|
626
|
+
" **scoped** npm name in the form `@<scope>/<name>`:",
|
|
627
|
+
" - Starts with `@`",
|
|
628
|
+
" - Has exactly one `/` separator",
|
|
629
|
+
" - `<scope>` and `<name>` are lowercase, kebab-case, non-empty",
|
|
630
|
+
" - Unscoped names (e.g. `my-stack`) are **not** allowed \u2014 every",
|
|
631
|
+
" app under `apps/` is scoped by owner.",
|
|
632
|
+
" If the input is missing or invalid, ask the user to supply a",
|
|
633
|
+
" scoped name. Do not guess the scope.",
|
|
634
|
+
"",
|
|
635
|
+
"2. **Collect metadata** \u2014 ask the user for each of the following,",
|
|
636
|
+
" one question at a time:",
|
|
637
|
+
" - **Description** \u2014 one-line summary of what the app does.",
|
|
638
|
+
" - **CDK version** \u2014 the AWS CDK version to pin (e.g. `2.150.0`).",
|
|
639
|
+
" If the user is unsure, suggest they match the CDK version",
|
|
640
|
+
" already in use by sibling `AwsCdkProject` entries in the",
|
|
641
|
+
" monorepo; otherwise pick the latest stable release.",
|
|
642
|
+
" Skip any question the user has already answered in the initial",
|
|
643
|
+
" prompt.",
|
|
644
|
+
"",
|
|
645
|
+
"3. **Determine the target outdir.** The sub-project lives at:",
|
|
646
|
+
"",
|
|
647
|
+
" ```",
|
|
648
|
+
" apps/<scope>/<name>",
|
|
649
|
+
" ```",
|
|
650
|
+
"",
|
|
651
|
+
" `<scope>` is everything after `@` and before `/` in the app",
|
|
652
|
+
" name; `<name>` is everything after the `/`. This matches the",
|
|
653
|
+
" default `outdir` that `AwsCdkProject` computes from the package",
|
|
654
|
+
" name, so the emitted block does **not** need to set `outdir`",
|
|
655
|
+
" explicitly.",
|
|
656
|
+
"",
|
|
657
|
+
"4. **Locate the projen config file.** Prefer the monorepo's",
|
|
658
|
+
" `projenrc/` directory \u2014 most monorepos declare sub-projects",
|
|
659
|
+
" there (e.g. `projenrc/root-project.ts` or a dedicated",
|
|
660
|
+
" `projenrc/apps.ts`). Fall back to `.projenrc.ts` only when",
|
|
661
|
+
" no `projenrc/` directory exists.",
|
|
662
|
+
"",
|
|
663
|
+
"5. **Emit the projen block.** Show the TypeScript block to paste",
|
|
664
|
+
" into the chosen projen config file. Example for",
|
|
665
|
+
" `@codedrifters/my-stack`:",
|
|
666
|
+
"",
|
|
667
|
+
" ```typescript",
|
|
668
|
+
" import { AwsCdkProject } from '@codedrifters/configulator';",
|
|
669
|
+
"",
|
|
670
|
+
" // Inside the monorepo's configuration function, alongside",
|
|
671
|
+
" // sibling sub-projects:",
|
|
672
|
+
" new AwsCdkProject({",
|
|
673
|
+
" parent: monorepo,",
|
|
674
|
+
" name: '@codedrifters/my-stack',",
|
|
675
|
+
" description: '<one-line description>',",
|
|
676
|
+
" cdkVersion: '<cdk-version>',",
|
|
677
|
+
" });",
|
|
678
|
+
" ```",
|
|
679
|
+
"",
|
|
680
|
+
" Substitute the user's scope, name, description, and CDK",
|
|
681
|
+
" version. Do not hard-code `outdir` \u2014 the default places the",
|
|
682
|
+
" sub-project at `apps/<scope>/<name>`.",
|
|
683
|
+
"",
|
|
684
|
+
"6. **Tell the user how to synthesize.** Instruct them to run, from",
|
|
685
|
+
" the repo root:",
|
|
686
|
+
"",
|
|
687
|
+
" ```",
|
|
688
|
+
" pnpm exec projen",
|
|
689
|
+
" pnpm install",
|
|
690
|
+
" ```",
|
|
691
|
+
"",
|
|
692
|
+
" `pnpm exec projen` regenerates the sub-project tree;",
|
|
693
|
+
" `pnpm install` updates the workspace lockfile. Do **not** run",
|
|
694
|
+
" these commands yourself \u2014 the user runs them.",
|
|
695
|
+
"",
|
|
696
|
+
"## Guardrails",
|
|
697
|
+
"",
|
|
698
|
+
"- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
|
|
699
|
+
" `pnpm test`, or any other package-manager, build, or test command.",
|
|
700
|
+
" Emit the projen block and instructions only.",
|
|
701
|
+
"- Never scaffold outside `apps/`. Shared libraries belong under",
|
|
702
|
+
" `packages/<scope>/<name>` (use `/create-package`); user-facing",
|
|
703
|
+
" sites belong under `sites/<scope>/<name>` (use `/create-site`).",
|
|
704
|
+
"- Never scope by category (e.g. `@apps/foo`, `@stacks/foo`). The",
|
|
705
|
+
" scope identifies the **owning party**; the top-level folder",
|
|
706
|
+
" identifies the kind.",
|
|
707
|
+
"- Do not invent an `outdir` \u2014 rely on the `AwsCdkProject` default",
|
|
708
|
+
" that places the sub-project at `apps/<scope>/<name>`.",
|
|
709
|
+
"",
|
|
710
|
+
"## Related Skills",
|
|
711
|
+
"",
|
|
712
|
+
"- `/create-package` \u2014 scaffold a new `TypeScriptProject` under",
|
|
713
|
+
" `packages/<scope>/<name>`.",
|
|
714
|
+
"- `/create-site` \u2014 scaffold a new `AstroProject` under",
|
|
715
|
+
" `sites/<scope>/<name>`."
|
|
716
|
+
].join("\n")
|
|
717
|
+
};
|
|
718
|
+
var createSiteSkill = {
|
|
719
|
+
name: "create-site",
|
|
720
|
+
description: "Scaffold a new AstroProject sub-project under sites/@scope/<name> by emitting the projen block to add to the monorepo config",
|
|
721
|
+
disableModelInvocation: true,
|
|
722
|
+
instructions: [
|
|
723
|
+
"# Create Site",
|
|
724
|
+
"",
|
|
725
|
+
"Scaffold a new user-facing web front end at",
|
|
726
|
+
"`sites/@scope/<name>` by emitting the projen block to add to the",
|
|
727
|
+
"monorepo's projen configuration. This skill walks the user through",
|
|
728
|
+
"naming, metadata, and placement; it does **not** run projen, install",
|
|
729
|
+
"dependencies, or execute any build commands.",
|
|
730
|
+
"",
|
|
731
|
+
"The default project type is `AstroProject` \u2014 the common shape for",
|
|
732
|
+
"marketing sites, SPAs, and client-facing static sites. A",
|
|
733
|
+
'`StarlightProject` with `role: "site"` is also a valid placement',
|
|
734
|
+
"under `sites/<scope>/<name>` for consumers who specifically want a",
|
|
735
|
+
"Starlight-based front end; it is **not** the monorepo-wide docs site.",
|
|
736
|
+
"",
|
|
737
|
+
"## Usage",
|
|
738
|
+
"",
|
|
739
|
+
"```",
|
|
740
|
+
"/create-site @<scope>/<name>",
|
|
741
|
+
"```",
|
|
742
|
+
"",
|
|
743
|
+
"Example: `/create-site @codedrifters/marketing-site` \u2192 scaffolds a",
|
|
744
|
+
"new `AstroProject` at `sites/@codedrifters/marketing-site`.",
|
|
745
|
+
"",
|
|
746
|
+
"## Docs-vs-Site Guard",
|
|
747
|
+
"",
|
|
748
|
+
"There is **exactly one** Starlight docs site per monorepo, and it",
|
|
749
|
+
"lives at `/docs` \u2014 not under `sites/`. Before emitting any block,",
|
|
750
|
+
"check whether the user actually wants the monorepo-wide docs site:",
|
|
751
|
+
"",
|
|
752
|
+
"- If the user's intent is to create the single dev-docs site for the",
|
|
753
|
+
" monorepo (names like `docs`, `documentation`, `dev-docs`, or any",
|
|
754
|
+
' explicit mention of "the docs site"), **refuse** to scaffold it',
|
|
755
|
+
" under `sites/`. Redirect them to the `StarlightProject` defaults",
|
|
756
|
+
" that place the docs site at `/docs`, and explain that `sites/` is",
|
|
757
|
+
" reserved for end-user-facing web front ends (marketing, SPAs,",
|
|
758
|
+
" client-facing apps).",
|
|
759
|
+
"- If the user wants a user-facing site that happens to use Starlight",
|
|
760
|
+
" (e.g. a public-facing documentation portal for a specific",
|
|
761
|
+
" product), that is fine \u2014 they should use `StarlightProject` with",
|
|
762
|
+
' `role: "site"`, which routes under `sites/<scope>/<name>`.',
|
|
763
|
+
"- Otherwise, proceed with `AstroProject` as the default.",
|
|
764
|
+
"",
|
|
765
|
+
"## Steps",
|
|
766
|
+
"",
|
|
767
|
+
"1. **Parse and validate the site name.** The argument must be a",
|
|
768
|
+
" **scoped** npm name in the form `@<scope>/<name>`:",
|
|
769
|
+
" - Starts with `@`",
|
|
770
|
+
" - Has exactly one `/` separator",
|
|
771
|
+
" - `<scope>` and `<name>` are lowercase, kebab-case, non-empty",
|
|
772
|
+
" - Unscoped names (e.g. `marketing-site`) are **not** allowed \u2014",
|
|
773
|
+
" every site under `sites/` is scoped by owner.",
|
|
774
|
+
" If the input is missing or invalid, ask the user to supply a",
|
|
775
|
+
" scoped name. Do not guess the scope. Run the docs-vs-site guard",
|
|
776
|
+
" above before continuing.",
|
|
777
|
+
"",
|
|
778
|
+
"2. **Collect metadata** \u2014 ask the user for each of the following,",
|
|
779
|
+
" one question at a time:",
|
|
780
|
+
" - **Description** \u2014 one-line summary of what the site is for.",
|
|
781
|
+
" - **Project type** \u2014 `AstroProject` (default) or",
|
|
782
|
+
" `StarlightProject` (role = site). If the user is unsure,",
|
|
783
|
+
" recommend `AstroProject` \u2014 Starlight is only the right choice",
|
|
784
|
+
" when the site's primary purpose is a documentation-style",
|
|
785
|
+
' layout. As an aside: a `StarlightProject` with `role: "site"`',
|
|
786
|
+
" lives at the same `sites/<scope>/<name>` path, so switching",
|
|
787
|
+
" between the two later is a low-cost change.",
|
|
788
|
+
" Skip any question the user has already answered in the initial",
|
|
789
|
+
" prompt.",
|
|
790
|
+
"",
|
|
791
|
+
"3. **Determine the target outdir.** The sub-project lives at:",
|
|
792
|
+
"",
|
|
793
|
+
" ```",
|
|
794
|
+
" sites/<scope>/<name>",
|
|
795
|
+
" ```",
|
|
796
|
+
"",
|
|
797
|
+
" `<scope>` is everything after `@` and before `/` in the site",
|
|
798
|
+
" name; `<name>` is everything after the `/`. This matches the",
|
|
799
|
+
" default `outdir` that `AstroProject` (and `StarlightProject` with",
|
|
800
|
+
' `role: "site"`) computes from the package name, so the emitted',
|
|
801
|
+
" block does **not** need to set `outdir` explicitly.",
|
|
802
|
+
"",
|
|
803
|
+
"4. **Locate the projen config file.** Prefer the monorepo's",
|
|
804
|
+
" `projenrc/` directory \u2014 most monorepos declare sub-projects",
|
|
805
|
+
" there (e.g. `projenrc/root-project.ts` or a dedicated",
|
|
806
|
+
" `projenrc/sites.ts`). Fall back to `.projenrc.ts` only when",
|
|
807
|
+
" no `projenrc/` directory exists.",
|
|
808
|
+
"",
|
|
809
|
+
"5. **Emit the projen block.** Show the TypeScript block to paste",
|
|
810
|
+
" into the chosen projen config file. Example for",
|
|
811
|
+
" `@codedrifters/marketing-site` as an `AstroProject`:",
|
|
812
|
+
"",
|
|
813
|
+
" ```typescript",
|
|
814
|
+
" import { AstroProject } from '@codedrifters/configulator';",
|
|
815
|
+
"",
|
|
816
|
+
" // Inside the monorepo's configuration function, alongside",
|
|
817
|
+
" // sibling sub-projects:",
|
|
818
|
+
" new AstroProject({",
|
|
819
|
+
" parent: monorepo,",
|
|
820
|
+
" name: '@codedrifters/marketing-site',",
|
|
821
|
+
" description: '<one-line description>',",
|
|
822
|
+
" });",
|
|
823
|
+
" ```",
|
|
824
|
+
"",
|
|
825
|
+
' If the user chose `StarlightProject` with `role: "site"`, emit',
|
|
826
|
+
" that variant instead \u2014 same path, different project class:",
|
|
827
|
+
"",
|
|
828
|
+
" ```typescript",
|
|
829
|
+
" import { StarlightProject } from '@codedrifters/configulator';",
|
|
830
|
+
"",
|
|
831
|
+
" new StarlightProject({",
|
|
832
|
+
" parent: monorepo,",
|
|
833
|
+
" name: '@codedrifters/marketing-site',",
|
|
834
|
+
" description: '<one-line description>',",
|
|
835
|
+
" role: 'site',",
|
|
836
|
+
" });",
|
|
837
|
+
" ```",
|
|
838
|
+
"",
|
|
839
|
+
" Substitute the user's scope, name, and description. Do not",
|
|
840
|
+
" hard-code `outdir` \u2014 the default places the sub-project at",
|
|
841
|
+
" `sites/<scope>/<name>`.",
|
|
842
|
+
"",
|
|
843
|
+
"6. **Tell the user how to synthesize.** Instruct them to run, from",
|
|
844
|
+
" the repo root:",
|
|
845
|
+
"",
|
|
846
|
+
" ```",
|
|
847
|
+
" pnpm exec projen",
|
|
848
|
+
" pnpm install",
|
|
849
|
+
" ```",
|
|
850
|
+
"",
|
|
851
|
+
" `pnpm exec projen` regenerates the sub-project tree;",
|
|
852
|
+
" `pnpm install` updates the workspace lockfile. Do **not** run",
|
|
853
|
+
" these commands yourself \u2014 the user runs them.",
|
|
854
|
+
"",
|
|
855
|
+
"## Guardrails",
|
|
856
|
+
"",
|
|
857
|
+
"- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
|
|
858
|
+
" `pnpm test`, or any other package-manager, build, or test command.",
|
|
859
|
+
" Emit the projen block and instructions only.",
|
|
860
|
+
"- Never scaffold the monorepo-wide docs site under `sites/`. The",
|
|
861
|
+
" dev-docs site is a singleton at `/docs` and is created once per",
|
|
862
|
+
' repo via `StarlightProject` with its default `role: "docs"` \u2014',
|
|
863
|
+
" redirect the user there if they ask for it.",
|
|
864
|
+
"- Never scaffold outside `sites/`. Shared libraries belong under",
|
|
865
|
+
" `packages/<scope>/<name>` (use `/create-package`); deployable apps",
|
|
866
|
+
" belong under `apps/<scope>/<name>` (use `/create-app`).",
|
|
867
|
+
"- Never scope by category (e.g. `@sites/foo`, `@web/foo`). The",
|
|
868
|
+
" scope identifies the **owning party**; the top-level folder",
|
|
869
|
+
" identifies the kind.",
|
|
870
|
+
"- Do not invent an `outdir` \u2014 rely on the `AstroProject` default",
|
|
871
|
+
' (or the `StarlightProject` default when `role: "site"`) that',
|
|
872
|
+
" places the sub-project at `sites/<scope>/<name>`.",
|
|
873
|
+
"",
|
|
874
|
+
"## Related Skills",
|
|
875
|
+
"",
|
|
876
|
+
"- `/create-package` \u2014 scaffold a new `TypeScriptProject` under",
|
|
877
|
+
" `packages/<scope>/<name>`.",
|
|
878
|
+
"- `/create-app` \u2014 scaffold a new `AwsCdkProject` under",
|
|
879
|
+
" `apps/<scope>/<name>`."
|
|
880
|
+
].join("\n")
|
|
881
|
+
};
|
|
595
882
|
var createRuleSkill = {
|
|
596
883
|
name: "create-rule",
|
|
597
884
|
description: "Guide for creating new agent rules in this project using configulator",
|
|
@@ -650,7 +937,12 @@ var baseBundle = {
|
|
|
650
937
|
name: "base",
|
|
651
938
|
description: "Core rules: project overview, interaction style, and general coding conventions",
|
|
652
939
|
appliesWhen: () => true,
|
|
653
|
-
skills: [
|
|
940
|
+
skills: [
|
|
941
|
+
createPackageSkill,
|
|
942
|
+
createAppSkill,
|
|
943
|
+
createSiteSkill,
|
|
944
|
+
createRuleSkill
|
|
945
|
+
],
|
|
654
946
|
rules: [
|
|
655
947
|
{
|
|
656
948
|
name: "project-overview",
|