ecc-conventions

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ECC Conventions

ECC 规范

Generated from affaan-m/ECC on 2026-03-20
生成自 affaan-m/ECC,日期为 2026-03-20

Overview

概述

This skill teaches Claude the development patterns and conventions used in ECC.
此 skill 教授 Claude 在 ECC 中使用的开发模式和约定。

Tech Stack

技术栈

  • Primary Language: JavaScript
  • Architecture: hybrid module organization
  • Test Location: separate
  • 主要语言:JavaScript
  • 架构:混合模块组织
  • 测试位置:独立

When to Use This Skill

何时使用此 skill

Activate this skill when:
  • Making changes to this repository
  • Adding new features following established patterns
  • Writing tests that match project conventions
  • Creating commits with proper message format
在以下情况下启用此 skill:
  • 修改此仓库
  • 按照既定模式添加新功能
  • 编写符合项目约定的测试
  • 使用正确格式创建提交

Commit Conventions

提交约定

Follow these commit message conventions based on 500 analyzed commits.
根据分析过的 500 次提交,遵循以下提交信息约定。

Commit Style: Conventional Commits

提交风格:Conventional Commits

Prefixes Used

使用的前缀

  • fix
  • test
  • feat
  • docs
  • fix
  • test
  • feat
  • docs

Message Guidelines

信息指南

  • Average message length: ~65 characters
  • Keep first line concise and descriptive
  • Use imperative mood ("Add feature" not "Added feature")
