AgentSkillsCN

sync-upstream

上游同步报告的分类规则与分析逻辑。

SKILL.md
--- frontmatter
name: sync-upstream
description: Categorization rules and analysis logic for upstream sync reports

Upstream Sync Analysis

Domain expertise for categorizing changes from the compound-engineering-plugin upstream into the local .agents setup.

Path Mapping

The upstream repo organizes agents into subdirectories by category. The local repo flattens these into a single agents/ directory.

Upstream PathLocal PathNotes
agents/review/*.mdagents/*.mdCode review agents
agents/research/*.mdagents/*.mdResearch/analysis agents
agents/design/*.mdagents/*.mdDesign review agents
agents/workflow/*.mdagents/*.mdWorkflow automation agents
agents/docs/*.mdagents/*.mdDocumentation agents
commands/workflows/*.mdcommands/*.mdWorkflow commands flatten to commands/
commands/*.mdcommands/*.mdDirect 1:1 mapping
skills/*/skills/*/Direct 1:1 mapping (directory per skill)

When mapping paths, strip the content root prefix (plugins/compound-engineering/) first, then apply the mapping table. Use the longest matching prefix from the table.

Skip Patterns

Filename Patterns

These basenames (without extension) are auto-skipped. Use glob matching.

PatternReason
dhh-rails-*DHH Rails style — Ruby/Rails specific
kieran-rails-*Kieran Rails reviewer — Ruby/Rails specific
every-style-*Every company style guides
ankane-readme-*Ankane README writer — Ruby gem specific
schema-drift-*Schema drift detector — Rails specific
andrew-kane-*Andrew Kane patterns — Ruby specific
dhh-rails-styleDHH Rails style (exact match)
dspy-rubyDSPy Ruby integration
rclonerclone deployment — Every infrastructure
deploy-docsDeployment docs — Every infrastructure
release-docsRelease docs — Every infrastructure
xcode-testXcode testing — iOS specific
feature-videoFeature video — Every workflow

Content Markers

When these strings appear in file content, it suggests the file is Ruby/Rails/Every-specific. A single occurrence in a large general-purpose file should not trigger a skip — use judgment:

MarkerIndicates
every.toEvery company domain
Every'sEvery company reference
bundle execRuby bundler command
standardrbRuby linter
erblintERB linter (Rails views)
brakemanRails security scanner
ActiveRecordRails ORM
schema.rbRails database schema
Rails.Rails framework reference

Heuristic: If a file contains 3+ distinct content markers, it is likely Rails/Every-specific and should be skipped. If it contains 1-2 markers in an otherwise general-purpose file, flag it for review but don't auto-skip.

Relevance Scoring

ScoreCriteria
HIGHFile exists locally AND changed upstream (update to existing content)
HIGHNew file that is clearly general-purpose (TypeScript, React, design, testing)
MEDIUMNew file that appears general-purpose but may need adaptation
LOWMatches skip patterns OR is language/framework-specific

Adaptation Notes

When porting content from upstream, common adaptations include:

  • Strip Every references — Replace "Every's" with generic language, remove every.to URLs
  • Remove Rails sections — Delete Rails-specific tool lists, commands, patterns
  • Adjust agent tool lists — Upstream agents may reference Rails-specific tools (standardrb, erblint, etc.)
  • Flatten paths — Upstream uses subdirectories for agent categories; local uses flat structure
  • Update cross-references — Links between agents/skills may use upstream paths

Report Template

The sync report written to .claude/sync-report.md follows this structure:

markdown
# Upstream Sync Report
Generated: <ISO date>
Range: <old_short>..<new_short> (<N> commits)

## Summary
- **Commits:** <N>
- **Updates:** <N> files changed that exist locally
- **New:** <N> files to consider adding
- **Skipped:** <N> files filtered by patterns

## Commits
- `<short_hash>` <commit message>

## Updates to Existing Content
Items that exist locally and changed upstream.

### <local_path>
- **Upstream path:** <relative_path>
- **Status:** <M/A/D> | +<added> / -<removed> lines
- **What changed:** <one-line summary>
- **Action needed:** Review diff, merge improvements

## New Content to Review
Items that don't exist locally and may be worth adding.

### <mapped_local_path>
- **Upstream path:** <relative_path>
- **Category:** <agent | command | skill>
- **Relevance:** <HIGH | MEDIUM | LOW> — <reason>
- **Summary:** <what this file does>

## Auto-Skipped
Filtered by skip patterns — listed for transparency.

- `<relative_path>` — <skip reason>