Thank you for your interest in contributing to OA CLI! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
The Open Agent Spec (OA) uses YAML files to define agent configurations. Use the canonical field open_agent_spec for the spec version (see README for the full schema). Here's how to create your own:
open_agent_spec: "1.5.0"
agent:
name: my-agent
description: A fantastic agent that changes the world
role: chat
intelligence:
type: llm
engine: openai
endpoint: https://api.openai.com/v1
model: gpt-4
config:
temperature: 0.7
max_tokens: 1000-
open_agent_spec: Version of the OA specification (string, e.g."1.0.9"). -
agentsection:name: A unique identifier for your agent (kebab-case; will be converted to snake_case for Python)description: A clear description of what your agent doesrole: Optional free-form string; well-known values: analyst, reviewer, chat, retriever, planner, executor, commander, coordinator
-
intelligencesection:engine: LLM provider (e.g. openai, anthropic, grok, cortex, codex, local, custom)endpoint: The API endpoint for your LLM providermodel: The specific model to use (e.g. "gpt-4", "gpt-3.5-turbo")config: Model-specific configurationtemperature: Controls randomness (0.0 to 1.0)max_tokens: Maximum length of the response
- Trading Agent:
open_agent_spec: "1.5.0"
agent:
name: market-analyzer
description: An agent that analyzes market signals and provides trading recommendations
role: analyst
intelligence:
type: llm
engine: openai
endpoint: https://api.openai.com/v1
model: gpt-4
config:
temperature: 0.3 # Lower temperature for more consistent outputs
max_tokens: 2000 # Longer responses for detailed analysis- Content Generator:
open_agent_spec: "1.5.0"
agent:
name: content-creator
description: An agent that generates creative content based on prompts
role: chat
intelligence:
type: llm
engine: openai
endpoint: https://api.openai.com/v1
model: gpt-4
config:
temperature: 0.8 # Higher temperature for more creative outputs
max_tokens: 1000-
Naming:
- Use kebab-case for the agent name (e.g.,
market-analyzer) - Make names descriptive and unique
- Avoid special characters
- Use kebab-case for the agent name (e.g.,
-
Description:
- Be clear and concise
- Include the agent's primary purpose
- Mention any key capabilities
-
Configuration:
- Adjust temperature based on task:
- Lower (0.1-0.3) for analytical tasks
- Higher (0.7-0.9) for creative tasks
- Set max_tokens based on expected response length
- Use appropriate model for your use case
- Adjust temperature based on task:
-
Validation:
- Test your spec file with
oa init --dry-run - Ensure all required fields are present
- Check that values are of correct types
- Test your spec file with
Add a new YAML spec under oas_cli/templates/ (e.g. my-template.yaml). For scaffolding, reference it explicitly with oa init --spec path/to/your.yaml --output .... Overriding the templates directory (e.g. via an env var) is not currently supported. Document the template in the README “Built-in Templates” section.
To add a new .agents/ example to the repository:
- Create a YAML spec in
.agents/following the standard spec structure (see examples in that directory). - Make sure
open_agent_spec,agent,intelligence(includingtype: llm),tasks, andpromptsare all present and valid. - Validate with
oa init --spec .agents/your-agent.yaml --output /tmp/test --dry-run. - Document the agent in the table in docs/REFERENCE.md under “Agents as code”.
See the existing .agents/ci-failure-repair.yaml for a production-quality example that is wired into a GitHub Actions workflow.
The formal specification at spec/open-agent-spec-1.4.md defines what a conforming OA runtime MUST do. The conformance test suite at spec/conformance/cases/ operationalises those requirements — each test case validates a specific normative MUST/MUST NOT from the spec.
To add a conformance test:
- Identify the normative requirement (section number + MUST/MUST NOT keyword).
- Create a YAML case file under
spec/conformance/cases/<category>/. - The embedded spec MUST be self-contained and minimal — include only what the test needs.
- Mock responses MUST be provided — conformance tests MUST NOT make real API calls.
- Run the suite:
python -m spec.conformance.harness.harness --adapter python --adapter node
See spec/conformance/README.md for the full test case format and category structure.
Key distinction: Conformance tests validate runtime behaviour against the spec, not implementation details. They should pass for any conforming OA runtime, not just the reference Python implementation.
- Check if the bug has already been reported in the Issues section
- Use the bug report template
- Include detailed steps to reproduce
- Include expected and actual behavior
- Add screenshots if applicable
- Check if the feature has already been suggested
- Use the feature request template
- Explain the problem you're trying to solve
- Describe your proposed solution
- Include any relevant examples
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests:
pytest tests/(see Testing below) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone the repository
git clone https://github.com/prime-vector/open-agent-spec.git
cd open-agent-spec
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"- Follow PEP 8 guidelines
- Use type hints
- Write docstrings for all functions and classes
- Keep functions small and focused
- Write meaningful commit messages
- Run all tests:
pytest tests/ - Run conformance suite:
python -m spec.conformance.harness.harness --adapter python - Write tests for new features; ensure all tests pass; maintain or improve test coverage.
- Pytest marks: If you add a new test category, register the mark in
pytest.ini(and optionally inpyproject.tomlunder[tool.pytest.ini_options]markers) sopytest -m <mark>works without "Unknown pytest.mark" warnings. Existing marks:contract,cortex,multi_engine,generator,integration,slow. - Spec version field: Use
open_agent_spec(notspec_version) in YAML specs; this is the canonical field name used by the schema and code.
- Update README.md if needed
- Add docstrings to new functions
- Update any relevant documentation
- Keep comments clear and helpful
- Fill in the PR template — What changed, Why, How tested.
- Update README.md and docs/ if your change affects user-facing behavior.
- Make sure CI passes (
pytest tests/,ruff check .,ruff format --check .). - One maintainer sign-off required for merge.
Feel free to open an issue for any questions or concerns. We're here to help!
By contributing, you agree that your contributions will be licensed under the project's MIT License.