skill-architect_edit2 is an architecture-editor generator for LLM-driven engineering workflows.
It turns architecture JSON into a single-file interactive HTML application that supports:
- architecture visualization,
- interactive structural edits,
- runtime health overlays,
- expected-vs-actual validation,
- development-brief export,
- full architecture snapshot export,
- and now a guarded Auto-Improve strategic suggestion workflow.
The repository is designed to create a practical architecture operating interface rather than static documentation. The generated editor should help teams:
- understand current architecture quickly,
- capture intentional architecture changes with auditability,
- detect architecture drift and contradictions early,
- generate implementation-ready briefs for coding agents.
Core generator script. It:
- loads an input architecture model (or falls back to a built-in sample model),
- renders an embedded HTML/JS application template,
- writes a single portable
.htmloutput file.
python scripts/generate_architecture_editor.py --input architecture.json --output architecture-editor.html
python scripts/generate_architecture_editor.py --output architecture-editor.htmlExample architecture model that can be used as a base for experimentation.
Reference contracts and behavior documentation for architecture model shape, editor behavior, and API health-check integration.
The editor expects (at minimum):
projectnodes[]edges[]changes[]
Optional advanced blocks include:
healthdeviationsexpectedArchitectureautoImprovedevBriefs
- node/edge rendering on a canvas,
- detail panel per node,
- edit mode with tracked changes,
- add/edit/delete flow steps,
- add/edit/delete API routes,
- add/delete nodes,
- add/reroute/delete edges.
All user-driven structural edits are recorded with origin: "user-edit" for governance and session policy checks.
- change log with before/after payloads,
- Development Brief export (
EXPORT CHANGES), - full architecture markdown snapshot export (
EXPORT ALL STATES).
- server-mediated live probing via
POST /probe-architecture, - endpoint and node statuses (
red,yellow,green,unknown), - edge coloration based on health/dependency status.
- compares
expectedArchitecturewith currently rendered model, - marks mismatches as deviations,
- supports global and node-specific deviation brief creation.
Two new buttons in the generated editor:
AUTO-IMPROVE: evaluates and proposes one strategic improvement,CONFIRM AI: confirms the pending proposal and converts it into a dev brief.
Auto-Improve can run only when:
- No user-requested changes have already been made in the current session (
origin: "user-edit"lock), and - No prior Auto-Improve exists for the active dev brief context (neither as pending proposal nor as confirmed history).
This enforces:
- low contradiction risk against manually requested changes,
- one strategic recommendation per brief (strictly enforced across pending + history),
- traceable proposal lifecycle.
The proposal includes:
- title,
- strategic goal context,
- impact rationale,
- effort estimate,
- scoped implementation steps,
- risk assessment,
- mitigation plan,
- success metrics.
When confirmed, a structured auto-improve dev brief is created and added to model.devBriefs.
- Contradictions with in-session intent if user changes already started.
- Overfitting to incomplete architecture data (missing APIs/constraints).
- Short-term optimization bias (impulsive proposals with weak strategic relevance).
- Operational false positives when enforcement enters CI too aggressively.
- hard gate against sessions with existing
user-editchanges, - one-trigger-per-dev-brief policy,
- explicit risk section in every proposal,
- mandatory mitigation list and success metrics,
- confirmation step before promotion to dev brief.
- introduce a configurable confidence score threshold,
- require baseline freshness checks (
expectedArchitectureupdated recently), - add human-owner field for accepted auto-improve items,
- enforce contradiction checks on later changes against confirmed auto-improve intent.
- Session-aware edit origin tagging added to structural edit change events.
- Deviation brief text consistency improved (English headings/instructions).
- Strategic workflow coverage expanded with proposal + confirmation lifecycle.
- One-trigger guard strengthened so Auto-Improve is blocked when either a pending proposal or a confirmed history entry exists for the same
devBriefId. - Operator-facing block message improved to include the concrete
devBriefIdand blocking reason.
Run these checks after modifying the script:
python -m py_compile scripts/generate_architecture_editor.py
python scripts/generate_architecture_editor.py --input assets/sample-architecture.json --output /tmp/architecture-editor.htmlThen open the generated HTML in a browser and test:
- normal edit mode,
- validation and deviation export,
- auto-improve (before any user edits),
- lock behavior after a user edit.
- Keep secrets out of architecture JSON and HTML.
- Route runtime checks through a controlled backend.
- Treat confirmed Auto-Improve briefs as strategic constraints for subsequent architecture changes.