@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.js CHANGED
@@ -514,12 +514,31 @@ var baseBundle = {
514
514
  },
515
515
  {
516
516
  name: "cursor-projen-restrictions",
517
- description: "Cursor must not run projen or package-manager install commands",
517
+ description: "Cursor must not run projen, build, test, or package-manager commands",
518
518
  scope: AGENT_RULE_SCOPE.ALWAYS,
519
519
  content: [
520
- "# Projen Restrictions",
520
+ "# Projen & Development Command Restrictions",
521
521
  "",
522
- "- **Do not run `npx projen`, `pnpm install`, or `pnpm i`** \u2014 after modifying Projen configuration, the user should run these commands locally."
522
+ "**Never** run any of the following commands. Instead, tell the user which commands to run and why.",
523
+ "",
524
+ "## Prohibited Commands",
525
+ "",
526
+ "- `npx projen` \u2014 synthesize project files",
527
+ "- `pnpm install` / `pnpm i` \u2014 install dependencies",
528
+ "- `pnpm build` / `pnpm build:all` \u2014 build the project",
529
+ "- `pnpm test` / `pnpm --filter ... test` \u2014 run tests",
530
+ "- `pnpm eslint` / `pnpm --filter ... eslint` \u2014 run linting",
531
+ "- `pnpm compile` / `pnpm --filter ... compile` \u2014 compile packages",
532
+ "- `pnpm reset` / `pnpm reset:all` \u2014 reset build artifacts",
533
+ "- Any `vitest`, `tsup`, `rollup`, or `turbo` commands",
534
+ "",
535
+ "## What to Do Instead",
536
+ "",
537
+ "After making changes that need validation, tell the user the specific commands to run:",
538
+ "",
539
+ "1. **After projen config changes** \u2014 tell the user to run `npx projen && pnpm install`",
540
+ "2. **After source code changes** \u2014 tell the user to run `pnpm --filter @codedrifters/<package> test`",
541
+ "3. **After multi-package changes** \u2014 tell the user to run `pnpm build:all`"
523
542
  ].join("\n"),
524
543
  platforms: {
525
544
  claude: { exclude: true }
@@ -825,13 +844,15 @@ var githubWorkflowBundle = {
825
844
  "",
826
845
  "When the user says **open a PR** (or similar), follow these steps exactly:",
827
846
  "",
828
- "1. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
829
- "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",
830
- "3. **Push the branch** to origin: `git push -u origin <branch>`",
831
- "4. **Create the PR** using `gh pr create`:",
847
+ "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.",
848
+ "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.",
849
+ "3. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
850
+ "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",
851
+ "5. **Push the branch** to origin: `git push -u origin <branch>`",
852
+ "6. **Create the PR** using `gh pr create`:",
832
853
  " - **Title**: use a conventional commit style title (e.g., `feat(scope): short description`)",
833
854
  " - **Body**: include `Closes #<issue-number>` (derived from the branch name) and a brief summary of changes",
834
- "5. **Enable auto-merge with squash** \u2014 use `gh pr merge --auto --squash` with the merge commit message:",
855
+ "7. **Enable auto-merge with squash** \u2014 use `gh pr merge --auto --squash` with the merge commit message:",
835
856
  "",
836
857
  "```",
837
858
  "gh pr merge --auto --squash --subject '<conventional-commit-title>' --body '<extended-description>'",
@@ -1063,6 +1084,185 @@ var projenBundle = {
1063
1084
  description: "Projen conventions, synthesis workflow, .projenrc.ts patterns",
1064
1085
  appliesWhen: (project) => hasDep(project, "projen"),
1065
1086
  rules: [
1087
+ {
1088
+ name: "development-commands",
1089
+ description: "Projen development commands for building, testing, linting, and validating changes",
1090
+ scope: AGENT_RULE_SCOPE.ALWAYS,
1091
+ content: [
1092
+ "# Development Commands",
1093
+ "",
1094
+ "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.",
1095
+ "",
1096
+ "## Synthesizing Projen Configuration",
1097
+ "",
1098
+ "After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files:",
1099
+ "",
1100
+ "```sh",
1101
+ "npx projen",
1102
+ "pnpm install",
1103
+ "```",
1104
+ "",
1105
+ "Both steps are required \u2014 `npx projen` regenerates files, `pnpm install` updates the lockfile to match.",
1106
+ "",
1107
+ "## Building",
1108
+ "",
1109
+ "**Full monorepo build** (compile + test + package, all sub-packages via Turborepo):",
1110
+ "",
1111
+ "```sh",
1112
+ "pnpm build:all",
1113
+ "```",
1114
+ "",
1115
+ "**Root project only** (synthesize + compile + lint):",
1116
+ "",
1117
+ "```sh",
1118
+ "pnpm build",
1119
+ "```",
1120
+ "",
1121
+ "**Single sub-package** (compile only):",
1122
+ "",
1123
+ "```sh",
1124
+ "pnpm --filter @codedrifters/<package> compile",
1125
+ "```",
1126
+ "",
1127
+ "Replace `<package>` with `configulator`, `constructs`, or `utils`.",
1128
+ "",
1129
+ "## Testing",
1130
+ "",
1131
+ "**Run tests for a single sub-package:**",
1132
+ "",
1133
+ "```sh",
1134
+ "pnpm --filter @codedrifters/<package> test",
1135
+ "```",
1136
+ "",
1137
+ "This runs ESLint + Vitest for the specified package.",
1138
+ "",
1139
+ "**Run only Vitest (skip lint) in a sub-package:**",
1140
+ "",
1141
+ "```sh",
1142
+ "cd packages/@codedrifters/<package>",
1143
+ "pnpm exec vitest run",
1144
+ "```",
1145
+ "",
1146
+ "**Run a specific test file:**",
1147
+ "",
1148
+ "```sh",
1149
+ "cd packages/@codedrifters/<package>",
1150
+ "pnpm exec vitest run src/path/to/file.test.ts",
1151
+ "```",
1152
+ "",
1153
+ "## Linting",
1154
+ "",
1155
+ "**Lint the root project:**",
1156
+ "",
1157
+ "```sh",
1158
+ "pnpm eslint",
1159
+ "```",
1160
+ "",
1161
+ "**Lint a single sub-package:**",
1162
+ "",
1163
+ "```sh",
1164
+ "pnpm --filter @codedrifters/<package> eslint",
1165
+ "```",
1166
+ "",
1167
+ "## Resetting Build Artifacts",
1168
+ "",
1169
+ "**Reset everything** (all packages + root):",
1170
+ "",
1171
+ "```sh",
1172
+ "pnpm reset:all",
1173
+ "```",
1174
+ "",
1175
+ "**Reset root only:**",
1176
+ "",
1177
+ "```sh",
1178
+ "pnpm reset",
1179
+ "```",
1180
+ "",
1181
+ "## Validating Changes Are Complete",
1182
+ "",
1183
+ "After finishing implementation work, validate that changes are correct by running the appropriate commands depending on what was changed:",
1184
+ "",
1185
+ "1. **Projen config changes** (`projenrc/`, `.projenrc.ts`):",
1186
+ " - Run `npx projen` then `pnpm install`",
1187
+ " - Verify no unexpected generated file changes with `git diff`",
1188
+ "",
1189
+ "2. **Source code changes** (in a sub-package):",
1190
+ " - Compile: `pnpm --filter @codedrifters/<package> compile`",
1191
+ " - Test: `pnpm --filter @codedrifters/<package> test`",
1192
+ "",
1193
+ "3. **Changes spanning multiple packages**:",
1194
+ " - Run `pnpm build:all` to validate the full monorepo build",
1195
+ "",
1196
+ "4. **Root-level changes** (projenrc, root config):",
1197
+ " - Run `pnpm build` to validate root synthesis + compilation + lint",
1198
+ "",
1199
+ "## Command Reference",
1200
+ "",
1201
+ "| Task | Command |",
1202
+ "|------|---------|",
1203
+ "| Synthesize projen | `npx projen` |",
1204
+ "| Install deps | `pnpm install` |",
1205
+ "| Full monorepo build | `pnpm build:all` |",
1206
+ "| Root build only | `pnpm build` |",
1207
+ "| Compile one package | `pnpm --filter @codedrifters/<pkg> compile` |",
1208
+ "| Test one package | `pnpm --filter @codedrifters/<pkg> test` |",
1209
+ "| Lint one package | `pnpm --filter @codedrifters/<pkg> eslint` |",
1210
+ "| Lint root | `pnpm eslint` |",
1211
+ "| Reset all artifacts | `pnpm reset:all` |"
1212
+ ].join("\n"),
1213
+ tags: ["workflow"]
1214
+ },
1215
+ {
1216
+ name: "agent-rules-customization",
1217
+ description: "How to customize agent rules for this repo via the Projen project definition",
1218
+ scope: AGENT_RULE_SCOPE.FILE_PATTERN,
1219
+ filePatterns: [
1220
+ "projenrc/**/*.ts",
1221
+ ".projenrc.ts",
1222
+ ".claude/rules/*.md",
1223
+ ".cursor/rules/*.mdc",
1224
+ "CLAUDE.md"
1225
+ ],
1226
+ content: [
1227
+ "# Customizing Agent Rules",
1228
+ "",
1229
+ "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.",
1230
+ "",
1231
+ "## Adding Repo-Specific Rules",
1232
+ "",
1233
+ "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`):",
1234
+ "",
1235
+ "```typescript",
1236
+ "agentConfig: {",
1237
+ " rules: [",
1238
+ " {",
1239
+ " name: 'my-repo-rule',",
1240
+ " description: 'What this rule does',",
1241
+ " scope: AGENT_RULE_SCOPE.ALWAYS, // or FILE_PATTERN with filePatterns",
1242
+ " content: '# My Rule\\n\\n- Guideline 1\\n- Guideline 2',",
1243
+ " },",
1244
+ " ],",
1245
+ "}",
1246
+ "```",
1247
+ "",
1248
+ "## Extending Existing Bundle Rules",
1249
+ "",
1250
+ "To append repo-specific content to a rule provided by a configulator bundle (without replacing it), use `agentConfig.ruleExtensions`:",
1251
+ "",
1252
+ "```typescript",
1253
+ "agentConfig: {",
1254
+ " ruleExtensions: {",
1255
+ " 'typescript-conventions': '## Additional Guidelines\\n\\n- My custom guideline',",
1256
+ " },",
1257
+ "}",
1258
+ "```",
1259
+ "",
1260
+ "## After Any Change",
1261
+ "",
1262
+ "Run `npx projen` then `pnpm install` to regenerate the output files."
1263
+ ].join("\n"),
1264
+ tags: ["workflow"]
1265
+ },
1066
1266
  {
1067
1267
  name: "projen-conventions",
1068
1268
  description: "Projen configuration patterns and best practices",