AgentSkillsCN

code-patterns

在当前项目中发现并记录编码模式、开发规范与架构设计。当 Claude 需要深入了解项目风格,以便在进行代码修改之前做好充分准备时,可使用此功能。

SKILL.md
--- frontmatter
name: code-patterns
description: Discovers and documents coding patterns, conventions, and architecture in the current project. Use when Claude needs to understand the project's style before making changes.
user-invocable: false

Code Pattern Discovery

Analyze the codebase to understand patterns and conventions before making changes.

What to look for:

  1. File organization — How are files structured? What naming conventions are used?
  2. Import patterns — How are modules imported? Relative vs absolute paths? Barrel exports?
  3. Error handling — Try/catch? Result types? Error boundaries? Custom error classes?
  4. Naming — camelCase, snake_case, PascalCase? Prefixes? Suffixes? Conventions for handlers, services, utils?
  5. Testing patterns — Where do tests live? What frameworks? Co-located or separate directory?
  6. API patterns — REST? GraphQL? How are endpoints structured? Middleware patterns?
  7. State management — How is state managed? Global stores? Context? Props drilling?
  8. Configuration — Where do configs live? Env vars? Config files? Defaults?

Output:

Summarize the patterns you find so Claude can follow them when making changes. Be specific — include examples from actual files with file:line references.