- 说明
- Code Standards
- Repository Structure
- Key Guidelines
- Playwright test requirements
- Dev environment tips
- Testing instructions
- PR instructions
- mcp
说明
- /.github/copilot-instructions.md 包含项目相关信息,如如何生成和测试项目,编码标准用于编码、对话、代码评审 ```md This is a Go based repository with a Ruby client for certain API endpoints. It is primarily responsible for ingesting metered usage for GitHub and recording that usage. Please follow these guidelines when contributing:
Code Standards
Required Before Each Commit
- Run
make fmtbefore committing any changes to ensure proper code formatting - This will run gofmt on all Go files to maintain consistent style
Development Flow
- Build:
make build - Test:
make test - Full CI check:
make ci(includes build, fmt, lint, test)
Repository Structure
cmd/: Main service entry points and executablesinternal/: Logic related to interactions with other GitHub serviceslib/: Core Go packages for billing logicadmin/: Admin interface componentsconfig/: Configuration files and templatesdocs/: Documentationproto/: Protocol buffer definitions. Runmake protoafter making updates here.ruby/: Ruby implementation components. Updates to this folder should include incrementing this version file using semantic versioning:ruby/lib/billing-platform/version.rbtesting/: Test helpers and fixtures
Key Guidelines
- Follow Go best practices and idiomatic patterns
- Maintain existing code structure and organization
- Use dependency injection patterns where appropriate
- Write unit tests for new functionality. Use table-driven unit tests when possible.
- Document public APIs and complex logic. Suggest changes to the
docs/folder when appropriate ```- /.github/instructions/*/.instructions.md 适用于处理的特定类型的文件,包含如如何生成和测试文件编码标准 ```md .github/instructions/playwright-tests.instructions.md — applyTo: “*/tests/.spec.ts” —
Playwright test requirements
When writing Playwright tests, please follow these guidelines to ensure consistency and maintainability:
- Use stable locators - Prefer
getByRole(),getByText(), andgetByTestId()over CSS selectors or XPath - Write isolated tests - Each test should be independent and not rely on other tests’ state
- Follow naming conventions - Use descriptive test names and
*.spec.tsfile naming - Implement proper assertions - Use Playwright’s
expect()with specific matchers liketoHaveText(),toBeVisible() - Leverage auto-wait - Avoid manual
setTimeout()and rely on Playwright’s built-in waiting mechanisms - Configure cross-browser testing - Test across Chromium, Firefox, and WebKit browsers
- Use Page Object Model - Organize selectors and actions into reusable page classes for maintainability
- Handle dynamic content - Properly wait for elements to load and handle loading states
- Set up proper test data - Use beforeEach/afterEach hooks for test setup and cleanup
- Configure CI/CD integration - Set up headless mode, screenshots on failure, and parallel execution
```
- **/AGENTS.md 智能体文件 寻找最接近当前任务文件的 智能体文件
```md
Dev environment tips
- Use
pnpm dlx turbo run where <project_name>to jump to a package instead of scanning withls. - Run
pnpm install --filter <project_name>to add the package to your workspace so Vite, ESLint, and TypeScript can see it. - Use
pnpm create vite@latest <project_name> -- --template react-tsto spin up a new React + Vite package with TypeScript checks ready. - Check the name field inside each package’s package.json to confirm the right name—skip the top-level one.
- **/AGENTS.md 智能体文件 寻找最接近当前任务文件的 智能体文件
```md
Testing instructions
- Find the CI plan in the .github/workflows folder.
- Run
pnpm turbo run test --filter <project_name>to run every check defined for that package. - From the package root you can just call
pnpm test. The commit should pass all tests before you merge. - To focus on one step, add the Vitest pattern:
pnpm vitest run -t "<test name>". - Fix any test or type errors until the whole suite is green.
- After moving files or changing imports, run
pnpm lint --filter <project_name>to be sure ESLint and TypeScript rules still pass. - Add or update tests for the code you change, even if nobody asked.
PR instructions
- Title format: [
] - Always run
pnpm lintandpnpm testbefore committing. ``` - /CLAUDE.md /GEMINI.md 两个是二选一的, 智能体文件
mcp
- .vscode/mcp.json { “servers”: { “github-mcp”: { “type”: “http”, “url”: “https://api.githubcopilot.com/mcp” }, “playwright”: { “type”: “stdio”, “command”: “npx”, “args”: [ “@playwright/mcp@latest” ] } } }
AGENTS.md 是下面的入口文件 product-specs/(产品规格)、design-docs/(设计文档)、exec-plans/(执行计划)
必须文件 SKILL.md 可选文件scripts(脚本、程序)/references(可查阅文档)/assets(文档模板、表格示列、静态图片)等 SKILL.MD文件主要分为2块内容,一个是YAML元数据内容,一个是Markdown指令数据 — name: description: —
###
| 属性 | 必需 | 含义 | 例如 |
|---|---|---|---|
| name | 是 | 描述SKILL名称,最多64个字符 | name: pdf |
| description | 是 | 描述该SKILL的作用以及何时使用,应包含有助于代理识别相关任务的特定关键词 | description: Comprehensive PDF toolkit for extracting text and tables,merging/splitting documents, and filling-out forms. |
| license | 否 | 适用于该SKILL的许可证 | license: Apache 2.0 |
| compatibility | 否 | 该SKILL存在的特定环境要求 | Requires git, docker, jq, and access to the internet |
| metadata | 否 | 任意键值映射,用于添加元数据信息 | metadata: author: “xxx” version: “1.0” |
| allowed-tools | 否 | 技能可使用的预先批准工具列表,以空格分隔 | allowed-tools: Bash(git:) Bash(jq:) Read |