@codedrifters/configulator 0.0.278 → 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 +39 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +39 -4
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.mts
CHANGED
|
@@ -2569,6 +2569,9 @@ interface AgentConfigOptions {
|
|
|
2569
2569
|
* Use this to supplement bundle rules with project-specific additions without
|
|
2570
2570
|
* replacing the entire rule.
|
|
2571
2571
|
*
|
|
2572
|
+
* Unknown keys (no matching rule in the active bundle set) are silently
|
|
2573
|
+
* ignored.
|
|
2574
|
+
*
|
|
2572
2575
|
* @example
|
|
2573
2576
|
* ```ts
|
|
2574
2577
|
* ruleExtensions: {
|
|
@@ -2577,6 +2580,42 @@ interface AgentConfigOptions {
|
|
|
2577
2580
|
* ```
|
|
2578
2581
|
*/
|
|
2579
2582
|
readonly ruleExtensions?: Readonly<Record<string, string>>;
|
|
2583
|
+
/**
|
|
2584
|
+
* Additional content to append to existing sub-agent prompts (from bundles
|
|
2585
|
+
* or custom subAgents). Keys are sub-agent names, values are markdown
|
|
2586
|
+
* content appended after a horizontal rule. Mirrors `ruleExtensions` but
|
|
2587
|
+
* targets the rendered sub-agent prompt across every active platform
|
|
2588
|
+
* (Claude, Cursor, etc.).
|
|
2589
|
+
*
|
|
2590
|
+
* Unknown keys (no matching sub-agent in the active bundle set) are
|
|
2591
|
+
* silently ignored.
|
|
2592
|
+
*
|
|
2593
|
+
* @example
|
|
2594
|
+
* ```ts
|
|
2595
|
+
* subAgentExtensions: {
|
|
2596
|
+
* 'requirements-writer': '## Project-Specific Gaps\n\n- Use branded types for IDs',
|
|
2597
|
+
* }
|
|
2598
|
+
* ```
|
|
2599
|
+
*/
|
|
2600
|
+
readonly subAgentExtensions?: Readonly<Record<string, string>>;
|
|
2601
|
+
/**
|
|
2602
|
+
* Additional content to append to existing skill `SKILL.md` bodies (from
|
|
2603
|
+
* bundles or custom skills). Keys are skill names, values are markdown
|
|
2604
|
+
* content appended after a horizontal rule. Mirrors `ruleExtensions` but
|
|
2605
|
+
* targets the rendered skill instructions across every active platform
|
|
2606
|
+
* (Claude, Cursor, etc.).
|
|
2607
|
+
*
|
|
2608
|
+
* Unknown keys (no matching skill in the active bundle set) are silently
|
|
2609
|
+
* ignored.
|
|
2610
|
+
*
|
|
2611
|
+
* @example
|
|
2612
|
+
* ```ts
|
|
2613
|
+
* skillExtensions: {
|
|
2614
|
+
* 'write-requirement': '## Project-Specific Templates\n\n- Use branded types for IDs',
|
|
2615
|
+
* }
|
|
2616
|
+
* ```
|
|
2617
|
+
*/
|
|
2618
|
+
readonly skillExtensions?: Readonly<Record<string, string>>;
|
|
2580
2619
|
/**
|
|
2581
2620
|
* Claude Code settings.json configuration.
|
|
2582
2621
|
* Generated to .claude/settings.json (committed, team-shared).
|
|
@@ -3053,11 +3092,17 @@ declare class AgentConfig extends Component {
|
|
|
3053
3092
|
*/
|
|
3054
3093
|
private resolveTemplates;
|
|
3055
3094
|
/**
|
|
3056
|
-
* Resolves template variables in skill instructions using project metadata
|
|
3095
|
+
* Resolves template variables in skill instructions using project metadata,
|
|
3096
|
+
* then appends any matching `skillExtensions` content after a horizontal
|
|
3097
|
+
* rule. Unknown keys in `skillExtensions` are silently ignored, mirroring
|
|
3098
|
+
* the `ruleExtensions` contract.
|
|
3057
3099
|
*/
|
|
3058
3100
|
private resolveSkillTemplates;
|
|
3059
3101
|
/**
|
|
3060
|
-
* Resolves template variables in sub-agent prompts using project metadata
|
|
3102
|
+
* Resolves template variables in sub-agent prompts using project metadata,
|
|
3103
|
+
* then appends any matching `subAgentExtensions` content after a horizontal
|
|
3104
|
+
* rule. Unknown keys in `subAgentExtensions` are silently ignored,
|
|
3105
|
+
* mirroring the `ruleExtensions` contract.
|
|
3061
3106
|
*/
|
|
3062
3107
|
private resolveSubAgentTemplates;
|
|
3063
3108
|
/**
|
package/lib/index.d.ts
CHANGED
|
@@ -2618,6 +2618,9 @@ interface AgentConfigOptions {
|
|
|
2618
2618
|
* Use this to supplement bundle rules with project-specific additions without
|
|
2619
2619
|
* replacing the entire rule.
|
|
2620
2620
|
*
|
|
2621
|
+
* Unknown keys (no matching rule in the active bundle set) are silently
|
|
2622
|
+
* ignored.
|
|
2623
|
+
*
|
|
2621
2624
|
* @example
|
|
2622
2625
|
* ```ts
|
|
2623
2626
|
* ruleExtensions: {
|
|
@@ -2626,6 +2629,42 @@ interface AgentConfigOptions {
|
|
|
2626
2629
|
* ```
|
|
2627
2630
|
*/
|
|
2628
2631
|
readonly ruleExtensions?: Readonly<Record<string, string>>;
|
|
2632
|
+
/**
|
|
2633
|
+
* Additional content to append to existing sub-agent prompts (from bundles
|
|
2634
|
+
* or custom subAgents). Keys are sub-agent names, values are markdown
|
|
2635
|
+
* content appended after a horizontal rule. Mirrors `ruleExtensions` but
|
|
2636
|
+
* targets the rendered sub-agent prompt across every active platform
|
|
2637
|
+
* (Claude, Cursor, etc.).
|
|
2638
|
+
*
|
|
2639
|
+
* Unknown keys (no matching sub-agent in the active bundle set) are
|
|
2640
|
+
* silently ignored.
|
|
2641
|
+
*
|
|
2642
|
+
* @example
|
|
2643
|
+
* ```ts
|
|
2644
|
+
* subAgentExtensions: {
|
|
2645
|
+
* 'requirements-writer': '## Project-Specific Gaps\n\n- Use branded types for IDs',
|
|
2646
|
+
* }
|
|
2647
|
+
* ```
|
|
2648
|
+
*/
|
|
2649
|
+
readonly subAgentExtensions?: Readonly<Record<string, string>>;
|
|
2650
|
+
/**
|
|
2651
|
+
* Additional content to append to existing skill `SKILL.md` bodies (from
|
|
2652
|
+
* bundles or custom skills). Keys are skill names, values are markdown
|
|
2653
|
+
* content appended after a horizontal rule. Mirrors `ruleExtensions` but
|
|
2654
|
+
* targets the rendered skill instructions across every active platform
|
|
2655
|
+
* (Claude, Cursor, etc.).
|
|
2656
|
+
*
|
|
2657
|
+
* Unknown keys (no matching skill in the active bundle set) are silently
|
|
2658
|
+
* ignored.
|
|
2659
|
+
*
|
|
2660
|
+
* @example
|
|
2661
|
+
* ```ts
|
|
2662
|
+
* skillExtensions: {
|
|
2663
|
+
* 'write-requirement': '## Project-Specific Templates\n\n- Use branded types for IDs',
|
|
2664
|
+
* }
|
|
2665
|
+
* ```
|
|
2666
|
+
*/
|
|
2667
|
+
readonly skillExtensions?: Readonly<Record<string, string>>;
|
|
2629
2668
|
/**
|
|
2630
2669
|
* Claude Code settings.json configuration.
|
|
2631
2670
|
* Generated to .claude/settings.json (committed, team-shared).
|
|
@@ -3102,11 +3141,17 @@ declare class AgentConfig extends Component {
|
|
|
3102
3141
|
*/
|
|
3103
3142
|
private resolveTemplates;
|
|
3104
3143
|
/**
|
|
3105
|
-
* Resolves template variables in skill instructions using project metadata
|
|
3144
|
+
* Resolves template variables in skill instructions using project metadata,
|
|
3145
|
+
* then appends any matching `skillExtensions` content after a horizontal
|
|
3146
|
+
* rule. Unknown keys in `skillExtensions` are silently ignored, mirroring
|
|
3147
|
+
* the `ruleExtensions` contract.
|
|
3106
3148
|
*/
|
|
3107
3149
|
private resolveSkillTemplates;
|
|
3108
3150
|
/**
|
|
3109
|
-
* Resolves template variables in sub-agent prompts using project metadata
|
|
3151
|
+
* Resolves template variables in sub-agent prompts using project metadata,
|
|
3152
|
+
* then appends any matching `subAgentExtensions` content after a horizontal
|
|
3153
|
+
* rule. Unknown keys in `subAgentExtensions` are silently ignored,
|
|
3154
|
+
* mirroring the `ruleExtensions` contract.
|
|
3110
3155
|
*/
|
|
3111
3156
|
private resolveSubAgentTemplates;
|
|
3112
3157
|
/**
|
package/lib/index.js
CHANGED
|
@@ -16968,6 +16968,19 @@ var projenBundle = {
|
|
|
16968
16968
|
"}",
|
|
16969
16969
|
"```",
|
|
16970
16970
|
"",
|
|
16971
|
+
"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.",
|
|
16972
|
+
"",
|
|
16973
|
+
"```typescript",
|
|
16974
|
+
"agentConfig: {",
|
|
16975
|
+
" subAgentExtensions: {",
|
|
16976
|
+
" 'requirements-writer': '## Project-Specific Gaps\\n\\n- My custom guidance',",
|
|
16977
|
+
" },",
|
|
16978
|
+
" skillExtensions: {",
|
|
16979
|
+
" 'write-requirement': '## Project-Specific Templates\\n\\n- My custom template note',",
|
|
16980
|
+
" },",
|
|
16981
|
+
"}",
|
|
16982
|
+
"```",
|
|
16983
|
+
"",
|
|
16971
16984
|
"## After Any Change",
|
|
16972
16985
|
"",
|
|
16973
16986
|
"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."
|
|
@@ -28243,9 +28256,13 @@ ${hook}`
|
|
|
28243
28256
|
});
|
|
28244
28257
|
}
|
|
28245
28258
|
/**
|
|
28246
|
-
* Resolves template variables in skill instructions using project metadata
|
|
28259
|
+
* Resolves template variables in skill instructions using project metadata,
|
|
28260
|
+
* then appends any matching `skillExtensions` content after a horizontal
|
|
28261
|
+
* rule. Unknown keys in `skillExtensions` are silently ignored, mirroring
|
|
28262
|
+
* the `ruleExtensions` contract.
|
|
28247
28263
|
*/
|
|
28248
28264
|
resolveSkillTemplates(skills, metadata) {
|
|
28265
|
+
const extensions = this.options.skillExtensions;
|
|
28249
28266
|
return skills.map((skill) => {
|
|
28250
28267
|
const { resolved, unresolvedKeys } = resolveTemplateVariables(
|
|
28251
28268
|
skill.instructions,
|
|
@@ -28256,13 +28273,24 @@ ${hook}`
|
|
|
28256
28273
|
`AgentConfig: ProjectMetadata not found; skill '${skill.name}' using default values`
|
|
28257
28274
|
);
|
|
28258
28275
|
}
|
|
28259
|
-
|
|
28276
|
+
const extra = extensions?.[skill.name];
|
|
28277
|
+
const baseInstructions = resolved;
|
|
28278
|
+
const finalInstructions = extra !== void 0 && extra !== "" ? `${baseInstructions}
|
|
28279
|
+
|
|
28280
|
+
---
|
|
28281
|
+
|
|
28282
|
+
${extra}` : baseInstructions;
|
|
28283
|
+
return finalInstructions !== skill.instructions ? { ...skill, instructions: finalInstructions } : skill;
|
|
28260
28284
|
});
|
|
28261
28285
|
}
|
|
28262
28286
|
/**
|
|
28263
|
-
* Resolves template variables in sub-agent prompts using project metadata
|
|
28287
|
+
* Resolves template variables in sub-agent prompts using project metadata,
|
|
28288
|
+
* then appends any matching `subAgentExtensions` content after a horizontal
|
|
28289
|
+
* rule. Unknown keys in `subAgentExtensions` are silently ignored,
|
|
28290
|
+
* mirroring the `ruleExtensions` contract.
|
|
28264
28291
|
*/
|
|
28265
28292
|
resolveSubAgentTemplates(subAgents, metadata) {
|
|
28293
|
+
const extensions = this.options.subAgentExtensions;
|
|
28266
28294
|
return subAgents.map((agent) => {
|
|
28267
28295
|
const { resolved, unresolvedKeys } = resolveTemplateVariables(
|
|
28268
28296
|
agent.prompt,
|
|
@@ -28273,7 +28301,14 @@ ${hook}`
|
|
|
28273
28301
|
`AgentConfig: ProjectMetadata not found; sub-agent '${agent.name}' using default values`
|
|
28274
28302
|
);
|
|
28275
28303
|
}
|
|
28276
|
-
|
|
28304
|
+
const extra = extensions?.[agent.name];
|
|
28305
|
+
const basePrompt = resolved;
|
|
28306
|
+
const finalPrompt = extra !== void 0 && extra !== "" ? `${basePrompt}
|
|
28307
|
+
|
|
28308
|
+
---
|
|
28309
|
+
|
|
28310
|
+
${extra}` : basePrompt;
|
|
28311
|
+
return finalPrompt !== agent.prompt ? { ...agent, prompt: finalPrompt } : agent;
|
|
28277
28312
|
});
|
|
28278
28313
|
}
|
|
28279
28314
|
/**
|