Establish trust, transparency, and consistency in AI-assisted development
A comprehensive framework of standardized rules for AI development workflows
- Overview
- Key Features
- Quick Start
- Rule Categories
- Architecture
- Detailed Rule Reference
- Usage Examples
- Integration Guide
- Contributing
- Development Setup
- License
AI Agent Rules is a collection of standardized protocols designed to govern AI agent behavior. This framework ensures:
- Transparency: Every AI action is visible and auditable
- User Control: Users maintain ultimate authority over all operations
- Consistency: Standardized patterns across all development activities
- Security: Principle of least privilege and explicit permission protocols
The repository provides a modular, extensible rule system for AI coding assistants and toolsets.
| Feature | Description |
|---|---|
| 🎯 Modular Architecture | Each rule domain is maintained in a separate markdown file for easy management |
| 📖 Self-Documenting | Rules are written in clear, unambiguous language with examples |
| 🔗 Cross-Referenced | Rules reference each other to form a cohesive framework |
| 🛡️ Security-First | Emphasis on permissions, secrets management, and safe operations |
| 🔄 CI/CD Ready | Rules designed to integrate with GitHub Actions and deployment pipelines |
| 📱 Multi-Platform | Covers Flutter, NestJS, React, Docker, and more |
# Using GitHub CLI (recommended)
gh repo clone Baneeishaque/AI-Agent-Rules
# Using Git
git clone https://github.com/Baneeishaque/AI-Agent-Rules.git- Start with
agent-rules.md- the central index of all rules - Explore specific domain rules based on your needs
- Reference rules in your AI tool configuration or workflow documentation
Reference specific rule files in your AI assistant's context or system prompt:
Follow the guidelines in:
- ai-agent-planning-rules.md for planning protocols
- ai-tools-rules.md for tool execution guidelines
- shell-execution-rules.md for command-line operations| File | Purpose |
|---|---|
android-app-launch-rules.md |
Automated protocol for emulator setup and deployment, optimized for M2 machines, with architecture and device fallbacks. |
| File | Purpose |
|---|---|
strict-dependency-freezing-rules.md |
Industrial protocol for ensuring reproducible builds by pinning exact versions of all external dependencies in package-level configuration. |
| File | Purpose |
|---|---|
zero-backend-sync-rules.md |
Architecture and implementation standards for background, invisible data synchronization using decentralized relays (Nostr), local-first storage (RxDB), and WASM hardening. |
| File | Purpose |
|---|---|
kmp-version-upgrade-rules.md |
A specific technical protocol for upgrading Kotlin, AGP, and related dependencies in a Kotlin Multiplatform project. |
| File | Purpose |
|---|---|
Docker-rules.md |
Guidelines for Docker containerization, best practices for Dockerfiles, and image optimization. |
ci-cd-rules.md |
Principles and practices for CI/CD, including protected branches, security, observability, advanced deployment strategies, and automated rollbacks. |
github-actions-workflow-rules.md |
Rules for GitHub Actions workflows, covering trigger preferences, security, performance, and integrations. |
render-deployment-rules.md |
Deployment configurations for Render, including environment variables and custom domains. |
| File | Purpose |
|---|---|
shellcheck-fixer-rules.md |
Specialized rules for repairing shell scripts to meet ShellCheck standards. |
| File | Purpose |
|---|---|
ai-agent-planning-rules.md |
Guidelines for agent planning, including the core directive to plan before acting and a protocol for iterative plan revisions. |
ai-agent-session-documentation-rules.md |
Protocol for documenting AI agent sessions or conversations as Markdown, including file attachment references, structured data, and traceability. |
ai-tools-rules.md |
Comprehensive rules for AI tool usage, including mandates for output visibility, explicit user confirmation for file writes, and integration with agent planning and security protocols. |
github-cli-permission-rules.md |
Explicit permission protocol for running gh commands, ensuring user control and transparency. |
moltbridge-discovery-rules.md |
Industrial standards for social graph broker discovery, trust threshold mandates, and cross-tool analysis traceability. |
node-crypto-mcp-infrastructure-rules.md |
Industrial standards for Ed25519 reliability, Uint8Array sanitization, and Zero-Network MCP Server architecture. |
postman-mcp-server-rules.md |
Standards for configuring, using, and troubleshooting the Postman MCP Server in AI agent environments. |
shell-execution-rules.md |
Guidelines for shell command execution, ensuring transparency, user control, and adherence to security protocols. |
| File | Purpose |
|---|---|
zero-data-loss-cloud-cleanup-rules.md |
Mandatory verification protocol before deleting cloud-synced local files to prevent data loss. |
| File | Purpose |
|---|---|
rclone-download-rules.md |
Protocol for efficient, reliable, and user-controlled rclone downloads with progress tracking, size-based ordering, and integrity verification. |
| File | Purpose |
|---|---|
flutter-app-development-rules.md |
Rules for Flutter app development, including version pinning with mise, dependency management, and mandatory documentation. |
| File | Purpose |
|---|---|
code-documentation-rules.md |
Standards for deep-dive, pedagogical code documentation including adjacent markdown files and various folder patterns. |
markdown-generation-rules.md |
Standards for creating machine-parseable, lint-compliant markdown documents. |
| File | Purpose |
|---|---|
git-atomic-commit-construction-rules.md |
Authoritative protocol for analyzing, grouping, and arranging changes into logical, independent atomic units before execution. |
git-commit-message-rules.md |
Strict rules for generating git commit messages, enforcing Conventional Commits, contextual information in titles, and no redundancy between title and body. |
git-gitignore-handling-rules.md |
Protocols for generating, maintaining, and customizing .gitignore files using standard APIs. |
git-history-refinement-rules.md |
Protocols for refining existing commit history using backup branches, jq for JSON atomicity, and tree parity verification. |
git-operation-rules.md |
Strict protocols for standard Git operations (commits & pushes), mandating explicit user requests and forbidding auto-actions. |
git-rebase-standardization-rules.md |
Industrial protocol for hierarchical branch rebasing, cross-branch deduplication, and literal commit fidelity. |
git-repo-management-rules.md |
Comprehensive protocol for the repository lifecycle, including standardized creation, CLI-based cloning, submodule initialization, and auto-indexing. |
git-submodule-history-repair-rules.md |
Protocols for repairing broken submodule pointers caused by history rewrites in submodule repositories. |
git-submodule-rules.md |
Protocols for managing submodules, preventing detached HEAD states, proper branch tracking, and descriptive parent commit messages. |
git-text-normalization-rules.md |
Rules to ensure Git treats text files correctly across encodings and platforms, preventing binary diffs and EOL churn. |
github-pr-management-rules.md |
Sequential, CLI-first protocols for handling Pull Requests, emphasizing security for private repositories and explicit user handoff. |
github-repo-metadata-management-rules.md |
Ultra-Lean Industrial protocols for Metadata-as-Code (MaC), using README.md as the absolute Single Source of Truth with visible markers for automation. |
repo-discovery-rules.md |
Multi-platform repository discovery and smart cloning workflows. |
| File | Purpose |
|---|---|
GitHub-Action-Creation-rules.md |
Strict guidelines for creating, structuring, and publishing GitHub Composite Actions to the Marketplace. enforce "Industrial" standards. |
| File | Purpose |
|---|---|
typescript-rules.md |
Industrial standards for TypeScript configuration, strictness, and strict dependency freezing. |
| File | Purpose |
|---|---|
flutter-android-rules.md |
Specific guidelines for Android configurations within Flutter projects. |
| File | Purpose |
|---|---|
brew-rules.md |
Comprehensive SSOT for Homebrew operations, including installation preferences, keg-only handling, and exclusion-based upgrade workflows. |
mise-plugin-backend-management-rules.md |
Intelligent backend selection for mise plugin installations with fallback handling and user prompts. |
| File | Purpose |
|---|---|
manual-testing-rules.md |
Authoritative protocol for designing, documenting, and executing manual verification plans. |
| File | Purpose |
|---|---|
ai-rule-standardization-rules.md |
Craftsmanship standards for developing "Ultra-Lean Industrial" AI Agent Rules, ensuring consistent formatting, structural hierarchy, and pedagogical clarity. |
| File | Purpose |
|---|---|
bash-scripting-rules.md |
Industrial standards for bash script development, including dependency management patterns, alphabetical organization conventions, and idempotent function design. |
| File | Purpose |
|---|---|
linkedin-contributor-call-rules.md |
Specialized protocol for drafting "Call for Contributors" posts to recruit developers for personal projects, focusing on mentorship, labour-rich stacks, and leadership. |
linkedin-post-creation-rules.md |
Protocol for crafting viral, professional, and accessible LinkedIn posts customized for Banee Ishaque K's persona, emphasizing plain-text optimization and human storytelling. |
| File | Purpose |
|---|---|
nestjs-react-app-rules.md |
Guidelines for developing NestJS backends with React frontends. |
nestjs-react-flutter-stack-rules.md |
Full-stack guidelines for NestJS/React web apps with an accompanying Flutter mobile client. |
| File | Purpose |
|---|---|
rule-management-rules.md |
Documentation sync and update workflow, including metadata management for rule indexing. |
script-management-rules.md |
Script standards, folder usage, and safeguards for helper scripts. |
warp-terminal-ai-rules.md |
Backup and reference for Warp AI Agent specific configurations. |
| File | Purpose |
|---|---|
github-atom-feed-rules.md |
Protocol for generating and providing GitHub repository Atom feed URLs for commits and releases |
AI-Agent-Rules/
├── 📄 agent-rules.md # Central index (start here!)
│
├── 📖 Documentation & Standards
│ ├── code-documentation-rules.md # Deep-dive & Pedagogical standards
│ └── markdown-generation-rules.md # Lint-compliant formatting
│
├── 🧠 Core Agent Rules
│ ├── ai-agent-planning-rules.md # Planning & workflow protocols
│ ├── ai-tools-rules.md # Tool execution guidelines
│ └── shell-execution-rules.md # Command-line safety
│
├── 🔐 Security & Permissions
│ └── github-cli-permission-rules.md # Permission protocols
│
├── 📱 Development Frameworks
│ ├── flutter-app-development-rules.md # Flutter best practices
│ ├── flutter-android-rules.md # Flutter Android specific
│ ├── nestjs-react-app-rules.md # NestJS + React
│ └── nestjs-react-flutter-stack-rules.md
│
├── ⚙️ CI/CD & DevOps
│ ├── ci-cd-rules.md # Pipeline principles
│ ├── github-actions-workflow-rules.md # Workflow configuration
│ ├── Docker-rules.md # Container guidelines
│ └── render-deployment-rules.md
│
├── 🗃️ Repository Management
│ ├── Git-Repository-rules.md # Repo creation standards
│ ├── Git-Repo-Cloning-rules.md # Cloning protocols
│ ├── Git-Repository-Indexing-rules.md
│ └── repo-discovery-rules.md
│
├── 📦 Package & Script Management
│ ├── Brew-Install-rules.md # Homebrew installation
│ ├── Brew-Upgrade-rules.md # Package upgrades
│ └── script-management-rules.md # Script organization
│
├── 🔧 Tooling
│ ├── android-app-launch-rules.md # Emulator management
│ ├── rule-management-rules.md # Documentation sync
│ └── warp-terminal-ai-rules.md # Terminal configurations
│
└── 📂 Configuration
├── .gitignore # Git ignore patterns
└── .vscode/ # VS Code settings
├── settings.json # Editor configuration
└── extensions.json # Recommended extensionsThe foundational rule that all agents must follow:
1. Deconstruct the Request → Analyze user intent
2. Formulate the Plan → Create step-by-step approach
3. Present for Approval → Seek user confirmation
4. Execute the Plan → Implement approved steps
5. Report Progress → Summarize completionKey Principles:
- ✅ Always plan before acting
- ✅ Plans must be explicit and actionable
- ✅ Support iterative plan revisions
- ✅ Handle ambiguous requests with clarification
Core Principles:
- Transparency → Full visibility of all tool actions
- User Control → User maintains ultimate authority
- Full Output → Never truncate stdout/stderr
- Least Privilege → Minimum necessary permissionsMandatory User Confirmation Required For:
- File write operations
- GitHub CLI commands
- Any destructive operations
# Always explain critical commands before execution
# Display full output (stdout + stderr)
# Prefer non-interactive commands when possible
# Use background processes (&) for long-running tasksEnvironment Setup:
# Use Mise for version management
mise install # Install SDK versions from mise.toml
mise use flutter@3.x.x # Pin Flutter versionCode Quality:
flutter analyze # Lint with zero warnings
dart format . # Format all code
flutter test --coverage # Run tests with coverageProject Structure:
lib/
├── src/
│ ├── features/ # Feature modules
│ │ ├── feature_name/
│ │ │ ├── domain/ # Business logic
│ │ │ ├── presentation/ # UI
│ │ │ └── data/ # Data sources
│ ├── common/ # Shared utilities
│ ├── core/ # App configuration
│ └── main.dartGitHub Actions Optimization:
- uses: actions/checkout@v3
with:
fetch-depth: 1 # Shallow clone for speed
sparse-checkout: true # Only needed directoriesSecurity:
- Use OIDC for cloud authentication
- Never hardcode secrets
- Protected branches required
- Automated secret rotation
Deployment Orchestration:
Supabase → GitHub Actions → Render
↓ ↓ ↓
Router Executor RuntimeAgent: I will implement the user authentication feature. Here is my plan:
1. Create the authentication model in `lib/src/features/auth/domain/`
2. Implement the auth repository with Firebase integration
3. Build the login screen widget
4. Add unit tests for auth logic
5. Run `flutter analyze` and `flutter test`
Do you approve this plan?Agent: I need to run the following command to install dependencies:
Command: npm install
Purpose: Install project dependencies from package.json
Location: ~/projects/my-app/
Do you want me to proceed?Agent: I need to clone the repository. Here is the command:
gh repo clone Baneeishaque/AI-Agent-Rules ~/sample/path/AI-Agent-Rules
This will clone the repository to your local machine.
Do you approve this command? Yes/No# User: "upgrade except google-chrome@canary"
# Agent runs dry-run, filters results, presents:
brew upgrade --greedy --verbose gh node ollama discord@ptb postman- Open Warp Terminal settings
- Navigate to AI Agent configuration
- Reference rule files from this repository
- Rules sync automatically across devices
Recommended extensions are pre-configured in .vscode/extensions.json. Key extensions include:
{
"recommendations": [
"eamodio.gitlens",
"mhutchie.git-graph",
"github.vscode-pull-request-github",
"semanticdiff.semanticdiff"
],
"onlyVscodeSupported": [
"github.copilot",
"github.copilot-chat"
]
}Note: See
.vscode/extensions.jsonfor the complete list of recommended extensions organized by platform support.
Include rule files in your system prompt or context:
# Example: Loading rules into context
with open('ai-agent-planning-rules.md', 'r') as f:
agent_rules = f.read()
system_prompt = f"""
You are an AI assistant. Follow these rules:
{agent_rules}
"""Reference CI/CD rules in your workflow:
name: CI Pipeline
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1 # As per ci-cd-rules.mdWe welcome contributions! Please follow these guidelines:
-
Create a new rule file:
<Domain>-rules.md# Domain Name Rules Brief description of the rule domain. --- ### 1. First Principle Explanation and examples...
-
Update the index: Add entry to
agent-rules.md| Rule Domain | [Domain-rules.md](./Domain-rules.md) | Description |
-
Commit with conventional message:
git commit -m "feat: Add Domain-rules.md for X functionality"
-
Edit the relevant
*-rules.mdfile -
Ensure cross-references remain valid
-
Update
agent-rules.mddescription if needed -
Use conventional commits:
git commit -m "docs: Update flutter-app-development-rules.md with state management section"
- Use clear, unambiguous language
- Include practical examples
- Add emoji icons for visual organization 💡 🛡️ 📜 🔗
- Keep rules actionable and specific
- Reference other rule files when appropriate
- Fork the repository
- Create a feature branch:
git checkout -b feat/new-rule-domain - Make your changes
- Run spell check (VS Code cSpell is configured)
- Submit a pull request with a clear description
Please tag your PR/Repository with relevant topics. See GITHUB_TOPICS.md for the complete list and guidelines.
- Git 2.x+
- VS Code (recommended) or any markdown editor
- GitHub CLI (
gh) for repository operations
# 1. Clone the repository
gh repo clone Baneeishaque/AI-Agent-Rules
# 2. Navigate to directory
cd AI-Agent-Rules
# 3. Open in VS Code
code .
# 4. Install recommended extensions (prompted automatically)The repository includes pre-configured settings:
- Spell checking: Custom dictionary for technical terms
- Markdown preview: Native support
- Git integration: GitLens, Git Graph, and more
- GitHub integration: PR and issue management
| Path | Purpose |
|---|---|
*.md |
Rule documentation files |
.vscode/settings.json |
Editor configuration |
.vscode/extensions.json |
Recommended extensions |
.gitignore |
Git ignore patterns |
| Metric | Count |
|---|---|
| Total Rule Files | 24 |
| Fully Documented Rules | 17 |
| Placeholder/Empty Rules | 4 |
| Core Agent Rules | 4 |
| Development Framework Rules | 4 |
| CI/CD & DevOps Rules | 4 |
| Repository Management Rules | 4 |
| Other Domain Rules | 8 |
Note: Some rule files are placeholders awaiting documentation. Check the rule categories table for current status.
- Conventional Commits
- GitHub Actions Documentation
- Flutter Documentation
- Mise Version Manager
- Warp Terminal
This project is open source. License information will be added soon.
Made with ❤️ for the AI-assisted development community
Establish trust through transparency, consistency, and user control