AgentSkillsCN

review-pattern-documentation

审查并完善模式文档,确保其完整性。当被要求“审查模式”、“检查模式文档”或“评估模式文档”时使用。

SKILL.md
--- frontmatter
name: review-pattern-documentation
description: Review and improve pattern documentation for completeness. Use when asked to "review pattern", "check pattern docs", or "evaluate pattern documentation".
argument-hint: <pattern-name>
allowed-tools: Read, Glob, Grep

Review Pattern Skill

Analyze pattern documentation against real implementations to find gaps that would cause confusion or errors during implementation.

Prerequisites

Run this skill from a consuming repo (one that uses the patterns), not from effect-patterns itself. The skill needs real code to compare against.

Workflow

  1. Map argument to pattern file

    • repositoryrepository-pattern.md
    • http-api or httphttp-api-pattern.md
    • error or error-handlingerror-handling-pattern.md
    • schemaschema-pattern.md
    • testing or testtesting-pattern.md
    • formform-pattern.md
    • effect-atom or atomeffect-atom-pattern.md
    • serviceservice-pattern.md
    • policyhttp-api-pattern.md (policies section)
  2. Read the pattern file from the patterns location (check CLAUDE.md for path)

  3. Find 2-3 real implementations in the current codebase

    • Use Glob/Grep to find code following this pattern
    • Pick varied examples (simple + complex cases)
  4. Perform gap analysis using the criteria in GAP-ANALYSIS.md

  5. Generate improvement report (see output format below)

Evaluation Dimensions

Focus on these four dimensions (details in GAP-ANALYSIS.md):

DimensionQuestion
ClarityWould an LLM need to guess or make assumptions?
Self-sufficiencyCan you implement without looking anything else up?
RecognizabilityIs the architecture immediately obvious from code?
ConcisenessIs the pattern short enough to be fully regarded?

Output Format

markdown
# Gap Analysis: [pattern-name]

## Summary

- **Pattern length**: X lines (target: <800)
- **Real implementations examined**: [list files]
- **Critical gaps**: X found
- **Minor gaps**: X found

## Critical Gaps

Issues that would cause implementation errors or require significant correction.

### 1. [Gap title]

**Found in**: `path/to/real/implementation.ts:42`
**Pattern says**: [what the doc says or omits]
**Code actually does**: [what real code does]
**Suggested fix**: [specific text to add/change in pattern]

### 2. ...

## Minor Gaps

Issues that would require lookup or cause minor friction.

### 1. [Gap title]
...

## Redundancy Check

Sections that could be trimmed without losing information:
- [section name]: [why it's redundant]

## Suggested Edits

Concrete changes to make, in priority order:

1. **[Location in pattern]**: [exact change]
2. ...

What Makes a Critical Gap

A gap is critical if any of these apply:

  • Missing import would cause compile error
  • Wrong file path would put code in wrong location
  • Omitted step would cause runtime error
  • Ambiguous instruction has multiple valid interpretations

A gap is minor if:

  • Information exists but is hard to find
  • Example works but isn't idiomatic
  • Related pattern link is missing

Length Guidelines

LengthStatus
<400 linesGood - high attention density
400-800 linesAcceptable - may lose some attention
>800 linesToo long - split or trim redundancy

Count only the rendered content, not template syntax.