Commit message example
text
feat(rules): add C# language support
Commit message example
text
chore(deps-dev): bump flatted (#675)
Commit message example
text
fix: auto-detect ECC root from plugin cache when CLAUDE_PLUGIN_ROOT is unset (#547) (#691)
Commit message example
text
docs: add Antigravity setup and usage guide (#552)
Commit message example
text
merge: PR #529 — feat(skills): add documentation-lookup, bun-runtime, nextjs-turbopack; feat(agents): add rust-reviewer
Commit message example
text
Revert "Add Kiro IDE support (.kiro/) (#548)"
Commit message example
text
Add Kiro IDE support (.kiro/) (#548)
Commit message example
text
feat: add block-no-verify hook for Claude Code and Cursor (#649)
  • 平均信息长度:约 65 个字符
  • 第一行应简洁且具有描述性
  • 使用祈使语气(使用 "Add feature",而不是 "Added feature")
提交信息示例
text
feat(rules): add C# language support
提交信息示例
text
chore(deps-dev): bump flatted (#675)
提交信息示例
text
fix: auto-detect ECC root from plugin cache when CLAUDE_PLUGIN_ROOT is unset (#547) (#691)
提交信息示例
text
docs: add Antigravity setup and usage guide (#552)
提交信息示例
text
merge: PR #529 — feat(skills): add documentation-lookup, bun-runtime, nextjs-turbopack; feat(agents): add rust-reviewer
提交信息示例
text
Revert "Add Kiro IDE support (.kiro/) (#548)"
提交信息示例
text
Add Kiro IDE support (.kiro/) (#548)
提交信息示例
text
feat: add block-no-verify hook for Claude Code and Cursor (#649)

Architecture

架构

Project Structure: Single Package

项目结构:单包

This project uses hybrid module organization.
此项目采用混合模块组织方式。

Configuration Files

配置文件

  • .github/workflows/ci.yml
  • .github/workflows/maintenance.yml
  • .github/workflows/monthly-metrics.yml
  • .github/workflows/release.yml
  • .github/workflows/reusable-release.yml
  • .github/workflows/reusable-test.yml
  • .github/workflows/reusable-validate.yml
  • .opencode/package.json
  • .opencode/tsconfig.json
  • .prettierrc
  • eslint.config.js
  • package.json
  • .github/workflows/ci.yml
  • .github/workflows/maintenance.yml
  • .github/workflows/monthly-metrics.yml
  • .github/workflows/release.yml
  • .github/workflows/reusable-release.yml
  • .github/workflows/reusable-test.yml
  • .github/workflows/reusable-validate.yml
  • .opencode/package.json
  • .opencode/tsconfig.json
  • .prettierrc
  • eslint.config.js
  • package.json

Guidelines

指南

  • This project uses a hybrid organization
  • Follow existing patterns when adding new code
  • 此项目采用混合组织方式
  • 添加新代码时遵循现有模式

Code Style

代码风格

Language: JavaScript

语言:JavaScript

Naming Conventions

命名约定

ElementConvention
FilescamelCase
FunctionscamelCase
ClassesPascalCase
ConstantsSCREAMING_SNAKE_CASE
元素约定
文件camelCase
函数camelCase
类PascalCase
常量SCREAMING_SNAKE_CASE

Import Style: Relative Imports

导入风格:相对导入

Export Style: Mixed Style

导出风格:混合风格

Preferred import style
typescript
// Use relative imports
import { Button } from '../components/Button'
import { useAuth } from './hooks/useAuth'
首选导入风格
typescript
// Use relative imports
import { Button } from '../components/Button'
import { useAuth } from './hooks/useAuth'

Testing

测试

Test Framework

测试框架

No specific test framework detected — use the repository's existing test patterns.
未检测到特定的测试框架——请使用仓库现有的测试模式。

File Pattern:
*.test.js

文件模式:
*.test.js

Test Types

测试类型

  • Unit tests: Test individual functions and components in isolation
  • Integration tests: Test interactions between multiple components/services
  • 单元测试:单独测试各个函数和组件
  • 集成测试:测试多个组件或服务之间的交互

Coverage

覆盖率

This project has coverage reporting configured. Aim for 80%+ coverage.
此项目已配置覆盖率报告。目标覆盖率达到 80% 以上。

Error Handling

错误处理

Error Handling Style: Try-Catch Blocks

错误处理风格:Try-Catch 块

Standard error handling pattern
typescript
try {
  const result = await riskyOperation()
  return result
} catch (error) {
  console.error('Operation failed:', error)
  throw new Error('User-friendly message')
}
标准错误处理模式
typescript
try {
  const result = await riskyOperation()
  return result
} catch (error) {
  console.error('Operation failed:', error)
  throw new Error('User-friendly message')
}

Common Workflows

常见工作流

These workflows were detected from analyzing commit patterns.
以下工作流通过分析提交模式识别得出。

Database Migration

数据库迁移

Database schema changes with migration files
Frequency: ~2 times per month
Steps:
  1. Create migration file
  2. Update schema definitions
  3. Generate/update types
Files typically involved:
  • **/schema.*
  • migrations/*
Example commit sequence:
feat: implement --with/--without selective install flags (#679)
fix: sync catalog counts with filesystem (27 agents, 113 skills, 58 commands) (#693)
feat(rules): add Rust language rules (rebased #660) (#686)
通过迁移文件进行数据库 schema 变更。
频率:每月约 2 次
步骤:
  1. 创建迁移文件
  2. 更新 schema 定义
  3. 生成或更新类型
通常涉及的文件:
  • **/schema.*
  • migrations/*
提交序列示例:
feat: implement --with/--without selective install flags (#679)
fix: sync catalog counts with filesystem (27 agents, 113 skills, 58 commands) (#693)
feat(rules): add Rust language rules (rebased #660) (#686)

Feature Development

功能开发

Standard feature implementation workflow
Frequency: ~22 times per month
Steps:
  1. Add feature implementation
  2. Add tests for feature
  3. Update documentation
Files typically involved:
  • manifests/*
  • schemas/*
  • **/*.test.*
  • **/api/**
Example commit sequence:
feat(skills): add documentation-lookup, bun-runtime, nextjs-turbopack; feat(agents): add rust-reviewer
docs(skills): align documentation-lookup with CONTRIBUTING template; add cross-harness (Codex/Cursor) skill copies
fix: address PR review — skill template (When to use, How it works, Examples), bun.lock, next build note, rust-reviewer CI note, doc-lookup privacy/uncertainty
标准功能实现工作流。
频率:每月约 22 次
步骤:
  1. 添加功能实现
  2. 为该功能添加测试
  3. 更新文档
通常涉及的文件:
  • manifests/*
  • schemas/*
  • **/*.test.*
  • **/api/**
提交序列示例:
feat(skills): add documentation-lookup, bun-runtime, nextjs-turbopack; feat(agents): add rust-reviewer
docs(skills): align documentation-lookup with CONTRIBUTING template; add cross-harness (Codex/Cursor) skill copies
fix: address PR review — skill template (When to use, How it works, Examples), bun.lock, next build note, rust-reviewer CI note, doc-lookup privacy/uncertainty

Add Language Rules

添加语言规则

Adds a new programming language to the rules system, including coding style, hooks, patterns, security, and testing guidelines.
Frequency: ~2 times per month
Steps:
  1. Create a new directory under rules/{language}/
  2. Add coding-style.md, hooks.md, patterns.md, security.md, and testing.md files with language-specific content
  3. Optionally reference or link to related skills
Files typically involved:
  • rules/*/coding-style.md
  • rules/*/hooks.md
  • rules/*/patterns.md
  • rules/*/security.md
  • rules/*/testing.md
Example commit sequence:
Create a new directory under rules/{language}/
Add coding-style.md, hooks.md, patterns.md, security.md, and testing.md files with language-specific content
Optionally reference or link to related skills
向规则系统添加一种新的编程语言,包括代码风格、hooks、模式、安全性和测试指南。
频率:每月约 2 次
步骤:
  1. 在 rules/{language}/ 下创建新目录
  2. 添加 coding-style.md、hooks.md、patterns.md、security.md 和 testing.md 文件,并写入特定于该语言的内容
  3. 根据需要引用或链接相关 skill
通常涉及的文件:
  • rules/*/coding-style.md
  • rules/*/hooks.md
  • rules/*/patterns.md
  • rules/*/security.md
  • rules/*/testing.md
提交序列示例:
Create a new directory under rules/{language}/
Add coding-style.md, hooks.md, patterns.md, security.md, and testing.md files with language-specific content
Optionally reference or link to related skills

Add New Skill

添加新 Skill

Adds a new skill to the system, documenting its workflow, triggers, and usage, often with supporting scripts.
Frequency: ~4 times per month
Steps:
  1. Create a new directory under skills/{skill-name}/
  2. Add SKILL.md with documentation (When to Use, How It Works, Examples, etc.)
  3. Optionally add scripts or supporting files under skills/{skill-name}/scripts/
  4. Address review feedback and iterate on documentation
Files typically involved:
  • skills/*/SKILL.md
  • skills/*/scripts/*.sh
  • skills/*/scripts/*.js
Example commit sequence:
Create a new directory under skills/{skill-name}/
Add SKILL.md with documentation (When to Use, How It Works, Examples, etc.)
Optionally add scripts or supporting files under skills/{skill-name}/scripts/
Address review feedback and iterate on documentation
向系统添加新 skill,记录其工作流、触发条件和使用方法,通常还会提供配套脚本。
频率:每月约 4 次
步骤:
  1. 在 skills/{skill-name}/ 下创建新目录
  2. 添加 SKILL.md 文档,包括何时使用、工作原理、示例等
  3. 根据需要在 skills/{skill-name}/scripts/ 下添加脚本或配套文件
  4. 处理审查反馈并迭代完善文档
通常涉及的文件:
  • skills/*/SKILL.md
  • skills/*/scripts/*.sh
  • skills/*/scripts/*.js
提交序列示例:
Create a new directory under skills/{skill-name}/
Add SKILL.md with documentation (When to Use, How It Works, Examples, etc.)
Optionally add scripts or supporting files under skills/{skill-name}/scripts/
Address review feedback and iterate on documentation

Add New Agent

添加新 Agent

Adds a new agent to the system for code review, build resolution, or other automated tasks.
Frequency: ~2 times per month
Steps:
  1. Create a new agent markdown file under agents/{agent-name}.md
  2. Register the agent in AGENTS.md
  3. Optionally update README.md and docs/COMMAND-AGENT-MAP.md
Files typically involved:
  • agents/*.md
  • AGENTS.md
  • README.md
  • docs/COMMAND-AGENT-MAP.md
Example commit sequence:
Create a new agent markdown file under agents/{agent-name}.md
Register the agent in AGENTS.md
Optionally update README.md and docs/COMMAND-AGENT-MAP.md
向系统添加新 Agent,用于代码审查、构建问题解决或其他自动化任务。
频率:每月约 2 次
步骤:
  1. 在 agents/{agent-name}.md 下创建新的 Agent Markdown 文件
  2. 在 AGENTS.md 中注册该 Agent
  3. 根据需要更新 README.md 和 docs/COMMAND-AGENT-MAP.md
通常涉及的文件:
  • agents/*.md
  • AGENTS.md
  • README.md
  • docs/COMMAND-AGENT-MAP.md
提交序列示例:
Create a new agent markdown file under agents/{agent-name}.md
Register the agent in AGENTS.md
Optionally update README.md and docs/COMMAND-AGENT-MAP.md

Add New Workflow Surface

添加新的工作流入口

Adds or updates a workflow entrypoint. Default to skills-first; only add a command shim when legacy slash compatibility is still required.
Frequency: ~1 times per month
Steps:
  1. Create or update the canonical workflow under skills/{skill-name}/SKILL.md
  2. Only if needed, add or update commands/{command-name}.md as a compatibility shim
Files typically involved:
  • skills/*/SKILL.md
  • commands/*.md
    (only when a legacy shim is intentionally retained)
Example commit sequence:
Create or update the canonical skill under skills/{skill-name}/SKILL.md
Only if needed, add or update commands/{command-name}.md as a compatibility shim
添加或更新工作流入口。默认采用 skill 优先方式;仅当仍需兼容旧版斜杠命令时,才添加 command shim。
频率:每月约 1 次
步骤:
  1. 在 skills/{skill-name}/SKILL.md 下创建或更新规范工作流
  2. 仅在需要时,添加或更新 commands/{command-name}.md 作为兼容性 shim
通常涉及的文件:
  • skills/*/SKILL.md
  • commands/*.md
    (仅在有意保留旧版 shim 时)
提交序列示例:
Create or update the canonical workflow under skills/{skill-name}/SKILL.md
Only if needed, add or update commands/{command-name}.md as a compatibility shim

Sync Catalog Counts

同步目录计数

Synchronizes the documented counts of agents, skills, and commands in AGENTS.md and README.md with the actual repository state.
Frequency: ~3 times per month
Steps:
  1. Update agent, skill, and command counts in AGENTS.md
  2. Update the same counts in README.md (quick-start, comparison table, etc.)
  3. Optionally update other documentation files
Files typically involved:
  • AGENTS.md
  • README.md
Example commit sequence:
Update agent, skill, and command counts in AGENTS.md
Update the same counts in README.md (quick-start, comparison table, etc.)
Optionally update other documentation files
将 AGENTS.md 和 README.md 中记录的 Agent、Skill 和命令数量与仓库的实际状态同步。
频率:每月约 3 次
步骤:
  1. 更新 AGENTS.md 中的 Agent、Skill 和命令数量
  2. 更新 README.md 中的相同数量,包括快速入门、对比表等位置
  3. 根据需要更新其他文档文件
通常涉及的文件:
  • AGENTS.md
  • README.md
提交序列示例:
Update agent, skill, and command counts in AGENTS.md
Update the same counts in README.md (quick-start, comparison table, etc.)
Optionally update other documentation files

Add Cross Harness Skill Copies

添加跨 Harness 的 Skill 副本

Adds skill copies for different agent harnesses (e.g., Codex, Cursor, Antigravity) to ensure compatibility across platforms.
Frequency: ~2 times per month
Steps:
  1. Copy or adapt SKILL.md to .agents/skills/{skill}/SKILL.md and/or .cursor/skills/{skill}/SKILL.md
  2. Optionally add harness-specific openai.yaml or config files
  3. Address review feedback to align with CONTRIBUTING template
Files typically involved:
  • .agents/skills/*/SKILL.md
  • .cursor/skills/*/SKILL.md
  • .agents/skills/*/agents/openai.yaml
Example commit sequence:
Copy or adapt SKILL.md to .agents/skills/{skill}/SKILL.md and/or .cursor/skills/{skill}/SKILL.md
Optionally add harness-specific openai.yaml or config files
Address review feedback to align with CONTRIBUTING template
为不同的 Agent Harness(例如 Codex、Cursor、Antigravity)添加 Skill 副本,以确保跨平台兼容性。
频率:每月约 2 次
步骤:
  1. 将 SKILL.md 复制或调整为 .agents/skills/{skill}/SKILL.md 和/或 .cursor/skills/{skill}/SKILL.md
  2. 根据需要添加特定于 Harness 的 openai.yaml 或配置文件
  3. 处理审查反馈,使其符合 CONTRIBUTING 模板
通常涉及的文件:
  • .agents/skills/*/SKILL.md
  • .cursor/skills/*/SKILL.md
  • .agents/skills/*/agents/openai.yaml
提交序列示例:
Copy or adapt SKILL.md to .agents/skills/{skill}/SKILL.md and/or .cursor/skills/{skill}/SKILL.md
Optionally add harness-specific openai.yaml or config files
Address review feedback to align with CONTRIBUTING template

Add Or Update Hook

添加或更新 Hook

Adds or updates git or bash hooks to enforce workflow, quality, or security policies.
Frequency: ~1 times per month
Steps:
  1. Add or update hook scripts in hooks/ or scripts/hooks/
  2. Register the hook in hooks/hooks.json or similar config
  3. Optionally add or update tests in tests/hooks/
Files typically involved:
  • hooks/*.hook
  • hooks/hooks.json
  • scripts/hooks/*.js
  • tests/hooks/*.test.js
  • .cursor/hooks.json
Example commit sequence:
Add or update hook scripts in hooks/ or scripts/hooks/
Register the hook in hooks/hooks.json or similar config
Optionally add or update tests in tests/hooks/
添加或更新 git 或 bash hooks,以执行工作流、质量或安全策略。
频率:每月约 1 次
步骤:
  1. 在 hooks/ 或 scripts/hooks/ 中添加或更新 hook 脚本
  2. 在 hooks/hooks.json 或类似配置中注册 hook
  3. 根据需要在 tests/hooks/ 中添加或更新测试
通常涉及的文件:
  • hooks/*.hook
  • hooks/hooks.json
  • scripts/hooks/*.js
  • tests/hooks/*.test.js
  • .cursor/hooks.json
提交序列示例:
Add or update hook scripts in hooks/ or scripts/hooks/
Register the hook in hooks/hooks.json or similar config
Optionally add or update tests in tests/hooks/

Address Review Feedback

处理审查反馈

Addresses code review feedback by updating documentation, scripts, or configuration for clarity, correctness, or convention alignment.
Frequency: ~4 times per month
Steps:
  1. Edit SKILL.md, agent, or command files to address reviewer comments
  2. Update examples, headings, or configuration as requested
  3. Iterate until all review feedback is resolved
Files typically involved:
  • skills/*/SKILL.md
  • agents/*.md
  • commands/*.md
  • .agents/skills/*/SKILL.md
  • .cursor/skills/*/SKILL.md
Example commit sequence:
Edit SKILL.md, agent, or command files to address reviewer comments
Update examples, headings, or configuration as requested
Iterate until all review feedback is resolved
通过更新文档、脚本或配置来处理代码审查反馈,提高清晰度、正确性或约定一致性。
频率:每月约 4 次
步骤:
  1. 编辑 SKILL.md、Agent 或命令文件以处理审查者意见
  2. 根据要求更新示例、标题或配置
  3. 持续迭代,直到解决所有审查反馈
通常涉及的文件:
  • skills/*/SKILL.md
  • agents/*.md
  • commands/*.md
  • .agents/skills/*/SKILL.md
  • .cursor/skills/*/SKILL.md
提交序列示例:
Edit SKILL.md, agent, or command files to address reviewer comments
Update examples, headings, or configuration as requested
Iterate until all review feedback is resolved

Best Practices

最佳实践

Based on analysis of the codebase, follow these practices:
根据对代码库的分析,遵循以下实践:

Do

应该

  • Use conventional commit format (feat:, fix:, etc.)
  • Follow *.test.js naming pattern
  • Use camelCase for file names
  • Prefer mixed exports
  • 使用 Conventional Commits 格式(feat:、fix: 等)
  • 遵循 *.test.js 命名模式
  • 文件名使用 camelCase
  • 优先使用混合导出

Don't

不应该

  • Don't write vague commit messages
  • Don't skip tests for new features
  • Don't deviate from established patterns without discussion

This skill was auto-generated by ECC Tools. Review and customize as needed for your team.
  • 不要编写含糊不清的提交信息
  • 不要为新功能跳过测试
  • 未经讨论,不要偏离既定模式

此 skill 由 ECC Tools 自动生成。请根据团队需要审查和自定义。