MoonshotAI / MoonshotAI/kimi-code

feat: 递归查询父级 AGENTS.md 并合并注入

Open
#811 3 comments 0 reactions 0 assignees View on GitHub

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 不会自动读取。

期望行为
  1. 从当前工作目录开始,逐级向上查找 AGENTS.md
  2. 将所有找到的 AGENTS.md 合并注入
  3. 近层(子目录)配置覆盖远层(父目录)配置——类似 .gitignore 的覆盖规则
使用场景
work/                          ← 这里有 AGENTS.md(用户身份、通用偏好)
└── space1/                ← 这里有 AGENTS.md(项目说明)
    └── space2/                  ← 当前工作目录(技术格式说明)

用户打开 工具/ 工作时,只能看到最底层的 AGENTS.md,上层的用户身份和项目偏好都不会自动生效,需要 Agent 手动查找。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.