Agent skill

Zhihu Instrument Test Governance

by zly2006 in zly2006/zhihu-plus-plus

Audit, add, migrate, or remove Zhihu++ Android instrument tests under app/src/androidTest.

AGPL-3.0Auto-check passedTesting & QA

Install Zhihu Instrument Test Governance

skills CLI
$ npx skills add zly2006/zhihu-plus-plus --skill zhihu-instrument-test-governance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zly2006/zhihu-plus-plus zhihu-instrument-test-governance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zly2006/zhihu-plus-plus.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/zhihu-instrument-test-governance .claude/skills/zhihu-instrument-test-governance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
zhihu-instrument-test-governance
GitHub stars
4.2k
Token cost
~2.4k tokens
SKILL.md length
1,332 words
Files
3 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Audit, add, migrate, or remove Zhihu++ Android instrument tests under app/src/androidTest.

  • Works in 6 steps: Establish an isolated cleanup surface → Build a per-test audit → Apply the deletion gate → …
  • Instrument-test cleanup
  • SKILL.md covers 回归与数据边界, Non-negotiable Rules, Required Provenance Block and Workflow, plus 1 more section
  • Calls gradle and git

What it does

Zhihu Instrument Test Governance is an agent skill from zly2006/zhihu-plus-plus. Audit, add, migrate, or remove Zhihu++ Android instrument tests under app/src/androidTest. Use for instrument-test cleanup, flaky device-test reduction, regression-test provenance, deciding whether a UI test belongs on an emulator, or reviewing a PR that changes permanent Android instrument coverage.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `agents/openai.yaml` and `references/provenance-and-decisions.md`).

It sits in Testing & QA. It works with Android. The repository describes itself as: Zhihu++ | 知乎++: Ad-free, low cost, AI powered zhihu android 3rd-party client. 去广告、占用低、AI大模型的新时代知乎安卓端体验. The licence is AGPL-3.0.

When your agent uses it

  • Instrument-test cleanup
  • Flaky device-test reduction
  • Regression-test provenance
  • Deciding whether a UI test belongs on an emulator

Example prompts

  • “/zhihu-instrument-test-governance”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Establish an isolated cleanup surface
  2. Build a per-test audit
  3. Apply the deletion gate
  4. Review test quality without weakening coverage
  5. Validate proportionally
  6. Publish an auditable cleanup PR

What it can do on your machine

Read from SKILL.md and the folder at commit eb9d9a7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gradle
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Zhihu Instrument Test Governance loads about 2.4k tokens when it runs, and up to ~3.3k if it reads all its reference files. Until then it costs about 84 tokens; SKILL.md has 1,332 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~84
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from zly2006/zhihu-plus-plus at commit eb9d9a7, republished under its AGPL-3.0 licence (© zly2006). 1,332 words, ~2,449 tokens.

Download SKILL.mdSave it as .claude/skills/zhihu-instrument-test-governance/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
zhihu-instrument-test-governance
description
Audit, add, migrate, or remove Zhihu++ Android instrument tests under app/src/androidTest. Use for instrument-test cleanup, flaky device-test reduction, regression-test provenance, deciding whether a UI test belongs on an emulator, or reviewing a PR that changes permanent Android instrument coverage.

Zhihu++ Instrument Test Governance

回归与数据边界

新增回归用例前必须在基线得到可复现失败,再在修复版本用同一用例验证通过。不得为注入时间或伪造后端数据新增一次性生产 helper;线上数据变更必须走真实服务端写入与读回,不能用 seed 冒充。

Treat emulator time as a recurring maintenance cost. Keep it only where a real product contract or historical regression needs Android, Compose, window, lifecycle, accessibility, or device integration to prove the behavior.

