contextos-agents 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/AGENTS.md +421 -0
- package/.agents/adapters/aider/export.js +137 -0
- package/.agents/adapters/claude/export.js +55 -0
- package/.agents/adapters/copilot/export.js +107 -0
- package/.agents/adapters/cursor/export.js +210 -0
- package/.agents/adapters/gemini/export.js +115 -0
- package/.agents/adapters/shared.js +119 -0
- package/.agents/adapters/zed/export.js +111 -0
- package/.agents/core/profiles/backend.yaml +47 -0
- package/.agents/core/profiles/enterprise.yaml +46 -0
- package/.agents/core/profiles/frontend.yaml +46 -0
- package/.agents/core/profiles/hackathon.yaml +45 -0
- package/.agents/core/profiles/mvp.yaml +43 -0
- package/.agents/core/profiles/startup.yaml +48 -0
- package/.agents/core/skills/adapters/EXAMPLES.md +19 -0
- package/.agents/core/skills/adapters/SKILL.md +105 -0
- package/.agents/core/skills/adapters/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/adapters/VALIDATION.json +12 -0
- package/.agents/core/skills/adapters/skill.yaml +10 -0
- package/.agents/core/skills/architecture-diagrams/SKILL.md +108 -0
- package/.agents/core/skills/architecture-diagrams/VALIDATION.json +12 -0
- package/.agents/core/skills/architecture-diagrams/skill.yaml +8 -0
- package/.agents/core/skills/brutalist-design/SKILL.md +150 -0
- package/.agents/core/skills/brutalist-design/VALIDATION.json +12 -0
- package/.agents/core/skills/brutalist-design/skill.yaml +8 -0
- package/.agents/core/skills/context-manager/EXAMPLES.md +19 -0
- package/.agents/core/skills/context-manager/SKILL.md +126 -0
- package/.agents/core/skills/context-manager/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/context-manager/VALIDATION.json +12 -0
- package/.agents/core/skills/context-manager/skill.yaml +10 -0
- package/.agents/core/skills/context-os/EXAMPLES.md +21 -0
- package/.agents/core/skills/context-os/SKILL.md +169 -0
- package/.agents/core/skills/context-os/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/context-os/VALIDATION.json +12 -0
- package/.agents/core/skills/context-os/packs.yaml +59 -0
- package/.agents/core/skills/context-os/references/context-rules.md +68 -0
- package/.agents/core/skills/context-os/references/pipeline.md +119 -0
- package/.agents/core/skills/context-os/references/project-graph.md +103 -0
- package/.agents/core/skills/context-os/rules.yaml +135 -0
- package/.agents/core/skills/context-os/skill.yaml +10 -0
- package/.agents/core/skills/database/EXAMPLES.md +74 -0
- package/.agents/core/skills/database/SKILL.md +101 -0
- package/.agents/core/skills/database/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/database/VALIDATION.json +11 -0
- package/.agents/core/skills/database/skill.yaml +25 -0
- package/.agents/core/skills/ddd/EXAMPLES.md +42 -0
- package/.agents/core/skills/ddd/SKILL.md +247 -0
- package/.agents/core/skills/ddd/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ddd/VALIDATION.json +12 -0
- package/.agents/core/skills/ddd/ddd.md +178 -0
- package/.agents/core/skills/ddd/skill.yaml +10 -0
- package/.agents/core/skills/decisions/EXAMPLES.md +35 -0
- package/.agents/core/skills/decisions/SKILL.md +90 -0
- package/.agents/core/skills/decisions/TROUBLESHOOTING.md +13 -0
- package/.agents/core/skills/decisions/VALIDATION.json +12 -0
- package/.agents/core/skills/decisions/skill.yaml +10 -0
- package/.agents/core/skills/docker/EXAMPLES.md +56 -0
- package/.agents/core/skills/docker/SKILL.md +63 -0
- package/.agents/core/skills/docker/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/docker/VALIDATION.json +11 -0
- package/.agents/core/skills/docker/skill.yaml +23 -0
- package/.agents/core/skills/engineering-workflow/EXAMPLES.md +57 -0
- package/.agents/core/skills/engineering-workflow/SKILL.md +343 -0
- package/.agents/core/skills/engineering-workflow/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/engineering-workflow/VALIDATION.json +12 -0
- package/.agents/core/skills/engineering-workflow/skill.yaml +13 -0
- package/.agents/core/skills/fastapi/EXAMPLES.md +36 -0
- package/.agents/core/skills/fastapi/SKILL.md +148 -0
- package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/fastapi/VALIDATION.json +12 -0
- package/.agents/core/skills/fastapi/fastapi.md +112 -0
- package/.agents/core/skills/fastapi/skill.yaml +10 -0
- package/.agents/core/skills/gemini-precision/SKILL.md +169 -0
- package/.agents/core/skills/gemini-precision/VALIDATION.json +12 -0
- package/.agents/core/skills/gemini-precision/skill.yaml +9 -0
- package/.agents/core/skills/generators/EXAMPLES.md +19 -0
- package/.agents/core/skills/generators/SKILL.md +112 -0
- package/.agents/core/skills/generators/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/generators/VALIDATION.json +12 -0
- package/.agents/core/skills/generators/skill.yaml +10 -0
- package/.agents/core/skills/generators/templates/API.md +77 -0
- package/.agents/core/skills/generators/templates/ARCHITECTURE.md +70 -0
- package/.agents/core/skills/generators/templates/DATABASE.md +42 -0
- package/.agents/core/skills/generators/templates/DECISION.md +46 -0
- package/.agents/core/skills/generators/templates/PRD.md +67 -0
- package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +56 -0
- package/.agents/core/skills/generators/templates/ROADMAP.md +51 -0
- package/.agents/core/skills/generators/templates/TASKS.md +43 -0
- package/.agents/core/skills/generators/templates/UI.md +73 -0
- package/.agents/core/skills/graphify/EXAMPLES.md +73 -0
- package/.agents/core/skills/graphify/SKILL.md +130 -0
- package/.agents/core/skills/graphify/VALIDATION.json +12 -0
- package/.agents/core/skills/graphify/skill.yaml +13 -0
- package/.agents/core/skills/gstack-roles/EXAMPLES.md +23 -0
- package/.agents/core/skills/gstack-roles/SKILL.md +152 -0
- package/.agents/core/skills/gstack-roles/TROUBLESHOOTING.md +13 -0
- package/.agents/core/skills/gstack-roles/VALIDATION.json +12 -0
- package/.agents/core/skills/gstack-roles/skill.yaml +12 -0
- package/.agents/core/skills/impeccable-design/EXAMPLES.md +26 -0
- package/.agents/core/skills/impeccable-design/SKILL.md +201 -0
- package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/impeccable-design/VALIDATION.json +12 -0
- package/.agents/core/skills/impeccable-design/skill.yaml +14 -0
- package/.agents/core/skills/interview-me/SKILL.md +97 -0
- package/.agents/core/skills/interview-me/VALIDATION.json +12 -0
- package/.agents/core/skills/interview-me/skill.yaml +8 -0
- package/.agents/core/skills/microservices/EXAMPLES.md +38 -0
- package/.agents/core/skills/microservices/SKILL.md +164 -0
- package/.agents/core/skills/microservices/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/microservices/VALIDATION.json +12 -0
- package/.agents/core/skills/microservices/microservices.md +119 -0
- package/.agents/core/skills/microservices/skill.yaml +10 -0
- package/.agents/core/skills/minimalist-design/SKILL.md +113 -0
- package/.agents/core/skills/minimalist-design/VALIDATION.json +12 -0
- package/.agents/core/skills/minimalist-design/skill.yaml +8 -0
- package/.agents/core/skills/nestjs/EXAMPLES.md +40 -0
- package/.agents/core/skills/nestjs/SKILL.md +139 -0
- package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/nestjs/VALIDATION.json +12 -0
- package/.agents/core/skills/nestjs/nestjs.md +103 -0
- package/.agents/core/skills/nestjs/skill.yaml +10 -0
- package/.agents/core/skills/nextjs/EXAMPLES.md +40 -0
- package/.agents/core/skills/nextjs/SKILL.md +163 -0
- package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/nextjs/VALIDATION.json +12 -0
- package/.agents/core/skills/nextjs/nextjs.md +67 -0
- package/.agents/core/skills/nextjs/skill.yaml +10 -0
- package/.agents/core/skills/node/EXAMPLES.md +80 -0
- package/.agents/core/skills/node/SKILL.md +128 -0
- package/.agents/core/skills/node/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/node/VALIDATION.json +12 -0
- package/.agents/core/skills/node/node.md +87 -0
- package/.agents/core/skills/node/skill.yaml +10 -0
- package/.agents/core/skills/performance/EXAMPLES.md +30 -0
- package/.agents/core/skills/performance/SKILL.md +75 -0
- package/.agents/core/skills/performance/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/performance/VALIDATION.json +12 -0
- package/.agents/core/skills/performance/performance.md +52 -0
- package/.agents/core/skills/performance/skill.yaml +10 -0
- package/.agents/core/skills/ponytail-mindset/EXAMPLES.md +45 -0
- package/.agents/core/skills/ponytail-mindset/SKILL.md +193 -0
- package/.agents/core/skills/ponytail-mindset/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ponytail-mindset/VALIDATION.json +12 -0
- package/.agents/core/skills/ponytail-mindset/skill.yaml +14 -0
- package/.agents/core/skills/react/EXAMPLES.md +79 -0
- package/.agents/core/skills/react/SKILL.md +132 -0
- package/.agents/core/skills/react/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/react/VALIDATION.json +12 -0
- package/.agents/core/skills/react/react.md +93 -0
- package/.agents/core/skills/react/skill.yaml +10 -0
- package/.agents/core/skills/react-best-practices/SKILL.md +155 -0
- package/.agents/core/skills/react-best-practices/VALIDATION.json +12 -0
- package/.agents/core/skills/react-best-practices/skill.yaml +10 -0
- package/.agents/core/skills/redesign-audit/SKILL.md +117 -0
- package/.agents/core/skills/redesign-audit/VALIDATION.json +12 -0
- package/.agents/core/skills/redesign-audit/skill.yaml +8 -0
- package/.agents/core/skills/security/EXAMPLES.md +64 -0
- package/.agents/core/skills/security/SKILL.md +158 -0
- package/.agents/core/skills/security/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/security/VALIDATION.json +12 -0
- package/.agents/core/skills/security/security.md +106 -0
- package/.agents/core/skills/security/skill.yaml +10 -0
- package/.agents/core/skills/soft-design/SKILL.md +108 -0
- package/.agents/core/skills/soft-design/VALIDATION.json +12 -0
- package/.agents/core/skills/soft-design/skill.yaml +8 -0
- package/.agents/core/skills/state-management/EXAMPLES.md +56 -0
- package/.agents/core/skills/state-management/SKILL.md +48 -0
- package/.agents/core/skills/state-management/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/state-management/VALIDATION.json +11 -0
- package/.agents/core/skills/state-management/skill.yaml +22 -0
- package/.agents/core/skills/subagent-orchestrator/SKILL.md +100 -0
- package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +12 -0
- package/.agents/core/skills/subagent-orchestrator/skill.yaml +8 -0
- package/.agents/core/skills/system-design/EXAMPLES.md +75 -0
- package/.agents/core/skills/system-design/SKILL.md +419 -0
- package/.agents/core/skills/system-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/system-design/VALIDATION.json +12 -0
- package/.agents/core/skills/system-design/skill.yaml +13 -0
- package/.agents/core/skills/system-design/system-design.md +112 -0
- package/.agents/core/skills/testing/EXAMPLES.md +71 -0
- package/.agents/core/skills/testing/SKILL.md +70 -0
- package/.agents/core/skills/testing/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/testing/VALIDATION.json +11 -0
- package/.agents/core/skills/testing/skill.yaml +26 -0
- package/.agents/core/skills/typescript/EXAMPLES.md +64 -0
- package/.agents/core/skills/typescript/SKILL.md +112 -0
- package/.agents/core/skills/typescript/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/typescript/VALIDATION.json +12 -0
- package/.agents/core/skills/typescript/skill.yaml +10 -0
- package/.agents/core/skills/typescript/typescript.md +71 -0
- package/.agents/core/skills/ui-design/EXAMPLES.md +21 -0
- package/.agents/core/skills/ui-design/SKILL.md +124 -0
- package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ui-design/VALIDATION.json +12 -0
- package/.agents/core/skills/ui-design/skill.yaml +10 -0
- package/.agents/core/skills/ui-design/ui.md +88 -0
- package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +62 -0
- package/.agents/core/skills/ui-ux-pro/SKILL.md +375 -0
- package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ui-ux-pro/VALIDATION.json +12 -0
- package/.agents/core/skills/ui-ux-pro/skill.yaml +13 -0
- package/.agents/core/skills/ux-design/EXAMPLES.md +36 -0
- package/.agents/core/skills/ux-design/SKILL.md +116 -0
- package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ux-design/VALIDATION.json +12 -0
- package/.agents/core/skills/ux-design/skill.yaml +10 -0
- package/.agents/core/skills/ux-design/ux.md +80 -0
- package/.agents/core/skills/vercel-optimize/SKILL.md +83 -0
- package/.agents/core/skills/vercel-optimize/VALIDATION.json +12 -0
- package/.agents/core/skills/vercel-optimize/skill.yaml +10 -0
- package/.agents/core/skills/web-accessibility/EXAMPLES.md +39 -0
- package/.agents/core/skills/web-accessibility/SKILL.md +170 -0
- package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/web-accessibility/VALIDATION.json +12 -0
- package/.agents/core/skills/web-accessibility/accessibility.md +63 -0
- package/.agents/core/skills/web-accessibility/skill.yaml +10 -0
- package/.agents/ctx.js +370 -0
- package/.agents/generated/claude/skills/adapters/SKILL.md +126 -0
- package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +101 -0
- package/.agents/generated/claude/skills/brutalist-design/SKILL.md +145 -0
- package/.agents/generated/claude/skills/context-manager/SKILL.md +147 -0
- package/.agents/generated/claude/skills/context-os/SKILL.md +191 -0
- package/.agents/generated/claude/skills/database/SKILL.md +191 -0
- package/.agents/generated/claude/skills/ddd/SKILL.md +305 -0
- package/.agents/generated/claude/skills/decisions/SKILL.md +134 -0
- package/.agents/generated/claude/skills/docker/SKILL.md +135 -0
- package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +414 -0
- package/.agents/generated/claude/skills/fastapi/SKILL.md +200 -0
- package/.agents/generated/claude/skills/gemini-precision/SKILL.md +161 -0
- package/.agents/generated/claude/skills/generators/SKILL.md +133 -0
- package/.agents/generated/claude/skills/graphify/SKILL.md +198 -0
- package/.agents/generated/claude/skills/gstack-roles/SKILL.md +184 -0
- package/.agents/generated/claude/skills/impeccable-design/SKILL.md +241 -0
- package/.agents/generated/claude/skills/interview-me/SKILL.md +90 -0
- package/.agents/generated/claude/skills/microservices/SKILL.md +218 -0
- package/.agents/generated/claude/skills/minimalist-design/SKILL.md +108 -0
- package/.agents/generated/claude/skills/nestjs/SKILL.md +195 -0
- package/.agents/generated/claude/skills/nextjs/SKILL.md +219 -0
- package/.agents/generated/claude/skills/node/SKILL.md +224 -0
- package/.agents/generated/claude/skills/performance/SKILL.md +121 -0
- package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +252 -0
- package/.agents/generated/claude/skills/react/SKILL.md +227 -0
- package/.agents/generated/claude/skills/react-best-practices/SKILL.md +146 -0
- package/.agents/generated/claude/skills/redesign-audit/SKILL.md +112 -0
- package/.agents/generated/claude/skills/security/SKILL.md +237 -0
- package/.agents/generated/claude/skills/soft-design/SKILL.md +103 -0
- package/.agents/generated/claude/skills/state-management/SKILL.md +120 -0
- package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +93 -0
- package/.agents/generated/claude/skills/system-design/SKILL.md +507 -0
- package/.agents/generated/claude/skills/testing/SKILL.md +157 -0
- package/.agents/generated/claude/skills/typescript/SKILL.md +192 -0
- package/.agents/generated/claude/skills/ui-design/SKILL.md +161 -0
- package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +451 -0
- package/.agents/generated/claude/skills/ux-design/SKILL.md +168 -0
- package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +76 -0
- package/.agents/generated/claude/skills/web-accessibility/SKILL.md +225 -0
- package/.agents/generated/gemini/skills/adapters/SKILL.md +135 -0
- package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +107 -0
- package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +151 -0
- package/.agents/generated/gemini/skills/context-manager/SKILL.md +156 -0
- package/.agents/generated/gemini/skills/context-os/SKILL.md +200 -0
- package/.agents/generated/gemini/skills/database/SKILL.md +200 -0
- package/.agents/generated/gemini/skills/ddd/SKILL.md +314 -0
- package/.agents/generated/gemini/skills/decisions/SKILL.md +143 -0
- package/.agents/generated/gemini/skills/docker/SKILL.md +144 -0
- package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +423 -0
- package/.agents/generated/gemini/skills/fastapi/SKILL.md +209 -0
- package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +167 -0
- package/.agents/generated/gemini/skills/generators/SKILL.md +142 -0
- package/.agents/generated/gemini/skills/graphify/SKILL.md +205 -0
- package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +193 -0
- package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +250 -0
- package/.agents/generated/gemini/skills/interview-me/SKILL.md +96 -0
- package/.agents/generated/gemini/skills/microservices/SKILL.md +227 -0
- package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +114 -0
- package/.agents/generated/gemini/skills/nestjs/SKILL.md +204 -0
- package/.agents/generated/gemini/skills/nextjs/SKILL.md +298 -0
- package/.agents/generated/gemini/skills/node/SKILL.md +323 -0
- package/.agents/generated/gemini/skills/performance/SKILL.md +185 -0
- package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +261 -0
- package/.agents/generated/gemini/skills/react/SKILL.md +332 -0
- package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +152 -0
- package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +118 -0
- package/.agents/generated/gemini/skills/security/SKILL.md +355 -0
- package/.agents/generated/gemini/skills/soft-design/SKILL.md +109 -0
- package/.agents/generated/gemini/skills/state-management/SKILL.md +129 -0
- package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +99 -0
- package/.agents/generated/gemini/skills/system-design/SKILL.md +631 -0
- package/.agents/generated/gemini/skills/testing/SKILL.md +166 -0
- package/.agents/generated/gemini/skills/typescript/SKILL.md +275 -0
- package/.agents/generated/gemini/skills/ui-design/SKILL.md +170 -0
- package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +460 -0
- package/.agents/generated/gemini/skills/ux-design/SKILL.md +177 -0
- package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +82 -0
- package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +300 -0
- package/.agents/mcp/runtime.py +454 -0
- package/.agents/mcp/server.mjs +189373 -0
- package/.agents/plugins.js +574 -0
- package/.agents/profiles.js +267 -0
- package/.agents/resolver.js +336 -0
- package/.agents/skills-index.json +200 -0
- package/.agents/skills.json +6 -0
- package/.agents/validate.js +500 -0
- package/LICENSE +21 -0
- package/README.md +415 -0
- package/benchmarks/gemini-issues.js +533 -0
- package/bin/index.js +458 -0
- package/package.json +70 -0
- package/registry.json +53 -0
- package/registry.schema.json +32 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: FastAPI
|
|
3
|
+
description: >
|
|
4
|
+
ContextOS skill for FastAPI
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# FastAPI
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
High-performance Python backend engineering using FastAPI, Pydantic v2, and async SQLAlchemy/Tortoise ORM. Enforces type-driven request validation, OpenAPI contracts, and async non-blocking endpoints.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
Activate when building Python REST APIs, microservices, asynchronous background jobs, or integrating Python ML services into web backends.
|
|
16
|
+
|
|
17
|
+
## Rules & Patterns
|
|
18
|
+
<!-- Source: fastapi.md -->
|
|
19
|
+
|
|
20
|
+
## FastAPI — Best Practices
|
|
21
|
+
|
|
22
|
+
## Project Structure
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
app/
|
|
26
|
+
├── main.py # App entry, CORS, middleware
|
|
27
|
+
├── config.py # Settings with Pydantic BaseSettings
|
|
28
|
+
├── database.py # Database session, engine
|
|
29
|
+
├── models/ # SQLAlchemy models
|
|
30
|
+
│ ├── __init__.py
|
|
31
|
+
│ └── user.py
|
|
32
|
+
├── schemas/ # Pydantic schemas (request/response)
|
|
33
|
+
│ ├── __init__.py
|
|
34
|
+
│ └── user.py
|
|
35
|
+
├── api/ # Route handlers
|
|
36
|
+
│ ├── __init__.py
|
|
37
|
+
│ ├── deps.py # Dependency injection
|
|
38
|
+
│ └── v1/
|
|
39
|
+
│ ├── __init__.py
|
|
40
|
+
│ └── users.py
|
|
41
|
+
├── services/ # Business logic
|
|
42
|
+
│ └── user_service.py
|
|
43
|
+
├── repositories/ # Database access
|
|
44
|
+
│ └── user_repo.py
|
|
45
|
+
└── tests/
|
|
46
|
+
└── test_users.py
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Pydantic Models
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from pydantic import BaseModel, EmailStr, Field
|
|
53
|
+
|
|
54
|
+
class UserCreate(BaseModel):
|
|
55
|
+
email: EmailStr
|
|
56
|
+
name: str = Field(..., min_length=1, max_length=100)
|
|
57
|
+
|
|
58
|
+
class UserResponse(BaseModel):
|
|
59
|
+
id: int
|
|
60
|
+
email: str
|
|
61
|
+
name: str
|
|
62
|
+
|
|
63
|
+
model_config = ConfigDict(from_attributes=True)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Dependency Injection
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from fastapi import Depends
|
|
70
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
71
|
+
|
|
72
|
+
async def get_db() -> AsyncGenerator[AsyncSession, None]:
|
|
73
|
+
async with async_session() as session:
|
|
74
|
+
yield session
|
|
75
|
+
|
|
76
|
+
async def get_current_user(
|
|
77
|
+
token: str = Depends(oauth2_scheme),
|
|
78
|
+
db: AsyncSession = Depends(get_db)
|
|
79
|
+
) -> User:
|
|
80
|
+
# Verify token, return user
|
|
81
|
+
...
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Async
|
|
85
|
+
|
|
86
|
+
- **Use async** for all I/O operations (database, HTTP calls, file I/O)
|
|
87
|
+
- **Never block the event loop** — no sync I/O in async endpoints
|
|
88
|
+
- **Use `asyncio.gather`** for parallel async operations
|
|
89
|
+
- **Background tasks** — `BackgroundTasks` for non-critical work
|
|
90
|
+
|
|
91
|
+
## Error Handling
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from fastapi import HTTPException
|
|
95
|
+
|
|
96
|
+
class AppException(HTTPException):
|
|
97
|
+
def __init__(self, status_code: int, detail: str, code: str):
|
|
98
|
+
super().__init__(status_code=status_code, detail=detail)
|
|
99
|
+
self.code = code
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Security
|
|
103
|
+
|
|
104
|
+
- **OAuth2 with JWT** — use `python-jose`
|
|
105
|
+
- **Password hashing** — bcrypt via `passlib`
|
|
106
|
+
- **CORS** — configure explicitly
|
|
107
|
+
- **Rate limiting** — use `slowapi`
|
|
108
|
+
- **Input validation** — Pydantic handles this automatically
|
|
109
|
+
|
|
110
|
+
## Testing
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import pytest
|
|
114
|
+
from httpx import AsyncClient
|
|
115
|
+
|
|
116
|
+
@pytest.mark.asyncio
|
|
117
|
+
async def test_create_user(client: AsyncClient):
|
|
118
|
+
response = await client.post("/api/v1/users", json={
|
|
119
|
+
"email": "test@example.com",
|
|
120
|
+
"name": "Test User"
|
|
121
|
+
})
|
|
122
|
+
assert response.status_code == 201
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Anti-Patterns
|
|
126
|
+
|
|
127
|
+
- [FAIL] Business logic in route handlers — use services
|
|
128
|
+
- [FAIL] Raw SQL without ORM — use SQLAlchemy
|
|
129
|
+
- [FAIL] Sync database calls — use async drivers
|
|
130
|
+
- [FAIL] Hardcoded settings — use Pydantic BaseSettings
|
|
131
|
+
- [FAIL] No schema validation — always use Pydantic models
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## Code Examples
|
|
135
|
+
|
|
136
|
+
See `EXAMPLES.md` for detailed code examples.
|
|
137
|
+
|
|
138
|
+
## Validation Checklist
|
|
139
|
+
|
|
140
|
+
What to verify during the review phase before completing the task.
|
|
141
|
+
|
|
142
|
+
## Common Mistakes
|
|
143
|
+
|
|
144
|
+
Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
|
|
145
|
+
|
|
146
|
+
## Integration Notes
|
|
147
|
+
|
|
148
|
+
How this skill interacts with other skills.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# fastapi Troubleshooting & Common Mistakes
|
|
2
|
+
|
|
3
|
+
## 1. Pydantic v1 vs v2 Deprecations
|
|
4
|
+
|
|
5
|
+
- **Symptom**: Warnings or crashes regarding @validator or .dict() methods.
|
|
6
|
+
- **Root Cause**: FastAPI projects upgrading to Pydantic v2.
|
|
7
|
+
- **Fix**: Use @field_validator instead of @validator, and .model_dump() instead of .dict().
|
|
8
|
+
|
|
9
|
+
## 2. Database Session Leaks
|
|
10
|
+
|
|
11
|
+
- **Symptom**: Database pool runs out of connections after a few requests.
|
|
12
|
+
- **Root Cause**: Database sessions opened manually without proper try...finally or dependency injection.
|
|
13
|
+
- **Fix**: Always provide database sessions via Depends(get_db) with a yield block.
|
|
14
|
+
|
|
15
|
+
## 3. Unhandled Validation Errors Returning Inconsistent JSON
|
|
16
|
+
|
|
17
|
+
- **Symptom**: Frontend receives raw 422 arrays without matching standard API error response envelope.
|
|
18
|
+
- **Root Cause**: Missing custom RequestValidationError handler.
|
|
19
|
+
- **Fix**: Register an app-level exception handler for RequestValidationError that normalizes error shapes.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# FastAPI — Best Practices
|
|
2
|
+
|
|
3
|
+
## Project Structure
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
app/
|
|
7
|
+
├── main.py # App entry, CORS, middleware
|
|
8
|
+
├── config.py # Settings with Pydantic BaseSettings
|
|
9
|
+
├── database.py # Database session, engine
|
|
10
|
+
├── models/ # SQLAlchemy models
|
|
11
|
+
│ ├── __init__.py
|
|
12
|
+
│ └── user.py
|
|
13
|
+
├── schemas/ # Pydantic schemas (request/response)
|
|
14
|
+
│ ├── __init__.py
|
|
15
|
+
│ └── user.py
|
|
16
|
+
├── api/ # Route handlers
|
|
17
|
+
│ ├── __init__.py
|
|
18
|
+
│ ├── deps.py # Dependency injection
|
|
19
|
+
│ └── v1/
|
|
20
|
+
│ ├── __init__.py
|
|
21
|
+
│ └── users.py
|
|
22
|
+
├── services/ # Business logic
|
|
23
|
+
│ └── user_service.py
|
|
24
|
+
├── repositories/ # Database access
|
|
25
|
+
│ └── user_repo.py
|
|
26
|
+
└── tests/
|
|
27
|
+
└── test_users.py
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Pydantic Models
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from pydantic import BaseModel, EmailStr, Field
|
|
34
|
+
|
|
35
|
+
class UserCreate(BaseModel):
|
|
36
|
+
email: EmailStr
|
|
37
|
+
name: str = Field(..., min_length=1, max_length=100)
|
|
38
|
+
|
|
39
|
+
class UserResponse(BaseModel):
|
|
40
|
+
id: int
|
|
41
|
+
email: str
|
|
42
|
+
name: str
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(from_attributes=True)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Dependency Injection
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from fastapi import Depends
|
|
51
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
52
|
+
|
|
53
|
+
async def get_db() -> AsyncGenerator[AsyncSession, None]:
|
|
54
|
+
async with async_session() as session:
|
|
55
|
+
yield session
|
|
56
|
+
|
|
57
|
+
async def get_current_user(
|
|
58
|
+
token: str = Depends(oauth2_scheme),
|
|
59
|
+
db: AsyncSession = Depends(get_db)
|
|
60
|
+
) -> User:
|
|
61
|
+
# Verify token, return user
|
|
62
|
+
...
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Async
|
|
66
|
+
|
|
67
|
+
- **Use async** for all I/O operations (database, HTTP calls, file I/O)
|
|
68
|
+
- **Never block the event loop** — no sync I/O in async endpoints
|
|
69
|
+
- **Use `asyncio.gather`** for parallel async operations
|
|
70
|
+
- **Background tasks** — `BackgroundTasks` for non-critical work
|
|
71
|
+
|
|
72
|
+
## Error Handling
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from fastapi import HTTPException
|
|
76
|
+
|
|
77
|
+
class AppException(HTTPException):
|
|
78
|
+
def __init__(self, status_code: int, detail: str, code: str):
|
|
79
|
+
super().__init__(status_code=status_code, detail=detail)
|
|
80
|
+
self.code = code
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Security
|
|
84
|
+
|
|
85
|
+
- **OAuth2 with JWT** — use `python-jose`
|
|
86
|
+
- **Password hashing** — bcrypt via `passlib`
|
|
87
|
+
- **CORS** — configure explicitly
|
|
88
|
+
- **Rate limiting** — use `slowapi`
|
|
89
|
+
- **Input validation** — Pydantic handles this automatically
|
|
90
|
+
|
|
91
|
+
## Testing
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import pytest
|
|
95
|
+
from httpx import AsyncClient
|
|
96
|
+
|
|
97
|
+
@pytest.mark.asyncio
|
|
98
|
+
async def test_create_user(client: AsyncClient):
|
|
99
|
+
response = await client.post("/api/v1/users", json={
|
|
100
|
+
"email": "test@example.com",
|
|
101
|
+
"name": "Test User"
|
|
102
|
+
})
|
|
103
|
+
assert response.status_code == 201
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Anti-Patterns
|
|
107
|
+
|
|
108
|
+
- [FAIL] Business logic in route handlers — use services
|
|
109
|
+
- [FAIL] Raw SQL without ORM — use SQLAlchemy
|
|
110
|
+
- [FAIL] Sync database calls — use async drivers
|
|
111
|
+
- [FAIL] Hardcoded settings — use Pydantic BaseSettings
|
|
112
|
+
- [FAIL] No schema validation — always use Pydantic models
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gemini-precision
|
|
3
|
+
description: >
|
|
4
|
+
High-precision engineering and execution guardrails optimized for Google Gemini models.
|
|
5
|
+
Enforces zero-assumption file inspection, complete non-lazy implementations, surgical
|
|
6
|
+
blast-radius containment, and mandatory proof-of-work execution.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# gemini-precision
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
High-precision operational standard designed specifically to harness the high speed and expansive context window of Google Gemini models while eliminating common LLM failure modes: hasty assumptions, partial code placeholders (`// ...`), unverified assertions, and scope creep.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
Activate whenever:
|
|
18
|
+
|
|
19
|
+
- Executing non-trivial code modifications, refactoring, bug fixes, or architecture design.
|
|
20
|
+
- The user requires maximum rigor, reliability, and precision from Gemini.
|
|
21
|
+
- Handling complex multi-file changes where accidental side-effects must be zero.
|
|
22
|
+
|
|
23
|
+
## Rules & Patterns
|
|
24
|
+
|
|
25
|
+
### 1. The Read-Before-Write Invariant (Zero Assumptions)
|
|
26
|
+
|
|
27
|
+
**Never write code based on assumptions about the codebase.**
|
|
28
|
+
|
|
29
|
+
- Before modifying a function or creating an integration, **always inspect the actual files** using `view_file` or `grep_search`.
|
|
30
|
+
- Check the exact runtime, framework version, and installed dependencies (e.g. React 19 vs 18, Next.js 15 vs 14, Tailwind v4 vs v3, Zod vs Joi) in `package.json` or config files before generating code.
|
|
31
|
+
- Verify imported symbol names and parameter signatures directly from source files.
|
|
32
|
+
|
|
33
|
+
### 2. The Zero-Placeholder Invariant (Complete Code Only)
|
|
34
|
+
|
|
35
|
+
**Never produce lazy, incomplete, or stubbed output.**
|
|
36
|
+
|
|
37
|
+
- ❌ **Forbidden**:
|
|
38
|
+
- `// TODO: implement logic here`
|
|
39
|
+
- `// ... rest of existing code ...`
|
|
40
|
+
- `// ... existing imports ...`
|
|
41
|
+
- Mock stub returns when real integration is required
|
|
42
|
+
- ✅ **Mandatory**:
|
|
43
|
+
- Provide **100% complete, fully-implemented, compilable, and drop-in ready** code.
|
|
44
|
+
- When replacing a block of code, include all necessary imports, type definitions, and edge-case handling.
|
|
45
|
+
|
|
46
|
+
### 3. The Proof-of-Work Invariant (Verification Before Completion)
|
|
47
|
+
|
|
48
|
+
**Never claim a task is complete without tool-verified evidence.**
|
|
49
|
+
|
|
50
|
+
- When modifying code or configuration:
|
|
51
|
+
1. Run the project validator or compiler (`node .agents/ctx.js validate`, `tsc --noEmit`, etc.).
|
|
52
|
+
2. Run unit and integration tests (`npm test`, `pytest`, etc.).
|
|
53
|
+
3. Run linter and formatting checks (`npm run lint:md`, `eslint`, etc.).
|
|
54
|
+
- If a test or validation fails, do not guess: read the exact error trace, fix the root cause, and re-run until green.
|
|
55
|
+
|
|
56
|
+
### 4. Surgical Blast Radius Containment
|
|
57
|
+
|
|
58
|
+
**Modify ONLY what is strictly necessary.**
|
|
59
|
+
|
|
60
|
+
- Keep edits isolated to the exact lines, functions, and files specified in the plan.
|
|
61
|
+
- Do not reformat, reorder, or alter indentation of unrelated code blocks.
|
|
62
|
+
- Preserve existing comments, docstrings, and project conventions unless explicitly asked to change them.
|
|
63
|
+
|
|
64
|
+
### 5. Ponytail Minimalism (YAGNI)
|
|
65
|
+
|
|
66
|
+
- Prioritize native platform APIs (standard library, browser built-ins) over new npm/pip packages.
|
|
67
|
+
- Follow the "Rule of Three": inline on first use, duplicate cleanly on second, abstract only on third.
|
|
68
|
+
- Keep solutions obvious to a mid-level developer without requiring multi-layered wrapper classes.
|
|
69
|
+
|
|
70
|
+
### 6. Targeted Tool-Specific Modifications
|
|
71
|
+
|
|
72
|
+
**Prevent accidental code loss during file updates.**
|
|
73
|
+
|
|
74
|
+
- For existing files requiring localized updates (< 50% change), always prefer surgical targeted replacement chunks over destructive full-file rewrites.
|
|
75
|
+
- Never discard unrelated file sections, existing comments, or helper utilities.
|
|
76
|
+
|
|
77
|
+
### 7. Persistent Context & Plan Tracking
|
|
78
|
+
|
|
79
|
+
**Prevent context drift during multi-step tasks.**
|
|
80
|
+
|
|
81
|
+
- When an operation requires more than 3 sequential steps, write and maintain a persistent plan or checklist on disk.
|
|
82
|
+
- Never rely exclusively on volatile conversational memory for tracking complex multi-file refactorings.
|
|
83
|
+
|
|
84
|
+
### 8. Progressive Step Narration (Transparent Pair Programming)
|
|
85
|
+
|
|
86
|
+
**Eliminate the "black box" by narrating technical decisions.**
|
|
87
|
+
|
|
88
|
+
- Avoid executing long, silent chains of tool calls without user visibility.
|
|
89
|
+
- Provide a concise 1–2 sentence transparent status update before key operations:
|
|
90
|
+
- State what was inspected or verified from the code.
|
|
91
|
+
- State the architectural decision made and the immediate next action.
|
|
92
|
+
- Keep narration crisp and actionable without excessive verbosity.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Code Examples
|
|
97
|
+
|
|
98
|
+
### Bad (Lazy Model Output) vs Good (Precision Model Output)
|
|
99
|
+
|
|
100
|
+
**❌ Bad (Lazy AI Output)**:
|
|
101
|
+
|
|
102
|
+
```javascript
|
|
103
|
+
// user.service.js
|
|
104
|
+
export async function updateUser(id, data) {
|
|
105
|
+
// ... existing auth check ...
|
|
106
|
+
// TODO: validate data with zod
|
|
107
|
+
return await db.user.update({ where: { id }, data });
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**✅ Good (Gemini Precision Output)**:
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
// user.service.js
|
|
115
|
+
import { z } from 'zod';
|
|
116
|
+
import { db } from '../lib/db.js';
|
|
117
|
+
import { ValidationError, UnauthorizedError } from '../errors/index.js';
|
|
118
|
+
|
|
119
|
+
const UpdateUserSchema = z.object({
|
|
120
|
+
name: z.string().min(1).max(100).optional(),
|
|
121
|
+
email: z.string().email().optional(),
|
|
122
|
+
}).strict();
|
|
123
|
+
|
|
124
|
+
export async function updateUser(id, data, session) {
|
|
125
|
+
if (!session?.userId || session.userId !== id) {
|
|
126
|
+
throw new UnauthorizedError('Access denied: cannot update another user');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const parsed = UpdateUserSchema.safeParse(data);
|
|
130
|
+
if (!parsed.success) {
|
|
131
|
+
throw new ValidationError('Invalid update payload', parsed.error.format());
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return await db.user.update({
|
|
135
|
+
where: { id },
|
|
136
|
+
data: parsed.data,
|
|
137
|
+
select: { id: true, name: true, email: true, updatedAt: true }
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Validation Checklist
|
|
145
|
+
|
|
146
|
+
- [ ] Inspected active codebase files before writing code.
|
|
147
|
+
- [ ] Delivered 100% complete code with zero `// TODO` or `// ...` placeholders.
|
|
148
|
+
- [ ] Ran automated tests and validation with green status.
|
|
149
|
+
- [ ] Confined changes to the minimal required blast radius.
|
|
150
|
+
- [ ] Preserved existing code via targeted edits rather than full-file overwrites.
|
|
151
|
+
- [ ] Persisted multi-step task state and milestones to disk.
|
|
152
|
+
- [ ] Narrated progress with concise, transparent step-by-step updates.
|
|
153
|
+
- [ ] Reported final status with verifiable evidence.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Common Mistakes
|
|
158
|
+
|
|
159
|
+
- **Assuming API contracts**: Guessing function parameters without opening the file.
|
|
160
|
+
- **Premature completion**: Declaring "fixed" without running the test suite.
|
|
161
|
+
- **Uncontrolled refactoring**: Rewriting adjacent components while fixing a 1-line bug.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Integration Notes
|
|
166
|
+
|
|
167
|
+
- Pairs with `engineering-workflow` to enforce the 6-phase pipeline.
|
|
168
|
+
- Enforces the 7-rung ladder of `ponytail-mindset`.
|
|
169
|
+
- Acts as the baseline behavioral guardrail across all Gemini and Antigravity operations.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
name: gemini-precision
|
|
2
|
+
description: High-precision engineering and execution guardrails optimized for Google Gemini models. Enforces zero-assumption file inspection, complete non-lazy implementations, surgical blast-radius containment, and mandatory proof-of-work execution.
|
|
3
|
+
tags:
|
|
4
|
+
- gemini
|
|
5
|
+
- precision
|
|
6
|
+
- quality
|
|
7
|
+
- workflow
|
|
8
|
+
- antigravity
|
|
9
|
+
version: 1.0.0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# generators Examples — Anti-patterns vs ContextOS Standard
|
|
2
|
+
|
|
3
|
+
## Example 1: Technical Documentation Generation
|
|
4
|
+
|
|
5
|
+
### Anti-pattern: Scaffolding from Scratch Without Templates
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
Agent drafts a 2-paragraph "architecture overview" missing databases, security, and hosting models.
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Best practice: ContextOS Standard (ctx init Template Generation)
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
Generates complete engineering suite:
|
|
15
|
+
- PRD.md (User personas, in-scope, out-of-scope, acceptance criteria)
|
|
16
|
+
- ARCHITECTURE.md (C4 model, data flow, scaling boundaries)
|
|
17
|
+
- DATABASE.md (ERD, indexing strategy, migration plans)
|
|
18
|
+
- API.md (OpenAPI 3.1 endpoints, error codes, authentication)
|
|
19
|
+
```
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: document-generator
|
|
3
|
+
description: >
|
|
4
|
+
Generates project documentation from a single idea. Creates PRD, Architecture,
|
|
5
|
+
Database, API, UI, Roadmap, Tasks, Decision Records, and Project Graph
|
|
6
|
+
using templates. Supports incremental updates.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# document-generator
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Automated technical documentation generator. Transforms initial project ideas and specs into comprehensive PRDs, architecture schemas, API contracts, database ERDs, and roadmap task breakdowns.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
Activate during project kickoff (ctx init), new service scaffolding, or when generating baseline technical specs from high-level user requirements.
|
|
18
|
+
|
|
19
|
+
## Rules & Patterns
|
|
20
|
+
|
|
21
|
+
You generate project documentation from a user's idea. Use the templates in `templates/` as the structure for each document.
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
### `ctx init`
|
|
26
|
+
|
|
27
|
+
Full project initialization. From one user prompt, generate ALL documents:
|
|
28
|
+
|
|
29
|
+
1. Ask clarifying questions (see Context OS SKILL.md)
|
|
30
|
+
2. Select profile and skill pack
|
|
31
|
+
3. Generate documents in this order:
|
|
32
|
+
- `docs/PRD.md` — Product Requirements (from template)
|
|
33
|
+
- `docs/ARCHITECTURE.md` — System Architecture
|
|
34
|
+
- `docs/DATABASE.md` — Database Schema
|
|
35
|
+
- `docs/API.md` — API Specification
|
|
36
|
+
- `docs/UI.md` — UI/UX Specification
|
|
37
|
+
- `docs/ROADMAP.md` — Development Roadmap
|
|
38
|
+
- `docs/TASKS.md` — Task Breakdown
|
|
39
|
+
- `docs/PROJECT_GRAPH.md` — Project Graph
|
|
40
|
+
4. Create `docs/decisions/` directory for future ADRs
|
|
41
|
+
5. Generate agent config via Adapters skill
|
|
42
|
+
|
|
43
|
+
### `ctx update`
|
|
44
|
+
|
|
45
|
+
Incremental update. When requirements change:
|
|
46
|
+
|
|
47
|
+
1. Identify which documents are affected
|
|
48
|
+
2. Update only affected documents
|
|
49
|
+
3. Show diff of changes
|
|
50
|
+
4. Ask user to confirm
|
|
51
|
+
5. Update Project Graph if structure changed
|
|
52
|
+
|
|
53
|
+
### `ctx plan`
|
|
54
|
+
|
|
55
|
+
Generate development plan from existing PRD:
|
|
56
|
+
|
|
57
|
+
1. Read `docs/PRD.md`
|
|
58
|
+
2. Break into modules (Project Graph)
|
|
59
|
+
3. Break modules into features
|
|
60
|
+
4. Break features into tasks
|
|
61
|
+
5. Estimate complexity (S/M/L/XL)
|
|
62
|
+
6. Output to `docs/TASKS.md`
|
|
63
|
+
|
|
64
|
+
## Template Usage
|
|
65
|
+
|
|
66
|
+
Each template contains:
|
|
67
|
+
|
|
68
|
+
- **Section headers** — required sections for the document
|
|
69
|
+
- **Placeholder prompts** — `{{description}}` markers that guide content generation
|
|
70
|
+
- **Examples** — sample content to illustrate the expected format
|
|
71
|
+
- **Validation rules** — what must be present for the document to be valid
|
|
72
|
+
|
|
73
|
+
When generating a document:
|
|
74
|
+
|
|
75
|
+
1. Read the template
|
|
76
|
+
2. Fill in each section based on the user's idea and clarifying answers
|
|
77
|
+
3. Replace all `{{placeholders}}` with real content
|
|
78
|
+
4. Remove the template comments (lines starting with `<!-- -->`)
|
|
79
|
+
5. Validate: ensure all required sections are present
|
|
80
|
+
|
|
81
|
+
## Document Dependencies
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
PRD.md
|
|
85
|
+
├── ARCHITECTURE.md
|
|
86
|
+
│ ├── DATABASE.md
|
|
87
|
+
│ ├── API.md
|
|
88
|
+
│ └── DEPLOYMENT.md
|
|
89
|
+
├── UI.md
|
|
90
|
+
├── ROADMAP.md
|
|
91
|
+
│ └── TASKS.md
|
|
92
|
+
└── PROJECT_GRAPH.md
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
When updating a parent document, check if child documents need updates too.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## Code Examples
|
|
99
|
+
|
|
100
|
+
See `EXAMPLES.md` for detailed code examples.
|
|
101
|
+
|
|
102
|
+
## Validation Checklist
|
|
103
|
+
|
|
104
|
+
What to verify during the review phase before completing the task.
|
|
105
|
+
|
|
106
|
+
## Common Mistakes
|
|
107
|
+
|
|
108
|
+
Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
|
|
109
|
+
|
|
110
|
+
## Integration Notes
|
|
111
|
+
|
|
112
|
+
How this skill interacts with other skills.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# generators Troubleshooting & Common Mistakes
|
|
2
|
+
|
|
3
|
+
## 1. Generic Boilerplate Generation
|
|
4
|
+
|
|
5
|
+
- **Symptom**: Generated documentation contains placeholders like [Insert DB Name here].
|
|
6
|
+
- **Root Cause**: Generating docs before clarifying core project constraints.
|
|
7
|
+
- **Fix**: Run the interview-me protocol before generating technical documentation.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
name: generators
|
|
2
|
+
description: >
|
|
3
|
+
Generates complete project documentation (PRD, Architecture, Database, API, UI,
|
|
4
|
+
Roadmap, Tasks) from ideas and templates with incremental update support.
|
|
5
|
+
tags:
|
|
6
|
+
- documentation
|
|
7
|
+
- generators
|
|
8
|
+
- architecture
|
|
9
|
+
- templates
|
|
10
|
+
version: 1.0.0
|