Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@ Welcome to the PIME repository! To maintain high code quality and consistency, a
- **Read `HACKING.txt` First**: Before proposing architectural changes, adding new features, or modifying IPC logic, you must read the `HACKING.txt` file at the root of the repository. It contains critical information about the C++ client (TSF) and the Python/Node.js backend server architecture.

## 2. Modularity, Commits, and Pull Requests
- **CRITICAL - Small, Incremental Changes**: This is the single most important rule. AI agents often generate unreviewable volumes of code. You MUST keep changes strictly scoped, small, and modular. Do not bundle multiple unrelated features, bug fixes, or refactors into a single commit. If a feature, bugfix, or refactor involves many modules, prefer doing it incrementally in smaller git commits, step by step, where each commit handles an independent part. Huge, monolithic PRs will be strictly rejected during code review.
- **Isolate Renames and Moves**: For API renames or file moves/renames, keep them in their own dedicated commit. Never mix renames or moves with new feature implementations or bug fixes.
- **Separate Features and Fixes**: Never mix bug fixes and new feature implementations. They must be handled in separate commits and separate Pull Requests.
- **CRITICAL - Small, Focused PRs (One Problem at a Time)**: This is the single most important rule. AI agents often bundle multiple disparate changes into unreviewable, monolithic PRs. You MUST prefer small, highly focused Pull Requests that solve exactly **one problem at a time**.
- **Single Topic per PR**: Never bundle multiple unrelated bug fixes, features, or architectural adjustments into a single PR. If a task or issue involves multiple orthogonal areas, split them into independent, modular PRs. Small PRs ensure fast code review, easy rollback, and clear CI failure isolation.
- **Granular, Incremental Commits**: Keep changes strictly scoped. Do not combine unrelated edits into a single commit. When a fix or feature spans multiple modules, break it down into logical, incremental commits where each commit handles an independent step.
- **Strictly Reject Monolithic PRs**: Huge, kitchen-sink PRs will be strictly rejected during code review.
- **Isolate Renames and Moves**: Keep API renames or file moves/renames in their own dedicated commit/PR. Never mix renames or moves with new feature implementations or bug fixes.
- **Separate Features and Fixes**: Never mix bug fixes and new feature implementations. They must always be handled in separate commits and separate Pull Requests.
- **Commit & PR Message Style**: Apply the same concise style to both git commit messages and GitHub Pull Requests:
- **Headline / Title**: The first line / PR title is a concise headline describing what it does. Include the bug/issue number if available.
- **Blank Line**: (For commits) Follow the headline with a blank line.
- **Body (Elaboration)**: If the headline/title cannot fully describe what it does, elaborate briefly in the body, using concise bullet points if needed. Avoid verbose boilerplate.
- **Rationale (Most Important)**: Most importantly, explain *why* the change or fix is needed (if applicable; explain the motivation, context, or root cause).
- Do NOT literally include labels or section headers like "WHAT:" or "WHY:" in the message.
- **AI Declaration**: Clearly declare AI involvement at the end of commit messages, PR descriptions, PR review comments, and issue reports. Distinguish the level of human involvement:
- **Human-Architected / Supervised**: When a human author provided the design, architecture, API contract, or directed the triage:
> `Architecture and design by <Author>. Implementation generated with AI assistance from <Agent> (<Model>).`
- **Fully Autonomous**: When generated autonomously without human design intervention:
> `Fully generated by <Agent> (<Model>) without human intervention.`
- **Ambiguous / Undetermined**: If the prompt is brief and the agent cannot deduce whether the user considers the architecture theirs, **the agent must ask the user to clarify** before creating commits or PRs.
- **AI Declaration**:
- **Commits & Pull Requests (Code)**: Distinguish the level of human creative contribution for code changes:
- **Human-Architected / Supervised**: When a human author provided the design, architecture, API contract, or directed the triage:
> `Architecture and design by <Author>. Implementation generated with AI assistance from <Agent> (<Model>).`
- **Fully Autonomous**: When generated autonomously without human design intervention:
> `Fully generated by <Agent> (<Model>) without human intervention.`
- **Ambiguous / Undetermined**: If the prompt is brief and the agent cannot deduce whether the user considers the architecture theirs, **the agent must ask the user to clarify** before creating commits or PRs.
- **PR Comments, Discussions & Issues**: The "Architecture and design" distinction applies strictly to code. For conversational comments, code reviews, and issue filings, simply append a concise footer declaration (e.g. `*(Review comment generated with assistance from Antigravity + Gemini 3.8 Flash)*`).

## 3. Coding Style & Language Guidelines

Expand Down