[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DHHZPTSW62C6D70E0MPZ49":3,"skill-same:01M7DHHZPTSW62C6D70E0MPZ49":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":13,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7DHHZPTSW62C6D70E0MPZ49","fastapi-router-py",null,"Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.","ak2dev\u002Fagentguard","ak2dev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F233005497?v=4","01M7DGWK3E3XCC276C6YRFSN05","01M7DGWK4J2A9WQ44CS5CRP4R6",0,"MIT","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-fastapi-router-py\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: fastapi-router-py\ndescription: Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.\nlicense: MIT\nmetadata:\n  author: Microsoft\n  version: \"1.0.0\"\n---\n\n# FastAPI Router\n\nCreate FastAPI routers following established patterns with proper authentication, response models, and HTTP status codes.\n\n## Quick Start\n\nCopy the template from [assets\u002Ftemplate.py](assets\u002Ftemplate.py) and replace placeholders:\n- `{{ResourceName}}` → PascalCase name (e.g., `Project`)\n- `{{resource_name}}` → snake_case name (e.g., `project`)\n- `{{resource_plural}}` → plural form (e.g., `projects`)\n\n## Authentication Patterns\n\n```python\n# Optional auth - returns None if not authenticated\ncurrent_user: Optional[User] = Depends(get_current_user)\n\n# Required auth - raises 401 if not authenticated\ncurrent_user: User = Depends(get_current_user_required)\n```\n\n## Response Models\n\n```python\n@router.get(\"\u002Fitems\u002F{item_id}\", response_model=Item)\nasync def get_item(item_id: str) -> Item:\n    ...\n\n@router.get(\"\u002Fitems\", response_model=list[Item])\nasync def list_items() -> list[Item]:\n    ...\n```\n\n## HTTP Status Codes\n\n```python\n@router.post(\"\u002Fitems\", status_code=status.HTTP_201_CREATED)\nasync def create_item(item: ItemCreate) -> Item:\n  ...\n\n@router.delete(\"\u002Fitems\u002F{id}\", status_code=status.HTTP_204_NO_CONTENT)\nasync def delete_item(id: str) -> None:\n  ...\n```\n\n## Integration Steps\n\n1. Create router in `src\u002Fbackend\u002Fapp\u002Frouters\u002F`\n2. Mount in `src\u002Fbackend\u002Fapp\u002Fmain.py`\n3. Create corresponding Pydantic models\n4. Create service layer if needed\n5. Add frontend API functions\n\n## Best Practices\n\n1. **Pick `def` or `async def` per endpoint based on whether you call async I\u002FO; do not call blocking I\u002FO from an `async def` handler.**\n2. **Manage long-lived resources (DB pools, HTTP clients) in `lifespan` and inject via `Depends`;** use `with`\u002F`async with` for per-request resources.\n\n## Reference Files\n\n| File | Contents |\n|------|----------|\n| [references\u002Fcapabilities.md](references\u002Fcapabilities.md) | Additional non-hero capabilities, operation-group coverage, and production checklists. |\n","# FastAPI Router\n\nCreate FastAPI routers following established patterns with proper authentication, response models, and HTTP status codes.\n\n## Quick Start\n\nCopy the template from [assets\u002Ftemplate.py](assets\u002Ftemplate.py) and replace placeholders:\n- `{{ResourceName}}` → PascalCase name (e.g., `Project`)\n- `{{resource_name}}` → snake_case name (e.g., `project`)\n- `{{resource_plural}}` → plural form (e.g., `projects`)\n\n## Authentication Patterns\n\n```python\n# Optional auth - returns None if not authenticated\ncurrent_user: Optional[User] = Depends(get_current_user)\n\n# Required auth - raises 401 if not authenticated\ncurrent_user: User = Depends(get_current_user_required)\n```\n\n## Response Models\n\n```python\n@router.get(\"\u002Fitems\u002F{item_id}\", response_model=Item)\nasync def get_item(item_id: str) -> Item:\n    ...\n\n@router.get(\"\u002Fitems\", response_model=list[Item])\nasync def list_items() -> list[Item]:\n    ...\n```\n\n## HTTP Status Codes\n\n```python\n@router.post(\"\u002Fitems\", status_code=status.HTTP_201_CREATED)\nasync def create_item(item: ItemCreate) -> Item:\n  ...\n\n@router.delete(\"\u002Fitems\u002F{id}\", status_code=status.HTTP_204_NO_CONTENT)\nasync def delete_item(id: str) -> None:\n  ...\n```\n\n## Integration Steps\n\n1. Create router in `src\u002Fbackend\u002Fapp\u002Frouters\u002F`\n2. Mount in `src\u002Fbackend\u002Fapp\u002Fmain.py`\n3. Create corresponding Pydantic models\n4. Create service layer if needed\n5. Add frontend API functions\n\n## Best Practices\n\n1. **Pick `def` or `async def` per endpoint based on whether you call async I\u002FO; do not call blocking I\u002FO from an `async def` handler.**\n2. **Manage long-lived resources (DB pools, HTTP clients) in `lifespan` and inject via `Depends`;** use `with`\u002F`async with` for per-request resources.\n\n## Reference Files\n\n| File | Contents |\n|------|----------|\n| [references\u002Fcapabilities.md](references\u002Fcapabilities.md) | Additional non-hero capabilities, operation-group coverage, and production checklists. |\n",{"name":5,"license":14,"metadata":23,"description":7},{"author":24,"version":25},"Microsoft","1.0.0","main","634c25395a24b98cd6125453ad4abb65517bcabb","bench\u002Fcorpus\u002Fbenign\u002Freal-ms-fastapi-router-py","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard","https:\u002F\u002Fsite-bionic8.vercel.app","https:\u002F\u002Fgithub.com\u002Fak2dev","2026-11-11 02:37:06",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add ak2dev\u002Fagentguard --skill fastapi-router-py",{"tool":39,"command":40},"bunx","bunx skills add ak2dev\u002Fagentguard --skill fastapi-router-py",{"tool":42,"command":43},"pnpm","pnpm dlx skills add ak2dev\u002Fagentguard --skill fastapi-router-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-fastapi-router-py\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"assets\u002Ftemplate.py","SCRIPT","脚本",4660,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-fastapi-router-py\u002Fassets\u002Ftemplate.py",{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fcapabilities.md","REFERENCE","参考文档",934,"https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Fbench\u002Fcorpus\u002Fbenign\u002Freal-ms-fastapi-router-py\u002Freferences\u002Fcapabilities.md",[60,68,73,78,83,89],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7DJ7GBSJBJ32GXNQXVAMNYK","csv-tool","Summarize CSV files and report column statistics.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-002\u002Fpositive\u002Ffault\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":69,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7DJ7F00PA7EHFM39RVCC8R5","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-002\u002Fnegative\u002Fnormal\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":74,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7DJ7DP7KDW7MYY5Q0R0JFEN","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-001\u002Fpositive\u002Ftoo-large\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":79,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M7DJ7C3VA0KQ8Q9ESNX6AJHE","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SYS-001\u002Fnegative\u002Fsmall\u002Fcsv-tool\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7DJ7AQZTGY5YADQX73TRB7K","pdf","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SKL-TYP-002\u002Fpositive\u002Fother-publisher\u002Fpdf\u002FSKILL.md",[],[],{"skillNo":90,"name":85,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":64,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M7DJ7831XDVWS4W9SAAKBJHX","https:\u002F\u002Fgithub.com\u002Fak2dev\u002Fagentguard\u002Fblob\u002Fmain\u002Ffixtures\u002Frules\u002FAG-SKL-TYP-002\u002Fnegative\u002Fsame-publisher\u002Fpdf\u002FSKILL.md",[],[]]