Borrowing it
Nothing to install: this file belongs to MCB-SMART-BOY/nixos-config. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/MCB-SMART-BOY/nixos-config/solo/.claude/skills/refactor/SKILL.mdgit clone --depth 1 https://github.com/MCB-SMART-BOY/nixos-configWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mcb-smart-boy/nixos-config/refactor)<a href="https://agentmods.dev/skills/mcb-smart-boy/nixos-config/refactor"><img src="https://agentmods.dev/badge/skills/mcb-smart-boy/nixos-config/refactor.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00045 | $0.00517 |
| Opus 5 | $0.00023 | $0.00259 |
| Sonnet 5 | $0.00009 | $0.00103 |
| Haiku 4.5 | $0.00005 | $0.00052 |
Grade A, and why
refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Refactor
原则
不改行为、小块提交、每次改动后 nix flake check、保留中文注释。
操作清单
A. 提取模块
- 识别可独立逻辑块(>150 行或清晰语义边界)
- 创建
modules/<name>.nix - 在
modules/default.niximports 中按类别插入 - 从原文件删除已移动配置
nix flake check
不提取:逻辑高度耦合(greetd+regreet)、<50 行独立功能、导致复杂模块间依赖。
B. 清理 tryEval 与用户输出边界
modules/lib.nix提供统一的resolvePkg与managedUserNames,系统模块必须复用,不能本地重定义- Home Manager 的用户入口校验、NixOS 上下文投影和 Home Manager 输出聚合属于独立 mcbctl 项目,不与 NixOS 模块共享实现
- 新增弹性包解析逻辑请使用
resolvePkg,不要手动实现;不要在同一项目内复制用户列表 fallback
C. 清理 overlay
当前没有本地 overlay。新增前先确认锁定 nixpkgs 未原生解决问题;仅在确有必要时添加,并附带上游 issue 与移除条件。
D. 去重包列表
- 系统基础设施保留在 NixOS
modules/packages.nix,由独立系统开关控制;gaming 跟随programs.steam.enable - 用户应用与偏好放在 mcbctl
/home/admin/mcbctl/profiles/;不要让 profile 反向设置 NixOS 系统包开关 - 检查 mcbctl 16 个 profile 间包重叠并合并/拆分;游离用户包归入对应 profile,确保在 mcbctl
profiles/default.nix注册
F. 死代码扫描
deadnix --fail .
statix check
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago Changed · +1 lines c338e435c7d1
- 7d ago First seen · 40 lines · 45 tokens per session scan A a07f1838032f
refactor is a skill published in the GitHub repository MCB-SMART-BOY/nixos-config (10 stars, last pushed 2d ago), licensed Apache-2.0. It adds 45 tokens to every session and 517 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…
babysit-pr
Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…