Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)
Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
5.7 KiB
5.7 KiB
AGENTS.md
Coding rules
- Read
SPEC.mdfirst and treat it as source of truth ("the spec"). IfSPEC.mddoes not exist, stop and ask. - Follow the user prompt exactly; do not omit explicitly requested steps.
- Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused:
- Scope: Don't add features, refactor code, or make "improvements" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability.
- Documentation: Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.
- Defensive coding: Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs).
- Abstractions: Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task.
- Custom coding: Don't reinvent the wheel, use the functions the framework provides you with. If you think that using framework is not possible, consult the relevant online or MCP docs to make sure. If you still cannot find a solution within the framework, stop and ask.
- Do not hard-code values or create solutions that only work for specific test inputs; implement the actual logic that solves the problem generally.
- The resulting code must be robust, maintainable, and extendable.
- The resulting code must not contradict the spec.
- Before writing code, post a short and concise "Plan + spec mapping" summary and ask for approval to proceed. Do not implement until you receive the go-ahead.
- Documentation Rules:
- filenames are always capitalized.
- describes the current state only. Do not include change/history phrasing.
- must always be coherent end-to-end never have stale or conflicting info.
- Always use repo virtual environment (unless there is none).
Testing policy
- Property-based tests (hypothesis) for all domain logic — required.
- Property test files use
_propertiessuffix:test_<module>_properties.py - Run full suite:
pytest - Run specific:
pytest tests/test_<module>.py - Type check:
mypy src/ - Lint:
ruff check .
Base branch rule
BASE_BRANCH = the branch that new work branches are created from and PRs target.
Default:
- If the user did not explicitly specify a base/target branch, set:
BASE_BRANCH=$(git branch --show-current)(from the user's main checkout at session start)
Override:
- If the user explicitly specifies a base/target branch in the prompt, use that as
BASE_BRANCH.
Remote base ref:
- If
origin/$BASE_BRANCHexists, use that asBASE_REF, else use$BASE_BRANCH:git show-ref --verify --quiet "refs/remotes/origin/$BASE_BRANCH" && BASE_REF="origin/$BASE_BRANCH" || BASE_REF="$BASE_BRANCH"
Before work
- Determine base branch (unless user specified it explicitly):
BASE_BRANCH=$(git branch --show-current)
- Fetch latest refs:
git fetch origin --prune
- Update base branch (fast-forward only) if it has an
origin/tracking ref:
git switch "$BASE_BRANCH"if git show-ref --verify --quiet "refs/remotes/origin/$BASE_BRANCH"; then git pull --ff-only origin "$BASE_BRANCH"; fi- If the pull fails for any reason, stop and ask.
- Read
SPEC.md+README.mdonce per session. Re-read only if changed/unsure:
git log -1 --oneline -- SPEC.md README.md
- If deviating from
SPEC.md: stop and ask. - Create a new local work branch (once per session) from BASE_BRANCH. ALWAYS push to the branch you created.
git switch -c "agent/<topic>-YYYYMMDD-<shortid>"
Tests
- Run tests if the prompt requests or
SPEC.mdrequires them; run all requested tests. - If any cannot be run: stop and ask.
After work
- Make sure you did not miss requested tests.
- If you are addressing a remote github issue with
- "to-do" checklist: for each item, make sure your implementation is fully complete and:
- if yes, check it off
- if not, finish implementation and recheck.
- "acceptance" checklist: for each item, make the acceptance criterion is completely fulfilled and:
- if yes, check it off
- if not, implement missing code and recheck.
- Update all relevant documentation appropriately.
- Before making a commit: Stop and ask user to
/review→Review uncommited changes. - Commit only after user confirms code review passed.
- Open a PR or use already opened PR
- use your created branch.
- Target
BASE_BRANCH. - PR text requirements:
- commands in backticks
- real newlines (ANSI-C quoting/heredoc)
- if addressing a remote github issue, reference it so that github can close automatically after merging.
- Only after PR is merged:
- switch back to base branch and sync it
git switch "$BASE_BRANCH"git fetch origin --pruneif git show-ref --verify --quiet "refs/remotes/origin/$BASE_BRANCH"; then git reset --hard "origin/$BASE_BRANCH"; fi- If the reset fails, stop and ask.
- delete the local merged work branch
Required completion checklist (final response)
- Base/target branch used correctly (BASE_BRANCH)
- all Coding rules followed
- All requested tests run (commands + results), or blocked → asked
- Documentation updated appropriately: list updated files
- PR opened (summary + command log) targeting BASE_BRANCH
- After merge (if applicable): base branch synced; merged branch deleted