Project Coding Standards
2026-09-06 11:37:13作者:咎岭娴Homer
Testing
- Write tests before code (TDD)
- For bugs: write a failing test first, then fix (Prove-It pattern)
- Test hierarchy: unit > integration > e2e (use the lowest level that captures the behavior)
- Run
npm testafter every change
Code Quality
- Review across five axes: correctness, readability, architecture, security, performance
- Every PR must pass: lint, type check, tests, build
- No secrets in code or version control
Implementation
- Build in small, verifiable increments
- Each increment: implement → test → verify → commit
- Never mix formatting changes with behavior changes
Boundaries
- Always: Run tests before commits, validate user input
- Ask first: Database schema changes, new dependencies
- Never: Commit secrets, remove failing tests, skip verification
这份文件与技能体系一一对应:"five axes" 评审标准来自 [skills/code-review-and-quality/SKILL.md](https://gitcode.com/GitHub_Trending/agentskill/agent-skills/blob/469d00f4e67ff4a21eb6e6e467a086c9a1f1deb8/skills/code-review-and-quality/SKILL.md?utm_source=gitcode_repo_files) 的五维评审框架;"Prove-It pattern"(先写失败测试再修 bug)来自 [skills/test-driven-development/SKILL.md](https://gitcode.com/GitHub_Trending/agentskill/agent-skills/blob/469d00f4e67ff4a21eb6e6e467a086c9a1f1deb8/skills/test-driven-development/SKILL.md?utm_source=gitcode_repo_files) 的"测试即证据"原则;"小步增量、implement → test → verify → commit" 则是 [skills/incremental-implementation/SKILL.md](https://gitcode.com/GitHub_Trending/agentskill/agent-skills/blob/469d00f4e67ff4a21eb6e6e467a086c9a1f1deb8/skills/incremental-implementation/SKILL.md?utm_source=gitcode_repo_files) 的核心循环。项目指令负责"常驻约束",斜杠命令负责"按需触发",两者互补。
此外,文档建议在 Copilot Chat 中配合专门的 agent 人格做定向评审(即上文 `@code-reviewer` 等用法),形成"项目指令兜底 + 人格按需深审"的双层质量闸口。
## 生命周期工作流:六个阶段全部以技能名调用
技能默认即用户可调用,因此只要被发现,整个开发生命周期无需额外配置即可用技能本名触发:
| 阶段 | Copilot 调用方式 | 说明 |
|------|------------------|------|
| Define | `/spec-driven-development` | 写代码前先产出结构化 spec |
| Plan | `/planning-and-task-breakdown` | 产出 `tasks/plan.md` 与 `tasks/todo.md` |
| Build | `/incremental-implementation` | 与 `/test-driven-development` 搭配;一次只做一个切片 |
| Verify | `/test-driven-development` | 红-绿-重构;bug 用 Prove-It 模式 |
| Review | `/code-review-and-quality` | 五轴评审 |
| Ship | `/shipping-and-launch` | 上线就绪检查 |
在 Copilot 聊天框输入 `/` 即可浏览当前工作区实际加载了哪些命令。
斜杠命令不可见时的兜底是**自然语言**,它在任何 Copilot 界面都可用,无论斜杠命令是否显示:
> Use the spec-driven-development skill to write a spec for [the feature].
> Use the code-review-and-quality skill to review my staged changes.
### 可选:自建 `/spec` 风格短别名
VS Code 的 extension-host 本地 agent 支持放在 `.github/prompts/<name>.prompt.md` 的提示词文件(prompt files),每个文件对应一个 `/<name>` 斜杠命令。**但要注意:Agent Host 不使用 prompt 文件**——如果你运行在 Agent Host 上,请直接用技能全名。
先明确别名的定位:别名只是到某个技能的"薄快捷方式",仅此而已。它们**不复现**本仓库 Claude Code 命令里的编排逻辑——例如 `/build auto` 的"单次批准后连续实施全部任务"、`/ship` 的"多人格并行扇出"。在 Copilot 上复刻那些编排是另一项独立工作,不是一个单文件别名能覆盖的。因此默认优先用技能名,只有当短形式确实值得多维护一个文件时才建别名。
官方给出的 `/spec` 别名创建示例(`[ -e ... ] ||` 保护避免覆盖已有文件):
```bash
mkdir -p .github/prompts
[ -e .github/prompts/spec.prompt.md ] || cat > .github/prompts/spec.prompt.md <<'EOF'
---
description: Write a structured spec before writing code
---
Use the spec-driven-development skill.
Ask clarifying questions about the objective and target users, core features and
acceptance criteria, stack preferences and constraints, and known boundaries.
Then write a spec covering objective, commands, project structure, code style,
testing strategy, and boundaries. Save it as SPEC.md in the project root and
confirm with me before any code is written.
EOF
登录后查看全文
热门项目推荐
相关项目推荐
atomcodeClaude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed. Get StartedRust0627
Hy4-previewHy4 preview 是由腾讯混元团队研发的新一代混合专家(MoE)旗舰模型。模型总参数量 770B,每个 token 激活 49B,主干共包含78层,第一层采用标准 FFN,其余 77 层均为 MoE 结构,每层包含 256 个路由专家与 1 个共享专家,每个 token 激活 top-8 路由专家及共享专家。主干之外原生内置 1 层 MTP(总参数量 10B,激活 0.7B)以支持投机解码。Python00
GLM-5.3GLM-5.3 与 GLM-5.2 使用相同的基座模型——所有提升均来自后训练。与 GLM-5.2 相比,它在复杂编程和长程任务上的表现显著提升。Jinja00
GLM-5.3-FlashGLM-5.3-Flash (320B-A18B),是GLM-5系列的首个原生多模态模型。320B总参数,能力超过GLM-5.2Jinja00
Spark-X2.5-4BSpark-X2.5-4B 旨在让强大的 AI 更实用、更高效、更易获得。在广泛日常任务中表现强劲,涵盖对话、写作、翻译、推理、编码、工具调用以及智能体工作流,并在同等规模的开源模型中取得领先成绩。Spark-X2.5 将面向效率的架构与最高 1M tokens 的原生上下文窗口相结合,并支持 200 多种语言。Python00
Spark-X2.5-1.7BSpark-X2.5-1.7B 旨在让强大的 AI 更加实用、高效且易于获取。这些模型在广泛的日常任务中表现出色,涵盖对话、写作、翻译、推理、编程、工具调用和智能体工作流,并在同等规模的开源模型中取得领先结果。Spark-X2.5 将面向效率的架构与最高 1M tokens 的原生上下文窗口相结合,并支持 200 多种语言。Python00
项目优选
收起
deepin linux kernel
C
33
18
本项目是CANN提供的transformer类大模型算子库,实现网络在NPU上加速计算。
C++
1.13 K
2.75 K
作为 Ascend for PyTorch 社区的核心组件,TorchNPU 是昇腾专为 PyTorch 打造的深度学习适配插件,使 PyTorch 框架能够直接调用昇腾 NPU,为开发者提供昇腾 AI 处理器的超强算力。
Python
857
1.35 K
暂无描述
Markdown
897
5.8 K
openEuler内核是openEuler操作系统的核心,既是系统性能与稳定性的基石,也是连接处理器、设备与服务的桥梁。
C
529
593
本项目是CANN提供的神经网络类计算算子库,实现网络在NPU上加速计算。
C++
915
1.83 K
JiuwenSwarm 是一款基于openJiuwen开发的智能AI Agent,它能够将大语言模型的强大能力,通过你日常使用的各类通讯应用,直接延伸至你的指尖。
Python
3.58 K
1.01 K
本项目是CANN提供的数学类基础计算算子库,实现网络在NPU上加速计算。
C++
1.35 K
1.46 K
CANN 学习中心仓,支持在线互动运行、边学边练,提供教程、示例与优化方案,一站式助力昇腾开发者快速上手。
Jupyter Notebook
1.01 K
515
AscendNPU-IR是基于MLIR(Multi-Level Intermediate Representation)构建的,面向昇腾亲和算子编译时使用的中间表示,提供昇腾完备表达能力,通过编译优化提升昇腾AI处理器计算效率,支持通过生态框架使能昇腾AI处理器与深度调优
C++
547
388