Non-negotiable Rules

  1. Never delete a test that protects a bug which actually occurred.
  2. Every retained @Test must have verified issue and fixing/introducing PR links next to it. Never invent provenance.
  3. Keep test cleanup out of feature and bug-fix PRs. Use a dedicated branch, worktree, commit, and PR.
  4. Do not add a permanent instrument test merely to confirm a low-risk visual choice once. Build the APK and capture a real before/after screenshot instead. A temporary instrument test may capture a screenshot for review. After retrieving the image, restore the test source to its original state before committing or submitting a PR. Permanent tests may capture pixels in memory only when those pixels support a meaningful visual assertion; do not retain screenshot file output or a screenshot-only assertion.
  5. Do not run the complete instrument suite locally unless the user explicitly asks. Prefer compilation, the smallest relevant test, or GitHub CI.
  6. Flakiness, runtime, or inconvenience never justify deleting a proven regression test. Repair its synchronization, fixture, or execution boundary.
  7. A test must assert user-observable behavior or a proven regression, not copy an implementation constant list into assertions. Delete tests that only restate the current source shape without an independent contract; validate the behavior through real interaction, build, or focused regression evidence instead.
  8. Every retained regression test must be red against the pre-fix implementation. Temporarily restore the old behavior (or run the test against the parent revision) and record the failing assertion before accepting the test.
  9. Every retained test must document both the related issue and the fixing or introducing PR with full URLs in its provenance KDoc.
  10. Every retained test must state the target state, what it verifies, and why the assertion protects that behavior; a bare test name or implementation-detail assertion is insufficient.
  11. Before stopping, execute every changed regression test against both the pre-fix implementation (must fail) and the fixed implementation (must pass). Record the exact red/green evidence; compilation alone is not sufficient.
  12. Every PR that adds or changes tests must state in its body, per test, whether red-to-green verification was completed, including the commands and terminal results or an explicit blocker.

Read references/provenance-and-decisions.md before changing tests.

Required Provenance Block

Place a KDoc block immediately above the annotations for every permanent test:

kotlin
/**
 * Regression: https://github.com/zly2006/zhihu-plus-plus/issues/123
 * Fixed by: https://github.com/zly2006/zhihu-plus-plus/pull/456
 */
@Test
fun restoredBehaviorStaysStable() = Unit

For a feature contract rather than a reported regression, use:

kotlin
/**
 * Contract: https://github.com/zly2006/zhihu-plus-plus/issues/123
 * Introduced by: https://github.com/zly2006/zhihu-plus-plus/pull/456
 */
@Test
fun featureContractStaysStable() = Unit

Both URLs are required. A commit hash, branch name, issue number without a URL, current cleanup PR, or a guessed related report is not historical provenance.

An introducing PR without an issue is not enough. A smoke test has no exemption. If no verified pair exists, record the test as UNVERIFIED in the audit. Do not add a fake block merely to make a checker pass, and do not create a retrospective issue solely to legalize an existing test.

Workflow

1. Establish an isolated cleanup surface
  • Fetch the intended base and create a dedicated worktree from it.
  • Record the base SHA.
  • Inventory staged, unstaged, and untracked files before editing.
  • Do not touch a feature worktree or a dirty main checkout.
  • Never set or change GRADLE_USER_HOME.
  • Never run gradle --stop or ./gradlew --stop.
  • If a task-owned Gradle process must be stopped, first prove the exact PID, cwd, and command belong to this worktree; terminate only that process.
2. Build a per-test audit

Inventory every @Test under app/src/androidTest. For each test record:

  • file and test name;
  • verified issue URL;
  • verified fixing or introducing PR URL;
  • classification: REGRESSION, CONTRACT, SMOKE, or UNVERIFIED;
  • why an Android device is necessary;
  • overlapping cheaper coverage;
  • decision: keep, migrate, consolidate, or delete;
  • evidence for that decision.

Use git history as the starting point, then read the linked issue and PR. Search by the test name, nearby production symbols, commit SHA, and user-visible behavior. A filename containing an issue number is a clue, not proof.

3. Apply the deletion gate

Use this order for every test:

  1. If it covers a real historical bug, keep it. Consolidation is allowed only when another retained test proves the same regression at least as strongly and carries the same provenance.
  2. If it protects a current product contract, keep it only when the assertion genuinely needs Android/device behavior.
  3. If the contract is valuable but device execution is unnecessary, migrate the coverage to the cheapest appropriate JVM/common test before removing the instrument version.
  4. If it only captures a one-time visual preference, implementation detail, duplicate fixture plumbing, or behavior already proven more strongly elsewhere, remove it.
  5. If provenance or equivalence is uncertain, keep it pending more evidence. Uncertainty is not permission to delete.

SMOKE is an audit classification, not an exemption. A smoke test can remain permanent only when a verified issue and PR document why that device-level signal matters. A pure reducer, mapping, or list transform cannot be retained by renaming it a smoke test.

Show full SKILL.md (484 more words)Show less
4. Review test quality without weakening coverage

For retained tests:

  • add the verified provenance block;
  • assert user-observable behavior, not only internal state or that composition did not crash;
  • replace fixed sleeps with semantics, idling, clock control, or explicit state waits;
  • keep fixtures deterministic and local when the behavior does not require the network;
  • split unrelated behaviors so a failure identifies one contract;
  • remove duplicate setup only when the remaining support object carries a real shared contract.

