mas-module-boundary
БесплатноБез исполняемых скриптовНе проверенDefine and enforce backend module boundaries for Python services. Use when adding or refactoring backend code under app/, reviewing dependency direction…
от AUTO-MAS-Project★ 821 звезда на GitHubОб этом скилле
MAS Module Boundary
Objective
Keep backend code maintainable by enforcing clear ownership, dependency direction, and placement rules across modules.
Layer Model
models/schema: external API contract and typed data structure.api: request parsing, response shaping, transport concerns.core: orchestration, lifecycle, task scheduling, state coordination.task: script-domain execution flow.services: system/network/integration capabilities.utils: reusable low-level helpers with no business policy.
Current Dev Map
- API routes:
app/api/*.py - Runtime orchestration:
app/core/*.py - Schema/config/runtime models:
app/models/schema.py,app/models/config.py,app/models/task.py,app/models/ConfigBase.py - Script domains:
app/task/MAA,app/task/general,app/task/SRC
Dependency Direction
api -> core/services/models.schemacore -> services/task/models/utilstask -> core/services/models/utilsservices -> utils/modelsmodels -> none of api/core/services/task
Disallowed examples:
models/schemaimportingcoreorservicesutilsimportingcoreorapiservicesimporting concreteapiroutersapiembedding long-running workflow loops directly
Ownership Rules
app/models/schema.py: naming, typing, field descriptions only. No filesystem, network, process, or business branching.app/api/*: accept*In, return*Out/OutBase, validate input, callcore/services, shape response.app/core/*: own global coordination, lifecycle, config composition, task scheduling, and broadcast.app/task/*: own per-script execution lifecycle (check/prepare/run/final) and domain task decisions.app/services/*: wrap external integrations and provide stable capabilities tocore/task.app/utils/*: generic helpers and low-level adapters only. No domain policy and no orchestrator imports.- Script-config import/restore policy belongs to
core/taskorchestration, notapiorschema: AUTO-MAS manages other scripts by swapping their config files/folders before and after task execution. - Script success/failure heuristics based on log text, log timestamp, and process exit belong to orchestrators and log-monitor helpers, not to schema models or transport handlers.
Placement Decision Tree
- Request/response contract or DTO typing ->
models/schema - Endpoint parsing and response mapping ->
api - Cross-task orchestration or global runtime state ->
core - Script-domain run logic ->
task/<domain> - OS/network/third-party integration ->
services - Reusable, context-agnostic helper ->
utils
Cross-Cutting Rules
- Avoid circular imports; if seen, extract interface/helper to a lower layer.
- Avoid direct config file IO in
api; use acorefacade. - Keep business constants close to the owning domain layer.
- Shared schema semantics should align with
mas-schema-naming. - New config modes or raw-config capabilities must be end-to-end complete: model field, edit entry, persistence path, and runtime consumer must all exist before the feature is considered real.
- Do not leave placeholder config fields, fake detailed-mode branches, or dead save paths in one layer when no owning runtime path exists.
- Do not create standalone
builder,loader, or helper-service modules for a feature that has no second call site and no real ownership boundary. - If a domain can be expressed as one task class plus nearby local helpers, prefer that over creating a mini-subsystem inside the domain folder.
- When adding support for a new external script, preserve the product's config-copy plus log-monitor architecture instead of embedding script-specific state machines into shared layers.
- Script-specific adaptation is cross-layer by design: add the script config/user config in
app/models/config.py, expose schema types inapp/models/schema.py, add endpoints inapp/api/scripts.py, extend global config orchestration inapp/core/config.py, and add task dispatch inapp/core/task_manager.py.app/api/scripts.pyholds endpoints only: parse the request, call a function exposed by the owningapp/task/<Xxx>/module, shape the response model. Directory handling, import, update, validation, and group propagation belong in the script domain; do not define script-private helpers in the API layer. The MaaFW engine underapp/task/MaaFW/is the exception: itstools/core/packages must stay host-agnostic and its worker subprocess must not import host modules — seeapp/task/MaaFW/AGENTS.mdbefore touching it. - For a new script domain, start from the closest existing task folder shape, commonly
app/task/general, then rename and adapt domain-specific config, run, manual-review, and manager code in place.
Anti-Patterns
- Business rules inside schema definitions.
- Route handlers containing workflow loops or retry engines.
- Utility modules importing orchestrators for convenienc
Установить mas-module-boundary в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл mas-module-boundary?
Define and enforce backend module boundaries for Python services. Use when adding or refactoring backend code under app/, reviewing dependency direction, deciding layer ownership, or preventing logic leakage across schema/api/core/services/task/utils modules.
Как установить скилл mas-module-boundary?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mas-module-boundary запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic