Thanks for contributing! This guide covers how to set up your environment, make changes, and submit them.
git clone https://github.com/Anantys-oss/koan.git
cd koan
make setup # Create venv, install dependenciesCopy and customize the instance template:
cp -r instance.example instance
# Edit instance/config.yaml, instance/soul.md, and .env as needed# Full test suite (KOAN_ROOT must be set)
KOAN_ROOT=/tmp/test-koan make test
# Single test file
KOAN_ROOT=/tmp/test-koan .venv/bin/pytest koan/tests/test_missions.py -v
# With coverage report
KOAN_ROOT=/tmp/test-koan make coverageAll tests must pass before submitting. CI runs against multiple Python versions — if it doesn't run on 3.11, it doesn't ship.
make lint # Runs ruff (PERF rules enforced; E/F/W/I/B are good hygiene)Fix all lint errors before committing. Do not disable rules with # noqa unless there is a clear, documented reason.
See CLAUDE.md for the full conventions. Key points:
- Python 3.11+ only — no syntax or stdlib introduced after 3.11.
- No inline prompts — LLM prompts go in
.mdfiles, loaded viaload_prompt()orload_skill_prompt(). Reusable fragments belong inkoan/system-prompts/_partials/. - Branch isolation — Kōan creates
koan/*branches, never commits tomain. - Public artifacts stay generic — no private operator identifiers in source code, comments, docstrings, tests, docs, or commit messages. Use placeholders:
my_toolkit,my_team,my_fix,@koan-bot,PROJ-NNN. - No hyphens in skill names — Telegram treats hyphens as word boundaries. Use underscores:
dead_code, notdead-code. - Config via files, not env vars — new features should use
config.yaml/projects.yamlfor configuration. Env vars are for secrets and deployment-specific settings.
Every core skill needs ALL of these. See the full checklist in CLAUDE.md "Adding a new core skill" section.
- Create
koan/skills/core/<skill_name>/SKILL.mdwith frontmatter includingname,description,group,commands, andaudience. - Register in
skill_dispatch.pyif it runs via the agent loop. - Add to
docs/users/skills.mdin the appropriate category table. - Add to
docs/users/user-manual.mdin the appropriate tier section and quick-reference table. - Run tests —
TestCoreSkillGroupEnforcementenforces thegroup:field.
See koan/skills/README.md for the full SKILL.md format and handler conventions.
Before implementing, inspect relevant docs with search tools. After changing user behavior, configuration, daemon flow, provider behavior, shared state, or safety boundaries, update the relevant docs in the same branch.
| Change type | Docs to update |
|---|---|
| User command / skill | docs/users/user-manual.md + docs/users/skills.md |
| Architecture / daemon | docs/architecture/ |
| Provider behavior | docs/providers/ |
| Messaging / tracker integration | docs/messaging/ |
| Config / operations | docs/operations/ + instance.example/config.yaml |
| Design decision / philosophy | docs/design/decisions.md |
| Security | docs/security/ |
Prefer updating an existing page over adding a new one unless the topic is a new subsystem.
- Create a feature branch and make your changes.
- Run
make lintandmake test— both must pass. - Update relevant documentation in the same branch.
- Submit a PR against
main. - The PR description should explain what changed and why.
Releases are cut from main when it's healthy and something worth shipping has landed. See docs/operations/maint.md for the full procedure (make release).