@codedrifters/configulator 0.0.174 → 0.0.175

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
@@ -463,12 +463,31 @@ var baseBundle = {
463
463
  },
464
464
  {
465
465
  name: "cursor-projen-restrictions",
466
- description: "Cursor must not run projen or package-manager install commands",
466
+ description: "Cursor must not run projen, build, test, or package-manager commands",
467
467
  scope: AGENT_RULE_SCOPE.ALWAYS,
468
468
  content: [
469
- "# Projen Restrictions",
469
+ "# Projen & Development Command Restrictions",
470
470
  "",
471
- "- **Do not run `npx projen`, `pnpm install`, or `pnpm i`** \u2014 after modifying Projen configuration, the user should run these commands locally."
471
+ "**Never** run any of the following commands. Instead, tell the user which commands to run and why.",
472
+ "",
473
+ "## Prohibited Commands",
474
+ "",
475
+ "- `npx projen` \u2014 synthesize project files",
476
+ "- `pnpm install` / `pnpm i` \u2014 install dependencies",
477
+ "- `pnpm build` / `pnpm build:all` \u2014 build the project",
478
+ "- `pnpm test` / `pnpm --filter ... test` \u2014 run tests",
479
+ "- `pnpm eslint` / `pnpm --filter ... eslint` \u2014 run linting",
480
+ "- `pnpm compile` / `pnpm --filter ... compile` \u2014 compile packages",
481
+ "- `pnpm reset` / `pnpm reset:all` \u2014 reset build artifacts",
482
+ "- Any `vitest`, `tsup`, `rollup`, or `turbo` commands",
483
+ "",
484
+ "## What to Do Instead",
485
+ "",
486
+ "After making changes that need validation, tell the user the specific commands to run:",
487
+ "",
488
+ "1. **After projen config changes** \u2014 tell the user to run `npx projen && pnpm install`",
489
+ "2. **After source code changes** \u2014 tell the user to run `pnpm --filter @codedrifters/<package> test`",
490
+ "3. **After multi-package changes** \u2014 tell the user to run `pnpm build:all`"
472
491
  ].join("\n"),
473
492
  platforms: {
474
493
  claude: { exclude: true }
@@ -774,13 +793,15 @@ var githubWorkflowBundle = {
774
793
  "",
775
794
  "When the user says **open a PR** (or similar), follow these steps exactly:",
776
795
  "",
777
- "1. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
778
- "2. **Pull and rebase from the default branch** \u2014 run `git pull origin {{repository.defaultBranch}} --rebase` to incorporate the latest changes and resolve any conflicts before pushing",
779
- "3. **Push the branch** to origin: `git push -u origin <branch>`",
780
- "4. **Create the PR** using `gh pr create`:",
796
+ "1. **Regenerate project files** \u2014 run `npx projen` then `pnpm install` to ensure all generated files are up to date. Check `git diff` \u2014 if there are changes, commit them before proceeding.",
797
+ "2. **Run the full monorepo build** \u2014 run `pnpm build:all` to compile, lint, and test all packages (mirrors the CI pipeline). This command requires the user to be authenticated to AWS on the prod account used for Turborepo remote caching (`readonlyaccess-prod-525259625215-us-east-1` profile). If the command fails due to AWS credentials, ask the user to authenticate first. If the build produces changes to turbo inputs (typically snapshot files or ESLint auto-fixes), commit those changes and run `pnpm build:all` again \u2014 the build must complete cleanly with no uncommitted changes.",
798
+ "3. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
799
+ "4. **Pull and rebase from the default branch** \u2014 run `git pull origin {{repository.defaultBranch}} --rebase` to incorporate the latest changes and resolve any conflicts before pushing",
800
+ "5. **Push the branch** to origin: `git push -u origin <branch>`",
801
+ "6. **Create the PR** using `gh pr create`:",
781
802
  " - **Title**: use a conventional commit style title (e.g., `feat(scope): short description`)",
782
803
  " - **Body**: include `Closes #<issue-number>` (derived from the branch name) and a brief summary of changes",
783
- "5. **Enable auto-merge with squash** \u2014 use `gh pr merge --auto --squash` with the merge commit message:",
804
+ "7. **Enable auto-merge with squash** \u2014 use `gh pr merge --auto --squash` with the merge commit message:",
784
805
  "",
785
806
  "```",
786
807
  "gh pr merge --auto --squash --subject '<conventional-commit-title>' --body '<extended-description>'",
@@ -1012,6 +1033,185 @@ var projenBundle = {
1012
1033
  description: "Projen conventions, synthesis workflow, .projenrc.ts patterns",
1013
1034
  appliesWhen: (project) => hasDep(project, "projen"),
1014
1035
  rules: [
1036
+ {
1037
+ name: "development-commands",
1038
+ description: "Projen development commands for building, testing, linting, and validating changes",
1039
+ scope: AGENT_RULE_SCOPE.ALWAYS,
1040
+ content: [
1041
+ "# Development Commands",
1042
+ "",
1043
+ "This project uses Projen to manage configuration and Turborepo to orchestrate builds across the monorepo. Run all commands from the **repository root** unless otherwise noted.",
1044
+ "",
1045
+ "## Synthesizing Projen Configuration",
1046
+ "",
1047
+ "After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files:",
1048
+ "",
1049
+ "```sh",
1050
+ "npx projen",
1051
+ "pnpm install",
1052
+ "```",
1053
+ "",
1054
+ "Both steps are required \u2014 `npx projen` regenerates files, `pnpm install` updates the lockfile to match.",
1055
+ "",
1056
+ "## Building",
1057
+ "",
1058
+ "**Full monorepo build** (compile + test + package, all sub-packages via Turborepo):",
1059
+ "",
1060
+ "```sh",
1061
+ "pnpm build:all",
1062
+ "```",
1063
+ "",
1064
+ "**Root project only** (synthesize + compile + lint):",
1065
+ "",
1066
+ "```sh",
1067
+ "pnpm build",
1068
+ "```",
1069
+ "",
1070
+ "**Single sub-package** (compile only):",
1071
+ "",
1072
+ "```sh",
1073
+ "pnpm --filter @codedrifters/<package> compile",
1074
+ "```",
1075
+ "",
1076
+ "Replace `<package>` with `configulator`, `constructs`, or `utils`.",
1077
+ "",
1078
+ "## Testing",
1079
+ "",
1080
+ "**Run tests for a single sub-package:**",
1081
+ "",
1082
+ "```sh",
1083
+ "pnpm --filter @codedrifters/<package> test",
1084
+ "```",
1085
+ "",
1086
+ "This runs ESLint + Vitest for the specified package.",
1087
+ "",
1088
+ "**Run only Vitest (skip lint) in a sub-package:**",
1089
+ "",
1090
+ "```sh",
1091
+ "cd packages/@codedrifters/<package>",
1092
+ "pnpm exec vitest run",
1093
+ "```",
1094
+ "",
1095
+ "**Run a specific test file:**",
1096
+ "",
1097
+ "```sh",
1098
+ "cd packages/@codedrifters/<package>",
1099
+ "pnpm exec vitest run src/path/to/file.test.ts",
1100
+ "```",
1101
+ "",
1102
+ "## Linting",
1103
+ "",
1104
+ "**Lint the root project:**",
1105
+ "",
1106
+ "```sh",
1107
+ "pnpm eslint",
1108
+ "```",
1109
+ "",
1110
+ "**Lint a single sub-package:**",
1111
+ "",
1112
+ "```sh",
1113
+ "pnpm --filter @codedrifters/<package> eslint",
1114
+ "```",
1115
+ "",
1116
+ "## Resetting Build Artifacts",
1117
+ "",
1118
+ "**Reset everything** (all packages + root):",
1119
+ "",
1120
+ "```sh",
1121
+ "pnpm reset:all",
1122
+ "```",
1123
+ "",
1124
+ "**Reset root only:**",
1125
+ "",
1126
+ "```sh",
1127
+ "pnpm reset",
1128
+ "```",
1129
+ "",
1130
+ "## Validating Changes Are Complete",
1131
+ "",
1132
+ "After finishing implementation work, validate that changes are correct by running the appropriate commands depending on what was changed:",
1133
+ "",
1134
+ "1. **Projen config changes** (`projenrc/`, `.projenrc.ts`):",
1135
+ " - Run `npx projen` then `pnpm install`",
1136
+ " - Verify no unexpected generated file changes with `git diff`",
1137
+ "",
1138
+ "2. **Source code changes** (in a sub-package):",
1139
+ " - Compile: `pnpm --filter @codedrifters/<package> compile`",
1140
+ " - Test: `pnpm --filter @codedrifters/<package> test`",
1141
+ "",
1142
+ "3. **Changes spanning multiple packages**:",
1143
+ " - Run `pnpm build:all` to validate the full monorepo build",
1144
+ "",
1145
+ "4. **Root-level changes** (projenrc, root config):",
1146
+ " - Run `pnpm build` to validate root synthesis + compilation + lint",
1147
+ "",
1148
+ "## Command Reference",
1149
+ "",
1150
+ "| Task | Command |",
1151
+ "|------|---------|",
1152
+ "| Synthesize projen | `npx projen` |",
1153
+ "| Install deps | `pnpm install` |",
1154
+ "| Full monorepo build | `pnpm build:all` |",
1155
+ "| Root build only | `pnpm build` |",
1156
+ "| Compile one package | `pnpm --filter @codedrifters/<pkg> compile` |",
1157
+ "| Test one package | `pnpm --filter @codedrifters/<pkg> test` |",
1158
+ "| Lint one package | `pnpm --filter @codedrifters/<pkg> eslint` |",
1159
+ "| Lint root | `pnpm eslint` |",
1160
+ "| Reset all artifacts | `pnpm reset:all` |"
1161
+ ].join("\n"),
1162
+ tags: ["workflow"]
1163
+ },
1164
+ {
1165
+ name: "agent-rules-customization",
1166
+ description: "How to customize agent rules for this repo via the Projen project definition",
1167
+ scope: AGENT_RULE_SCOPE.FILE_PATTERN,
1168
+ filePatterns: [
1169
+ "projenrc/**/*.ts",
1170
+ ".projenrc.ts",
1171
+ ".claude/rules/*.md",
1172
+ ".cursor/rules/*.mdc",
1173
+ "CLAUDE.md"
1174
+ ],
1175
+ content: [
1176
+ "# Customizing Agent Rules",
1177
+ "",
1178
+ "Agent rules for Claude and Cursor are **generated** by configulator's `AgentConfig` component. The generated output files (`.claude/rules/`, `.cursor/rules/`, `CLAUDE.md`) must not be edited directly \u2014 they are overwritten on every `npx projen` run.",
1179
+ "",
1180
+ "## Adding Repo-Specific Rules",
1181
+ "",
1182
+ "Rules that only apply to this repository should be added to the `agentConfig.rules` array in the Projen project definition (`.projenrc.ts` or `projenrc/*.ts`):",
1183
+ "",
1184
+ "```typescript",
1185
+ "agentConfig: {",
1186
+ " rules: [",
1187
+ " {",
1188
+ " name: 'my-repo-rule',",
1189
+ " description: 'What this rule does',",
1190
+ " scope: AGENT_RULE_SCOPE.ALWAYS, // or FILE_PATTERN with filePatterns",
1191
+ " content: '# My Rule\\n\\n- Guideline 1\\n- Guideline 2',",
1192
+ " },",
1193
+ " ],",
1194
+ "}",
1195
+ "```",
1196
+ "",
1197
+ "## Extending Existing Bundle Rules",
1198
+ "",
1199
+ "To append repo-specific content to a rule provided by a configulator bundle (without replacing it), use `agentConfig.ruleExtensions`:",
1200
+ "",
1201
+ "```typescript",
1202
+ "agentConfig: {",
1203
+ " ruleExtensions: {",
1204
+ " 'typescript-conventions': '## Additional Guidelines\\n\\n- My custom guideline',",
1205
+ " },",
1206
+ "}",
1207
+ "```",
1208
+ "",
1209
+ "## After Any Change",
1210
+ "",
1211
+ "Run `npx projen` then `pnpm install` to regenerate the output files."
1212
+ ].join("\n"),
1213
+ tags: ["workflow"]
1214
+ },
1015
1215
  {
1016
1216
  name: "projen-conventions",
1017
1217
  description: "Projen configuration patterns and best practices",