Skip to content

docs: add AGENTS.md for AI contributor guidelines#688

Merged
thepagent merged 4 commits intomainfrom
add-agents-md
May 1, 2026
Merged

docs: add AGENTS.md for AI contributor guidelines#688
thepagent merged 4 commits intomainfrom
add-agents-md

Conversation

@chaodu-agent
Copy link
Copy Markdown
Collaborator

Summary

Add AGENTS.md to the repo root — a structured guidelines file that Kiro CLI (and other ACP agents) automatically reads into context on every session start.

Why

Analysis of the last 100 merged PRs revealed recurring patterns that cost us fix-after-fix cycles:

Pattern PRs Affected Root Cause
Thread detection rework 7 PRs (#503#634) No documented contract
Fix-after-feature 4 instances (#658#659, etc.) Default value changes
Helm template bugs 5 PRs (#500, #638, #639, #650, #654) No template test requirement
Dockerfile partial updates #544#545 No "change all" rule
Security leak #670 No env isolation guideline

Since 50+ of our last 100 PRs are from AI agents, this file directly shapes contributor behavior — every guideline prevents a class of bugs.

What's Included

  1. Architecture map — file responsibilities
  2. Message flow pipeline — the full event→response chain
  3. Rust conventions — do/don't list from real incidents
  4. Critical rules — backward-compat defaults, thread detection contract, security, Dockerfiles, cross-platform
  5. Helm chart checklist — template test commands, Go nil trap, PVC policy
  6. Breaking change protocol — commit format, migration docs
  7. PR standards — commit types, test requirements
  8. ADR references — read before implementing in those areas

Impact

Agents reading this file will:

  • Stop breaking backward compatibility with new defaults
  • Stop reinventing thread detection logic
  • Test Helm templates before submitting
  • Update all Dockerfiles together
  • Gate platform-specific code properly
  • Follow consistent PR format

@chaodu-agent chaodu-agent requested a review from thepagent as a code owner May 1, 2026 17:35
@github-actions github-actions Bot added pending-screening PR awaiting automated screening closing-soon PR missing Discord Discussion URL — will auto-close in 3 days labels May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⚠️ This PR is missing a Discord Discussion URL in the body.

All PRs must reference a prior Discord discussion to ensure community alignment before implementation.

Please edit the PR description to include a link like:

Discord Discussion URL: https://discord.com/channels/...

This PR will be automatically closed in 3 days if the link is not added.

Copy link
Copy Markdown
Collaborator Author

@chaodu-agent chaodu-agent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One factual issue in AGENTS.md before merge:

  • AGENTS.md says agent subprocesses only receive HOME, PATH, and explicit [agent].env keys. That is no longer true in main: src/acp/connection.rs also preserves USER on Unix, and USERPROFILE, USERNAME, SystemRoot, and SystemDrive on Windows.
  • Because this section is documenting the process-environment security boundary, the wording needs to match the implementation exactly; otherwise contributors may make the wrong assumption about what reaches the child process.

Please update the guideline text to reflect the actual preserved baseline vars, or relax it to say that credentials are stripped while a small OS/runtime baseline is retained.

List all baseline env vars passed to child processes:
- All platforms: HOME, PATH
- Unix: USER
- Windows: USERPROFILE, USERNAME, SystemRoot, SystemDrive

Caught by 擺渡法師 review.
Copy link
Copy Markdown
Collaborator Author

@chaodu-agent chaodu-agent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅ — Accurate project guidelines for AI contributors. All findings addressed. Ready for maintainer approval.

Review Summary (四法師)

Baseline Check: AGENTS.md is net-new (does not exist on main).

Fixes applied (3 commits by 超渡法師):

  1. Added missing src files to architecture map (bot_turns.rs, error_display.rs, setup/)
  2. Removed non-existent ci/full-values.yaml Helm checklist reference
  3. Added missing multi-platform-adapters.md ADR reference
  4. Fixed env_clear security description to match actual implementation (caught by 擺渡法師)

Monk Reviews:

  • 覺渡法師: 🟢 LGTM — verified factual accuracy post-fix
  • 普渡法師: 🟢 LGTM — architecture map fully validated against main
  • 擺渡法師: 🟢 LGTM — blocking env_clear issue resolved

Non-blocking NITs:

  • Consider adding Discord Discussion URL to PR description
  • Consider adding config-reference.md link in Helm section

@thepagent thepagent merged commit e9794b6 into main May 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closing-soon PR missing Discord Discussion URL — will auto-close in 3 days pending-screening PR awaiting automated screening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants