Skip to content
This repository was archived by the owner on Sep 22, 2026. It is now read-only.

fix(agent-runner): read Development Rules from AGENTS.md before CLAUDE.md - #42

Draft
robotlearning123 wants to merge 1 commit into
mainfrom
fix/read-agents-md-rules
Draft

robotlearning123 wants to merge 1 commit into
mainfrom
fix/read-agents-md-rules

Conversation

@robotlearning123

Copy link
Copy Markdown
Member

buildSystemPrompt() read the ## Development Rules section only from CLAUDE.md. A project whose CLAUDE.md just imports AGENTS.md (@AGENTS.md, the layout Claude Code and Codex can share) therefore lost its rules from the agent prompt without any error. This PR takes the section from the first of AGENTS.md and CLAUDE.md that contains it.

Tests (src/__tests__/agent-runner.test.ts, temp directories):

  • AGENTS.md holds the rules and CLAUDE.md only imports it: the rules are injected.
  • Only CLAUDE.md holds the rules (today's layout): the rules are injected.
  • AGENTS.md exists without the section: CLAUDE.md is used.
  • Neither file has the section: nothing is injected.
  • Both files have it: AGENTS.md wins and CLAUDE.md is not added as well.

The first test fails against the previous code. npx tsc --noEmit passes; npm test gives 389 pass, 0 fail, 3 skipped (the existing skips). For the current repo, the prompt is unchanged.

Draft until independent review passes. The docs PR that moves this repo to AGENTS.md is stacked on top of this one.

…E.md

buildSystemPrompt() read the Development Rules section only from CLAUDE.md, so
a project whose CLAUDE.md just imports AGENTS.md (`@AGENTS.md`) lost its rules.
Take the section from the first of AGENTS.md, CLAUDE.md that contains it.

This branch has not been deployed

No deployments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants