Cette page fournit des exemples pratiques d'agents personnalisés que vous pouvez utiliser comme points de départ pour vos propres flux de travail.
Cet agent personnalisé est optimisé pour la gestion de l'infrastructure AWS. Il préapprouve les opérations sûres tout en restreignant les commandes destructrices.
{ "name": "aws-specialist-agent", "description": "Specialized agent for AWS infrastructure and development tasks", "prompt": "You are an expert AWS infrastructure specialist with deep knowledge of cloud architecture and best practices", "tools": ["read", "write", "shell", "@git"], "permissions": { "rules": [ { "capability": "shell", "match": ["aws *", "terraform *", "git *"], "effect": "allow" }, { "capability": "fs_write", "match": ["infrastructure/**", "scripts/**", "*.yaml", "*.yml"], "effect": "allow" }, { "capability": "shell", "match": ["rm -rf *", "sudo *"], "effect": "deny" } ] }, "resources": [ "file://README.md", "file://infrastructure/**/*.yaml", "file://docs/aws-setup.md" ], "hooks": [ { "name": "check-aws-identity", "trigger": "SessionStart", "action": { "type": "command", "command": "aws sts get-caller-identity" } } ], "model": "claude-sonnet-4" }
Cas d'utilisation :
Cet agent personnalisé est conçu pour les tâches générales de développement logiciel, y compris la révision de code, les tests et les opérations Git.
{ "name": "development-workflow-agent", "description": "General development workflow agent with Git integration", "prompt": "You are a software development assistant with expertise in Git workflows and code management", "mcpServers": { "github": { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "Bearer ${GITHUB_PAT}" }, "disabledTools": ["create_issue", "update_issue", "create_pull_request", "merge_pull_request", "push_files", "delete_file"] } }, "tools": ["read", "write", "shell", "@github/issue_read", "@github/search_issues"], "allowedTools": ["read", "@github/issue_read", "@github/search_issues"], "toolAliases": { "@github/issue_read": "issue", "@github/search_issues": "issues" }, "permissions": { "rules": [ { "capability": "fs_write", "match": ["src/**", "tests/**", "docs/**", "*.md", "*.json"], "effect": "allow" }, { "capability": "shell", "match": ["git *", "npm *"], "effect": "allow" }, { "capability": "mcp", "match": ["@github/issue_read", "@github/search_issues"], "effect": "allow" } ] }, "resources": [ "file://README.md", "file://CONTRIBUTING.md", "file://docs/**/*.md" ], "hooks": [ { "name": "git-status", "trigger": "SessionStart", "action": { "type": "command", "command": "git status --porcelain" } }, { "name": "current-branch", "trigger": "SessionStart", "action": { "type": "command", "command": "git branch --show-current" } } ] }
Cas d'utilisation :
Cet agent personnalisé se concentre spécifiquement sur les tâches de révision de code, avec des outils et un contexte optimisés pour analyser la qualité du code, la sécurité et les bonnes pratiques.
{ "name": "code-review-agent", "description": "Specialized agent for code review and quality analysis", "prompt": "You are a code review specialist focused on quality, security, and best practices", "tools": ["read", "shell"], "allowedTools": ["read"], "permissions": { "rules": [ { "capability": "shell", "match": ["grep *", "find *", "git diff *", "git log *", "eslint *", "pylint *"], "effect": "allow" }, { "capability": "shell", "match": ["rm *", "sudo *"], "effect": "deny" } ] }, "resources": [ "file://CONTRIBUTING.md", "file://docs/coding-standards.md", "file://.eslintrc.json", "file://pyproject.toml" ], "hooks": [ { "name": "changed-files", "trigger": "SessionStart", "action": { "type": "command", "command": "git diff --name-only HEAD~1" } } ] }
Cas d'utilisation :
Cet exemple montre comment créer un agent personnalisé adapté à un projet spécifique, incluant des serveurs MCP, une documentation et des processus de build spécifiques au projet.
{ "name": "mobile-app-agent", "description": "Agent for the mobile app backend project", "prompt": "You are a backend development specialist for mobile applications with expertise in Docker and database management", "mcpServers": { "docker": { "command": "docker-mcp-server", "args": ["--socket", "/var/run/docker.sock"] }, "database": { "command": "postgres-mcp-server", "args": ["--connection", "postgresql://localhost:5432/myapp"], "env": { "PGPASSWORD": "${DATABASE_PASSWORD}" } } }, "tools": ["read", "write", "shell", "@docker", "@database"], "allowedTools": ["read", "@docker/docker_ps", "@docker/docker_logs", "@database/query_read_only"], "toolAliases": { "@docker/docker_ps": "containers", "@docker/docker_logs": "logs", "@database/query_read_only": "query" }, "permissions": { "rules": [ { "capability": "fs_write", "match": ["src/**", "tests/**", "migrations/**", "docker-compose.yml", "Dockerfile"], "effect": "allow" }, { "capability": "shell", "match": ["npm test", "npm run build", "docker-compose *"], "effect": "allow" }, { "capability": "shell", "match": ["rm -rf *", "sudo *"], "effect": "deny" } ] }, "resources": [ "file://README.md", "file://docs/api-documentation.md", "file://docs/database-schema.md", "file://docker-compose.yml" ], "hooks": [ { "name": "compose-status", "trigger": "SessionStart", "action": { "type": "command", "command": "docker-compose ps" } }, { "name": "git-status", "trigger": "SessionStart", "action": { "type": "command", "command": "git status --porcelain" } } ] }
Cas d'utilisation :
Cet exemple montre un agent configuré pour utiliser un serveur MCP distant :
{ "name": "domain-finder", "description": "Agent with access to domain search capabilities", "prompt": "You help users find and research domain names using the find-a-domain service.", "mcpServers": { "find-a-domain": { "type": "http", "url": "https://api.findadomain.dev/mcp" } }, "tools": ["@find-a-domain"], "allowedTools": ["@find-a-domain"] }
Cet agent donne accès à des outils de recherche de domaines par l'intermédiaire d'un serveur MCP distant. Si le serveur nécessite une authentification OAuth, utilisez la commande /mcp pour vous authentifier lorsque demandé.
Pour les serveurs nécessitant OAuth avec des portées spécifiques :
{ "name": "github-agent", "description": "Agent with GitHub API access", "mcpServers": { "github": { "type": "http", "url": "https://api.github.com/mcp", "oauthScopes": ["repo", "user", "read:org"] } }, "tools": ["@github"], "allowedTools": ["@github"] }
Si vous rencontrez des erreurs de portée OAuth, vous pouvez utiliser un tableau vide pour contourner les exigences de portée :
{ "name": "github-agent", "description": "Agent with GitHub API access", "mcpServers": { "github": { "type": "http", "url": "https://api.github.com/mcp", "oauthScopes": [] } }, "tools": ["@github"], "allowedTools": ["@github"] }
/upgrade-agent pour migrer les configurations v2
Exemples d'agents