Do not create helper layers that merely rename a single Compose assertion or navigation call.

If a proven regression remains flaky after a scoped repair attempt, keep its code and provenance. Temporary isolation is allowed only with a new follow-up issue that records the failure mode, owner, restoration condition, and affected CI lane; never silently disable it or delete it to make checks green.

5. Validate proportionally

After edits:

  1. Run the provenance audit command from the reference.
  2. Run git diff --check.
  3. Run formatting.
  4. Compile the affected androidTest source set if the project exposes a suitable task.
  5. Run only targeted instrument tests when device-specific behavior or a changed fixture needs execution.
  6. Let GitHub CI run the complete suite and follow it to a terminal result when CI is the acceptance boundary.

Do not describe an in-progress check as green or a compiled test as behaviorally executed.

Removing or migrating the test that emitted the visible ANR/error does not by itself fix a stalled shard. Inspect the shard's last START/PASS, active workflow step, and runner/process teardown state to distinguish a test-body hang from Activity focus cleanup or runner-shell deadlock, then require the replacement run to reach a terminal result.

When a regression contract does not depend on Android framework or device behavior, migrate it to the cheapest common/JVM layer and remove the redundant instrument test. Preserve historical device regressions unless equivalent coverage is demonstrated; never delete them merely to make the shard terminate.

6. Publish an auditable cleanup PR

The Chinese PR body must include:

  • base SHA and the exact instrument-test inventory before/after;
  • a keep/migrate/consolidate/delete count;
  • every deleted test and why it passed the deletion gate;
  • the issue/PR pair and classification for every retained test;
  • confirmation that no historical regression coverage was deleted;
  • the validation actually completed and checks still running;
  • a note that the PR contains no product behavior change.

Read the PR back after creation and verify title/body language, head/base, diff scope, and mergeability.

Stop Conditions

Stop deletion and gather more evidence when:

  • an issue or PR link cannot be verified;
  • a test name suggests a regression but history is unclear;
  • cheaper coverage looks similar but does not assert the same user-visible outcome;
  • removing a fixture would silently reduce several retained tests;
  • the only reason to delete is suite duration or flakiness.

When blocked, keep the test and document the unresolved provenance. Conservative retention is cheaper than silently reintroducing a known bug.

© zly2006, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .agents/skills/zhihu-instrument-test-governance of zly2006/zhihu-plus-plus.

  • SKILL.md
  • agents/openai.yaml
  • references/provenance-and-decisions.md

Open the folder on GitHubat commit eb9d9a7

Compare with similar skills

Zhihu Instrument Test Governance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Zhihu Instrument Test Governance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Zhihu Instrument Test Governance this skillzly2006/zhihu-plus-plus4.2k—~2.4kAutomated safety check: PassAGPL-3.0
E2Ecallstack/react-native-pager-view3.4k3 repos~2.1kAutomated safety check: PassMIT
Diagnoseywwynm/EverythingDone14417 repos~1.8kAutomated safety check: PassGPL-3.0
SoloPi AI Controlalipay/SoloPi6.3k—~3.6kAutomated safety check: PassApache-2.0
Testing SkillTypeCellOS/BlockNote10k—~2.6kAutomated safety check: PassCustom licence
Mesh Labpermissionlesstech/bitchat-android7.8k—~2.9kAutomated safety check: PassGPL-3.0

Similar skills

  • E2E

    callstack/react-native-pager-view

    Agentic end-to-end tests with e2e, the e2e runner. An agent skill from callstack/react-native-pager-view.

    3.4k GitHub starsUsed in 3 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Diagnose

    ywwynm/EverythingDone

    Disciplined diagnosis loop for hard bugs and performance regressions.

    144 GitHub starsUsed in 17 repos~1.8k tokens
    Testing & QAAuto-check passed
  • SoloPi AI Control

    alipay/SoloPi

    Drives Android devices through SoloPi's typed command line to record, replay and verify app behavior, with device pools and signed on-device decision models.

    6.3k GitHub stars~3.6k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Testing Skill

    TypeCellOS/BlockNote

    Instructions for writing, running, and updating unit/end-to-end tests.

    10k GitHub stars~2.6k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Mesh Lab

    permissionlesstech/bitchat-android

    Run, diagnose, and extend bitchat Android Mesh Lab physical-device tests.

    7.8k GitHub stars~2.9k tokensUpdated today
    Testing & QAAuto-check passed
  • BrowserStack Live Testing

    handsontable/handsontable

    Opens a live BrowserStack session on a real Android, iOS or desktop browser for a local or public URL, tunneling localhost through Cloudflare when needed.

    22k GitHub stars~950 tokensUpdated yesterday
    Testing & QAAuto-check passed

