MoonshotAI / MoonshotAI/kimi-code
feat: 递归查询父级 AGENTS.md 并合并注入
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Feature Request
希望 kimi-code CLI 能原生支持递归查询父级目录的 AGENTS.md 文件,并自动合并注入到 agent 的系统上下文中。
当前行为
只自动加载当前工作目录下的 AGENTS.md,父级目录的 AGENTS.md 不会自动读取。
期望行为
- 从当前工作目录开始,逐级向上查找
AGENTS.md - 将所有找到的
AGENTS.md合并注入 - 近层(子目录)配置覆盖远层(父目录)配置——类似
.gitignore的覆盖规则
使用场景
work/ ← 这里有 AGENTS.md(用户身份、通用偏好)
└── space1/ ← 这里有 AGENTS.md(项目说明)
└── space2/ ← 当前工作目录(技术格式说明)
用户打开 工具/ 工作时,只能看到最底层的 AGENTS.md,上层的用户身份和项目偏好都不会自动生效,需要 Agent 手动查找。
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the existing logic that loads AGENTS.md from the current working directory and trace how its content enters the agent system context. Add parent-directory discovery and define the merge order so nearer files override farther files, then verify the resulting context across the nested-directory example described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100