[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-5b473a46-6707-46f8-830b-cba1014900fe":3,"$fbNQwwoEuaF8fbicFYYdQYRxY7F41GcKdRfvx2b-2uVI":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"5b473a46-6707-46f8-830b-cba1014900fe","python-fastapi-development","使用异步模式、SQLAlchemy、Pydantic、身份验证和生产API模式进行Python FastAPI后端开发。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: python-fastapi-development\ndescription: \"Python FastAPI backend development with async patterns, SQLAlchemy, Pydantic, authentication, and production API patterns.\"\ncategory: granular-workflow-bundle\nrisk: safe\nsource: personal\ndate_added: \"2026-02-27\"\n---\n\n# Python\u002FFastAPI Development Workflow\n\n## Overview\n\nSpecialized workflow for building production-ready Python backends with FastAPI, featuring async patterns, SQLAlchemy ORM, Pydantic validation, and comprehensive API patterns.\n\n## When to Use This Workflow\n\nUse this workflow when:\n- Building new REST APIs with FastAPI\n- Creating async Python backends\n- Implementing database integration with SQLAlchemy\n- Setting up API authentication\n- Developing microservices\n\n## Workflow Phases\n\n### Phase 1: Project Setup\n\n#### Skills to Invoke\n- `app-builder` - Application scaffolding\n- `python-development-python-scaffold` - Python scaffolding\n- `fastapi-templates` - FastAPI templates\n- `uv-package-manager` - Package management\n\n#### Actions\n1. Set up Python environment (uv\u002Fpoetry)\n2. Create project structure\n3. Configure FastAPI app\n4. Set up logging\n5. Configure environment variables\n\n#### Copy-Paste Prompts\n```\nUse @fastapi-templates to scaffold a new FastAPI project\n```\n\n```\nUse @python-development-python-scaffold to set up Python project structure\n```\n\n### Phase 2: Database Setup\n\n#### Skills to Invoke\n- `prisma-expert` - Prisma ORM (alternative)\n- `database-design` - Schema design\n- `postgresql` - PostgreSQL setup\n- `pydantic-models-py` - Pydantic models\n\n#### Actions\n1. Design database schema\n2. Set up SQLAlchemy models\n3. Create database connection\n4. Configure migrations (Alembic)\n5. Set up session management\n\n#### Copy-Paste Prompts\n```\nUse @database-design to design PostgreSQL schema\n```\n\n```\nUse @pydantic-models-py to create Pydantic models for API\n```\n\n### Phase 3: API Routes\n\n#### Skills to Invoke\n- `fastapi-router-py` - FastAPI routers\n- `api-design-principles` - API design\n- `api-patterns` - API patterns\n\n#### Actions\n1. Design API endpoints\n2. Create API routers\n3. Implement CRUD operations\n4. Add request validation\n5. Configure response models\n\n#### Copy-Paste Prompts\n```\nUse @fastapi-router-py to create API endpoints with CRUD operations\n```\n\n```\nUse @api-design-principles to design RESTful API\n```\n\n### Phase 4: Authentication\n\n#### Skills to Invoke\n- `auth-implementation-patterns` - Authentication\n- `api-security-best-practices` - API security\n\n#### Actions\n1. Choose auth strategy (JWT, OAuth2)\n2. Implement user registration\n3. Set up login endpoints\n4. Create auth middleware\n5. Add password hashing\n\n#### Copy-Paste Prompts\n```\nUse @auth-implementation-patterns to implement JWT authentication\n```\n\n### Phase 5: Error Handling\n\n#### Skills to Invoke\n- `fastapi-pro` - FastAPI patterns\n- `error-handling-patterns` - Error handling\n\n#### Actions\n1. Create custom exceptions\n2. Set up exception handlers\n3. Implement error responses\n4. Add request logging\n5. Configure error tracking\n\n#### Copy-Paste Prompts\n```\nUse @fastapi-pro to implement comprehensive error handling\n```\n\n### Phase 6: Testing\n\n#### Skills to Invoke\n- `python-testing-patterns` - pytest testing\n- `api-testing-observability-api-mock` - API testing\n\n#### Actions\n1. Set up pytest\n2. Create test fixtures\n3. Write unit tests\n4. Implement integration tests\n5. Configure test database\n\n#### Copy-Paste Prompts\n```\nUse @python-testing-patterns to write pytest tests for FastAPI\n```\n\n### Phase 7: Documentation\n\n#### Skills to Invoke\n- `api-documenter` - API documentation\n- `openapi-spec-generation` - OpenAPI specs\n\n#### Actions\n1. Configure OpenAPI schema\n2. Add endpoint documentation\n3. Create usage examples\n4. Set up API versioning\n5. Generate API docs\n\n#### Copy-Paste Prompts\n```\nUse @api-documenter to generate comprehensive API documentation\n```\n\n### Phase 8: Deployment\n\n#### Skills to Invoke\n- `deployment-engineer` - Deployment\n- `docker-expert` - Containerization\n\n#### Actions\n1. Create Dockerfile\n2. Set up docker-compose\n3. Configure production settings\n4. Set up reverse proxy\n5. Deploy to cloud\n\n#### Copy-Paste Prompts\n```\nUse @docker-expert to containerize FastAPI application\n```\n\n## Technology Stack\n\n| Category | Technology |\n|----------|------------|\n| Framework | FastAPI |\n| Language | Python 3.11+ |\n| ORM | SQLAlchemy 2.0 |\n| Validation | Pydantic v2 |\n| Database | PostgreSQL |\n| Migrations | Alembic |\n| Auth | JWT, OAuth2 |\n| Testing | pytest |\n\n## Quality Gates\n\n- [ ] All tests passing (>80% coverage)\n- [ ] Type checking passes (mypy)\n- [ ] Linting clean (ruff, black)\n- [ ] API documentation complete\n- [ ] Security scan passed\n- [ ] Performance benchmarks met\n\n## Related Workflow Bundles\n\n- `development` - General development\n- `database` - Database operations\n- `security-audit` - Security testing\n- `api-development` - API patterns\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,56,1883,"2026-05-16 13:35:53",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"45801f25-c9dc-4447-9870-8197dc468f7a","1.0.0","python-fastapi-development.zip",2014,"uploads\u002Fskills\u002F5b473a46-6707-46f8-830b-cba1014900fe\u002Fpython-fastapi-development.zip","8adbb0e43a323a546faffb0b2aba9ca02d4cd4c3c6a781520d6933f53e35899d","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":5171}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]