modular-code — скилл для Claude Code: что делает и как установить
Скилл modular-code для Claude Code делит крупные Python-файлы на модули по смыслу и слоям. Разделяет файлы со смешанными задачами и кодом, который трудно читать и тестировать.
MIT ★ 3 951 обновлён 2026-01-26
npx skills add parcadei/Continuous-Claude-v3 --skill modular-code -a claude-codeЧто делает modular-code
Скилл предлагает ориентиры по размеру файлов: 150–500 строк — рабочий диапазон, а файлы свыше 500 строк советует проверять на естественные места для разделения. Разбивать код только ради числа строк не стоит: модули можно выделять по предметной области, уровню абстракции, типам данных или операциям ввода-вывода.
Рекомендации охватывают структуру пакета, имена модулей и перенос функций из большого файла. При рефакторинге предлагается переносить связанные функции поэтапно, обновлять импорты и запускать тесты после каждого переноса. Для файлов на 2000 строк и больше в скилле указана необходимость разделения, но некоторые вычислительные модули могут быть исключением.
Какие задачи решает
- разделить файл с несвязанными задачами на модули
- выделить операции ввода-вывода из основной логики
- организовать функции по предметной области
- перенести части большого файла и обновить импорты
- подготовить структуру Python-пакета с моделями и обработчиками
Примеры запросов агенту
- Раздели этот Python-файл на модули по связанным задачам, сохранив понятные имена.
- Предложи структуру пакета для этого кода и отдели ввод-вывод от основной логики.
- Переноси функции из большого файла по группам, обновляй импорты и запускай тесты после каждого шага.
Как установить modular-code
1Через Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill modular-code -a claude-code2Вручную: положить файлы
~/.claude/skills/modular-code/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/modular-code/
1Через Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill modular-code -a codex2Вручную: положить файлы
.agents/skills/modular-code/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill modular-code -a cursor2Вручную: положить файлы
.cursor/skills/modular-code/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install parcadei/Continuous-Claude-v3 .claude/skills/modular-code2Вручную: положить файлы
.github/skills/modular-code/SKILL.md1Через Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill modular-code -a gemini-cli2Командой платформы
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/modular-codeВручную: положить файлы
.devin/skills/modular-code/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о modular-code
Как установить modular-code в Claude Code?
Выполните npx skills add parcadei/Continuous-Claude-v3 --skill modular-code -a claude-code. Файл скилла находится по пути ~/.claude/skills/modular-code/SKILL.md.
Что делает modular-code?
Скилл помогает организовать Python-код в модули с понятными границами и именами. Он также описывает поэтапный перенос функций из крупных файлов.
Когда modular-code советует разделять файл?
Среди ориентиров — размер свыше 500 строк, несвязанные задачи в одном файле и сложности с поиском функций или организацией тестов. Одного числа строк недостаточно: разделение должно следовать смысловым границам.
Исходный текст
SKILL.md · MIT
--- name: modular-code description: Modular Code Organization user-invocable: false --- # Modular Code Organization Write modular Python code with files sized for maintainability and AI-assisted development. ## File Size Guidelines | Lines | Status | Action | |-------|--------|--------| | 150-500 | Optimal | Sweet spot for AI code editors and human comprehension | | 500-1000 | Large | Look for natural split points | | 1000-2000 | Too large | Refactor into focused modules | | 2000+ | Critical | Must split - causes tooling issues and cognitive overload | ## When to Split Split when ANY of these apply: - File exceeds 500 lines - Multiple unrelated concerns in same file - Scroll fatigue finding functions - Tests for the file are hard to organize - AI tools truncate or miss context ## How to Split ### Natural Split Points 1. **By domain concept**: `auth.py` → `auth/login.py`, `auth/tokens.py`, `auth/permissions.py` 2. **By abstraction layer**: Separate interface from implementation 3. **By data type**: Group operations on related data structures 4. **By I/O boundary**: Isolate database, API, file operations ### Package Structure ``` feature/ ├── __init__.py # Keep minimal, just exports ├── core.py # Main logic (under 500 lines) ├── models.py # Data structures ├── handlers.py # I/O and side effects └── utils.py # Pure helper functions ``` ## DO - Use meaningful module names (`data_storage.py` not `utils2.py`) - Keep `__init__.py` files minimal or empty - Group related functions together - Isolate pure functions from side effects - Use snake_case for module names ## DON'T - Split files arbitrarily by line count alone - Create single-function modules - Over-modularize into "package hell" - Use dots or special characters in module names - Hide dependencies with "magic" imports ## Refactoring Large Files When splitting an existing large file: 1. **Identify clusters**: Find groups of related functions 2. **Extract incrementally**: Move one cluster at a time 3. **Update imports**: Fix all import statements 4. **Run tests**: Verify nothing broke after each move 5. **Document**: Update any references to old locations ## Current Codebase Candidates Files over 2000 lines that need attention: - Math compute modules (scipy, mpmath, numpy) - domain-specific, may be acceptable - patterns.py - consider splitting by pattern type - memory_backfill.py - consider splitting by operation type ## Sources - [The Hitchhiker's Guide to Python](https://docs.python-guide.org/writing/structure/) - [Python Project Best Practices - Dagster](https://dagster.io/blog/python-project-best-practices) - [Right-Sizing Python Files for AI Editors](https://medium.com/@eamonn.faherty_58176/right-sizing-your-python-files-the-150-500-line-sweet-spot-for-ai-code-editors-340d550dcea4) - [PEP 8 Style Guide](https://peps.python.org/pep-0008/)
© parcadei · MIT · parcadei/Continuous-Claude-v3