{"slug": "rules-for-ai-agents", "title": "rules for ai agents", "summary": "A developer published a set of mandatory coding guidelines for AI agent development, emphasizing branch management, code quality principles, and syntax verification. The rules require contributors to avoid direct commits to main, use descriptive branch names, and run 'node --check' before submitting pull requests.", "body_md": "This document contains mandatory guidelines to keep our codebase clean, maintainable, and error-free. Every contributor is required to adhere to these rules before and during the development process.\n\nBefore you write your first line of code, you **must** complete the following two steps:\n\nNever commit code directly to the main branch (`main`\n\n/`master`\n\n).\n\n**Branch Format:**`change-type/feature-name`\n\n**Examples:**`feature/add-login`\n\n(for new features)`bugfix/fix-broken-api`\n\n(for bug fixes)`refactor/clean-calc-function`\n\n(for code quality improvements)\n\nAsk yourself (or discuss with the team) before you start typing code:\n\n**Do I fully understand the problem or feature that needs to be worked on?****What is the best data structure and logical flow for this implementation?****Does this change have the potential to break existing functionalities (breaking changes)?****How will I test this code to ensure it actually works and is secure?**\n\nApply the following professional programming principles to ensure your code remains highly readable for other engineers:\n\n**DRY Principle (Don't Repeat Yourself):** Do not write duplicate code. Extract repetitive logic into reusable functions or components.**KISS Principle (Keep It Simple, Stupid):** Write straightforward logic that goes directly to the point. Avoid over-engineering or making code unnecessarily complex.**Meaningful Names:** Use variable and function names that clearly describe their purpose (e.g.,`isUserLoggedIn`\n\nis better than`status`\n\n). Consistently use English for all naming conventions.**Single Responsibility:** A single function or module should do only one thing well. If a function grows too long, split it into smaller sub-functions.**Remove Dead Code:** Do not leave commented-out code or unused variables in the repository.\n\nTo ensure your code is free of critical errors before submitting a Pull Request, perform this mandatory verification:\n\nUse the native Node.js command to check the validity of your code's syntax without running it:\n\n```\nnode --check filename.js\n```\n\nNote:Ensure the command above yields no errors or warnings before pushing your changes to the remote repository.\n\n`git checkout main && git pull origin main`\n\n(Ensure your local code is up to date).`git checkout -b feature/new-feature-name`\n\n(Create a new branch).- Think through and answer the\n**4 Crucial Questions** listed above. - Write your code adhering to professional cleanliness standards.\n- Run\n`node --check <file>`\n\nfor syntax verification. `git add . && git commit -m \"feat: clear description of changes\"`\n\n.`git push origin feature/new-feature-name`\n\nand open a Pull Request.", "url": "https://wpnews.pro/news/rules-for-ai-agents", "canonical_source": "https://gist.github.com/Kazuya-Labs/74ba7971b10fd52eb94332f7a6ec05ab", "published_at": "2026-08-29 03:12:50+00:00", "updated_at": "2026-08-29 03:17:52.166871+00:00", "lang": "en", "topics": ["developer-tools"], "entities": [], "alternates": {"html": "https://wpnews.pro/news/rules-for-ai-agents", "markdown": "https://wpnews.pro/news/rules-for-ai-agents.md", "text": "https://wpnews.pro/news/rules-for-ai-agents.txt", "jsonld": "https://wpnews.pro/news/rules-for-ai-agents.jsonld"}}