Skip to content

Instantly share code, notes, and snippets.

@bater
Last active September 9, 2025 15:59
Show Gist options
  • Save bater/1f360ca9b80e4e9da60b5aa1cf90d98a to your computer and use it in GitHub Desktop.
Save bater/1f360ca9b80e4e9da60b5aa1cf90d98a to your computer and use it in GitHub Desktop.

Revisions

  1. bater revised this gist Sep 9, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions agents.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@
    # Purpose

    This file defines coding style and design preferences for all AI Coding Agents (e.g., Gemini, Claude Code, Copilot).

    Goal: produce code that is clear to humans and consistent for machines.

    ## General Principles
  2. bater renamed this gist Sep 9, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. bater created this gist Sep 9, 2025.
    29 changes: 29 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@

    # Purpose

    This file defines coding style and design preferences for all AI Coding Agents (e.g., Gemini, Claude Code, Copilot).
    Goal: produce code that is clear to humans and consistent for machines.

    ## General Principles

    * Code must be readable by humans and regular for machines.
    * Prefer clarity over cleverness.
    * Naming must be explicit, avoid metaphors or hidden meaning.
    * Consistency is more important than abstraction depth.
    * Every layer of abstraction must provide clear value.
    * Documentation (docstrings, comments) must capture purpose and usage, not just repetition.
    * Avoid unnecessary duplication, but also avoid over-abstraction that hides logic.
    * Always provide type hints and structured metadata (docstrings, schema).
    * Specs and requirements must be preserved in code as structured reference (comments or annotations).
    * Treat code as a shared medium between humans and AI; prefer explicitness over style.

    ## Practical Rules

    * Always generate consistent formatting (follow language community conventions).
    * Use docstrings + type hints for all public functions, classes, and modules.
    * Keep function length moderate; split if exceeding ~50 lines.
    * Avoid one-letter or context-free variable names.
    * Keep imports explicit; avoid import *.
    * Write comments for why, not for what.
    * Avoid hidden "clever" tricks; prefer straightforward implementations.
    * Prefer deterministic and reproducible outputs.