A comprehensive Python agentic tool for OpenCode with 10 skills, 4 subagents, and production-ready FastAPI patterns.
Note: This package is experimental and works great for local project-based use.
Stop repeating yourself. This agent pack gives OpenCode deep Python expertise:
| What You Get | Benefit |
|---|---|
| 10 specialized skills | Load expertise on-demand (FastAPI, SQLAlchemy, pytest, etc.) |
| 4 subagents | Delegate to specialists for coding, review, testing, exploration |
| Production patterns | Code that scales, not just code that works |
| Zero-config | Install and start coding |
Before: Explain FastAPI patterns, Pydantic schemas, JWT auth, async database every time.
After:
skill(name="python-fastapi")
Create a login endpoint
- 1 Primary Agent -
python-expertwith intelligent skill loading - 4 Specialized Subagents - Code generation, review, testing, and exploration
- 10 On-Demand Skills - FastAPI, SQLAlchemy, pytest, asyncio, and more
- 4 Context Files - Standards, patterns, security, and navigation
- Production Ready - Targets Python 3.13+, FastAPI, Pydantic v2, SQLAlchemy 2.0
# Install globally
npm install -g python-expert-agent
# Install to current project
python-expert-agent init
# Install globally (for all projects, experimental)
python-expert-agent init --globalnpx python-expert-agent initCopy the .opencode directory and AGENTS.md to your project root.
# 1. Install the agent pack
npm install -g python-expert-agent
python-expert-agent init
# 2. Start OpenCode in your Python project
cd /path/to/your/python/project
opencode
# 3. The python-expert agent is automatically detected
# 4. Use skills on-demand
skill(name="python-fastapi")
skill(name="python-backend")skill(name="python-fastapi")
Create a POST /api/users endpoint with:
- Email validation
- Password hashing (bcrypt)
- JWT token generation
skill(name="python-testing-general")
Write tests for src/services/user.py:
- Unit tests for create_user, get_user
- Mock the database
- Test edge cases (empty input, duplicates)
skill(name="python-asyncio")
Fix the memory leak in src/services/websocket.py.
Connections are not being cleaned up properly.
Review src/api/auth.py for:
- SQL injection vulnerabilities
- Hardcoded secrets
- Missing authentication checks
skill(name="python-backend")
Create an async SQLAlchemy model for:
- User entity with relationships
- Alembic migration
- Repository pattern
Project Opens
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β OpenCode reads .opencode/config.json β
β β β
β Loads python-expert agent β
β β β
β Detects .py files in project β
β β β
β Invokes skill(name="python-fundamentals") β
βββββββββββββββββββββββββββββββββββββββββββββββ
User: "Create a FastAPI endpoint with JWT auth"
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β python-expert (Primary Agent) β
β β
β 1. Parse request for keywords: β
β "fastapi" β python-fastapi β
β "jwt" β python-backend β
β β
β 2. Invoke skills: β
β skill(name="python-fastapi") β
β skill(name="python-backend") β
β β
β 3. Determine complexity: β
β "create" + multi-step = Complex β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Complex Task? β
ββββββββββββ¬βββββββββββ
β
ββββββββββββββ΄βββββββββββββ
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
βSimple Query β βComplex Task β
β β β β
βAnswer β βDelegate to β
βdirectly β βsubagent β
ββββββββββββββββ ββββββββββββββββ
Complex Task: "Create user authentication system"
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β python-expert (Primary Agent) β
β β
β Delegates context discovery: β
β task(subagent_type="explore", description="Find auth β
β patterns, existing user models, similar endpoints")β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β python-scout (Explore Subagent) β
β β
β 1. Search codebase for relevant files β
β 2. Read existing patterns and conventions β
β 3. Check .opencode/context/ for standards β
β 4. Return ranked recommendations: β
β - Files to reference β
β - Patterns to follow β
β - Skills to load β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β python-expert (Primary Agent) β
β β
β Receives context from scout, delegates implementation: β
β task(subagent_type="general", description="Create auth β
β system", prompt="Context: [scout findings]...") β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β python-coder (General Subagent) β
β β
β 1. Load skills: python-fastapi, python-backend β
β 2. Read reference files found by scout β
β 3. Follow project patterns from context β
β 4. Create endpoint, schema, service, tests β
β 5. Run verification (mypy, ruff, pytest) β
β 6. Return summary of changes β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Subagent | When Used | What It Does |
|---|---|---|
python-scout |
Before implementation | Discovers context, finds patterns, recommends files |
python-coder |
Implementation tasks | Creates/modifies code following skill patterns |
python-reviewer |
After implementation | Reviews code for quality, security, performance |
python-tester |
Testing tasks | Writes unit/integration tests with mocking |
1. Scout β Discover context and patterns
2. Coder β Implement following patterns
3. Tester β Write tests for new code
4. Reviewer β Review for quality/security (optional)
- Skills are on-demand: Load via
skill(name="...")- no auto-loading - Context first: Complex tasks start with scout for context discovery
- Pattern-driven: All code follows loaded skill patterns
- Verification included: Type checking, linting, tests run automatically
| Agent | Description |
|---|---|
python-expert |
Main agent with skill loading protocol, keyword detection, and task delegation |
| Subagent | Type | Purpose |
|---|---|---|
python-coder |
general | Code generation and feature implementation |
python-reviewer |
general | Code quality and security review |
python-tester |
general | Test writing with pytest patterns |
python-scout |
explore | Context discovery and file finding |
| Skill | Triggers | Best For |
|---|---|---|
python-fundamentals |
*.py, python, dataclass |
Core Python 3.11+ patterns |
python-fundamentals-313 |
3.13, jit, free-threading |
Python 3.13+ specific features |
python-fastapi |
fastapi, pydantic, endpoint |
REST APIs, Pydantic schemas |
python-backend |
sqlalchemy, database, orm |
Async database, migrations |
python-testing-general |
pytest, test, mock |
Unit/integration testing |
python-testing-deep |
hypothesis, property-based |
Advanced testing techniques |
python-asyncio |
async, await, asyncio |
Async/await, concurrency |
python-type-hints |
typing, mypy, pyright |
Type annotations, mypy config |
python-package-management |
uv, pip, pyproject |
Dependencies, virtual envs |
python-tooling |
docker, ci, cd |
Docker, GitHub Actions, profiling |
.opencode/
βββ config.json # Agent selection
βββ opencode.json # Schema reference
βββ agent/
β βββ python-expert.md # Primary agent definition
βββ subagents/
β βββ python-coder.md # Code generation
β βββ python-reviewer.md # Code review
β βββ python-tester.md # Test writing
β βββ python-scout.md # Context discovery
βββ skills/ # 10 Python skills
β βββ python-fundamentals/
β βββ python-fastapi/
β βββ python-backend/
β βββ ...
βββ context/
β βββ navigation.md # Quick reference
β βββ python/
β βββ standards.md # Code quality standards
β βββ patterns.md # Common patterns
β βββ security.md # Security patterns
βββ config/
β βββ agent-metadata.json # Agent registry
βββ docs/ # Documentation
python-expert-agent init [path] # Install to project
python-expert-agent init --global # Install globally (experimental)
python-expert-agent init --force # Overwrite existing files
python-expert-agent --version # Show version
python-expert-agent --help # Show help| Layer | Technology | Version |
|---|---|---|
| Language | Python | 3.13+ |
| Web Framework | FastAPI | 0.115+ |
| Data Validation | Pydantic | 2.7+ |
| ORM | SQLAlchemy | 2.0 (async) |
| Database | PostgreSQL | 16 |
| Testing | pytest | latest |
| Package Manager | UV | latest |
| Linting | ruff, mypy | latest |
Full documentation is available in .opencode/docs/:
| Document | Description |
|---|---|
| Overview | System introduction |
| Architecture | Component relationships |
| Agents | Agent configuration |
| Skills | Skill documentation |
| Subagents | Subagent workflows |
| Workflow | Development patterns |
| Configuration | Customization guide |
| Requirement | Version |
|---|---|
| OpenCode CLI | latest (Currently tested on v1.2.15) |
| Node.js | 18+ (for CLI installer) |
| Python | 3.11+ (for projects using this agent) |
OpenCode is general-purpose. This pack adds:
- Python-specific patterns and best practices
- Framework expertise (FastAPI, SQLAlchemy, pytest)
- Specialized subagents for different task types
- Context files with project standards
Yes. The agent reads your existing code patterns and follows them.
Yes. Edit any .opencode/skills/*/SKILL.md file to add your own patterns.
Python 3.11+ is required. Patterns use 3.13+ features where applicable.
No. Skills must be explicitly invoked with skill(name="..."). This gives you control over context usage.
Yes: python-expert-agent init --global (experimental feature).
Contributions are welcome! Please feel free to submit issues and pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details.
- OpenCode - The open source AI coding agent
- OpenCode Docs - Official documentation
- npm Package - npm registry