一键导入
python-architect
Creates high-level Python architecture with protocols, test stubs, and module structure. Use when designing Python projects or features.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Creates high-level Python architecture with protocols, test stubs, and module structure. Use when designing Python projects or features.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Drive a GitHub issue — bare or tracked on a Project board — from triage to a merge-ready PR through a gated pipeline (design hardening, tests green, code-review clean), scaling the machinery to the task's tier and asking at most one batched question. Auto-links the issue to close on merge, advances the board card, then merges and cleans up once you approve the PR in-session. Triggers: "take task N", "work on issue #N", "do the next task", "build/fix X" when no issue exists yet, and — for the merge gate later — "merge it", "approve the PR", "ship it", "lgtm merge".
Slim or restructure an oversized CLAUDE.md into path-scoped .claude/rules/ files, verifying nothing was lost. Use when it exceeds ~200 lines, when Claude ignores instructions in it, or when choosing between CLAUDE.md, rules, skills and @import.
Use when removing AI-generation patterns from text in English or Russian. Auto-detects language by Cyrillic ratio and applies the matching ruleset. Trigger phrases: "humanize this", "remove AI patterns", "make this sound human", "очеловечить текст", "убрать признаки нейросети", "сделай текст живым". Honors explicit overrides like "humanize as English" / "обработай как русский". For mixed-language text, asks which ruleset to apply.
Reads input artifact(s) — codebase, planning session, refactor plan, or generic doc — and writes a tour-spec.json describing sections, embedded sources, cross-refs, quizzes, and external link maps. Use when the user wants a fresh learning guide built from source material; auto-hands-off to learning-guide:render. Trigger phrases — "create a learning guide for X", "make an interactive tour", "generate onboarding doc", "build a learning module".
Use when the user asks to "create a learning guide", "make an interactive tour", "generate onboarding doc", "build a learning module", or any variant of turning an artifact (codebase, planning session, refactor plan, design doc) into an interactive HTML guide. Dispatches to learning-guide:analyze for new tours or learning-guide:render for re-renders after spec edits. Also use when the user is uncertain which step they need.
Renders an existing tour-spec.json to a self-contained interactive HTML guide via the bundled Node renderer. Use when the user has hand-edited a tour-spec.json, when learning-guide:analyze hands off after drafting, or when the user explicitly asks to "render the tour", "regenerate the HTML", or "update the embedded sources". Idempotent for generated artifacts; preserves user-edited README and tour-spec.json.
| name | python-architect |
| description | Creates high-level Python architecture with protocols, test stubs, and module structure. Use when designing Python projects or features. |
| allowed-tools | Read, Glob, Grep |
You are a senior Python architect designing clean, testable systems.
pyproject.toml, Ruff/Flake8, mypy/pyright, framework conventions)project/
├── src/
│ └── package_name/
│ ├── __init__.py
│ ├── domain/ # Business logic
│ ├── services/ # Application services
│ ├── adapters/ # External integrations
│ └── config.py # Configuration
├── tests/
│ ├── unit/
│ ├── integration/
│ └── conftest.py
├── pyproject.toml
└── requirements.txt
from __future__ import annotations
from dataclasses import dataclass
from typing import Protocol
class UserRepository(Protocol):
def find_by_id(self, user_id: str) -> User | None: ...
def save(self, user: User) -> None: ...
@dataclass
class User:
id: str
name: str
email: str
class UserService:
def __init__(self, repository: UserRepository) -> None:
self._repository = repository
def get_user(self, user_id: str) -> User | None:
return self._repository.find_by_id(user_id)
import pytest
from unittest.mock import Mock
class TestUserService:
@pytest.fixture
def mock_repository(self) -> Mock:
return Mock(spec=UserRepository)
@pytest.fixture
def service(self, mock_repository: Mock) -> UserService:
return UserService(mock_repository)
def test_get_user_returns_user_when_exists(
self, service: UserService, mock_repository: Mock
) -> None:
# Arrange
expected_user = User(id="1", name="Test", email="test@example.com")
mock_repository.find_by_id.return_value = expected_user
# Act
result = service.get_user("1")
# Assert
assert result == expected_user
mock_repository.find_by_id.assert_called_once_with("1")
def test_get_user_returns_none_when_not_exists(
self, service: UserService, mock_repository: Mock
) -> None:
# Arrange
mock_repository.find_by_id.return_value = None
# Act
result = service.get_user("unknown")
# Assert
assert result is None
classDiagram
class UserRepository {
<<protocol>>
+find_by_id(id: str) Optional[User]
+save(user: User) None
}
class UserService {
-_repository: UserRepository
+get_user(id: str) Optional[User]
}
UserRepository <.. UserService
flowchart LR
API[API Layer] --> Service[Service Layer]
Service --> Repository[Repository Layer]
Repository --> DB[(Database)]