AgentSkillsCN

compact-reviewer:code-quality

当您审查Compact代码,关注代码的可读性、命名规范、代码组织方式、文档质量,以及格式与风格的一致性时,可选用此功能。

SKILL.md
--- frontmatter
name: compact-reviewer:code-quality
description: Use when reviewing Compact code for readability issues, naming conventions, code organization, documentation quality, or consistent formatting and style.

Code Quality Skill

Evaluate code readability, organization, and documentation.

When to Use

This skill activates for queries about:

  • Code readability
  • Naming conventions
  • Code organization
  • Documentation quality
  • Formatting and style

Trigger words: readability, naming, organization, documentation, clean code, style, format

Quick Reference

Quality Checklist

AspectGoodPoor
Namingget_user_balancegub
StructureLogical groupingMixed concerns
CommentsExplain whyExplain what
FormattingConsistentInconsistent
Length<50 lines/circuit>100 lines

Naming Conventions

ElementConventionExample
Circuitsverb_nountransfer_tokens, get_balance
Ledgersnounbalances, user_count
ConstantsUPPER_SNAKEMAX_SUPPLY, FEE_RATE
Parameterssnake_caserecipient_address, token_amount
Witnessesget_* prefixget_secret_key, get_proof

Review Process

1. Naming Analysis

Check all names for:

  • Clarity and descriptiveness
  • Consistent conventions
  • Meaningful distinctions
  • No abbreviations (except common ones)

2. Structure Review

Evaluate organization:

  • Logical grouping of related items
  • Consistent ordering
  • Appropriate separation
  • Clear module boundaries

3. Documentation Check

Assess documentation:

  • Public interfaces documented
  • Complex logic explained
  • Assumptions stated
  • Examples where helpful

4. Formatting Assessment

Check consistency:

  • Indentation
  • Line length
  • Blank lines
  • Brace style

References

Related Skills