e08c484838
Six-step weekly workflow (research → sources → storyline → draft → quality → publication) supporting Claude, ChatGPT, Gemini, and Mistral in parallel for creative steps. Web search via Anthropic tool for news research. Episode index built from 34 existing KNIEPUNKT episodes for redundancy checks. Sessions persisted as JSON for mid-workflow resume. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6.7 KiB
6.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).
Documentation MCP policy
- We run ONE docs MCP server:
docs(multi-library).
Library selection
- For any docs query call (everything except
list_libraries), you MUST setlibrary. - If the prompt or repo context involves a specific product/project unambiguously, use that as
library(e.g.library="haystack"). - If more than one library could plausibly match, call
list_librariesand select the best match (do not invent/guess library ids). - If the task spans multiple products, run separate docs calls per library and label results by library.
Version selection
-
If the prompt or repo context involves a version or range (e.g.
2.25,2.x), callfind_version(library=..., targetVersion=...)and record the returnedversion. -
Use that resolved
versionfor all subsequent calls for that library. -
If
find_versioncannot resolve unambiguously, stop and ask. -
If no version is mentioned, omit
version(defaults to latest indexed for that library). -
We also run the
githubMCP server. Consult it always for code that is in public github instead of searching at the disk or cloning the repos locally.
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"
Notes:
- This supports long-lived feature integration branches and stacked PRs.
- The base branch may itself be another PR branch (for stacking); set BASE_BRANCH accordingly.
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 only 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