- Source code lives in
src/simacode(CLI insrc/simacode/cli.py, API insrc/simacode/api/). - Tests are in
tests/followingtest_*.pyor*_test.pypatterns. - Docs in
docs/; scripts and utilities inscripts/andtools/. - Config: project
.simacode/config.yaml(created bysimacode init); sample env in.env.mcp.sample.
- Install:
poetry install(add--with devfor dev tools). - CLI help:
poetry run simacode --help. - Run chat:
poetry run simacode chat --interactive(add--reactfor ReAct mode). - Run API (dev):
poetry run simacode serve --reload --debug. - Tests:
poetry run pytest -v(coverage enabled via config). - Lint/format:
poetry run black . && poetry run isort . && poetry run flake8 src/simacode. - Types:
poetry run mypy src/simacode.
- Python 3.10+, 4-space indentation, PEP 8/PEP 257.
- Formatting: Black (line length 88) + isort (profile "black").
- Linting: flake8; Typing: mypy (strict settings in
pyproject.toml). - Names: modules/packages
snake_case, functions/varssnake_case, classesCamelCase. - Public APIs must include type hints; prefer small, focused modules under
src/simacode/*.
- Framework: pytest (+ pytest-asyncio). Default discovery uses
tests/withTest*classes andtest_*functions. - Coverage: collected for
simacodewith term, HTML, and XML reports. Aim to cover new/changed code. - Examples:
- File:
tests/test_cli.py - Run specific:
poetry run pytest tests/test_cli.py -q
- File:
- Use Conventional Commits:
feat: ...,fix: ...,docs: ...,chore: ...,refactor: ...,test: .... - Keep commits focused; include rationale when behavior changes.
- Before PR: ensure
poetry run black .,isort .,flake8,mypy, andpytestall pass. Runpoetry run pre-commit run -aif hooks are installed. - PRs should include: clear description, linked issues, test evidence (logs or screenshots), and notes on configuration changes.
- Do not commit secrets. Prefer env vars (
SIMACODE_API_KEY,OPENAI_API_KEY) and project config in.simacode/config.yaml. - When working with MCP, consult
.env.mcp.sampleandREADME.mdMCP sections; avoid proxy issues by settingno_proxyfor localhost.