More from zly2006/zhihu-plus-plus

All 11 skills in this repo
  • Zhihu Pp AI Slop Cleaner

    zly2006/zhihu-plus-plus

    A skill your agent uses for Zhihu++ maintenance work that scans Kotlin main sources for low-call functions, structurally similar function bodies, dead code, pure forwarding wrappers, pointless…

    4.2k GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • GitHub PR Assets

    zly2006/zhihu-plus-plus

    Manage screenshots and other visual assets for GitHub pull requests.

    4.2k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Launch On Device

    zly2006/zhihu-plus-plus

    Build, install, and launch the Zhihu++ Android app on a connected device using ADB.

    4.2k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Picky User

    zly2006/zhihu-plus-plus

    以 subagent 启动的 UI 挑剔用户评审。Use when the user, AGENTS, or the current task requires “挑剔的用户”.

    4.2k GitHub stars~744 tokensUpdated today
    Auto-check passed
  • Release Latex Fork

    zly2006/zhihu-plus-plus

    Release the LaTeX fork used by Zhihu++. An agent skill from zly2006/zhihu-plus-plus.

    4.2k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Zhihu Parallel PR Workflow

    zly2006/zhihu-plus-plus

    Coordinate Zhihu++ issue implementation and pull requests when the user explicitly asks for subagents or when multiple independent issues or scopes have real parallel value.

    4.2k GitHub stars~2.4k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Zhihu Instrument Test Governance

What does Zhihu Instrument Test Governance do?

Audit, add, migrate, or remove Zhihu++ Android instrument tests under app/src/androidTest. Zhihu Instrument Test Governance is an agent skill from zly2006/zhihu-plus-plus. Audit, add, migrate, or remove Zhihu++ Android instrument tests under app/src/androidTest.

When should I use Zhihu Instrument Test Governance?

Zhihu Instrument Test Governance fits situations like: instrument-test cleanup; flaky device-test reduction; regression-test provenance; deciding whether a UI test belongs on an emulator.

How do I install Zhihu Instrument Test Governance in Claude Code?

Run `npx skills add zly2006/zhihu-plus-plus --skill zhihu-instrument-test-governance -a claude-code`. Or copy the skill folder (.agents/skills/zhihu-instrument-test-governance in zly2006/zhihu-plus-plus) into .claude/skills/zhihu-instrument-test-governance in your project. Claude Code loads it when a task matches its description.

How do I install Zhihu Instrument Test Governance in Codex?

Run `npx skills add zly2006/zhihu-plus-plus --skill zhihu-instrument-test-governance -a codex`. Or copy the skill folder (.agents/skills/zhihu-instrument-test-governance in zly2006/zhihu-plus-plus) into .agents/skills/zhihu-instrument-test-governance in your project. Codex loads it when a task matches its description.

Can I use Zhihu Instrument Test Governance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zly2006/zhihu-plus-plus --skill zhihu-instrument-test-governance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/zhihu-instrument-test-governance, .gemini/skills/zhihu-instrument-test-governance, .github/skills/zhihu-instrument-test-governance and .opencode/skills/zhihu-instrument-test-governance in your project.

What does Zhihu Instrument Test Governance need to run?

Going by SKILL.md and its folder, Zhihu Instrument Test Governance needs the command-line tools its instructions call (gradle and git).

Does Zhihu Instrument Test Governance access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Zhihu Instrument Test Governance safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Zhihu Instrument Test Governance use?

Zhihu Instrument Test Governance is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Zhihu Instrument Test Governance use?

About 2.4k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 806 tokens, read only when the agent opens those files.

What are the alternatives to Zhihu Instrument Test Governance?

Skills that share tags, products or a category with Zhihu Instrument Test Governance: E2E (callstack/react-native-pager-view, 3.4k stars), Diagnose (ywwynm/EverythingDone, 144 stars), SoloPi AI Control (alipay/SoloPi, 6.3k stars) and Testing Skill (TypeCellOS/BlockNote, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Zhihu Instrument Test Governance?

zly2006 (a GitHub user) maintains it in zly2006/zhihu-plus-plus, which has 4,229 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 10, 2026.

Source: zly2006/zhihu-plus-plus on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.