refactor-skill
Skill1.6k starsChanged 7 days agoApache-2.0View on GitHub
Apply practical guidance on readable code, domain modeling, modern C++, clean code, behavior-preserving refactoring, and design patterns when implementing, refactoring, or reviewing software.
3 other projects use a version of this.
Trending
Quiet since June.about the whole repository
Most recently taken up by
- vinta/hal-9000their own version, first seen Oct 21, 2026
- joeloverbeck/skill-evidencetheir own version, first seen Aug 23, 2026
- shawn-dumas/claude-code-skillstheir own version, first seen Mar 24, 2026
Who's talking about jd-opensource/xllm
- kvcache-ai/Mooncake“[TE] feat: setup the RDMA for mlu device.”GitHub · Apr 2, 2026 · 3 reactions
- MayDay-wpf/snow-cli“bufix: fix codebase and terminal execute confict.”GitHub · Jan 13, 2026 · 2 reactions
- xLLM-AI/xllm“build: remove xllm_ops build cache from npu ci script.”GitHub · Jun 15, 2026 · 1 reactions
- xLLM-AI/xllm“build: align xllm_ops marker path with ascend opp vendor. ”GitHub · Jun 12, 2026 · 1 reactions
- xLLM-AI/xllm“build: update xllm_ops submodule for stale cache cleanup.”GitHub · Jun 12, 2026 · 1 reactions
The biggest 5 of 20 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 20
Talked about on GitHub (20 times).
On GitHub · 20
- Apr 2, 2026[TE] feat: setup the RDMA for mlu device. — kvcache-ai/Mooncake3 reactions · 2 comments
- Jan 13, 2026bufix: fix codebase and terminal execute confict. — MayDay-wpf/snow-cli2 reactions
- Jun 15, 2026build: remove xllm_ops build cache from npu ci script. — xLLM-AI/xllm1 reaction
- Jun 12, 2026build: align xllm_ops marker path with ascend opp vendor. — xLLM-AI/xllm1 reaction
- Jun 12, 2026build: update xllm_ops submodule for stale cache cleanup. — xLLM-AI/xllm1 reaction
15 more on GitHub
- Jan 31, 2026[Roadmap] xLLM Roadmap H1 2026. — xLLM-AI/xllm1 reaction · 1 comment
- Jan 9, 2026[Question]: release的镜像如何使用,是否还需要编译 — xLLM-AI/xllm1 reaction · 7 comments
- Dec 27, 2025feat: add 'xllm --help' command. — xLLM-AI/xllm1 reaction · 2 comments
- Jun 3, 2026[Add] xLLM (jd-opensource/xllm) — PyTorchKR/landscape0 reactions · 3 comments
- May 11, 2026[Question]: Float8_e4m3fn has not been supported — xLLM-AI/xllm0 reactions · 2 comments
- Mar 4, 2026feat: support Qwen3-next on npu device. — xLLM-AI/xllm0 reactions · 4 comments
- Mar 3, 2026feat: support tool call in PD disagg mode. — xLLM-AI/xllm0 reactions
- Feb 2, 2026[Bug]: early return in prefetch_from_storage — xLLM-AI/xllm0 reactions
- Jan 16, 2026feat: support Qwen3-Omni-Thinker on NPU device. — xLLM-AI/xllm0 reactions · 2 comments
- Jan 14, 2026feat: support Qwen3-Omni-Thinker on NPU device. — xLLM-AI/xllm0 reactions
- Jan 9, 2026[Doc]: max_concurrent_requests代码和描述不一致 — xLLM-AI/xllm0 reactions · 1 comment
- Jan 4, 2026feat: support prefix cache for multi-modal model. — xLLM-AI/xllm0 reactions · 1 comment
- Dec 31, 2025 refactor: decouple the execution of vision encoder and llm. — xLLM-AI/xllm0 reactions · 4 comments
- Dec 9, 2025python setup.py build 遇到报错 — zai-org/GLM-V0 reactions · 1 comment
- Oct 24, 2025I'm currently trying to compile xllm on Ubuntu 22.04, but it fails with an error during the libsystemd build step. Is there a complete compilation guide available for Ubuntu-based systems? — xLLM-AI/xllm0 reactions · 2 comments
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- vinta/hal-9000★ 142same name
- shawn-dumas/claude-code-skills★ 1same name
- joeloverbeck/skill-evidence★ 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 repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/clang-format.mdcCursor rule
- .cursor/rules/move-copy-semantics.mdcCursor rule
- add-unit-testSkill
- code-reviewSkill
- git-workflowSkill
- tilelang-ascend-kernelSkill
- xllm-npu-profilerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. 0 are common, 23 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
23
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Use this skill when implementing or refactoring software, improving code structure, or reviewing design choices.
- Distinctive: line 39
Prefer one term for one concept, and avoid abbreviations unless they are established in the domain.
- Distinctive: line 41
Keep related operations and data close.
- Distinctive: line 48
Use comments to explain intent, constraints, tradeoffs, or surprising behavior.
- Distinctive: line 56
Start with the problem's vocabulary and boundaries.
- Distinctive: line 60
Use entities for identity and lifecycle, value objects for values defined by their attributes, and aggregates where invariants must be …
- Distinctive: line 63
Put each invariant and state transition with its natural owner.
- Distinctive: line 67
Keep DTOs, configuration, and parameter bundles simple when they are only carrying data.
- Very specific: line 70
Avoid generic Manager, Helper, or Common concepts when a precise domain name can state the responsibility.
- Very specific: line 86
Prefer const-correct interfaces, explicit conversions, and types that prevent invalid states.
- Distinctive: line 97
Never rely on virtual dispatch from a constructor or destructor to reach a more-derived implementation.
- Distinctive: line 108
Treat templates, overloads, conversions, inheritance, and operator overloading as interface design tools.
- Distinctive: line 115
Prefer standard containers and algorithms when they communicate intent.
- Distinctive: line 116
Consider allocation, copying, indirection, and locality for hot paths, but measure before claiming a performance benefit or complicating a …
- Very specific: line 122
Do not mechanically copy older idioms.
- Distinctive: line 131
Prefer cohesive functions, modules, and classes with clear inputs, outputs, dependencies, and side effects.
- Distinctive: line 137
Use errors, assertions, and validation to communicate the contract at the correct boundary.
- Distinctive: line 140
Keep tests focused on observable behavior and important invariants.
- Distinctive: line 147
When behavior is nontrivial, establish relevant tests or other executable evidence before restructuring.
- Distinctive: line 152
Keep each step easy to inspect and reverse.
- Distinctive: line 153
Run the narrowest useful checks after meaningful steps, then run the repository-required validation for the final change.
- Distinctive: line 160
Look for duplication, long or mixed-responsibility functions, misplaced responsibilities, excessive coupling, primitive values carrying …
- Distinctive: line 170
Use composition by default for assembling capabilities and data.
- Distinctive: line 173
Consider factories or registries for controlled construction and selection, strategies for interchangeable algorithms, adapters for …
- Distinctive: line 177
Keep abstractions aligned with real clients and boundaries.
- Distinctive: line 180
Check that a pattern leaves construction, ownership, error handling, and domain rules easier to understand than before.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Copyright 2026 The xLLM Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->Readable Design and Refactoring
Use this skill when implementing or refactoring software, improving code structure, or reviewing design choices. Apply the smallest set of principles that helps the current task. User instructions, repository guidance, language standards, and correctness take precedence.
The guidance below distills ideas associated with The Art of Readable Code, Domain-Driven Design, Effective C++, More Effective C++, Clean Code, Refactoring, and Design Patterns. It is engineering guidance, not a substitute for those books or a collection of quotations. Do not invent page references or present paraphrases as direct quotations. For C++, interpret older advice in the context of the project's current standard, libraries, and toolchain.
Make code easy to understand
- Choose names that reveal the domain meaning, intent, units, and constraints. Prefer one term for one concept, and avoid abbreviations unless they are established in the domain.
- Keep related operations and data close. Give functions one coherent purpose, keep their abstraction level consistent, and expose the normal path clearly.
- Simplify conditions and expressions when doing so makes intent easier to follow. Name a meaningful intermediate result instead of leaving readers to decode a long expression.
- Limit variable scope and lifetime. Initialize values near their first use, avoid mutable state that is not needed, and make data flow visible.
- Use comments to explain intent, constraints, tradeoffs, or surprising behavior. Do not use comments to compensate for misleading names or tangled control flow.
- Make error behavior and side effects apparent at the boundary. Prefer explicit types and contracts over implicit call ordering or repeated parsing.
Model the domain deliberately
- Start with the problem's vocabulary and boundaries. Use a consistent ubiquitous language within each bounded context, and translate explicitly at context boundaries.
- Introduce domain objects when they express meaningful rules or concepts. Use entities for identity and lifecycle, value objects for values defined by their attributes, and aggregates where invariants must be maintained together.
- Put each invariant and state transition with its natural owner. Keep application services focused on coordinating use cases, domain services on domain operations without a natural object owner, and infrastructure on external concerns.
- Keep DTOs, configuration, and parameter bundles simple when they are only carrying data. Do not turn every record into a behavior-rich class or force every class into a DDD category.
- Avoid generic
Manager,Helper, orCommonconcepts when a precise domain name can state the responsibility.
Apply C++ practices with current language tools
- Make ownership and lifetime explicit. Prefer RAII and standard-library
resource wrappers; use
std::unique_ptrfor sole ownership andstd::shared_ptronly when shared lifetime is truly required. Use raw pointers and references as non-owning access only when lifetime is clear. - Establish valid members and base subobjects during construction. Prefer member and base initializer lists over default construction followed by assignment, and list initializers in declaration order.
- Design copy and move operations intentionally. Understand whether a type owns resources, whether copying is valid, and whether moving preserves its invariants. Avoid accidental expensive copies, but do not add move machinery where the compiler already provides the desired behavior.
- Prefer const-correct interfaces, explicit conversions, and types that
prevent invalid states. Use
enum class,nullptr, and scoped types where they improve safety and clarity. - Make single-argument converting constructors
explicitunless implicit conversion is an intentional part of the type's interface. Keep operators unsurprising; prefer named operations when overloaded syntax would obscure meaning. - Make class interfaces safe to use: initialize members, define or delete special member functions according to ownership semantics, use virtual destructors for polymorphic bases, and avoid exposing mutable internals that bypass invariants.
- Never rely on virtual dispatch from a constructor or destructor to reach a more-derived implementation. Keep virtual interfaces substitutable, and avoid public inheritance when the derived type cannot honor the base contract.
- Handle exceptions with a clear safety guarantee and at the appropriate boundary. Preserve RAII cleanup, avoid partially updated state, and do not catch failures merely to hide them or continue with an invalid object.
- For operations that can fail, preserve a valid state at minimum; use the
strong guarantee (no observable state change on failure) when it is
practical and part of the contract. Mark operations
noexceptonly when they can uphold that promise. - Treat templates, overloads, conversions, inheritance, and operator overloading as interface design tools. Avoid surprising implicit behavior, slicing, name hiding, and inheritance where composition expresses ownership or reuse more clearly.
- Return values rather than references or pointers to local objects. Avoid exposing handles into private state when callers could outlive or mutate the owning object; make any necessary view's lifetime explicit.
- Prefer standard containers and algorithms when they communicate intent. Consider allocation, copying, indirection, and locality for hot paths, but measure before claiming a performance benefit or complicating a simple design.
- Pass small cheap-to-copy values by value, large read-only inputs by const reference or a suitable view, and retained sink arguments by value then move. Choose by the actual type and lifetime contract, not a blanket rule.
- Do not mechanically copy older idioms. Use current project guidance and
language facilities instead of obsolete constructs such as
auto_ptr, owning raw pointers, or manual resource management.
Keep code clean and changeable
- Reduce duplication when the same knowledge or rule must otherwise be changed in multiple places. Keep distinct policies separate even when their code currently looks similar.
- Prefer cohesive functions, modules, and classes with clear inputs, outputs, dependencies, and side effects. Do not split code into tiny helpers that merely add indirection without naming a useful concept.
- Make dependencies point toward stable policy. Keep I/O, frameworks, and storage details at explicit boundaries rather than letting them dictate the domain model.
- Use errors, assertions, and validation to communicate the contract at the correct boundary. Avoid defensive checks for conditions already guaranteed by a schema, constructor, or type.
- Keep tests focused on observable behavior and important invariants. Tests should support safe change, not encode private implementation details.
Refactor in behavior-preserving steps
- Identify the current behavior, the design problem, and the scope of the change. Inspect callers, ownership, state transitions, and error contracts.
- When behavior is nontrivial, establish relevant tests or other executable evidence before restructuring. Record externally observable behavior and edge cases that must remain stable.
- Make small transformations with one clear purpose: improve a name, extract a cohesive operation, move a rule to its owner, or introduce a boundary. Keep each step easy to inspect and reverse.
- Run the narrowest useful checks after meaningful steps, then run the repository-required validation for the final change. Reinspect the diff for accidental behavior changes and unrelated edits.
- Separate structural refactoring from intentional behavior changes where practical. If behavior must change, state the new contract and verify it directly.
Look for duplication, long or mixed-responsibility functions, misplaced responsibilities, excessive coupling, primitive values carrying domain meaning, and repeated conditional logic. Treat these as prompts to investigate, not automatic commands to add abstractions.
Choose design patterns only for real variation
- Begin with the responsibility or change pressure, not a catalog entry. Explain what varies, who owns that variation, and why the current design makes it difficult to change.
- Use composition by default for assembling capabilities and data. Use inheritance when substitutability is part of the contract, not merely to share implementation.
- Consider factories or registries for controlled construction and selection, strategies for interchangeable algorithms, adapters for incompatible interfaces, and facades for a simpler stable entry point—only when they solve an existing problem.
- Keep abstractions aligned with real clients and boundaries. Avoid speculative extension points, pattern-shaped wrappers, unnecessary virtual dispatch, shared ownership, or layers that only forward calls.
- Check that a pattern leaves construction, ownership, error handling, and domain rules easier to understand than before.
Completion checks
Before finishing, ask:
- Can a reader understand the names, normal flow, and failure behavior without reconstructing hidden conventions?
- Does each domain rule have a clear owner, and are context boundaries explicit where needed?
- Are ownership, lifetime, copy/move behavior, and object invariants safe and visible in C++ interfaces?
- Did the refactor preserve existing behavior except for changes explicitly requested?
- Does each new abstraction or pattern solve a concrete responsibility or variation problem?
- Did validation exercise meaningful behavior, and are any unverified claims clearly identified?
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
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.

