architecture-deepening-workflow
Orchestrate the 7-phase architecture deepening cycle to decompose monolithic hotspots into subpackages <= 200 lines with contract tests and visual briefs. Do not use for superficial linting or single-line bug fixes.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- architecture-deepening-workflow
- description
- Orchestrate the 7-phase architecture deepening cycle to decompose monolithic hotspots into subpackages <= 200 lines with contract tests and visual briefs. Do not use for superficial linting or single-line bug fixes.
02 资源文件 4
- 参考文档CARD.md3.0 KB
- 参考文档config.default.yaml349 B
- 参考文档references/seam_patterns.md1.4 KB
- 脚本scripts/deepen_cycle.py7.8 KB
03 SKILL.md 正文
Architecture Deepening Workflow
Authoritative operational orchestration skill for executing systematic architecture deepening cycles across monolithic hotspots in the Brain Harness repository.
Overview
The architecture-deepening-workflow codifies the empirical 7-phase protocol perfected across 70 continuous deepening cycles:
- Hotspot Mining: Scans repository for monolithic files (> 200 LOC, Rule 11), filtering noise roots (
.git,__pycache__, untracked GEV). - AST Seam Mapping: Traces upstream callers, downstream imports, Click command groups, IoC service keys, and test contracts.
- Subpackage Modularization: Factors monolithic code into fine-grained subpackages where every file is $\le 200$ LOC, equipped with slotted domain models (Rule 12), single-seam resolvers (Rule 58), and Click single-source consolidation (Rule 6).
- Contract Verification: Authors and executes strict contract tests (
tests/test_<name>_decomposition.py) and verifies zero ruff lint errors. - Interactive Visual Master Brief: Generates standalone dark-mode HTML visual review briefs in
%TEMP%. - Multi-Cycle Regression Gate: Executes the cumulative multi-cycle regression suite (1,000+ tests) with Windows proactor background guards.
- Secure Token-Redacted Git Push: Stages only cycle files and pushes with in-memory token redaction (Rule 15).
Dependencies
monolith-decomposition-engine— AST seam factorization, slotted models, and single-seam resolvers.adversarial-agent-verifier— Harsh adversarial test review and DAG seam verification.agent-skill-sdlc— 3-tier zero-fork configuration and validation lifecycle.
Utility Scripts
The skill provides a multi-command CLI helper under scripts/deepen_cycle.py:
# 1. Scan for monolithic candidates > 200 lines
python scripts/deepen_cycle.py scan --threshold 200 --output scan_results.json
# 2. Plan submodule breakdown for a specific target
python scripts/deepen_cycle.py plan --target src/harness/commands/plugins.py --output plan.json
# 3. Check line count limits across submodules in a directory
python scripts/deepen_cycle.py check-lines --dir src/harness/commands/plugins/ --max-lines 200
# 4. Run contract verification and lint checks
python scripts/deepen_cycle.py verify --test tests/test_plugins_decomposition.py --lint-target src/harness/commands/plugins/
# 5. Synthesize interactive HTML visual review brief
python scripts/deepen_cycle.py brief --cycle 71 --title "Plugin Commands Decomposition" --output-html %TEMP%\review.html
# 6. Execute full multi-cycle regression gate
python scripts/deepen_cycle.py regression --script scratch/run_full_cycle_regression.py
# 7. Securely commit and push with token redaction
python scripts/deepen_cycle.py push --cycle 71 --message "refactor(cycle-71): decompose plugin commands" --files src/harness/commands/plugins/ tests/test_plugins_decomposition.py
Mandatory Checkpoint Gates
Before committing or staging any architecture deepening cycle artifacts, assert all gates:
- Gate 1 (LOC Enforcement): Assert every factored submodule file is ≤ 200 lines with
check-linessubcommand. - Gate 2 (Contract Test Pass): Assert all
tests/test_*_decomposition.pycontracts pass with zero failures. - Gate 3 (Regression Gate): Execute the full cumulative multi-cycle regression suite before push. Do not bypass via
--no-tests. - Gate 4 (User Approval for Push): Request explicit user review via
RequestFeedback: truebefore executing the secure token-redacted git push step.
Anti-Patterns
- Premature Submodule Bloat — Leaving factored submodules above 200 lines in violation of Rule 11.
- Untracked File Staging — Executing
git add .or touching untracked external files (e.g. Gods Eye View) instead of explicit cycle file lists. - Bypassing Regression Gates — Committing or pushing changes without running the full cumulative regression suite.
- Leaking Secrets in Git Arguments — Interpolating tokens directly into shell strings instead of isolated Python runner scripts with in-memory redaction (Rule 15).
- Silent Batch Exception Masking — Using bare
except Exception: continuewithout logging or reraising programming errors (Rule 32).
04 同仓库更多 Skills
ui-behavior-primitive-architect
Architect, audit, and verify zero-dependency headless UI behavior primitives, WebMCP agent bridges, WAI-ARIA/SSR/RTL tri-modal checks, and framework expert routing. Do not use for static CSS theme styling or backend database migrations.
trustgraph-ontology-governor
Govern knowledge graphs, SHACL-AF triple policies, OntologyRAG subclass validation, PROV-O dual named graphs, and Laya entropy decision scoring. Do not use for relational SQL queries or generic web scraping.
shim-harness-governor
Govern universal CLI agent loops, 4-tier tool permissions, ancestor-symlink workspace sandboxes, deterministic-first command routing, collision-safe MCP namespacing, and layered skill loading. Do not use for static UI styling or external SQL analytics.
graphiti-zep-memory-governor
Govern bi-temporal knowledge graphs with Graphiti future-edge clamping, MinHash/LSH entity dedup, RRF/MMR reranking, and Zep typed ontologies. Do not use for static SQL joins or generic web crawling.
agora-mcp-workbench-architect
Architect, audit, and orchestrate Agora Workbench MCP servers, loopback sidecars, unified state graphs, gateway/dispatcher connectors, and policy-enforced data lakes. Do not use for static frontend CSS styling or non-MCP desktop GUI automation.
skill-eval-assurance-runner
Evaluate and assure agent skills using small-N Wilson confidence intervals, unbiased pass^k reliability, deterministic trajectory graders, preflight boundary honesty, and sealed digest verification. Do not use for subjective prose review or unconstrained production deployment.