@codedrifters/configulator 0.0.277 → 0.0.279
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.d.mts +47 -2
- package/lib/index.d.ts +47 -2
- package/lib/index.js +93 -35
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +93 -35
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -2867,20 +2867,26 @@ var createPackageSkill = {
|
|
|
2867
2867
|
" places the sub-project at `packages/<scope>/<name>`.",
|
|
2868
2868
|
"",
|
|
2869
2869
|
"6. **Tell the user how to synthesize.** Instruct them to run, from",
|
|
2870
|
-
" the repo root:",
|
|
2870
|
+
" the repo root, the safe three-step regen sequence:",
|
|
2871
2871
|
"",
|
|
2872
2872
|
" ```",
|
|
2873
|
+
" pnpm i",
|
|
2873
2874
|
" pnpm exec projen",
|
|
2874
|
-
" pnpm
|
|
2875
|
+
" pnpm i",
|
|
2875
2876
|
" ```",
|
|
2876
2877
|
"",
|
|
2877
|
-
" `pnpm
|
|
2878
|
-
"
|
|
2879
|
-
"
|
|
2878
|
+
" The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
|
|
2879
|
+
" so synth runs against the right configulator/projen/plugin",
|
|
2880
|
+
" versions \u2014 without it, `pnpm exec projen` may synth against a",
|
|
2881
|
+
" stale resolved version of any pnpm-managed component and produce",
|
|
2882
|
+
" phantom drift in generated files. `pnpm exec projen` regenerates",
|
|
2883
|
+
" the sub-project tree; the trailing `pnpm i` updates the workspace",
|
|
2884
|
+
" lockfile to pick up any dependency changes projen wrote during",
|
|
2885
|
+
" synth. Do **not** run these commands yourself \u2014 the user runs them.",
|
|
2880
2886
|
"",
|
|
2881
2887
|
"## Guardrails",
|
|
2882
2888
|
"",
|
|
2883
|
-
"- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
|
|
2889
|
+
"- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
|
|
2884
2890
|
" `pnpm test`, or any other package-manager, build, or test command.",
|
|
2885
2891
|
" Emit the projen block and instructions only.",
|
|
2886
2892
|
"- Never scaffold outside `packages/`. Deployable apps belong under",
|
|
@@ -2990,20 +2996,26 @@ var createAppSkill = {
|
|
|
2990
2996
|
" sub-project at `apps/<scope>/<name>`.",
|
|
2991
2997
|
"",
|
|
2992
2998
|
"6. **Tell the user how to synthesize.** Instruct them to run, from",
|
|
2993
|
-
" the repo root:",
|
|
2999
|
+
" the repo root, the safe three-step regen sequence:",
|
|
2994
3000
|
"",
|
|
2995
3001
|
" ```",
|
|
3002
|
+
" pnpm i",
|
|
2996
3003
|
" pnpm exec projen",
|
|
2997
|
-
" pnpm
|
|
3004
|
+
" pnpm i",
|
|
2998
3005
|
" ```",
|
|
2999
3006
|
"",
|
|
3000
|
-
" `pnpm
|
|
3001
|
-
"
|
|
3002
|
-
"
|
|
3007
|
+
" The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
|
|
3008
|
+
" so synth runs against the right configulator/projen/plugin",
|
|
3009
|
+
" versions \u2014 without it, `pnpm exec projen` may synth against a",
|
|
3010
|
+
" stale resolved version of any pnpm-managed component and produce",
|
|
3011
|
+
" phantom drift in generated files. `pnpm exec projen` regenerates",
|
|
3012
|
+
" the sub-project tree; the trailing `pnpm i` updates the workspace",
|
|
3013
|
+
" lockfile to pick up any dependency changes projen wrote during",
|
|
3014
|
+
" synth. Do **not** run these commands yourself \u2014 the user runs them.",
|
|
3003
3015
|
"",
|
|
3004
3016
|
"## Guardrails",
|
|
3005
3017
|
"",
|
|
3006
|
-
"- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
|
|
3018
|
+
"- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
|
|
3007
3019
|
" `pnpm test`, or any other package-manager, build, or test command.",
|
|
3008
3020
|
" Emit the projen block and instructions only.",
|
|
3009
3021
|
"- Never scaffold outside `apps/`. Shared libraries belong under",
|
|
@@ -3149,20 +3161,26 @@ var createSiteSkill = {
|
|
|
3149
3161
|
" `sites/<scope>/<name>`.",
|
|
3150
3162
|
"",
|
|
3151
3163
|
"6. **Tell the user how to synthesize.** Instruct them to run, from",
|
|
3152
|
-
" the repo root:",
|
|
3164
|
+
" the repo root, the safe three-step regen sequence:",
|
|
3153
3165
|
"",
|
|
3154
3166
|
" ```",
|
|
3167
|
+
" pnpm i",
|
|
3155
3168
|
" pnpm exec projen",
|
|
3156
|
-
" pnpm
|
|
3169
|
+
" pnpm i",
|
|
3157
3170
|
" ```",
|
|
3158
3171
|
"",
|
|
3159
|
-
" `pnpm
|
|
3160
|
-
"
|
|
3161
|
-
"
|
|
3172
|
+
" The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
|
|
3173
|
+
" so synth runs against the right configulator/projen/plugin",
|
|
3174
|
+
" versions \u2014 without it, `pnpm exec projen` may synth against a",
|
|
3175
|
+
" stale resolved version of any pnpm-managed component and produce",
|
|
3176
|
+
" phantom drift in generated files. `pnpm exec projen` regenerates",
|
|
3177
|
+
" the sub-project tree; the trailing `pnpm i` updates the workspace",
|
|
3178
|
+
" lockfile to pick up any dependency changes projen wrote during",
|
|
3179
|
+
" synth. Do **not** run these commands yourself \u2014 the user runs them.",
|
|
3162
3180
|
"",
|
|
3163
3181
|
"## Guardrails",
|
|
3164
3182
|
"",
|
|
3165
|
-
"- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
|
|
3183
|
+
"- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
|
|
3166
3184
|
" `pnpm test`, or any other package-manager, build, or test command.",
|
|
3167
3185
|
" Emit the projen block and instructions only.",
|
|
3168
3186
|
"- Never scaffold the monorepo-wide docs site under `sites/`. The",
|
|
@@ -3266,7 +3284,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
3266
3284
|
"## Important Notes",
|
|
3267
3285
|
"",
|
|
3268
3286
|
"- **Never edit generated files** \u2014 they are marked with `// ~~ Generated by projen`",
|
|
3269
|
-
"- **After modifying Projen configuration**, run `pnpm exec projen`
|
|
3287
|
+
"- **After modifying Projen configuration**, run the three-step regen sequence: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again. The leading `pnpm i` syncs `node_modules` with the lockfile so synth runs against the right configulator/projen/plugin versions; the trailing `pnpm i` refreshes the lockfile to match anything projen rewrote in `package.json`.",
|
|
3270
3288
|
"- **Configure dependencies through Projen** \u2014 never use `npm install`, `pnpm add`, or `yarn add`. Add them to `deps` or `devDeps` in Projen config.",
|
|
3271
3289
|
"- **Export from index.ts** to maintain clean public APIs",
|
|
3272
3290
|
"",
|
|
@@ -3325,7 +3343,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
|
|
|
3325
3343
|
"",
|
|
3326
3344
|
"After making changes that need validation, tell the user the specific commands to run:",
|
|
3327
3345
|
"",
|
|
3328
|
-
"1. **After projen config changes** \u2014 tell the user to run `pnpm exec projen && pnpm
|
|
3346
|
+
"1. **After projen config changes** \u2014 tell the user to run the three-step regen sequence: `pnpm i && pnpm exec projen && pnpm i`",
|
|
3329
3347
|
"2. **After source code changes** \u2014 tell the user to run `pnpm --filter @codedrifters/<package> test`",
|
|
3330
3348
|
"3. **After multi-package changes** \u2014 tell the user to run `pnpm build:all`"
|
|
3331
3349
|
].join("\n"),
|
|
@@ -9101,7 +9119,7 @@ var githubWorkflowBundle = {
|
|
|
9101
9119
|
"",
|
|
9102
9120
|
"When the user says **open a PR** (or similar), follow these steps exactly:",
|
|
9103
9121
|
"",
|
|
9104
|
-
"1. **Regenerate project files** \u2014 run `pnpm exec projen
|
|
9122
|
+
"1. **Regenerate project files** \u2014 run the three-step regen sequence (`pnpm i`, then `pnpm exec projen`, then `pnpm i` again) to ensure all generated files are up to date. The leading `pnpm i` is required because `pnpm exec projen` synthesises against whatever version of configulator (and projen, and any projen plugins) is currently resolved in `node_modules`; if the lockfile has moved past `node_modules` (typically right after `git pull` lands a dependency upgrade, or on a fresh checkout), synth runs against stale templates and produces phantom drift in `.claude/`, `.github/labels.yml`, `CLAUDE.md`, and other generated files. The trailing `pnpm i` picks up any dependency changes projen wrote into `package.json` during synth. Check `git diff` after the third step \u2014 if there are changes, commit them before proceeding.",
|
|
9105
9123
|
"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.",
|
|
9106
9124
|
"3. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
|
|
9107
9125
|
"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",
|
|
@@ -13799,7 +13817,7 @@ var issueWorkerSubAgent = {
|
|
|
13799
13817
|
"",
|
|
13800
13818
|
"Run the appropriate verification commands depending on what changed:",
|
|
13801
13819
|
"",
|
|
13802
|
-
"1. If Projen config was changed: `pnpm exec projen && pnpm
|
|
13820
|
+
"1. If Projen config was changed: run the three-step regen sequence `pnpm i && pnpm exec projen && pnpm i` (leading `pnpm i` syncs `node_modules` with the lockfile so synth runs against the right configulator/projen/plugin versions; trailing `pnpm i` refreshes the lockfile after synth)",
|
|
13803
13821
|
"2. Compile the affected package: `pnpm --filter @codedrifters/<package> compile`",
|
|
13804
13822
|
"3. Test the affected package: `pnpm --filter @codedrifters/<package> test`",
|
|
13805
13823
|
"4. If changes span multiple packages: `pnpm build:all`",
|
|
@@ -15090,7 +15108,7 @@ var pnpmBundle = {
|
|
|
15090
15108
|
"- Configure dependencies in Projen configuration files (`.projenrc.ts` or `projenrc/*.ts`)",
|
|
15091
15109
|
"- Add dependencies to `deps`, `devDeps`, or `peerDeps` arrays in project configuration",
|
|
15092
15110
|
'- Use catalog dependencies when available (e.g., `"aws-cdk-lib@catalog:"`)',
|
|
15093
|
-
"- Ask the user to run `pnpm exec projen`
|
|
15111
|
+
"- Ask the user to run the three-step regen sequence after updating dependency configuration: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again. The leading `pnpm i` syncs `node_modules` with the lockfile so synth runs against the right configulator/projen/plugin versions; the trailing `pnpm i` picks up any dependency changes projen wrote during synth.",
|
|
15094
15112
|
"",
|
|
15095
15113
|
"**DO NOT:**",
|
|
15096
15114
|
"- Run `npm install some-package`",
|
|
@@ -16527,14 +16545,19 @@ var projenBundle = {
|
|
|
16527
16545
|
"",
|
|
16528
16546
|
"## Synthesizing Projen Configuration",
|
|
16529
16547
|
"",
|
|
16530
|
-
"After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files:",
|
|
16548
|
+
"After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files using the safe three-step sequence:",
|
|
16531
16549
|
"",
|
|
16532
16550
|
"```sh",
|
|
16551
|
+
"pnpm i",
|
|
16533
16552
|
"pnpm exec projen",
|
|
16534
|
-
"pnpm
|
|
16553
|
+
"pnpm i",
|
|
16535
16554
|
"```",
|
|
16536
16555
|
"",
|
|
16537
|
-
"
|
|
16556
|
+
"All three steps are required:",
|
|
16557
|
+
"",
|
|
16558
|
+
"1. The leading `pnpm i` guarantees `node_modules` matches `pnpm-lock.yaml` before synth. Without this step, `pnpm exec projen` may synth against a stale version of any pnpm-resolved component (configulator itself, projen, or any plugin) that the lockfile has already moved past \u2014 most commonly right after `git pull` updates the lockfile or on a fresh checkout. The result is phantom drift in `.claude/`, `.github/labels.yml`, `CLAUDE.md`, and other configulator-generated files that looks like a real bundle change but vanishes after running `pnpm i`.",
|
|
16559
|
+
"2. `pnpm exec projen` regenerates files against the now-synced templates.",
|
|
16560
|
+
"3. The trailing `pnpm i` picks up any dependency changes projen wrote into `package.json` during the synth pass and refreshes the lockfile.",
|
|
16538
16561
|
"",
|
|
16539
16562
|
"## Building",
|
|
16540
16563
|
"",
|
|
@@ -16615,7 +16638,7 @@ var projenBundle = {
|
|
|
16615
16638
|
"After finishing implementation work, validate that changes are correct by running the appropriate commands depending on what was changed:",
|
|
16616
16639
|
"",
|
|
16617
16640
|
"1. **Projen config changes** (`projenrc/`, `.projenrc.ts`):",
|
|
16618
|
-
" - Run `pnpm exec projen
|
|
16641
|
+
" - Run the three-step regen sequence: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again",
|
|
16619
16642
|
" - Verify no unexpected generated file changes with `git diff`",
|
|
16620
16643
|
"",
|
|
16621
16644
|
"2. **Source code changes** (in a sub-package):",
|
|
@@ -16632,8 +16655,8 @@ var projenBundle = {
|
|
|
16632
16655
|
"",
|
|
16633
16656
|
"| Task | Command |",
|
|
16634
16657
|
"|------|---------|",
|
|
16635
|
-
"|
|
|
16636
|
-
"| Install deps | `pnpm
|
|
16658
|
+
"| Regenerate projen configuration | `pnpm i && pnpm exec projen && pnpm i` |",
|
|
16659
|
+
"| Install deps | `pnpm i` |",
|
|
16637
16660
|
"| Full monorepo build | `pnpm build:all` |",
|
|
16638
16661
|
"| Root build only | `pnpm build` |",
|
|
16639
16662
|
"| Compile one package | `pnpm --filter @codedrifters/<pkg> compile` |",
|
|
@@ -16689,9 +16712,22 @@ var projenBundle = {
|
|
|
16689
16712
|
"}",
|
|
16690
16713
|
"```",
|
|
16691
16714
|
"",
|
|
16715
|
+
"The same pattern applies to bundled sub-agents and skills. Use `agentConfig.subAgentExtensions` to append project-specific content to a sub-agent prompt and `agentConfig.skillExtensions` to append content to a skill's `SKILL.md` body. Both options mirror `ruleExtensions` exactly \u2014 keys are sub-agent / skill names, values are markdown appended after a horizontal rule, and unknown keys are silently ignored.",
|
|
16716
|
+
"",
|
|
16717
|
+
"```typescript",
|
|
16718
|
+
"agentConfig: {",
|
|
16719
|
+
" subAgentExtensions: {",
|
|
16720
|
+
" 'requirements-writer': '## Project-Specific Gaps\\n\\n- My custom guidance',",
|
|
16721
|
+
" },",
|
|
16722
|
+
" skillExtensions: {",
|
|
16723
|
+
" 'write-requirement': '## Project-Specific Templates\\n\\n- My custom template note',",
|
|
16724
|
+
" },",
|
|
16725
|
+
"}",
|
|
16726
|
+
"```",
|
|
16727
|
+
"",
|
|
16692
16728
|
"## After Any Change",
|
|
16693
16729
|
"",
|
|
16694
|
-
"Run `pnpm exec projen
|
|
16730
|
+
"Run the three-step regen sequence to regenerate the output files: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again. The leading `pnpm i` syncs `node_modules` with the lockfile before synth so `pnpm exec projen` runs against the right configulator/projen/plugin versions; the trailing `pnpm i` refreshes the lockfile for any dependency changes projen made during synth."
|
|
16695
16731
|
].join("\n"),
|
|
16696
16732
|
tags: ["workflow"]
|
|
16697
16733
|
},
|
|
@@ -16709,7 +16745,7 @@ var projenBundle = {
|
|
|
16709
16745
|
"- Edit Projen configuration in:",
|
|
16710
16746
|
" - `.projenrc.ts` (root)",
|
|
16711
16747
|
" - `projenrc/*.ts` (package-specific)",
|
|
16712
|
-
"- After making Projen changes, run `pnpm exec projen`
|
|
16748
|
+
"- After making Projen changes, run the three-step regen sequence: `pnpm i`, `pnpm exec projen`, `pnpm i`. The leading `pnpm i` ensures `node_modules` matches the lockfile so synth runs against the right configulator/projen/plugin versions; without it, synth can produce phantom drift in generated files. The trailing `pnpm i` picks up dependency changes projen wrote during synth.",
|
|
16713
16749
|
"",
|
|
16714
16750
|
"## Workspace Dependencies",
|
|
16715
16751
|
"",
|
|
@@ -27964,9 +28000,13 @@ ${hook}`
|
|
|
27964
28000
|
});
|
|
27965
28001
|
}
|
|
27966
28002
|
/**
|
|
27967
|
-
* Resolves template variables in skill instructions using project metadata
|
|
28003
|
+
* Resolves template variables in skill instructions using project metadata,
|
|
28004
|
+
* then appends any matching `skillExtensions` content after a horizontal
|
|
28005
|
+
* rule. Unknown keys in `skillExtensions` are silently ignored, mirroring
|
|
28006
|
+
* the `ruleExtensions` contract.
|
|
27968
28007
|
*/
|
|
27969
28008
|
resolveSkillTemplates(skills, metadata) {
|
|
28009
|
+
const extensions = this.options.skillExtensions;
|
|
27970
28010
|
return skills.map((skill) => {
|
|
27971
28011
|
const { resolved, unresolvedKeys } = resolveTemplateVariables(
|
|
27972
28012
|
skill.instructions,
|
|
@@ -27977,13 +28017,24 @@ ${hook}`
|
|
|
27977
28017
|
`AgentConfig: ProjectMetadata not found; skill '${skill.name}' using default values`
|
|
27978
28018
|
);
|
|
27979
28019
|
}
|
|
27980
|
-
|
|
28020
|
+
const extra = extensions?.[skill.name];
|
|
28021
|
+
const baseInstructions = resolved;
|
|
28022
|
+
const finalInstructions = extra !== void 0 && extra !== "" ? `${baseInstructions}
|
|
28023
|
+
|
|
28024
|
+
---
|
|
28025
|
+
|
|
28026
|
+
${extra}` : baseInstructions;
|
|
28027
|
+
return finalInstructions !== skill.instructions ? { ...skill, instructions: finalInstructions } : skill;
|
|
27981
28028
|
});
|
|
27982
28029
|
}
|
|
27983
28030
|
/**
|
|
27984
|
-
* Resolves template variables in sub-agent prompts using project metadata
|
|
28031
|
+
* Resolves template variables in sub-agent prompts using project metadata,
|
|
28032
|
+
* then appends any matching `subAgentExtensions` content after a horizontal
|
|
28033
|
+
* rule. Unknown keys in `subAgentExtensions` are silently ignored,
|
|
28034
|
+
* mirroring the `ruleExtensions` contract.
|
|
27985
28035
|
*/
|
|
27986
28036
|
resolveSubAgentTemplates(subAgents, metadata) {
|
|
28037
|
+
const extensions = this.options.subAgentExtensions;
|
|
27987
28038
|
return subAgents.map((agent) => {
|
|
27988
28039
|
const { resolved, unresolvedKeys } = resolveTemplateVariables(
|
|
27989
28040
|
agent.prompt,
|
|
@@ -27994,7 +28045,14 @@ ${hook}`
|
|
|
27994
28045
|
`AgentConfig: ProjectMetadata not found; sub-agent '${agent.name}' using default values`
|
|
27995
28046
|
);
|
|
27996
28047
|
}
|
|
27997
|
-
|
|
28048
|
+
const extra = extensions?.[agent.name];
|
|
28049
|
+
const basePrompt = resolved;
|
|
28050
|
+
const finalPrompt = extra !== void 0 && extra !== "" ? `${basePrompt}
|
|
28051
|
+
|
|
28052
|
+
---
|
|
28053
|
+
|
|
28054
|
+
${extra}` : basePrompt;
|
|
28055
|
+
return finalPrompt !== agent.prompt ? { ...agent, prompt: finalPrompt } : agent;
|
|
27998
28056
|
});
|
|
27999
28057
|
}
|
|
28000
28058
|
/**
|