@codedrifters/configulator 0.0.156 → 0.0.157
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 +19 -0
- package/lib/index.d.ts +19 -0
- package/lib/index.js +117 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +117 -0
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.mts
CHANGED
|
@@ -190,6 +190,25 @@ interface AgentSkill {
|
|
|
190
190
|
* @example ['src/api/**\/*.ts']
|
|
191
191
|
*/
|
|
192
192
|
readonly paths?: ReadonlyArray<string>;
|
|
193
|
+
/**
|
|
194
|
+
* Resource directories bundled with the skill (e.g., references/, scripts/, assets/).
|
|
195
|
+
* @example ['references/', 'scripts/']
|
|
196
|
+
*/
|
|
197
|
+
readonly references?: ReadonlyArray<string>;
|
|
198
|
+
/**
|
|
199
|
+
* Context isolation mode. Set to 'fork' to run in an isolated subagent context.
|
|
200
|
+
*/
|
|
201
|
+
readonly context?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Subagent name to delegate to when context is 'fork'.
|
|
204
|
+
* @example 'code-reviewer'
|
|
205
|
+
*/
|
|
206
|
+
readonly agent?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Shell for dynamic context injection via !`command` syntax.
|
|
209
|
+
* @default 'bash'
|
|
210
|
+
*/
|
|
211
|
+
readonly shell?: string;
|
|
193
212
|
}
|
|
194
213
|
/**
|
|
195
214
|
* Platform-specific overrides for a sub-agent definition.
|
package/lib/index.d.ts
CHANGED
|
@@ -239,6 +239,25 @@ interface AgentSkill {
|
|
|
239
239
|
* @example ['src/api/**\/*.ts']
|
|
240
240
|
*/
|
|
241
241
|
readonly paths?: ReadonlyArray<string>;
|
|
242
|
+
/**
|
|
243
|
+
* Resource directories bundled with the skill (e.g., references/, scripts/, assets/).
|
|
244
|
+
* @example ['references/', 'scripts/']
|
|
245
|
+
*/
|
|
246
|
+
readonly references?: ReadonlyArray<string>;
|
|
247
|
+
/**
|
|
248
|
+
* Context isolation mode. Set to 'fork' to run in an isolated subagent context.
|
|
249
|
+
*/
|
|
250
|
+
readonly context?: string;
|
|
251
|
+
/**
|
|
252
|
+
* Subagent name to delegate to when context is 'fork'.
|
|
253
|
+
* @example 'code-reviewer'
|
|
254
|
+
*/
|
|
255
|
+
readonly agent?: string;
|
|
256
|
+
/**
|
|
257
|
+
* Shell for dynamic context injection via !`command` syntax.
|
|
258
|
+
* @default 'bash'
|
|
259
|
+
*/
|
|
260
|
+
readonly shell?: string;
|
|
242
261
|
}
|
|
243
262
|
/**
|
|
244
263
|
* Platform-specific overrides for a sub-agent definition.
|
package/lib/index.js
CHANGED
|
@@ -333,10 +333,109 @@ var awsCdkBundle = {
|
|
|
333
333
|
};
|
|
334
334
|
|
|
335
335
|
// src/agent/bundles/base.ts
|
|
336
|
+
var createRuleSkill = {
|
|
337
|
+
name: "create-rule",
|
|
338
|
+
description: "Guide for creating new agent rules in this project using configulator",
|
|
339
|
+
disableModelInvocation: true,
|
|
340
|
+
instructions: [
|
|
341
|
+
"# Create Agent Rule",
|
|
342
|
+
"",
|
|
343
|
+
"Create a new agent rule for the **{{repository.owner}}/{{repository.name}}** project.",
|
|
344
|
+
"",
|
|
345
|
+
"## Steps",
|
|
346
|
+
"",
|
|
347
|
+
"1. **Identify the rule purpose** \u2014 ask what behavior the rule should enforce or guide",
|
|
348
|
+
"2. **Choose a scope:**",
|
|
349
|
+
" - `AGENT_RULE_SCOPE.ALWAYS` \u2014 active in all contexts",
|
|
350
|
+
" - `AGENT_RULE_SCOPE.FILE_PATTERN` \u2014 active only when working on matching files (requires `filePatterns`)",
|
|
351
|
+
"3. **Pick a name** \u2014 lowercase kebab-case (e.g., `react-conventions`, `api-error-handling`)",
|
|
352
|
+
"4. **Write the content** \u2014 clear, actionable markdown instructions",
|
|
353
|
+
"5. **Add to the project config** \u2014 add the rule to `AgentConfigOptions.rules` in the Projen config file",
|
|
354
|
+
"",
|
|
355
|
+
"## Rule Template",
|
|
356
|
+
"",
|
|
357
|
+
"```typescript",
|
|
358
|
+
"import { AGENT_RULE_SCOPE } from '@codedrifters/configulator';",
|
|
359
|
+
"",
|
|
360
|
+
"// In your AgentConfig options:",
|
|
361
|
+
"{",
|
|
362
|
+
" rules: [",
|
|
363
|
+
" {",
|
|
364
|
+
" name: 'my-new-rule',",
|
|
365
|
+
" description: 'What this rule does \u2014 used by AI for rule selection',",
|
|
366
|
+
" scope: AGENT_RULE_SCOPE.ALWAYS, // or FILE_PATTERN",
|
|
367
|
+
" // filePatterns: ['src/**/*.ts'], // required for FILE_PATTERN scope",
|
|
368
|
+
" content: [",
|
|
369
|
+
" '# Rule Title',",
|
|
370
|
+
" '',",
|
|
371
|
+
" '## Guidelines',",
|
|
372
|
+
" '',",
|
|
373
|
+
" '- Guideline 1',",
|
|
374
|
+
" '- Guideline 2',",
|
|
375
|
+
" ].join('\\n'),",
|
|
376
|
+
" tags: ['coding'], // optional: for ordering",
|
|
377
|
+
" },",
|
|
378
|
+
" ],",
|
|
379
|
+
"}",
|
|
380
|
+
"```",
|
|
381
|
+
"",
|
|
382
|
+
"## Best Practices",
|
|
383
|
+
"",
|
|
384
|
+
"- Keep rules **focused** \u2014 one concern per rule",
|
|
385
|
+
'- Use **imperative tone** \u2014 "Use X" not "You should use X"',
|
|
386
|
+
"- Include **examples** for complex patterns",
|
|
387
|
+
"- Use `ruleExtensions` to add project-specific content to existing bundle rules instead of replacing them"
|
|
388
|
+
].join("\n")
|
|
389
|
+
};
|
|
390
|
+
var reviewPrSkill = {
|
|
391
|
+
name: "review-pr",
|
|
392
|
+
description: "Review a pull request for code quality, conventions, and correctness",
|
|
393
|
+
instructions: [
|
|
394
|
+
"# Review Pull Request",
|
|
395
|
+
"",
|
|
396
|
+
"Review the current pull request in **{{repository.owner}}/{{repository.name}}**.",
|
|
397
|
+
"",
|
|
398
|
+
"## Review Checklist",
|
|
399
|
+
"",
|
|
400
|
+
"1. **Read the PR description** \u2014 understand the intent and linked issue",
|
|
401
|
+
"2. **Review the diff** \u2014 check all changed files for:",
|
|
402
|
+
" - Correctness and logic errors",
|
|
403
|
+
" - Adherence to project conventions",
|
|
404
|
+
" - Test coverage for new/changed behavior",
|
|
405
|
+
" - No unintended side effects",
|
|
406
|
+
"3. **Check PR conventions:**",
|
|
407
|
+
" - Title uses conventional commit prefix (`feat:`, `fix:`, `docs:`, etc.)",
|
|
408
|
+
" - Body includes a closing keyword (`Closes #<issue>`)",
|
|
409
|
+
" - Summary of changes is present",
|
|
410
|
+
"4. **Verify build and tests pass**",
|
|
411
|
+
"",
|
|
412
|
+
"## Commands",
|
|
413
|
+
"",
|
|
414
|
+
"```bash",
|
|
415
|
+
"# View the PR details",
|
|
416
|
+
"gh pr view",
|
|
417
|
+
"",
|
|
418
|
+
"# View the diff",
|
|
419
|
+
"gh pr diff",
|
|
420
|
+
"",
|
|
421
|
+
"# Check CI status",
|
|
422
|
+
"gh pr checks",
|
|
423
|
+
"```",
|
|
424
|
+
"",
|
|
425
|
+
"## Output Format",
|
|
426
|
+
"",
|
|
427
|
+
"Provide a structured review with:",
|
|
428
|
+
"- **Summary**: One-line verdict (approve, request changes, or comment)",
|
|
429
|
+
"- **Findings**: Bulleted list of issues or suggestions, grouped by severity",
|
|
430
|
+
"- **Positive notes**: What was done well"
|
|
431
|
+
].join("\n"),
|
|
432
|
+
allowedTools: ["Read", "Glob", "Grep", "Bash(gh *)"]
|
|
433
|
+
};
|
|
336
434
|
var baseBundle = {
|
|
337
435
|
name: "base",
|
|
338
436
|
description: "Core rules: project overview, interaction style, and general coding conventions",
|
|
339
437
|
appliesWhen: () => true,
|
|
438
|
+
skills: [createRuleSkill, reviewPrSkill],
|
|
340
439
|
rules: [
|
|
341
440
|
{
|
|
342
441
|
name: "project-overview",
|
|
@@ -1607,6 +1706,15 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1607
1706
|
lines.push(` - "${p}"`);
|
|
1608
1707
|
}
|
|
1609
1708
|
}
|
|
1709
|
+
if (skill.context) {
|
|
1710
|
+
lines.push(`context: "${skill.context}"`);
|
|
1711
|
+
}
|
|
1712
|
+
if (skill.agent) {
|
|
1713
|
+
lines.push(`agent: "${skill.agent}"`);
|
|
1714
|
+
}
|
|
1715
|
+
if (skill.shell) {
|
|
1716
|
+
lines.push(`shell: "${skill.shell}"`);
|
|
1717
|
+
}
|
|
1610
1718
|
if (skill.allowedTools && skill.allowedTools.length > 0) {
|
|
1611
1719
|
lines.push(`allowed-tools:`);
|
|
1612
1720
|
for (const tool of skill.allowedTools) {
|
|
@@ -1723,6 +1831,15 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1723
1831
|
if (skill.userInvocable === false) {
|
|
1724
1832
|
lines.push(`user-invocable: false`);
|
|
1725
1833
|
}
|
|
1834
|
+
if (skill.context) {
|
|
1835
|
+
lines.push(`context: "${skill.context}"`);
|
|
1836
|
+
}
|
|
1837
|
+
if (skill.agent) {
|
|
1838
|
+
lines.push(`agent: "${skill.agent}"`);
|
|
1839
|
+
}
|
|
1840
|
+
if (skill.shell) {
|
|
1841
|
+
lines.push(`shell: "${skill.shell}"`);
|
|
1842
|
+
}
|
|
1726
1843
|
if (skill.allowedTools && skill.allowedTools.length > 0) {
|
|
1727
1844
|
lines.push(`allowed-tools:`);
|
|
1728
1845
|
for (const tool of skill.allowedTools) {
|