Agent-rules provides a framework for defining rules and instructions for agentic coding tools. It enables developers to create consistent, reusable workflows for tools like Cursor, Claude CLI, and Gemini CLI. This skill is useful for teams looking to automate repetitive coding tasks and enforce best practices across their development workflows.
git clone https://github.com/lirantal/agent-rules.gitAgent-rules provides a framework for defining rules and instructions for agentic coding tools. It enables developers to create consistent, reusable workflows for tools like Cursor, Claude CLI, and Gemini CLI. This skill is useful for teams looking to automate repetitive coding tasks and enforce best practices across their development workflows.
[{"step":"Identify the repetitive task to automate","action":"List the specific coding task (e.g., 'pull request review', 'dependency updates', 'test generation') and the tool you'll use (e.g., Cursor, Claude CLI).","tip":"Start with high-frequency tasks that have clear success criteria to validate the rules before expanding."},{"step":"Define the rule components","action":"Break down the task into enforceable rules (e.g., linting, security checks, performance thresholds). Use the example JSON structure as a template.","tip":"Prioritize rules that prevent common mistakes or enforce team standards. Avoid over-engineering early versions."},{"step":"Configure the execution environment","action":"Set up the tool's configuration file (e.g., `.cursor/rules.json` for Cursor or `gemini.json` for Gemini CLI) with the rules. Specify triggers (e.g., pull requests) and timeouts.","tip":"Test the rules in a staging environment first. Use the tool's dry-run or preview mode if available."},{"step":"Integrate with CI/CD","action":"Add the agent-rules configuration to your repository's CI pipeline (e.g., GitHub Actions, GitLab CI). Ensure the tool runs automatically on the specified triggers.","tip":"Monitor the first few runs to catch false positives or edge cases. Adjust rules based on feedback."},{"step":"Iterate and expand","action":"Gradually add more rules or tasks to the agent-rules configuration. Document changes in the repository's README or CONTRIBUTING guide.","tip":"Use version control for the rules file (e.g., Git) to track changes and collaborate with the team."}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/lirantal/agent-rulesCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Define a set of agent-rules for [TOOL_NAME] to automate [SPECIFIC_TASK] in [PROJECT_NAME]. The rules should include [KEY_COMPONENTS] and enforce [BEST_PRACTICES]. Format the rules as a JSON configuration file for direct use with the tool. Example: 'Define agent-rules for Cursor to automate pull request reviews in the 'ecommerce-backend' project. The rules should include linting, security checks, and performance validation, and enforce the team's coding standards.'
```json
{
"name": "ecommerce-backend-pr-review",
"description": "Automated pull request review rules for the ecommerce-backend project",
"rules": {
"linting": {
"enabled": true,
"command": "npm run lint",
"severity": "error",
"auto-fix": true,
"ignore": ["node_modules", ".git"]
},
"security": {
"enabled": true,
"sast_tool": "semgrep",
"ruleset": "owasp-top-ten",
"fail_on": ["sql-injection", "hardcoded-secrets"],
"auto-remediate": false
},
"performance": {
"enabled": true,
"checks": [
{
"type": "database-query",
"threshold": "100ms",
"action": "flag"
},
{
"type": "api-response",
"threshold": "500ms",
"action": "warn"
}
]
},
"standards": {
"enabled": true,
"requirements": [
"Use TypeScript strict mode",
"Follow repository naming conventions",
"Include unit tests for new features",
"Document public APIs with JSDoc"
],
"auto-format": true,
"prettier_config": ".prettierrc"
},
"communication": {
"enabled": true,
"templates": {
"review_comment": "PR Review by automated agent-rules:\n- [ ] Linting passed: ✅\n- [ ] Security scan passed: ✅\n- [ ] Performance checks passed: ✅\n- [ ] Standards compliance: ✅\n\nReview the changes and approve if everything looks good."
}
}
},
"execution": {
"trigger": "pull_request",
"environment": "production",
"timeout": 300,
"retries": 2
}
}
```AI assistant built for thoughtful, nuanced conversation
Google's multimodal AI model and assistant
The AI Code Editor for productive developers
Hey, what’s on your mind today?
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan