Introduction¶
When writing code with AI, the common friction is not “can’t write it,” but rather the output being too long: explanatory fluff, obvious comments, creating numerous files for tiny changes, or adding unrequested capabilities. Fixing these results manually is often slower than writing from scratch.
Below introduces clean-code on SkillHub (coord @org-02qudk26/clean-code-zh). It writes a set of executable coding principles into the Agent’s Skill documentation, constraining the model during coding, bug fixing, and small-scale refactoring: less abstraction, less fluff, delivering runnable changes first.
What is This¶
clean-code is a programming Agent Skill based on the generic SKILL.md format. The SkillHub page matches the metadata inside the package. The current version is 2.0.0, source is enterprise, publisher is Zhiyu Tech, category dev-programming; requires_api_key=false, and installing this Skill itself does not depend on an extra API Key.
One-sentence positioning: use tabular principles, naming and function specifications, anti-pattern checklists, and a “check dependencies before editing files” rule to keep the Agent concise, direct, and problem-solving centered.
Core Features¶
The following content comes from the SKILL.md inside the installed v2.0.0 package. These are constraints declared by the Skill to the Agent, not a standalone CLI tool.
Coding Principles and Style¶
The Skill summarizes five basic principles in a table: Single Responsibility, DRY (Don’t Repeat Yourself), Keep It Simple, YAGNI (You Aren’t Gonna Need It), and the Boy Scout Rule (leave code cleaner than you found it).
Naming conventions: variables should be meaningful (e.g., userCount), functions should be verb+noun (e.g., getUserById()), booleans should be phrased as questions (isActive, hasPermission), and constants should use uppercase snake_case. It also clarifies: if a comment is needed to explain a name, the name should be changed instead.
Function conventions: small body (suggested max ~20 lines, ideal 5–10 lines), do one thing, minimize parameters (max 3, prefer 0–2), avoid implicit side effects.
Structure and style encourage: using guard clauses for edge cases, limiting nesting depth (suggested max 2 levels), composing with small functions, and placing related code close together.
Interaction with Users¶
The Skill specifies the Agent’s default reaction in coding scenarios: if the user requests a feature, write code directly; if the user reports an error, fix the issue first and avoid lengthy explanations; if requirements are unclear, ask questions instead of making assumptions.
Anti-Pattern Checklist¶
The document lists forms that need to be avoided and compares them with corresponding actions, for example: delete obvious comments, avoid creating helper functions for a single line of logic, avoid excessive nesting, use named constants to replace magic numbers, split “God functions” with too many responsibilities, etc.
Dependency Check Before Editing¶
Before changing any file, the Skill requires the Agent to self-check: who imports the file, what the file depends on, which tests cover it, and whether it is a shared component. The rule emphasizes: affected dependencies and imports should be handled together within the same task, leaving no broken interfaces or missed updates.
Self-Check Before Completion¶
Before claiming a task is complete, the Skill lists items to check: whether the user’s requirements are met precisely, whether all necessary files were changed, whether changes were verified, and whether Lint/type checks passed, and if edge cases were missed.
Validation Scripts (Optional, Conditional)¶
The latter part of the document includes an “Agent -> Script” mapping table. For example, general scenarios can run Python scripts under the skill directory like lint-and-validate, and it stipulates that output must be parsed first, summarized to the user, and confirmed before fixing. These script paths point to the installation directories of other Skills. When only installing clean-code, most commands in this table may not exist locally; they should be regarded as extension instructions to be used in conjunction with specialized skills, not as built-in executables of this Skill.
The frontmatter in the package also declares allowed-tools: Read, Write, Edit and priority: CRITICAL, indicating that after enabling, these guidelines should participate in Agent decision-making with high priority.
Installation and Activation¶
The installation process follows the SkillHub official instructions: first confirm that skillhub CLI is installed on the machine, then install the Skill to the skills directory actually read by the current Agent; when not specifying --dir, it defaults to ./skills/, and the Agent may fail to load.
1. Check or Install SkillHub CLI¶
command -v skillhub && skillhub --version
If not installed, follow the SkillHub installation documentation (full installation example):
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
2. Install clean-code¶
skillhub install clean-code-zh --namespace org-02qudk26 --dir <你的 Agent skills 目录>
Common Agent skills directories (excerpted from SkillHub installation documentation):
| Environment | skills directory |
|---|---|
| Cursor | ~/.cursor/skills/ |
| Claude Code | ~/.claude/skills/ |
| Codex | ~/.codex/skills/ or .agents/skills/ under the project |
After successful installation, this Skill will land in a subdirectory similar to @org-02qudk26/clean-code-zh. The specific way to enable it depends on each Agent’s discovery mechanism for Skills; generally, placing the directory in the path above and restarting or refreshing the Agent is enough to participate in the conversation.
The official page also suggests referring to: https://skillhub.cn/install/skillhub.md
Typical Usage¶
This Skill does not provide a separate business API. Typical usage is to keep the Skill enabled during sessions where coding, bug fixing, or small-step refactoring is needed, and let the Agent automatically follow the tables and rules in SKILL.md.
You can understand the Skill’s intent by comparing the three scenarios in the README.md inside the package (these are explanatory materials, not real test cases):
- Before modifying the shared
UserService, track callers and tests first; if parameter semantics change, update controllers and types synchronously to avoid breaking interfaces by changing only one file. - Change nested approval logic to guard clauses and small functions to return early on invalid states.
- When two form validations are similar, extract shared validation only when logic is stable and there is definite reuse value, avoiding factories or new files for a single line of logic.
In daily conversation, you can directly propose specific tasks (e.g., “Fix the 500 on an interface, don’t give a long explanation”), and the Skill will reinforce behaviors like “change code directly, ask before assuming for unclear requirements”; if the team wants to run Lint before delivery, provided the corresponding validation Skill is installed, you can execute checks following the script flow in SKILL.md.
Suitable Scenarios and Notes¶
Suitable for:
- Teams or individuals who want the Agent to write less tutorial-style output, less over-engineering, and prioritize small, verifiable changes.
- As a permanent coding behavior constraint (
priority: CRITICAL) on Agents that support Skill directories, such as Cursor, Claude Code, and Codex.
Notes:
- SkillHub page statistics (as of data scraping): rating approx 100000, downloads 726, install count 0 (platform display value, does not represent local usage).
- The validation scripts in the documentation depend on paths of other Skills; do not blindly copy the commands if those Skills are not installed together, to avoid “file not found” errors.
- The Skill requires “check dependencies before editing code” and “self-check before completion.” In large monoliths or repositories lacking test information, the Agent still requires you to supplement context; it cannot replace manual architecture reviews.
- The guidelines are pragmatic, in-line, and file-minimal, which may conflict with codebase styles that have strong layering and heavy interface abstraction. It is advisable to align with team standards before enabling.
Conclusion¶
clean-code puts concise coding, naming and function specifications, anti-patterns, and pre-edit dependency checks into readable Skill documents for Agents, used to reduce redundant explanations and over-abstraction in AI coding. If you are selecting a programming Skill on SkillHub, you can install it to the current Agent’s skills directory using the commands above.
- SkillHub Page: https://www.skillhub.cn/skills/org-02qudk26/clean-code-zh
- API Coordinate Page: https://api.skillhub.cn/org-02qudk26/clean-code-zh