@codedrifters/configulator 0.0.239 → 0.0.240

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
@@ -767,6 +767,91 @@ var baseBundle = {
767
767
  ].join("\n"),
768
768
  tags: ["workflow"]
769
769
  },
770
+ {
771
+ name: "monorepo-layout",
772
+ description: "Canonical monorepo top-level folders (docs, apps, packages, sites), the @ownerscope/<name> scoping rule, the docs-singleton carve-out, and the scaffolding skills that place new sub-projects",
773
+ scope: AGENT_RULE_SCOPE.ALWAYS,
774
+ content: [
775
+ "# Monorepo Layout",
776
+ "",
777
+ "Every monorepo built with `@codedrifters/configulator` uses a single,",
778
+ "fixed top-level folder layout. Agents, scaffolding skills, pnpm-workspace",
779
+ "globs, Turbo filters, and CI cache keys all assume these roots.",
780
+ "",
781
+ "## Four Canonical Top-Level Folders",
782
+ "",
783
+ "| Folder | Purpose | Examples |",
784
+ "|--------|---------|----------|",
785
+ "| `/docs` | **Single** Starlight site covering the entire monorepo. The one site that lives outside `/sites`. | Monorepo-wide developer docs, ADRs, how-to guides. |",
786
+ "| `/apps/@scope/<name>` | Deployable applications \u2014 anything that runs or ships as a running process. | AWS CDK stacks, mobile apps (iOS/Android), backend services. |",
787
+ "| `/packages/@scope/<name>` | Shared libraries \u2014 published npm packages and workspace-internal libraries. | `@codedrifters/configulator`, `@codedrifters/constructs`, `@codedrifters/utils`. |",
788
+ "| `/sites/@scope/<name>` | User-facing web front ends that are **not** the monorepo-wide docs site. | Marketing sites, SPAs, per-client static sites. |",
789
+ "",
790
+ "No other top-level folder is part of this contract. Generated roots",
791
+ "(`.projen/`, `.github/`, `node_modules/`, `.turbo/`, etc.) are orthogonal",
792
+ "and unchanged.",
793
+ "",
794
+ "## Scoping Rule",
795
+ "",
796
+ "Every sub-project under `apps/`, `packages/`, or `sites/` is named",
797
+ "`@ownerscope/<name>`, where **scope is the owning party** (not a category).",
798
+ "",
799
+ "- `@codedrifters/configulator` \u2014 a shared library owned by CodeDrifters \u2192 `packages/@codedrifters/configulator`",
800
+ "- `@codedrifters/infrastructure-stack` \u2014 an AWS CDK app owned by CodeDrifters \u2192 `apps/@codedrifters/infrastructure-stack`",
801
+ "- `@clientA/iphone-app` \u2014 a mobile app owned by Client A \u2192 `apps/@clientA/iphone-app`",
802
+ "- `@clientB/marketing-site` \u2014 a marketing site owned by Client B \u2192 `sites/@clientB/marketing-site`",
803
+ "",
804
+ "The scope identifies **who owns the sub-project**, not what kind of",
805
+ "sub-project it is. Kind is captured by the top-level folder (`apps/`,",
806
+ "`packages/`, `sites/`). Never scope by category (e.g. `@apps/foo`,",
807
+ "`@libs/bar`) \u2014 the top-level folder already carries that information.",
808
+ "",
809
+ "## Docs-Singleton Carve-Out",
810
+ "",
811
+ "There is **exactly one** Starlight docs site per monorepo, and it lives",
812
+ "at `/docs`. It is **not** `sites/@scope/docs`.",
813
+ "",
814
+ "- The docs site is monorepo-wide. Sub-project documentation belongs",
815
+ " inside that single site (under `docs/content/`), not in a per-package",
816
+ " `docs/` folder.",
817
+ "- Configulator's `StarlightProject` defaults its `outdir` to `/docs`.",
818
+ "- `/sites` is reserved for end-user-facing web front ends (marketing",
819
+ " sites, SPAs, client-facing apps). It deliberately does not host the",
820
+ " dev-docs site.",
821
+ "",
822
+ "## Project-Type \u2192 `outdir` Mapping",
823
+ "",
824
+ "Configulator project types default their `outdir` according to the",
825
+ "following table. Override `outdir` explicitly only when you have a",
826
+ "genuine reason \u2014 the defaults cover the common path.",
827
+ "",
828
+ "| Configulator project type | Default `outdir` |",
829
+ "|---------------------------|------------------|",
830
+ "| `TypeScriptProject` | `packages/<scope>/<name>` |",
831
+ "| `AwsCdkProject` | `apps/<scope>/<name>` |",
832
+ "| `AstroProject` | `sites/<scope>/<name>` |",
833
+ "| `StarlightProject` (role = docs) | `docs/` |",
834
+ "",
835
+ "`<scope>` is parsed from the sub-project's package name (everything",
836
+ "after `@` and before `/`). `<name>` is the unscoped part of the",
837
+ "package name.",
838
+ "",
839
+ "## Placing New Sub-Projects",
840
+ "",
841
+ "Never hand-roll a sub-project path. Use one of the scaffolding skills,",
842
+ "which take `@scope/<name>` as input, validate it, and place the new",
843
+ "project in the correct folder:",
844
+ "",
845
+ "- `/create-package` \u2014 scaffolds a new `TypeScriptProject` under `packages/<scope>/<name>`",
846
+ "- `/create-app` \u2014 scaffolds a new `AwsCdkProject` under `apps/<scope>/<name>`",
847
+ "- `/create-site` \u2014 scaffolds a new `AstroProject` under `sites/<scope>/<name>`",
848
+ "",
849
+ "The monorepo-wide docs site at `/docs` is a singleton and is created",
850
+ "once per repo via `StarlightProject` \u2014 it is not scaffolded per",
851
+ "sub-project."
852
+ ].join("\n"),
853
+ tags: ["project"]
854
+ },
770
855
  {
771
856
  name: "issue-conventions",
772
857
  description: "Issue title prefixes, GitHub issue type mapping, prerequisite issues",