everything-claude-code-zh / rules
Cursor rule2k starsChanged 9 months agoMITView on GitHub
扩展通用规则的 Swift 编程风格
Trending
More talk lately.thin dataabout the whole repository
Who's talking about xu-xiang/everything-claude-code-zh
The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.
In this repository114 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- rules/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- examples/CLAUDE.mdCLAUDE.md
- .cursor/rules/common-agents.mdCursor rule
- .cursor/rules/common-coding-style.mdCursor rule
- .cursor/rules/common-development-workflow.mdCursor rule
- .cursor/rules/common-git-workflow.mdCursor rule
- .cursor/rules/common-hooks.mdCursor rule
- .cursor/rules/common-patterns.mdCursor rule
- .cursor/rules/common-performance.mdCursor rule
- .cursor/rules/common-security.mdCursor rule
- .cursor/rules/common-testing.mdCursor rule
- .cursor/rules/golang-coding-style.mdCursor rule
- .cursor/rules/golang-hooks.mdCursor rule
- .cursor/rules/golang-patterns.mdCursor rule
- .cursor/rules/golang-security.mdCursor rule
- .cursor/rules/golang-testing.mdCursor rule
- .cursor/rules/python-coding-style.mdCursor rule
- .cursor/rules/python-hooks.mdCursor rule
- .cursor/rules/python-patterns.mdCursor rule
- .cursor/rules/python-security.mdCursor rule
- .cursor/rules/python-testing.mdCursor rule
- .cursor/rules/swift-hooks.mdCursor rule
- .cursor/rules/swift-patterns.mdCursor rule
- .cursor/rules/swift-security.mdCursor rule
- .cursor/rules/swift-testing.mdCursor rule
- .cursor/rules/typescript-coding-style.mdCursor rule
- .cursor/rules/typescript-hooks.mdCursor rule
- .cursor/rules/typescript-patterns.mdCursor rule
- .cursor/rules/typescript-security.mdCursor rule
- .cursor/rules/typescript-testing.mdCursor rule
- api-designSkill
- article-writingSkill
- backend-patternsSkill
- coding-standardsSkill
- content-engineSkill
- e2e-testingSkill
- eval-harnessSkill
- frontend-patternsSkill
- frontend-slidesSkill
- investor-materialsSkill
- investor-outreachSkill
- market-researchSkill
- security-reviewSkill
- strategic-compactSkill
- tdd-workflowSkill
- verification-loopSkill
- oneskillSkill
- article-writingSkill
- content-engineSkill
- frontend-slidesSkill
- investor-materialsSkill
- investor-outreachSkill
- market-researchSkill
- api-designSkill
- article-writingSkill
- autonomous-loopsSkill
- backend-patternsSkill
- The first 60 shown.
The file
Files
Swift 编程风格
本文件在通用编程风格规则的基础上,增加了 Swift 特有的内容。
格式化(Formatting)
- 使用 SwiftFormat 进行自动格式化,使用 SwiftLint 进行风格检查(Enforcement)
swift-format已内置于 Xcode 16+ 中,可作为替代方案
不可变性(Immutability)
- 优先使用
let而非var—— 默认将所有内容定义为let,仅在编译器要求时才更改为var - 默认使用具有值语义(Value Semantics)的
struct;仅在需要唯一标识(Identity)或引用语义(Reference Semantics)时才使用class
命名(Naming)
遵循 Apple API 设计指南(Apple API Design Guidelines):
- 使用处清晰明了 —— 省略不必要的词汇
- 根据方法和属性的角色(Role)而非类型(Type)进行命名
- 优先使用
static let定义常量,而非全局常量
错误处理(Error Handling)
使用类型化抛出(Typed Throws,Swift 6+)和模式匹配(Pattern Matching):
func load(id: String) throws(LoadError) -> Item {
guard let data = try? read(from: path) else {
throw .fileNotFound(id)
}
return try decode(data)
}并发(Concurrency)
启用 Swift 6 严格并发检查。优先选择:
- 使用
Sendable值类型进行跨隔离边界的数据传输 - 使用 Actor 处理共享的可变状态(Shared Mutable State)
- 优先使用结构化并发(Structured Concurrency,如
async let、TaskGroup),而非非结构化的Task {}
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.

