agentleFS
wnzzerwnzzer/rank-analysis/.claude/skills/shipping-changes/SKILL.md

shipping-changes

Skill471 starsChanged 3 months agoMITView on GitHub

Use when src files in the rank-analysis repo (rank-analysis-app/**/*.ts, .vue, .rs) have just been edited via Edit/Write/MultiEdit, OR before any `git commit`, `git push`, or `gh pr create` in this repo. Symptoms include "I'm done with that change", "实现完了", a finished logical chunk of work, or about to invoke any commit/push/PR command.

  • Reads credentials
  • Commits and pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. harshnag/agent-engineering-practices★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Rule of thumb: never commit on main, never skip npm run check, never git add -A without reading git status first.

    line 15
  2. Very specific:

    If anything is red, fix the root cause — no --no-verify, no // eslint-disable, no #[allow(clippy::...)] unless the rule is genuinely wrong …

    line 50
  3. Very specific:

    Fix the root cause: Don't disable the rule, don't --no-verify, don't add // eslint-disable unless the rule is genuinely wrong for the case.

    line 85
  4. Very specific:

    Never --amend a pushed commit.

    line 123
  5. Distinctive:

    If any answer is uncertain, propose 2 alternative titles to the user before pushing.

    line 139
  6. Very specific:

    If git status shows the branch is far behind origin/main (10+ commits), rebase first to avoid merge conflicts in the PR:

    line 141

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Shipping Changes (rank-analysis)

Overview

Single source of truth for "the code changed — now what?" in this repo. Two trigger moments funnel into one skill:

  • A. Just edited code → run the quality gate, fix anything red, then continue editing or move to ship.
  • B. About to git commit / git push / gh pr create → run the full ship workflow (branch → gate → commit → push → PR).

Rule of thumb: never commit on main, never skip npm run check, never git add -A without reading git status first.

When to Use

Trigger A — code just edited (lightweight gate):

  • Edit / Write / MultiEdit just finished on files under rank-analysis-app/src/ or rank-analysis-app/src-tauri/src/
  • A logical chunk of work is done ("我改完这块了" / "feature 实现完了")
  • → Run §A. Stop there if not ready to commit yet.

Trigger B — about to commit / push / PR (full ship):

  • Next planned action is git commit, git push, or gh pr create
  • Returning to a dirty working tree and wrapping it up
  • → Run §1 → §4 (full workflow). §A is a subset of §2, so don't double-run.

Skip when:

  • WIP / experiment you don't intend to merge.
  • Doc-only edits outside rank-analysis-app/ (still commit, but quality steps are no-ops).

Direct push to main is acceptable for (skip §1 branch step, still run §2 gate):

  • Trivial typo / link fix in root docs (README*.md, CLAUDE.md) — no PR review value
  • Config-only changes under .claude/, .github/ where the maintainer is sole stakeholder
  • Single-line urgent hot-fix where every minute counts

For everything else — branch + PR + squash merge.

§A. Quick gate after edits

Run from rank-analysis-app/:

npm run check        # canonical gate: prettier + eslint + vue-tsc + cargo fmt --check + cargo clippy -Dwarnings
npm run test         # vitest — if you touched code that has (or should have) tests
cd src-tauri && cargo test && cd ..   # if Rust logic changed

If anything is red, fix the root cause — no --no-verify, no // eslint-disable, no #[allow(clippy::...)] unless the rule is genuinely wrong for the case. Re-run until clean.

Then either:

  • Continue editing (re-run §A after the next chunk), or
  • Move to §1 to ship.

Workflow

1. Snapshot the working tree

git status
git diff
git log --oneline -5

Decide the commit type from the diff (see §3). If still on main, branch first:

git switch -c <type>/<short-kebab-summary>

Branch name examples: feat/match-export, fix/lcu-reconnect, refactor/automation-manager.

2. Quality gate — CODE_QUALITY.md

Run from rank-analysis-app/:

npm run check        # = format + lint + typecheck + cargo fmt --check + cargo clippy -Dwarnings
npm run test         # vitest
cd src-tauri && cargo test && cd ..

npm run check is the canonical gate. If it fails:

  • Fix the root cause. Don't disable the rule, don't --no-verify, don't add // eslint-disable unless the rule is genuinely wrong for the case.
  • Re-run npm run check until clean. Then re-run git status — formatters may have rewritten files.

For UI changes, also npm run tauri dev and exercise the feature in the app. Type-check passing ≠ feature works.

3. Commit — Conventional Commits

