# Merge Agents Md

> 该skill没有执行文件，为操作指引：通用 AGENTS.md 合并技能，支持多种编程语言模板

- **Type:** Skill
- **Install:** `agentstack add skill-hellyguo-self-ai-spec-merge-agents-md`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [hellyguo](https://agentstack.voostack.com/s/hellyguo)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [hellyguo](https://github.com/hellyguo)
- **Source:** https://github.com/hellyguo/self-ai-spec/tree/main/skills/merge-agents-md

## Install

```sh
agentstack add skill-hellyguo-self-ai-spec-merge-agents-md
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 合并 AGENTS.md

## 概述

将语言特定的 AGENTS.md 模板与项目当前目录下的 AGENTS.md 进行合并，生成更新后的 AGENTS.md 文件。

## 语言支持

| 语言 | 模板文件 |
|------|----------|
| Java | `AGENTS.java.md` |
| Python | `AGENTS.python.md` |
| C++ | `AGENTS.cpp.md` |
| Rust | `AGENTS.rust.md` |
| JavaScript | `AGENTS.js.md` |
| ANSI C | `AGENTS.ansi_c.md` |

## 合并流程

### 1. 确定语言类型

根据以下方式确定语言类型：

- 用户明确指定语言
- 根据项目源代码文件类型自动推断
- 优先级：用户指定 > 自动推断

### 2. 授权读取模板

```
授权读取：${AI_SPEC_ROOT}/agent-template/AGENTS.{lang}.md

Read ${AI_SPEC_ROOT}/agent-template/AGENTS.{lang}.md
```

### 3. 合并规则

| 模板内容 | 项目内容 | 合后结果 |
|----------|----------|----------|
| 通用规则（交互规则、角色定位等） | 无 | 直接添加 |
| 通用规则 | 已存在 | 检查一致性，补充缺失项 |
| 语言特定规则（构建命令、代码风格等） | 无 | 直接添加 |
| 语言特定规则 | 已存在 | 以项目内容为主，模板内容为补充 |
| 项目特定内容 | - | 保留不变 |

### 4. 合并优先级

1. **保留项目特有内容**：项目特有的配置、命令、规则不覆盖
2. **补充模板内容**：模板中有但项目中没有的内容，添加到项目
3. **校验一致性**：相同规则在不同版本中检查一致性

### 5. 输出

合并后更新当前目录下的 `AGENTS.md` 文件。

## 合并示例

### Java 项目合并

```
# 读取 Java 模板
Read ${AI_SPEC_ROOT}/agent-template/AGENTS.java.md

# 读取项目现有 AGENTS.md（如存在）
Read ./AGENTS.md

# 合并内容，输出到 ./AGENTS.md
Write ./AGENTS.md
```

### Python 项目合并

```
# 读取 Python 模板
Read ${AI_SPEC_ROOT}/agent-template/AGENTS.python.md

# 读取项目现有 AGENTS.md（如存在）
Read ./AGENTS.md

# 合并内容，输出到 ./AGENTS.md
Write ./AGENTS.md
```

## 合并检查清单

合并完成后检查：

- [ ] 交互规则完整
- [ ] 构建命令正确
- [ ] 代码风格指南存在
- [ ] 语言特定规则已添加
- [ ] 项目特有内容保留
- [ ] 无冲突内容
- [ ] 格式规范（Markdown）

## 提交变更

合并完成后执行 git 提交：

```bash
git add AGENTS.md
git commit -m "docs: 更新 AGENTS.md 合并 {lang} 模板"
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [hellyguo](https://github.com/hellyguo)
- **Source:** [hellyguo/self-ai-spec](https://github.com/hellyguo/self-ai-spec)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-hellyguo-self-ai-spec-merge-agents-md
- Seller: https://agentstack.voostack.com/s/hellyguo
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
