echoes-review
Echoes review — analyse your current branch or an existing PR for naming violations, a11y gaps, design-token misuse, missing exports, and architectural issues in the Echoes React component library.
来源信息
- 仓库
- SonarSource/echoes-react
- 最近来源活动
- 2026年6月17日 12:39
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 9
- 分支
- 5
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- echoes-review
- description
- Echoes review — analyse your current branch or an existing PR for naming violations, a11y gaps, design-token misuse, missing exports, and architectural issues in the Echoes React component library.
Run echoes review: $ARGUMENTS
Parse arguments:
- `--pr <number or URL>` — review a specific PR's diff instead of the current branch; accepts a bare number (`123`) or a full GitHub URL — extract the number from the URL path before proceeding; `--base` is ignored when this is set since `gh pr diff` always diffs against the PR's own base branch
- `--base <branch>` — override the base branch when diffing the current branch (default: auto-detected main or master); has no effect when `--pr` is provided
---
## Step 1: Load review guidelines
Read all files under `.gitar/review/` — they contain the authoritative rules for this review:
@.gitar/review/general-design.md
@.gitar/review/naming-and-api.md
@.gitar/review/component-patterns.md
@.gitar/review/folder-and-exports.md
@.gitar/review/radix-ui.md
@.gitar/review/design-tokens.md
@.gitar/review/accessibility.md
@.gitar/review/testing.md
@.gitar/review/localization.md
@.gitar/review/stories-and-figma.md
---
## Step 2: Get the diff
The two modes use **different data sources**. Do not mix them.
### Mode A: `--pr`
Run all three commands in a **single** Bash call so they require only one permission grant:
```bash
git fetch origin pull/{pr}/head:pr-{pr} && gh pr diff {pr} --name-only && echo "==FULL_DIFF==" && gh pr diff {pr}
```
For each changed file that looks architecturally significant (component files, index exports, stories, tests, figma-connect files, design token files), read its full content in a **single** Bash call:
```bash
for f in file1 file2 file3; do echo "=== $f ==="; git show pr-{pr}:$f; done
```
### Mode B: Current branch (no `--pr`)
Run branch detection, merge-base resolution, file list, and full diff in a **single** Bash call so they require only one permission grant:
```bash
git rev-parse --abbrev-ref HEAD && MERGE_BASE=$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD origin/master) && echo "Merge base: $MERGE_BASE" && git diff $MERGE_BASE --name-only && echo "==FULL_DIFF==" && git diff $MERGE_BASE
```
For each architecturally significant changed file that is untracked (not in the diff), read its full content from disk using the Read tool — not a separate Bash call.
---
## Step 3: Analyse
Apply every rule from the loaded `.gitar/review/` files to the diff. For each finding note: file path, approximate line, and whether it's a **must fix** (correctness risk) or **worth addressing** (design smell that will compound).
Before reporting each finding, assess the tradeoff:
- **Scope**: one-liner fix, single-file refactor, or multi-file change?
- **Complexity trade**: does the fix remove complexity in one place but add it somewhere else?
- **Risk**: does it touch a public API (breaking change for consumers)?
- **Strategic direction**: is the implementation heading the right way, or is it a local fix on a fundamentally wrong approach?
Include the tradeoff in every finding. A finding without a tradeoff is just a complaint.
---
## Step 4: Report findings
---
**Must fix:**
- `{file}:{line}` — {what breaks or violates and why} → fix: {concrete suggestion} | cost: {tradeoff}
**Worth addressing (will compound if left):**
- `{file}:{line}` — {the smell or gap} → suggestion: {cleaner approach} | cost: {tradeoff}
**Looks good:**
- {something specific that was done well}
---
Keep each finding to 2-3 sentences. If no must-fix items, say so clearly.
### Closing prompt
**If `--pr` was used** (reviewing an existing PR):
Ask: "Want me to address any of these, or post these findings as a comment on the PR?"
If the answer is to post: use `gh pr comment {pr} --body "{findings}"`. Do **not** offer to create a new PR — one already exists.
**If reviewing the current branch** (no `--pr`):
Ask: "Want to address any of these before opening the PR, or shall I go ahead and create it?"
If the answer is to create it: `gh pr create --title "{title}" --body "{body}"`. Mention any deferred items briefly in the PR body so reviewers are aware.
在 GitHub 查看