⚠️ This repo is squash-merge-only. All commits on a PR collapse into one commit on main, and that commit's message defaults to the PR title (see §4). So:

  • Intermediate commits on the branch can be looser (wip, address review, fix typo are fine).
  • The PR title is the canonical entry — it's what lands in main, what cliff.toml parses, and what shows up in the next release's changelog.
  • Still prefer conventional format for branch commits — easier review, safer fallback if squash is ever bypassed.

Format: <type>: <short imperative summary> (Chinese summary OK; matches existing log).

typeuse for
featnew user-visible capability
fixbug fix
refactorinternal change, no behavior change
perfperformance improvement
styleformatting only (prettier/cargo fmt)
docsdocs / comments
testtests only
chorebuild, deps, tooling, version bumps

Stage files explicitly by name (never git add -A — it sweeps in .env, screenshots, untracked agent dirs):

git add rank-analysis-app/src/components/Foo.vue \
        rank-analysis-app/src-tauri/src/command/foo.rs
git commit -m "$(cat <<'EOF'
feat: 一句话说明做了什么以及为什么

可选的正文,解释非显然的取舍。
EOF
)"

Never --amend a pushed commit. Never --no-verify. If a hook fails, fix the underlying issue and create a NEW commit.

4. Push and open PR

🎯 PR title = squash commit message = changelog entry. This repo is configured to:

  • Squash-merge only (no merge commits, no rebase merge)
  • Default squash commit message = PR title (no commit-bullet noise)
  • Auto-delete remote branch on merge

So the PR title must be a valid conventional commit: <type>(<scope>): <summary>. Vague titles like update stuff / 修了一下 get skipped by cliff.toml and disappear from the release notes.

Before gh pr create, verify the proposed title (this becomes the squash commit + the only line cliff.toml parses):

  1. Does it parse as <type>(<scope>)?: <imperative summary>?
  2. Is the <type> one of: feat | fix | refactor | perf | style | docs | test | chore? (other types get skipped by .github/cliff.toml)
  3. Is the summary specific (feat(record): viewport 自适应) not vague (update record)?

If any answer is uncertain, propose 2 alternative titles to the user before pushing. A bad title silently disappears from the next release's changelog.

If git status shows the branch is far behind origin/main (10+ commits), rebase first to avoid merge conflicts in the PR:

git fetch origin main
git rebase origin/main
# resolve conflicts → re-run §2 quality gate → continue
git push -u origin HEAD
gh pr create --title "<type>(<scope>): <summary>" --body "$(cat <<'EOF'
## Summary
- bullet 1
- bullet 2

## Test plan
- [ ] `npm run check` passes
- [ ] `npm run test` passes
- [ ] `cargo test` passes
- [ ] Manual: <what you exercised in the app>
EOF
)"

Print the returned PR URL back to the user. After merge, no need to clean up — the remote branch auto-deletes.

Quick Reference

StepCommand
Quality gatecd rank-analysis-app && npm run check
Frontend testsnpm run test
Rust testscd src-tauri && cargo test
Branchgit switch -c <type>/<slug>
Commitgit commit -m "<type>: ..." (HEREDOC for body)
Pushgit push -u origin HEAD
PRgh pr create --title "<type>(<scope>): ..." --body ...
After mergeNothing — remote branch auto-deletes, only main stays

Common Mistakes

MistakeFix
Committing on maingit switch -c <branch>; git reset --soft origin/main only if nothing pushed
git add -A sweeping .claude/, .env, build artifactsStage by explicit path
Skipping npm run check because "it's a small change"Run it. Formatters reorder imports; typecheck catches drift
--no-verify to bypass a failing hookFix the hook's complaint; re-stage; new commit
git commit --amend after pushMake a fixup commit instead
Disabling clippy/eslint rule to silence a warningFix the code; only suppress with a comment explaining why
Vague commit (fix: bug, chore: update)Say what changed and why in one sentence
Vague PR title (update stuff, 修了一下)This is the squashed commit + changelog entry. Make it a real conventional commit
Forgetting Rust side when only frontend touched (or vice versa)npm run check runs both; trust the gate

Red Flags — STOP

  • "I'll just push and fix CI" → run npm run check locally first, it's faster than CI
  • "Hook is being annoying, --no-verify" → no
  • "The diff is too big to read, git add -A" → split the commit instead
  • "I'll amend the pushed commit" → fixup commit instead
  • "I'll just write a short PR title, cliff will figure it out" → no, vague titles get dropped from release notes. Always <type>(<scope>): <imperative summary>

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.