一键导入
tdd-morphic
TDD workflow for Morphic-Agent's 4-layer Clean Architecture. RED → GREEN → REFACTOR, placing tests and impls in the correct layer directories.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TDD workflow for Morphic-Agent's 4-layer Clean Architecture. RED → GREEN → REFACTOR, placing tests and impls in the correct layer directories.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | tdd-morphic |
| description | TDD workflow for Morphic-Agent's 4-layer Clean Architecture. RED → GREEN → REFACTOR, placing tests and impls in the correct layer directories. |
| when_to_use | When implementing any new domain entity, use case, port, or infrastructure impl. Invoke before writing production code. |
| allowed-tools | ["Read","Write","Edit","Bash(uv run pytest *)","Bash(ruff check *)","Grep","Glob"] |
| model | sonnet |
You execute the RED → GREEN → REFACTOR loop while respecting Morphic's layer boundaries.
| Code layer | Test folder |
|---|---|
domain/entities/ | tests/unit/domain/test_entities.py |
domain/services/ | tests/unit/domain/test_<service>.py |
domain/ports/ | No tests (ABCs only) |
application/use_cases/ | tests/unit/application/test_<use_case>.py (mock ports) |
infrastructure/*/ | tests/integration/test_<impl>.py (real PG/Redis/Qdrant) |
interface/api/routes/ | tests/integration/test_api_<route>.py (TestClient) |
interface/cli/commands/ | tests/integration/test_cli_<cmd>.py |
uv run --extra dev pytest tests/unit/<layer>/test_<name>.py -v
Expect: FAIL with specific assertion error.uv run --extra dev pytest tests/unit/ -v
uv run --extra dev ruff check .
infrastructure/ or application/. Use plain pytest, no TestClient, no DB.unittest.mock.AsyncMock or a hand-rolled in-memory port. Never real DB.docker compose up. Skip with pytest.importorskip for external services.After each GREEN, make a micro-commit:
git add <only changed files>
git commit -m "tests(<layer>): add <what>" -m "then" -m "feat(<layer>): implement <what>"
(or two separate commits).
# TDD <feature>
## RED
- Test: tests/unit/<...>/test_<...>.py::test_<name>
- Failure: <assertion>
## GREEN
- Impl: <file>:<line>
- Passing: <N>/<N> tests
## REFACTOR
- Changes: <summary>
- Lint: clean
Verify a feature spec, plan, or PR against the non-negotiable principles in `.specify/memory/constitution.md`.
Extract session insights after a task completes and feed them into Morphic's self-evolution engine. Captures what worked, what didn't, and proposes prompt/routing tweaks.
Keep CLAUDE.md (thin router) and AGENTS.md (telegraph-style) in sync. Detects drift in command lists, paths, and routing tables between the two root instruction files.
Generate a monthly or on-demand cost report across LLM providers, local LLMs, and agent engines. Flags overspend and suggests downgrades.
Run live end-to-end verification across Morphic-Agent's 6 agent CLI engines. Produces a baseline comparison table with duration and cost per engine.
Inspect Morphic-Agent's fractal task graph for a given task_id. Reports bypass classifier decisions, Gate 2 skips, parallelism, and regression flags.