{"slug": "agents-md-file-for-your-beloved-coding-agents", "title": "agents.md file for your beloved coding agents", "summary": "The article titled \"agents.md file for your beloved coding agents\" provides a comprehensive set of operational instructions for AI coding agents working within a repository. It establishes the file as the project-wide source of truth, mandating rules such as preferring minimal changes, preserving existing conventions, fixing root causes, and running full test suites after each iteration. The instructions also cover logging all user input in an append-only file, using git incrementally without rollbacks, and maintaining a monorepo structure with specific testing and dependency guidelines.", "body_md": "# Project Rules\n\nThese instructions apply to every task performed in this repository.\n\n## Purpose\n- Treat this file as the project-wide source of truth for repository-specific working rules.\n- Read and follow these instructions before making changes in this repo.\n\n## Working Style\n- Prefer minimal, targeted changes over broad refactors.\n- Preserve existing conventions and structure unless explicitly asked to change them.\n- Call out assumptions when repository context is missing.\n- If a request is ambiguous and the risk of a wrong change is material, ask a concise clarifying question before editing.\n\n## Code Changes\n- Fix root causes when practical; avoid cosmetic-only changes unless requested.\n- Do not introduce new dependencies unless they are necessary for the task.\n- Keep files and APIs simple; avoid premature abstraction.\n- Add comments only when they clarify non-obvious logic.\n\n## Verification\n- Run the smallest relevant verification for the change made.\n- If tests or builds cannot be run, state that clearly and explain why.\n- Do not claim success without checking the relevant output.\n- Make sure to run the full test suite and any linters and checks after each iteration.\n- After each UI or style change, generate fresh screenshots that reflect the current state and attach them in the chat so the user gets visual confirmation of the direction.\n\n## Safety\n- Do not overwrite or revert user changes unless explicitly requested.\n- Avoid destructive commands unless the user clearly asked for them.\n- For secrets, use environment variables or the project’s existing secret-management approach.\n\n## Communication\n- Be concise and direct.\n- Summarize what changed, how it was verified, and any remaining risk.\n- Prefer actionable next steps over long explanations.\n\n## Updating These Rules\n- If the user asks to change repository-wide behavior, update this file.\n- New instructions added here should be treated as persistent for future interactions in this repo.\n\n## Logging LLM Use\n- Maintain an append only file that logs all user input that you receive. Make sure there are no secrets in this log file because we will check it in git.\n- The logs should also include a timestamp.\n- One log entry per line.\n- Do not log prompts that does not touch any files in the repo that needs version controlling. An example is, if the prompt asks a question about a concept, we do not log this as it won't change the state of the repository.\n\n## Version Control\n- After each prompt you generate or alter some code, make sure to add them to git.\n- To do that, you do \"git add .\" and git commit with a meaningful and concise message.\n- Never ever check in secrets or personal data.\n- Use git in an append only manner, do only incremental updates and never rollback changes or overwrite previous commits.\n\n## Testing\n- Testing logic must be self contained.\n- Tests must be lightweight most of the time.\n- Tests must only depend on the subject being tested.\n- Tests for each app must live in a sibling `test` directory at the same level as `src`.\n- Test directory hierarchy must mirror the `src` hierarchy.\n- If a source file is `src/foo/bar.ts`, its test should be `test/foo/bar.test.ts`.\n\n## Development\n- Keep separate concerns in separate files.\n- Favor composition over inheritance.\n- Consider using dependency injection and keep dependencies to a minimum.\n- Keep functions small and one purpose.\n- Each module, function or unit of development must have a single responsibility.\n- Each file/module must be responsible for one thing only.\n- Keep diffs to a minimum as much as possible.\n- Maintain a fast feedback loop in our development cycle.\n- Act as autonomous as possible with minimal guidance from user by making use of all the skills available to you.\n- Long-running or batch-style scripts must emit progress logging so the user can see what the script is doing, how many items have been processed, how many remain, and overall progress.\n\n## Technical Decisions\n- Before picking a certain solution like a framework, cloud provider or database etc. you must run it through me and we decide together.\n- Find a good balance of tech-debt tomorrow vs. practicality today.\n\n## Monorepo\n- This is a monorepo project, with multiple subprojects underneath.\n- You must think thorough before deciding which subproject my prompts were meant to be applied. You should deduce from the context provided from my prompts. If you can't decide, you must ask me.\n\n## How You as Coding Agent Act\n\nOperate autonomously. Do not stop to propose obvious next steps.\nIf a next step is sensible and low-risk, implement it.\nMake reasonable assumptions from the existing codebase and continue until you hit a real blocker.\n\nOnly interrupt me if:\n1. The choice is irreversible or high-risk.\n2. You need external credentials, access, or a product decision that cannot be inferred.\n3. You find conflicting requirements in the repo or my prior instructions.\n\nOtherwise:\n- choose the next step yourself\n- make the code changes\n- run relevant tests/checks\n- fix follow-up issues you introduced\n- continue iterating\n\nBatch non-blocking questions at the end under “Open decisions”.\nDo not ask me for permission to do straightforward engineering work.\n\nYou may modify app code, tests, config, migrations, and docs in this repo.\nYou may install/update normal dependencies if needed.\nPrefer the most complete implementation over a partial scaffold.\n", "url": "https://wpnews.pro/news/agents-md-file-for-your-beloved-coding-agents", "canonical_source": "https://gist.github.com/selcukcihan/69efd2ae5dd09162a00718c48b89727c", "published_at": "2026-04-15 09:06:34+00:00", "updated_at": "2026-05-21 21:06:42.065593+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models"], "entities": [], "alternates": {"html": "https://wpnews.pro/news/agents-md-file-for-your-beloved-coding-agents", "markdown": "https://wpnews.pro/news/agents-md-file-for-your-beloved-coding-agents.md", "text": "https://wpnews.pro/news/agents-md-file-for-your-beloved-coding-agents.txt", "jsonld": "https://wpnews.pro/news/agents-md-file-for-your-beloved-coding-agents.jsonld"}}