backend-core
FastAPI backend routes, auth credentials, data services, migrations, tests, and service-layer troubleshooting for Open Wearables.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- backend-core
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- FastAPI backend routes, auth credentials, data services, migrations, tests, and service-layer troubleshooting for Open Wearables.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-routes.md12.8 KB
- 参考文档references/data-model-and-services.md19.4 KB
- 参考文档references/troubleshooting.md13.9 KB
- 参考文档references/workflows.md14.6 KB
03 SKILL.md 正文
Backend Core
Use this sub-skill for Open Wearables FastAPI backend work: API routes, developer auth, API keys, SDK applications, users, connections, summaries, events, health scores, timeseries, sync status, seed data, outgoing webhooks, service/repository/model/schema patterns, configuration, migrations, Celery/Redis orchestration, and backend tests.
Route the task
- For endpoint families, auth requirements, route registration, OpenAPI/docs navigation, and API-change checklists, read api-routes.md.
- For data models, repositories, service layer patterns, schemas, summaries/events/timeseries flow, sync status, seed data, and outgoing webhook internals, read data-model-and-services.md.
- For concrete backend commands, local Docker/uv workflows, migrations, seeding, targeted pytest selection, and endpoint implementation steps, read workflows.md.
- For PostgreSQL/Redis/testcontainers, auth/API-key, Svix, AWS, Celery, OpenAPI, pagination/date, and migration failures, read troubleshooting.md.
- When a checkout is available, run the safe static checker before or after backend edits:
python skills/disco/open-wearables/sub-skills/backend-core/scripts/check_backend_core.py --repo-root .. Add--import-openapionly when backend dependencies and config are ready; it still avoids network and writes.
Boundaries
This sub-skill owns generic backend/API behavior. Route provider-specific OAuth, provider factory registration, coverage constants, vendor workout parsing, provider webhook parsing, historical backfill internals, and provider-specific import normalization to provider-integrations. Route React portal pages, API hooks, query keys, runtime frontend config, and UI presentation to frontend-portal. Route FastMCP tools, assistant configs, and MCP REST-client behavior to mcp-server.
When work crosses boundaries, keep the shared endpoint contract, auth, database schema, service/repository changes, migrations, and external API docs navigation here; ask the owning sibling sub-skill to handle provider internals or frontend/MCP callers.
Non-negotiable backend rules
- Preserve the route hierarchy: module routers are prefix-free, the v1 router attaches prefixes/tags, the head router attaches the API version prefix, and
app.mainincludes the head router. - Do not use trailing slash route roots on prefixed routers. Use
""for a prefixed router's root endpoint;"/"can create 307 redirects behind reverse proxies. - Keep route handlers thin. Validate/parse request inputs, call services, and return Pydantic response models; do not call repositories directly from routes.
- Keep repositories database-only and model-only. Pydantic schemas and business decisions belong in services or route schemas, not repository methods.
- Use SQLAlchemy 2.0
Mapped[...]model fields and the existingapp.mappingsaliases for IDs, FKs, constrained strings, dates, decimals, JSON, and relationships. - Use Pydantic v2 schema style with
ConfigDict(from_attributes=True)for ORM reads and schema defaults for generated IDs/timestamps where appropriate. - Protect public/external data APIs with
ApiKeyDepunless the route is intentionally token/SDK/OAuth/system-specific; protect dashboard/admin routes withDeveloperDep. - If you add, remove, rename, or retag an endpoint tagged
External: *, update the API Reference navigation indocs/docs.jsonin the same change. - Treat credentials as secrets. Never log API keys, JWTs, application secrets, provider OAuth tokens, Svix tokens, AWS keys, or master encryption material.
- Run focused backend quality checks after changes when dependencies are available: targeted
pytest,ruff check,ruff format --checkor format, andty checkfor type-impacting work.
Fast start for future agents
- Classify the task as route/API contract, data-service/model, background/sync/webhook, migration/config, test failure, or troubleshooting.
- Read the nearest reference in this sub-skill; avoid reopening source files unless you are implementing or verifying drift.
- For endpoint changes, update the route module, schemas, service, repository/model/migration if needed, route registration/tags, tests, and external API docs navigation together.
- For data ingestion or sync changes, verify the affected data-source identity, event/timeseries upsert semantics, sync-status events, and outgoing webhook side effects.
- Prefer the smallest safe test set first, then expand to the native candidate files listed in workflows.md when the change scope requires it.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.