@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.mjs
CHANGED
|
@@ -284,10 +284,109 @@ var awsCdkBundle = {
|
|
|
284
284
|
};
|
|
285
285
|
|
|
286
286
|
// src/agent/bundles/base.ts
|
|
287
|
+
var createRuleSkill = {
|
|
288
|
+
name: "create-rule",
|
|
289
|
+
description: "Guide for creating new agent rules in this project using configulator",
|
|
290
|
+
disableModelInvocation: true,
|
|
291
|
+
instructions: [
|
|
292
|
+
"# Create Agent Rule",
|
|
293
|
+
"",
|
|
294
|
+
"Create a new agent rule for the **{{repository.owner}}/{{repository.name}}** project.",
|
|
295
|
+
"",
|
|
296
|
+
"## Steps",
|
|
297
|
+
"",
|
|
298
|
+
"1. **Identify the rule purpose** \u2014 ask what behavior the rule should enforce or guide",
|
|
299
|
+
"2. **Choose a scope:**",
|
|
300
|
+
" - `AGENT_RULE_SCOPE.ALWAYS` \u2014 active in all contexts",
|
|
301
|
+
" - `AGENT_RULE_SCOPE.FILE_PATTERN` \u2014 active only when working on matching files (requires `filePatterns`)",
|
|
302
|
+
"3. **Pick a name** \u2014 lowercase kebab-case (e.g., `react-conventions`, `api-error-handling`)",
|
|
303
|
+
"4. **Write the content** \u2014 clear, actionable markdown instructions",
|
|
304
|
+
"5. **Add to the project config** \u2014 add the rule to `AgentConfigOptions.rules` in the Projen config file",
|
|
305
|
+
"",
|
|
306
|
+
"## Rule Template",
|
|
307
|
+
"",
|
|
308
|
+
"```typescript",
|
|
309
|
+
"import { AGENT_RULE_SCOPE } from '@codedrifters/configulator';",
|
|
310
|
+
"",
|
|
311
|
+
"// In your AgentConfig options:",
|
|
312
|
+
"{",
|
|
313
|
+
" rules: [",
|
|
314
|
+
" {",
|
|
315
|
+
" name: 'my-new-rule',",
|
|
316
|
+
" description: 'What this rule does \u2014 used by AI for rule selection',",
|
|
317
|
+
" scope: AGENT_RULE_SCOPE.ALWAYS, // or FILE_PATTERN",
|
|
318
|
+
" // filePatterns: ['src/**/*.ts'], // required for FILE_PATTERN scope",
|
|
319
|
+
" content: [",
|
|
320
|
+
" '# Rule Title',",
|
|
321
|
+
" '',",
|
|
322
|
+
" '## Guidelines',",
|
|
323
|
+
" '',",
|
|
324
|
+
" '- Guideline 1',",
|
|
325
|
+
" '- Guideline 2',",
|
|
326
|
+
" ].join('\\n'),",
|
|
327
|
+
" tags: ['coding'], // optional: for ordering",
|
|
328
|
+
" },",
|
|
329
|
+
" ],",
|
|
330
|
+
"}",
|
|
331
|
+
"```",
|
|
332
|
+
"",
|
|
333
|
+
"## Best Practices",
|
|
334
|
+
"",
|
|
335
|
+
"- Keep rules **focused** \u2014 one concern per rule",
|
|
336
|
+
'- Use **imperative tone** \u2014 "Use X" not "You should use X"',
|
|
337
|
+
"- Include **examples** for complex patterns",
|
|
338
|
+
"- Use `ruleExtensions` to add project-specific content to existing bundle rules instead of replacing them"
|
|
339
|
+
].join("\n")
|
|
340
|
+
};
|
|
341
|
+
var reviewPrSkill = {
|
|
342
|
+
name: "review-pr",
|
|
343
|
+
description: "Review a pull request for code quality, conventions, and correctness",
|
|
344
|
+
instructions: [
|
|
345
|
+
"# Review Pull Request",
|
|
346
|
+
"",
|
|
347
|
+
"Review the current pull request in **{{repository.owner}}/{{repository.name}}**.",
|
|
348
|
+
"",
|
|
349
|
+
"## Review Checklist",
|
|
350
|
+
"",
|
|
351
|
+
"1. **Read the PR description** \u2014 understand the intent and linked issue",
|
|
352
|
+
"2. **Review the diff** \u2014 check all changed files for:",
|
|
353
|
+
" - Correctness and logic errors",
|
|
354
|
+
" - Adherence to project conventions",
|
|
355
|
+
" - Test coverage for new/changed behavior",
|
|
356
|
+
" - No unintended side effects",
|
|
357
|
+
"3. **Check PR conventions:**",
|
|
358
|
+
" - Title uses conventional commit prefix (`feat:`, `fix:`, `docs:`, etc.)",
|
|
359
|
+
" - Body includes a closing keyword (`Closes #<issue>`)",
|
|
360
|
+
" - Summary of changes is present",
|
|
361
|
+
"4. **Verify build and tests pass**",
|
|
362
|
+
"",
|
|
363
|
+
"## Commands",
|
|
364
|
+
"",
|
|
365
|
+
"```bash",
|
|
366
|
+
"# View the PR details",
|
|
367
|
+
"gh pr view",
|
|
368
|
+
"",
|
|
369
|
+
"# View the diff",
|
|
370
|
+
"gh pr diff",
|
|
371
|
+
"",
|
|
372
|
+
"# Check CI status",
|
|
373
|
+
"gh pr checks",
|
|
374
|
+
"```",
|
|
375
|
+
"",
|
|
376
|
+
"## Output Format",
|
|
377
|
+
"",
|
|
378
|
+
"Provide a structured review with:",
|
|
379
|
+
"- **Summary**: One-line verdict (approve, request changes, or comment)",
|
|
380
|
+
"- **Findings**: Bulleted list of issues or suggestions, grouped by severity",
|
|
381
|
+
"- **Positive notes**: What was done well"
|
|
382
|
+
].join("\n"),
|
|
383
|
+
allowedTools: ["Read", "Glob", "Grep", "Bash(gh *)"]
|
|
384
|
+
};
|
|
287
385
|
var baseBundle = {
|
|
288
386
|
name: "base",
|
|
289
387
|
description: "Core rules: project overview, interaction style, and general coding conventions",
|
|
290
388
|
appliesWhen: () => true,
|
|
389
|
+
skills: [createRuleSkill, reviewPrSkill],
|
|
291
390
|
rules: [
|
|
292
391
|
{
|
|
293
392
|
name: "project-overview",
|
|
@@ -1558,6 +1657,15 @@ var ClaudeRenderer = class _ClaudeRenderer {
|
|
|
1558
1657
|
lines.push(` - "${p}"`);
|
|
1559
1658
|
}
|
|
1560
1659
|
}
|
|
1660
|
+
if (skill.context) {
|
|
1661
|
+
lines.push(`context: "${skill.context}"`);
|
|
1662
|
+
}
|
|
1663
|
+
if (skill.agent) {
|
|
1664
|
+
lines.push(`agent: "${skill.agent}"`);
|
|
1665
|
+
}
|
|
1666
|
+
if (skill.shell) {
|
|
1667
|
+
lines.push(`shell: "${skill.shell}"`);
|
|
1668
|
+
}
|
|
1561
1669
|
if (skill.allowedTools && skill.allowedTools.length > 0) {
|
|
1562
1670
|
lines.push(`allowed-tools:`);
|
|
1563
1671
|
for (const tool of skill.allowedTools) {
|
|
@@ -1674,6 +1782,15 @@ var CursorRenderer = class _CursorRenderer {
|
|
|
1674
1782
|
if (skill.userInvocable === false) {
|
|
1675
1783
|
lines.push(`user-invocable: false`);
|
|
1676
1784
|
}
|
|
1785
|
+
if (skill.context) {
|
|
1786
|
+
lines.push(`context: "${skill.context}"`);
|
|
1787
|
+
}
|
|
1788
|
+
if (skill.agent) {
|
|
1789
|
+
lines.push(`agent: "${skill.agent}"`);
|
|
1790
|
+
}
|
|
1791
|
+
if (skill.shell) {
|
|
1792
|
+
lines.push(`shell: "${skill.shell}"`);
|
|
1793
|
+
}
|
|
1677
1794
|
if (skill.allowedTools && skill.allowedTools.length > 0) {
|
|
1678
1795
|
lines.push(`allowed-tools:`);
|
|
1679
1796
|
for (const tool of skill.allowedTools) {
|