[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AFP7J0R2YF6TRVYHABRRJW":3,"skill-same:01M7AFP7J0R2YF6TRVYHABRRJW":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M7AFP7J0R2YF6TRVYHABRRJW","trove-python",null,"Python\u002FFastAPI coding conventions and best practices. Auto-activates when working with Python files. Covers async patterns, type hints, SQLAlchemy, Pydantic, logging, and error handling.","bravew\u002Ftrove","bravew","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F10855844?v=4","01M7ACJ91JZSQYHT81XPVYR7VA","Yong","01M7AFERNR92HDPGNGP5QA16DM",10,"MIT","https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove\u002Fblob\u002Fmain\u002Fplugins\u002Ftrove-dev\u002Fskills\u002Ftrove-python\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: trove-python\ndescription: \"Python\u002FFastAPI coding conventions and best practices. Auto-activates when working with Python files. Covers async patterns, type hints, SQLAlchemy, Pydantic, logging, and error handling.\"\npaths:\n  - \"**\u002F*.py\"\nwhen_to_use: \"python conventions; fastapi patterns; async python; pydantic models\"\nuser-invocable: false\nmetadata:\n  trove-category: code\n  trove-category-label: Code\n---\n\u003C!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->\n\u003C!-- Regenerate: bun run build:skills -->\n\n## Session Init\n\nThis skill ships Trove conventions. Prefer existing project patterns over generic best practices when they conflict.\n\n# Python \u002F FastAPI Conventions\n\n## Imports\n\n- **Top-level imports only** — never inline imports inside functions\n- Organization: stdlib → third-party → local (isort-compatible)\n- Use `from __future__ import annotations` when needed for forward refs\n\n## Type Hints\n\n- All function signatures must have type hints (params + return)\n- Use `from typing import` for complex types (`Optional`, `Union`, etc.)\n- Pydantic models for all request\u002Fresponse schemas\n- Prefer `X | None` over `Optional[X]` (Python 3.10+)\n\n## Async Patterns (CRITICAL)\n\nNever call blocking I\u002FO in async functions:\n\n```python\n# BAD — blocks the event loop\nasync def get_user(user_id: str):\n    response = requests.get(f\"\u002Fusers\u002F{user_id}\")  # BLOCKING!\n    time.sleep(1)  # BLOCKING!\n\n# GOOD — non-blocking\nasync def get_user(user_id: str):\n    async with httpx.AsyncClient() as client:\n        response = await client.get(f\"\u002Fusers\u002F{user_id}\")\n    await asyncio.sleep(1)\n```\n\n- Use `httpx.AsyncClient` for HTTP (not `requests`)\n- Use `asyncio.sleep` for delays (not `time.sleep`)\n- Use `async with` for context managers (DB sessions, HTTP clients)\n\n## Logging\n\n```python\n# INFO\u002FDEBUG — f-strings are fine (fast path, no Sentry indexing needed)\nlogger.info(f\"Processing user {user_id}\")\n\n# WARNING\u002FERROR — static message + extra dict (enables Sentry grouping)\nlogger.warning(\"Payment failed\", extra={\"user_id\": user_id, \"amount\": amount})\n\n# EXCEPTION — use in except blocks (auto-captures stack trace)\ntry:\n    await process()\nexcept Exception:\n    logger.exception(\"Processing failed\", extra={\"user_id\": user_id})\n```\n\nNever use `sentry_sdk.capture_exception()` — use `logger.exception()` instead.\n\n## SQLAlchemy Async\n\n```python\n# Always use async session context manager\nasync with get_async_session() as session:\n    result = await session.execute(select(User).where(User.id == user_id))\n    user = result.scalar_one_or_none()\n\n# Eager loading to avoid N+1\nstmt = select(User).options(selectinload(User.posts)).where(User.id == user_id)\n```\n\n## Error Handling\n\n- Use specific exception types, not bare `except:`\n- FastAPI: raise `HTTPException` with appropriate status codes\n- Service layer: raise domain-specific exceptions\n- Never silently swallow exceptions\n\n## Pydantic Models\n\n```python\nclass UserResponse(BaseModel):\n    model_config = ConfigDict(from_attributes=True)\n\n    id: str\n    name: str\n    email: str | None = None\n    created_at: datetime\n```\n\n## AI Gotchas\n\n- **httpx vs requests**: Always use `httpx.AsyncClient` in async code\n- **datetime**: Use `datetime.now(tz=UTC)` not `datetime.utcnow()` (deprecated)\n- **Pydantic v2**: Use `model_config = ConfigDict(...)` not `class Config:`\n- **SQLAlchemy 2.0**: Use `select()` not `session.query()`\n","\u003C!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->\n\u003C!-- Regenerate: bun run build:skills -->\n\n## Session Init\n\nThis skill ships Trove conventions. Prefer existing project patterns over generic best practices when they conflict.\n\n# Python \u002F FastAPI Conventions\n\n## Imports\n\n- **Top-level imports only** — never inline imports inside functions\n- Organization: stdlib → third-party → local (isort-compatible)\n- Use `from __future__ import annotations` when needed for forward refs\n\n## Type Hints\n\n- All function signatures must have type hints (params + return)\n- Use `from typing import` for complex types (`Optional`, `Union`, etc.)\n- Pydantic models for all request\u002Fresponse schemas\n- Prefer `X | None` over `Optional[X]` (Python 3.10+)\n\n## Async Patterns (CRITICAL)\n\nNever call blocking I\u002FO in async functions:\n\n```python\n# BAD — blocks the event loop\nasync def get_user(user_id: str):\n    response = requests.get(f\"\u002Fusers\u002F{user_id}\")  # BLOCKING!\n    time.sleep(1)  # BLOCKING!\n\n# GOOD — non-blocking\nasync def get_user(user_id: str):\n    async with httpx.AsyncClient() as client:\n        response = await client.get(f\"\u002Fusers\u002F{user_id}\")\n    await asyncio.sleep(1)\n```\n\n- Use `httpx.AsyncClient` for HTTP (not `requests`)\n- Use `asyncio.sleep` for delays (not `time.sleep`)\n- Use `async with` for context managers (DB sessions, HTTP clients)\n\n## Logging\n\n```python\n# INFO\u002FDEBUG — f-strings are fine (fast path, no Sentry indexing needed)\nlogger.info(f\"Processing user {user_id}\")\n\n# WARNING\u002FERROR — static message + extra dict (enables Sentry grouping)\nlogger.warning(\"Payment failed\", extra={\"user_id\": user_id, \"amount\": amount})\n\n# EXCEPTION — use in except blocks (auto-captures stack trace)\ntry:\n    await process()\nexcept Exception:\n    logger.exception(\"Processing failed\", extra={\"user_id\": user_id})\n```\n\nNever use `sentry_sdk.capture_exception()` — use `logger.exception()` instead.\n\n## SQLAlchemy Async\n\n```python\n# Always use async session context manager\nasync with get_async_session() as session:\n    result = await session.execute(select(User).where(User.id == user_id))\n    user = result.scalar_one_or_none()\n\n# Eager loading to avoid N+1\nstmt = select(User).options(selectinload(User.posts)).where(User.id == user_id)\n```\n\n## Error Handling\n\n- Use specific exception types, not bare `except:`\n- FastAPI: raise `HTTPException` with appropriate status codes\n- Service layer: raise domain-specific exceptions\n- Never silently swallow exceptions\n\n## Pydantic Models\n\n```python\nclass UserResponse(BaseModel):\n    model_config = ConfigDict(from_attributes=True)\n\n    id: str\n    name: str\n    email: str | None = None\n    created_at: datetime\n```\n\n## AI Gotchas\n\n- **httpx vs requests**: Always use `httpx.AsyncClient` in async code\n- **datetime**: Use `datetime.now(tz=UTC)` not `datetime.utcnow()` (deprecated)\n- **Pydantic v2**: Use `model_config = ConfigDict(...)` not `class Config:`\n- **SQLAlchemy 2.0**: Use `select()` not `session.query()`\n",{"name":5,"paths":24,"metadata":26,"description":7,"when_to_use":29,"user-invocable":20},[25],"**\u002F*.py",{"trove-category":27,"trove-category-label":28},"code","Code","python conventions; fastapi patterns; async python; pydantic models","main","f88db1f1cf0e0703dd962051ebc142db961d7799","plugins\u002Ftrove-dev\u002Fskills\u002Ftrove-python",1,"https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove","https:\u002F\u002Fgithub.com\u002Fbravew","2026-11-12 07:56:32",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add bravew\u002Ftrove --skill trove-python",{"tool":43,"command":44},"bunx","bunx skills add bravew\u002Ftrove --skill trove-python",{"tool":46,"command":47},"pnpm","pnpm dlx skills add bravew\u002Ftrove --skill trove-python","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove\u002Fblob\u002Fmain\u002Fplugins\u002Ftrove-dev\u002Fskills\u002Ftrove-python\u002FSKILL.md",true,[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7AGJDHTQAS1VK6P7VJAV79G","using-trove","Skill discipline anchor for the Trove marketplace. Loaded once per session; routes the agent to the right trove-* skill before code, planning, review, or git actions.","https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fusing-trove\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7AGJAS4V4TXE6TV6F839BGZ","trove-write-skill","Skill authoring workflow. Use when creating or updating a Codex or Trove skill, including rubrics, tasks, metadata, and validation.","https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Ftrove-write-skill\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7AGJ87K41ZAC8DDBAV17QFW","trove-worktree","Git worktree workflow for spikes, risky experiments, and broad refactors that should not disturb the user's current branch.","https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Ftrove-worktree\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7AGJ32V58VYBFYMS9EMHRY4","trove-why","Reconstruct design rationale and decision history from evidence — source control, issue tracker (Linear), docs (Notion), chat (Slack), error tracking (Sentry) — with calibrated confidence. Use for \"why does X work this way\", \"why did we pick Y\", regressions, and postmortems. Use trove-explain for how it works now.","https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Ftrove-why\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7AGJ0FHJSRR8MMXC3V8XNHF","trove-verify","Completion verification workflow. Use before claiming done, fixed, complete, ready, or shipped.","https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Ftrove-verify\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7AGHWV4B9SDS60RH5W0B0K5","trove-unslop","Cut AI tells from writing — PR descriptions, release notes, specs, commit bodies, and replies. Use before finalizing prose, or when the user asks to clean up, de-slop, or make text sound human.","https:\u002F\u002Fgithub.com\u002Fbravew\u002Ftrove\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Ftrove-unslop\u002FSKILL.md",[],[]]