LearnCen Docs
Guides 2 min read

17. Complete OpenCode Project

Project: Task Management API

Build a production-style learning project using OpenCode.

Technology

  • Python
  • FastAPI
  • PostgreSQL
  • Pytest
  • Git
  • OpenCode

17.1 Project structure

Start with:

task-api/
|
+-- AGENTS.md
|
+-- .opencode/
|   |
|   +-- agents/
|   |   +-- architect.md
|   |   +-- tester.md
|   |   +-- reviewer.md
|   |   +-- security.md
|   |   +-- documentation.md
|   |
|   +-- skills/
|       +-- api-testing/
|           +-- SKILL.md
|
+-- app/
+-- tests/
+-- README.md

17.2 AGENTS.md

# Task API Instructions

## Technology

Python, FastAPI, PostgreSQL, Pytest.

## Coding

- Use type hints.
- Keep functions focused.
- Reuse existing utilities.
- Avoid unrelated refactors.

## Testing

Run pytest after application changes.

## Security

Never hardcode secrets.

Validate external input.

## Git

Do not push automatically.

17.3 Architecture task

Ask the architect:

Design the architecture for the Task Management API.

Requirements:
- Users
- Authentication
- Tasks
- CRUD
- Authorization
- Tests

Do not modify files.

Return a detailed implementation plan.

17.4 Implementation task

After reviewing the plan:

Implement the approved plan.

Work incrementally.

After each major component:
1. Run relevant tests.
2. Inspect failures.
3. Fix confirmed issues.
4. Continue.

Follow AGENTS.md.

17.5 Testing

Ask:

Review the application testing strategy.

Ensure coverage for:
- User registration
- Login
- Authentication failure
- Authorization
- Task CRUD
- Invalid input
- Missing resources
- Edge cases

17.6 Security

Ask:

Perform a security review.

Check:
- Password storage
- Authentication
- Authorization
- Token handling
- Secrets
- Input validation
- Injection risks
- Error disclosure

17.7 Review

Ask:

Review all current changes.

Do not modify files.

Report:
- Critical findings
- High findings
- Medium findings
- Low findings
- Missing tests
- Maintainability concerns

17.8 Documentation

Ask:

Update README.md.

Document:
- Setup
- Environment variables
- Database
- Running the API
- Running tests
- Authentication
- Endpoints
- Example requests

17.9 Final verification

Run:

pytest

Then inspect:

git status
git diff

Do not push until a human reviews the changes.


Final deliverables

The project should contain:

AGENTS.md
.opencode/agents/
.opencode/skills/
app/
tests/
README.md

and a passing test suite appropriate to the implementation.