@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.mjs CHANGED
@@ -16712,6 +16712,19 @@ var projenBundle = {
16712
16712
  "}",
16713
16713
  "```",
16714
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
+ "",
16715
16728
  "## After Any Change",
16716
16729
  "",
16717
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."
@@ -27987,9 +28000,13 @@ ${hook}`
27987
28000
  });
27988
28001
  }
27989
28002
  /**
27990
- * 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.
27991
28007
  */
27992
28008
  resolveSkillTemplates(skills, metadata) {
28009
+ const extensions = this.options.skillExtensions;
27993
28010
  return skills.map((skill) => {
27994
28011
  const { resolved, unresolvedKeys } = resolveTemplateVariables(
27995
28012
  skill.instructions,
@@ -28000,13 +28017,24 @@ ${hook}`
28000
28017
  `AgentConfig: ProjectMetadata not found; skill '${skill.name}' using default values`
28001
28018
  );
28002
28019
  }
28003
- return resolved !== skill.instructions ? { ...skill, instructions: resolved } : skill;
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;
28004
28028
  });
28005
28029
  }
28006
28030
  /**
28007
- * 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.
28008
28035
  */
28009
28036
  resolveSubAgentTemplates(subAgents, metadata) {
28037
+ const extensions = this.options.subAgentExtensions;
28010
28038
  return subAgents.map((agent) => {
28011
28039
  const { resolved, unresolvedKeys } = resolveTemplateVariables(
28012
28040
  agent.prompt,
@@ -28017,7 +28045,14 @@ ${hook}`
28017
28045
  `AgentConfig: ProjectMetadata not found; sub-agent '${agent.name}' using default values`
28018
28046
  );
28019
28047
  }
28020
- return resolved !== agent.prompt ? { ...agent, prompt: resolved } : agent;
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;
28021
28056
  });
28022
28057
  }
28023
28058
  /**