Cursor rule
.cursor/rules/creating-kiro-agents.mdcKiro agent configuration patterns, JSON structure, tool permissions, and security best practices for creating specialized AI development assistants
Cursor rules
Quality
76/100
Scores the file, not the repository.Length
885 words
39 headings · 20 code blocksRepository
121
— · pushed 40 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# Kiro Agent Development89Patterns for creating specialized Kiro AI agents with proper configuration, tools, and security.1011## Agent File Structure1213```json14{15 "name": "agent-name",16 "description": "One-line purpose",17 "prompt": "System instructions",18 "tools": ["fs_read", "fs_write"],19 "toolsSettings": {},20 "resources": [],21 "mcpServers": {},22 "hooks": {}23}24```2526**Location:**27- Project: `.kiro/agents/<name>.json`28- Global: `~/.kiro/agents/<name>.json`2930## Core Principles3132### 1. Specialization33✅ Create focused agents: `backend-api-specialist`34❌ Avoid generic agents: `general-helper`3536### 2. Least Privilege37Only grant necessary tools and paths.3839```json40{41 "toolsSettings": {42 "fs_write": {43 "allowedPaths": ["src/api/**", "tests/api/**"]44 },45 "execute_bash": {46 "allowedCommands": ["npm test", "npm run build"]47 }48 }49}50```5152### 3. Clear Prompts53Be specific about domain, focus areas, and standards.5455```json56{57 "prompt": "Backend API expert specializing in Express.js and MongoDB.\n\n## Focus\n- RESTful API design\n- Security (input validation, auth)\n- Error handling\n- Query optimization\n\n## Standards\n- Always use async/await\n- Implement proper logging\n- Validate all inputs"58}59```6061## Common Patterns6263### Backend Specialist64```json65{66 "name": "backend-dev",67 "description": "Node.js/Express API development with MongoDB",68 "prompt": "Backend development expert. Focus on API design, database optimization, and security.\n\n## Core Principles\n- RESTful conventions\n- Input validation\n- Error handling\n- Query optimization",69 "tools": ["fs_read", "fs_write", "execute_bash"],70 "toolsSettings": {71 "fs_write": {72 "allowedPaths": ["src/api/**", "src/routes/**", "src/models/**"]73 }74 }75}76```7778### Code Reviewer79```json80{81 "name": "code-reviewer",82 "description": "Reviews code against team standards",83 "prompt": "You review code for:\n- Quality and readability\n- Security issues\n- Performance problems\n- Standard compliance\n\nProvide constructive feedback with examples.",84 "tools": ["fs_read"],85 "resources": ["file://.kiro/steering/review-checklist.md"]86}87```8889### Test Writer90```json91{92 "name": "test-writer",93 "description": "Writes comprehensive Vitest test suites",94 "prompt": "Testing expert using Vitest.\n\n## Requirements\n- Unit tests for all functions\n- Edge case coverage\n- Proper mocking\n- AAA pattern (Arrange, Act, Assert)",95 "tools": ["fs_read", "fs_write"],96 "toolsSettings": {97 "fs_write": {98 "allowedPaths": ["**/*.test.ts", "**/*.spec.ts", "tests/**"]99 }100 }101}102```103104### Frontend Specialist105```json106{107 "name": "frontend-dev",108 "description": "React/Next.js development with TypeScript",109 "prompt": "Frontend expert in React, Next.js, and TypeScript.\n\n## Focus\n- Component architecture\n- Performance optimization\n- Accessibility (WCAG)\n- Responsive design",110 "tools": ["fs_read", "fs_write"],111 "toolsSettings": {112 "fs_write": {113 "allowedPaths": ["src/components/**", "src/app/**", "src/styles/**"]114 }115 }116}117```118119### DevOps Engineer120```json121{122 "name": "devops",123 "description": "Infrastructure and deployment automation",124 "prompt": "DevOps expert specializing in Docker, Kubernetes, and CI/CD.\n\nFocus on automation, reliability, and security.",125 "tools": ["fs_read", "fs_write", "execute_bash"],126 "toolsSettings": {127 "fs_write": {128 "allowedPaths": [".github/**", "docker/**", "k8s/**", "terraform/**"]129 },130 "execute_bash": {131 "allowedCommands": ["docker*", "kubectl*", "terraform*"]132 }133 }134}135```136137## Tool Configuration138139### Common Tools140- `fs_read` - Read files141- `fs_write` - Write files (requires `allowedPaths`)142- `execute_bash` - Run commands (requires `allowedCommands`)143- MCP server tools - Varies by server144145### File System Tools146```json147{148 "toolsSettings": {149 "fs_read": {150 "allowedPaths": ["src/**", "docs/**"]151 },152 "fs_write": {153 "allowedPaths": ["src/generated/**"],154 "excludePaths": ["src/generated/migrations/**"]155 }156 }157}158```159160### Bash Execution161```json162{163 "toolsSettings": {164 "execute_bash": {165 "allowedCommands": ["npm test", "npm run build"],166 "timeout": 30000167 }168 }169}170```171172### MCP Servers173```json174{175 "mcpServers": {176 "database": {177 "command": "mcp-server-postgres",178 "args": ["--host", "localhost"],179 "env": {180 "DB_URL": "${DATABASE_URL}"181 }182 },183 "fetch": {184 "command": "mcp-server-fetch",185 "args": []186 }187 },188 "tools": ["fs_read", "db_query", "fetch"],189 "allowedTools": ["fetch"]190}191```192193## Advanced Features194195### Lifecycle Hooks196```json197{198 "hooks": {199 "agentSpawn": ["git fetch origin", "npm run db:check"],200 "userPromptSubmit": ["git status --short"]201 }202}203```204205### Resource Loading206```json207{208 "resources": [209 "file://.kiro/steering/api-standards.md",210 "file://.kiro/steering/security-policy.md"211 ]212}213```214215## Best Practices216217### Naming218- Use **kebab-case**: `backend-specialist`219- Be **specific**: `react-testing-expert`, not `helper`220- Indicate **domain**: `aws-infrastructure`221222### Security2231. Grant minimum necessary tools2242. Restrict file paths with `allowedPaths`2253. Whitelist commands with `allowedCommands`2264. Use `allowedTools` for safe operations227228### Prompts2291. Define expertise area clearly2302. List specific focus areas2313. Specify standards/conventions2324. Provide pattern examples2335. Set clear expectations234235## Anti-Patterns236237### ❌ Don't: Grant All Tools238```json239{240 "tools": ["*"] // Security risk241}242```243244### ❌ Don't: Vague Prompts245```json246{247 "prompt": "You are a helpful assistant." // Too generic248}249```250251### ❌ Don't: No Path Restrictions252```json253{254 "tools": ["fs_write"] // Can modify any file255}256```257258### ✅ Do: Be Specific259```json260{261 "prompt": "Backend API expert in Express.js.\n\nFocus:\n- REST design\n- Security\n- Error handling",262 "tools": ["fs_read", "fs_write"],263 "toolsSettings": {264 "fs_write": {265 "allowedPaths": ["src/api/**"]266 }267 }268}269```270271## Common Tasks272273### Creating an Agent2742751. **Clarify Requirements**276 - What domain/task?277 - What tools needed?278 - What file paths?2792802. **Create JSON File**281```bash282 touch .kiro/agents/my-agent.json283```2842853. **Design Configuration**286 - Choose pattern (backend, frontend, etc.)287 - Set tool restrictions288 - Write clear prompt2892904. **Test Agent**291```bash292 kiro agent use my-agent293 kiro "What can you help me with?"294```295296## Troubleshooting297298### Agent Not Found299- File must be in `.kiro/agents/`300- Extension must be `.json`301- Validate JSON syntax302303### Tools Not Working304- Check tool name spelling305- Verify `allowedPaths` restrictions306- Ensure MCP servers installed307- Review `allowedTools` list308309### Prompt Ineffective310- Be more specific about tasks311- Add concrete examples312- Reference team standards313- Structure with markdown headers314315## Integration with PRPM316317```bash318# Install Kiro agent from PRPM319prpm install @username/agent-name --as kiro --subtype agent320321# Publish your agent322prpm init my-agent --subtype agent323prpm publish324```325326## Summary327328**Key Points:**3291. Specialize agents for specific domains3302. Restrict tools to minimum necessary3313. Write clear, structured prompts3324. Use kebab-case naming3335. Reference steering files for standards3346. Test agents before deployment335336**Goal:** Create secure, focused agents that enforce team standards and improve development workflows.337
Also in pr-pm/prpm
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| pr-pm/prpm.cursor/rules/karen-repo-reviewer.mdc · 121 | Cursor rules | archgit | 58/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/beanstalk-deploy.mdc · 121 | Cursor rules | teststyletypes | 62/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/core-principles.mdc · 121 | Cursor rules | testlint-formatstylearch+6 | 69/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/creating-agents-md.mdc · 121 | Cursor rules | testlint-formatstylearch+7 | 92/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/creating-cursor-rules.mdc · 121 | Cursor rules | testlint-formatstylearch+5 | 76/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/creating-skills.mdc · 121 | Cursor rules | stylearchtesting-strategydo-not+1 | 61/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/format-conversion.mdc · 121 | Cursor rules | testlint-formatstyledo-not+1 | 63/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/github-actions-testing.mdc · 121 | Cursor rules | setupbuildstylearch+4 | 93/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/prpm-json-best-practices.mdc · 121 | Cursor rules | setuplint-formatstylearch+5 | 73/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/self-improve-cursor.mdc · 121 | Cursor rules | setuptestarchdependencies+3 | 69/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/testing-patterns.mdc · 121 | Cursor rules | testlint-formatstyletesting-strategy | 77/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/typescript-type-safety.mdc · 121 | Cursor rules | buildstylearchtypes+2 | 89/100 | 3 days ago | |
| pr-pm/prpm.cursor/rules/typescript-type-specialist.mdc · 121 | Cursor rules | styletypesdo-notagent-behaviour | 65/100 | 3 days ago | |
| pr-pm/prpmAGENTS.md · 121 | AGENTS.md | setupbuildtestlint-format+12 | 84/100 | 3 days ago | |
| pr-pm/prpmCLAUDE.md · 121 | CLAUDE.md | teststylegitapi+2 | 69/100 | 3 days ago |
Diff against .cursor/rules/karen-repo-reviewer.mdc Diff against .cursor/rules/beanstalk-deploy.mdc Diff against .cursor/rules/core-principles.mdc Diff against .cursor/rules/creating-agents-md.mdc Diff against .cursor/rules/creating-cursor-rules.mdc Diff against .cursor/rules/creating-skills.mdc Diff against .cursor/rules/format-conversion.mdc Diff against .cursor/rules/github-actions-testing.mdc Diff against .cursor/rules/prpm-json-best-practices.mdc Diff against .cursor/rules/self-improve-cursor.mdc Diff against .cursor/rules/testing-patterns.mdc Diff against .cursor/rules/typescript-type-safety.mdc Diff against .cursor/rules/typescript-type-specialist.mdc Diff against AGENTS.md Diff against CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
