Loading...
Loading...
Creates rule files for the Claude Code framework. Rules are markdown files in .claude/rules/ that are auto-loaded by Claude Code.
npx skill4agent add oimiragieo/agent-studio rule-creator.claude/rules/test -f .claude/rules/<rule-name>.md && echo "EXISTS" || echo "NEW"Skill({ skill: "artifact-updater", args: "--type rule --path .claude/rules/<rule-name>.md --changes '...'" })companion-check.cjs.claude/lib/creators/companion-check.cjscheckCompanions("rule", "{rule-name}")# Rule Name
## Section 1
- Guideline 1
- Guideline 2
## Section 2
- Guideline 3
- Guideline 4# Testing
## Test-Driven Development
- Use TDD for new features and bug fixes (Red-Green-Refactor cycle)
- Write failing test first, then minimal code to pass, then refactor
- Never write production code without a failing test first
## Test Organization
- Add unit tests for utilities and business logic
- Add integration tests for API boundaries
- Keep tests deterministic and isolated (no shared state)
- Place test files in `tests/` directory mirroring source structure// Validate rule name (lowercase, hyphens only)
const ruleName = args.name.toLowerCase().replace(/[^a-z0-9-]/g, '-');
// Validate content is not empty
if (!args.content || args.content.trim().length === 0) {
throw new Error('Rule content cannot be empty');
}const rulePath = `.claude/rules/${ruleName}.md`;
// Format content as markdown
const content = args.content.startsWith('#')
? args.content
: `# ${ruleName.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}\n\n${args.content}`;
await writeFile(rulePath, content);.claude/rules/// Verify file was created
const fileExists = await exists(rulePath);
if (!fileExists) {
throw new Error('Rule file creation failed');
}const {
runIntegrationChecklist,
queueCrossCreatorReview,
} = require('.claude/lib/creator-commons.cjs');
await runIntegrationChecklist('rule', rulePath);
await queueCrossCreatorReview('rule', rulePath, {
artifactName: ruleName,
createdBy: 'rule-creator',
});const {
runIntegrationChecklist,
queueCrossCreatorReview,
} = require('.claude/lib/creator-commons.cjs');
// 1. Run integration checklist
const result = await runIntegrationChecklist('rule', '.claude/rules/<rule-name>.md');
// 2. Queue cross-creator review
await queueCrossCreatorReview('rule', '.claude/rules/<rule-name>.md', {
artifactName: '<rule-name>',
createdBy: 'rule-creator',
});
// 3. Review impact report
// Check result.mustHave for failures - address before marking complete.claude/rules/Skill({
skill: 'rule-creator',
args: `--name code-standards --content "# Code Standards
## Organization
- Prefer small, cohesive files over large ones
- Keep interfaces narrow; separate concerns by feature
## Style
- Favor immutability; avoid in-place mutation
- Validate inputs and handle errors explicitly"`,
});Skill({
skill: 'rule-creator',
args: `--name git-workflow --content "# Git Workflow
## Commit Guidelines
- Keep changes scoped and reviewable
- Use conventional commits: feat:, fix:, refactor:, docs:, chore:
## Branch Workflow
- Create feature branches from main
- Never force-push to main/master"`,
});artifact-updaterskill-creator.claude/context/memory/learnings.md.claude/context/memory/learnings.md.claude/context/memory/issues.md.claude/context/memory/decisions.mdASSUME INTERRUPTION: If it's not in memory, it didn't happen.
agent-creatorskill-creatortool-creatorhook-creatorrule-creatorsemgrep-rule-creatortemplate-creatorworkflow-creatorcommand-creator.claude/CLAUDE.mdvalidate-integration.cjsWebFetch