AGENT SKILL

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

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:

  1. Hotspot Mining: Scans repository for monolithic files (> 200 LOC, Rule 11), filtering noise roots (.git, __pycache__, untracked GEV).
  2. AST Seam Mapping: Traces upstream callers, downstream imports, Click command groups, IoC service keys, and test contracts.
  3. 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).
  4. Contract Verification: Authors and executes strict contract tests (tests/test_<name>_decomposition.py) and verifies zero ruff lint errors.
  5. Interactive Visual Master Brief: Generates standalone dark-mode HTML visual review briefs in %TEMP%.
  6. Multi-Cycle Regression Gate: Executes the cumulative multi-cycle regression suite (1,000+ tests) with Windows proactor background guards.
  7. Secure Token-Redacted Git Push: Stages only cycle files and pushes with in-memory token redaction (Rule 15).

Dependencies

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:

  1. Gate 1 (LOC Enforcement): Assert every factored submodule file is ≤ 200 lines with check-lines subcommand.
  2. Gate 2 (Contract Test Pass): Assert all tests/test_*_decomposition.py contracts pass with zero failures.
  3. Gate 3 (Regression Gate): Execute the full cumulative multi-cycle regression suite before push. Do not bypass via --no-tests.
  4. Gate 4 (User Approval for Push): Request explicit user review via RequestFeedback: true before 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: continue without logging or reraising programming errors (Rule 32).

04 同仓库更多 Skills

SpectreDeath
SpectreDeath/Brain-Harness

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.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

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.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

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.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

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.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

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.

★ 0
SpectreDeath
SpectreDeath/Brain-Harness

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.

★ 0