Skip to content

Commit c03c3f8

Browse files
committed
docs: restructure skills to standard directory format
- .agents/skills/contributing.md → .agents/skills/mcpp-contributing/SKILL.md - .agents/skills/mcpp-usage.md → .agents/skills/mcpp-usage/SKILL.md - Both skills now have YAML frontmatter (name, description) - Update README references to new skill paths
1 parent 96ebb19 commit c03c3f8

5 files changed

Lines changed: 301 additions & 386 deletions

File tree

.agents/skills/contributing.md

Lines changed: 0 additions & 211 deletions
This file was deleted.
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
name: mcpp-contributing
3+
description: Use when contributing to the mcpp project — submitting bug fixes, new features, code optimizations, documentation improvements, or any PR. Covers issue creation, branch conventions, build verification, CI requirements, and PR workflow using gh and git.
4+
---
5+
6+
# mcpp 项目开发贡献
7+
8+
## Overview
9+
10+
mcpp 项目的贡献流程:先创建 Issue → 实现改动 → 提交 PR → CI 通过 → Review 合入。
11+
12+
- 仓库:https://github.com/mcpp-community/mcpp
13+
- 构建:`mcpp build`(C++23 模块自举)
14+
- 测试:`tests/e2e/` 下的 bash 脚本
15+
- CI:GitHub Actions,base 为 `main` 的 PR 自动触发
16+
17+
## 贡献流程
18+
19+
### 1. 创建 Issue(必须)
20+
21+
所有贡献先创建 Issue,特别是新功能。避免重复工作,留下讨论记录。
22+
23+
**Bug 修复**
24+
25+
```bash
26+
gh issue create \
27+
--title "fix: 简短描述" \
28+
--body "## 复现步骤
29+
1. ...
30+
31+
## 期望行为
32+
...
33+
34+
## 实际行为
35+
...
36+
37+
## 环境
38+
- mcpp 版本:\`mcpp --version\`
39+
- OS:"
40+
```
41+
42+
**新功能**
43+
44+
```bash
45+
gh issue create \
46+
--title "feat: 简短描述" \
47+
--body "## 动机
48+
...
49+
50+
## 设计思路
51+
...
52+
53+
## 涉及模块
54+
..."
55+
```
56+
57+
**代码优化**
58+
59+
```bash
60+
gh issue create \
61+
--title "refactor: 简短描述" \
62+
--body "## 当前问题
63+
...
64+
65+
## 优化方案
66+
..."
67+
```
68+
69+
### 2. 实现改动
70+
71+
**分支**
72+
73+
```bash
74+
git checkout main && git pull origin main
75+
git checkout -b <type>/<short-description>
76+
# type: feat / fix / refactor / test / docs
77+
```
78+
79+
**开发要求**
80+
- 遵循现有代码风格(查看相邻代码)
81+
- 模块导入用 `import std;``import mcpp.xxx;`
82+
- 只改需要改的,不顺手重构不相关代码
83+
84+
**构建验证**
85+
86+
```bash
87+
# 找到 mcpp 二进制
88+
ls target/x86_64-linux-gnu/*/bin/mcpp
89+
# 构建
90+
<mcpp-binary> build
91+
```
92+
93+
**测试**
94+
95+
```bash
96+
bash tests/e2e/01_help_and_version.sh # 基础测试
97+
bash tests/e2e/<relevant-test>.sh # 相关测试
98+
# 新功能应创建对应 E2E 测试
99+
```
100+
101+
### 3. 提交 PR
102+
103+
**提交信息**`feat:` / `fix:` / `refactor:` / `test:` / `docs:` 前缀
104+
105+
```bash
106+
git push -u origin <branch>
107+
gh pr create \
108+
--title "<type>: 简短描述" \
109+
--body "## Summary
110+
- 改动点
111+
112+
Closes #<issue>
113+
114+
## Test plan
115+
- [ ] mcpp build 通过
116+
- [ ] E2E 测试通过"
117+
```
118+
119+
### 4. CI 必须通过
120+
121+
CI 不通过的 PR 不会被合入。
122+
123+
```bash
124+
gh pr checks <pr-number> # 查看状态
125+
gh run view <run-id> --log-failed # 查看失败日志
126+
```
127+
128+
CI 内容:mcpp 自举构建 + E2E 测试。只有 base 为 `main` 的 PR 触发。
129+
130+
### 5. Review & 合入
131+
132+
维护者 review → 反馈修改 → CI 重跑 → Squash merge。
133+
134+
## 项目结构
135+
136+
```
137+
src/
138+
├── cli.cppm ← 命令行入口
139+
├── config.cppm ← 全局配置
140+
├── manifest.cppm ← mcpp.toml 解析
141+
├── build/ ← 构建系统(ninja 后端)
142+
├── pm/ ← 包管理子系统
143+
├── toolchain/ ← 编译器检测管理
144+
├── modgraph/ ← 模块图扫描验证
145+
├── pack/ ← 打包发布
146+
└── xlings.cppm ← xlings 抽象层
147+
tests/e2e/ ← E2E 测试脚本
148+
docs/ ← 用户文档
149+
.agents/docs/ ← 设计文档
150+
.agents/skills/ ← Agent 技能文档
151+
```
152+
153+
## 注意事项
154+
155+
- C++23 模块项目,修改模块时注意 import 依赖顺序
156+
- E2E 测试应独立运行,不依赖网络
157+
- 不确定方向时先在 Issue 讨论再动手

0 commit comments

Comments
 (0)