一键导入
refactoring
mach-mono refactoring rules — file-by-file approach, dependency tier order, extract-don't-delete, build after each file, commit granularity.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
mach-mono refactoring rules — file-by-file approach, dependency tier order, extract-don't-delete, build after each file, commit granularity.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | refactoring |
| description | mach-mono refactoring rules — file-by-file approach, dependency tier order, extract-don't-delete, build after each file, commit granularity. |
| user-invocable | false |
Full reference:
docs/AGENT-GUIDELINES.md→ Refactoring Rules.
Fix all violations in one pass when touching a file. Don't leave partial fixes:
.shared singleton accessDefaults[.] with settings injection@Observable / @MainActor if missingWork tier-by-tier to avoid cascading breaks:
| Tier | Description | Approach |
|---|---|---|
| 1 — Leaf | No downstream dependents | Safe to change first |
| 2 — Hub | Consumed by Tier 1 | Change after Tier 1 is clean |
| 3 — God objects | Decompose last | Break apart after tiers 1+2 stable |
When splitting large files:
bazelisk build //Apps/machNotch:machNotch passesNever delete code without first verifying the replacement is working.
bazelisk build //Apps/machNotch:machNotch
Don't batch multiple files without verifying between them.
One commit per logical unit — enables clean rollbacks:
refactor: eliminate .shared from VolumeManager ✅
refactor: fix everything ❌
Swift code quality rules for mach-mono — 300-line file limit, @Observable, no singletons in views, no direct Defaults access, protocol-based services. Auto-loaded when editing .swift files.
mach-mono visual design rules — minimalistic aesthetic, clarity, cohesion, tech-forward style, iconography. Auto-loaded when working on UI/view files.
mach-mono git branching, integration, and release workflow — main as canonical branch, topic branches, commit shape, deploy via tags.
machNotch plugin architecture rules — NotchPlugin protocol, lifecycle, DI via PluginContext, HUD event bus, PluginSettings. Auto-loaded when working in Plugins/.
Save session context before ending a conversation. Updates CLAUDE.md with learnings and creates a session summary for resuming work later.
Expert guidance on Swift Concurrency best practices, patterns, and implementation. Use when developers mention: (1) Swift Concurrency, async/await, actors, or tasks, (2) "use Swift Concurrency" or "modern concurrency patterns", (3) migrating to Swift 6, (4) data races or thread safety issues, (5) refactoring closures to async/await, (6) @MainActor, Sendable, or actor isolation, (7) concurrent code architecture or performance optimization, (8) concurrency-related linter warnings (SwiftLint or similar; e.g. async_without_await, Sendable/actor isolation/MainActor lint).