Contributing
Contributing
Section titled “Contributing”Thank you for your interest in contributing to @maestria/opencode! This guide covers how to set up the development environment, make changes, and submit pull requests.
Development Setup
Section titled “Development Setup”-
Clone the monorepo
Terminal window git clone https://github.com/agustinusnathaniel/maestria.gitcd maestria -
Install dependencies
Terminal window vp install -
Verify the setup
Terminal window vp checkvp run -r testvp run -r build
Project Structure
Section titled “Project Structure”maestria/├── apps/│ └── docs/ # Documentation site (this site)├── packages/│ └── opencode/ # @maestria/opencode plugin│ ├── agents/ # Agent definitions (.md files)│ ├── rules/ # Global rules (AGENTS.md)│ ├── src/ # Plugin source code│ └── tests/ # Plugin tests├── docs/│ ├── adr/ # Architecture Decision Records (internal)│ └── notes/ # Session notes (internal)└── vite.config.ts # Vite+ configurationMaking Changes
Section titled “Making Changes”Adding or Modifying Agents
Section titled “Adding or Modifying Agents”Agent definitions are Markdown files in packages/opencode/agents/. Each file has:
- YAML frontmatter — description, mode, permissions
- Prompt body — The full agent instructions
To add a new agent, create a new .md file in that directory. To modify an existing agent, edit the corresponding file.
Modifying Global Rules
Section titled “Modifying Global Rules”Global rules live in packages/opencode/rules/AGENTS.md. Use the three-way filter documented in the plugin’s ADRs when adding new rules:
- Agent file — if it applies to one agent’s domain
- Global rules — if it’s cross-cutting and not covered elsewhere
- Exclude — if covered by agent directives or OpenCode defaults
Modifying Plugin Code
Section titled “Modifying Plugin Code”The plugin source is packages/opencode/src/index.ts (~190 lines). The main components are:
parseFrontmatter()— Custom YAML frontmatter parserparseAgentFile()— Splits agent files into frontmatter + promptloadAgents()— Reads all.mdfiles from the agents directoryMaestriaPlugin— Plugin factory returning config + session.compacting hooks
Running the Docs Site Locally
Section titled “Running the Docs Site Locally”vp run website#devBuilding and Testing
Section titled “Building and Testing”# Build all packagesvp run -r build
# Run testsvp run -r test
# Format and lintvp checkCreating a Changeset
Section titled “Creating a Changeset”This project uses Changesets for versioning and publishing:
pnpm changesetFollow the prompts to describe your changes. Commit the generated changeset file alongside your changes.
Pull Request Process
Section titled “Pull Request Process”- Fork the repository and create a feature branch
- Make your changes following the existing conventions
- Verify — run
vp checkand ensure tests pass - Create a changeset if your changes affect the published package
- Submit a PR with a clear description of what you changed and why
Need Help?
Section titled “Need Help?”Open an issue on GitHub or reach out to the maintainers.