mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-31 22:23:27 +08:00
feat(ecc): prune plugin 43→12 items, promote 7 rules to .claude/rules/ (#245)
ECC community plugin pruning: removed 530+ non-essential files (.cursor/, .opencode/, docs/ja-JP, docs/zh-CN, docs/zh-TW, language-specific skills/agents/rules). Retained 4 agents, 3 commands, 5 skills. Promoted 13 rule files (8 common + 5 typescript) to .claude/rules/ for CC native loading. Extracted reusable patterns to EXTRACTED-PATTERNS.md.
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
# Python 模式
|
||||
|
||||
> 本文档扩展了 [common/patterns.md](../common/patterns.md),补充了 Python 特定的内容。
|
||||
|
||||
## 协议(鸭子类型)
|
||||
|
||||
```python
|
||||
from typing import Protocol
|
||||
|
||||
class Repository(Protocol):
|
||||
def find_by_id(self, id: str) -> dict | None: ...
|
||||
def save(self, entity: dict) -> dict: ...
|
||||
```
|
||||
|
||||
## 数据类作为 DTO
|
||||
|
||||
```python
|
||||
from dataclasses import dataclass
|
||||
|
||||
@dataclass
|
||||
class CreateUserRequest:
|
||||
name: str
|
||||
email: str
|
||||
age: int | None = None
|
||||
```
|
||||
|
||||
## 上下文管理器与生成器
|
||||
|
||||
* 使用上下文管理器(`with` 语句)进行资源管理
|
||||
* 使用生成器进行惰性求值和内存高效迭代
|
||||
|
||||
## 参考
|
||||
|
||||
查看技能:`python-patterns`,了解包括装饰器、并发和包组织在内的综合模式。
|
||||
Reference in New Issue
Block a user