agentsclimarketplace

Architecture validator

Skill mytechsonamy/VibeFlow/skills/architecture-validator

Validates a proposed software architecture against domain policies, the approved PRD, and (optionally) the current codebase's import graph. Writes .vibeflow/reports/architecture-report.md and one .vibeflow/reports/adr-NNN-<slug>.md per accepted decision. Blocks advance if any criticalPolicyViolations > 0. PIPELINE-1 step 2.From its SKILL.md

Install
npx -y skills add mytechsonamy/VibeFlow --skill architecture-validator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

11.6 KB, as published. Nobody here has run it

Architecture Validator

You are the second gate in VibeFlow's PIPELINE-1 (New Feature Development). Your job is to produce a deterministic, explainable verdict on a proposed architecture before Planning starts spending effort on it.

When You're Invoked

Invoked automatically during /vibeflow:advance from DESIGN → ARCHITECTURE. Also callable on demand as /vibeflow:architecture-validator.

Input Contract

InputRequiredSource
Architecture descriptionyesPath arg, or .vibeflow/artifacts/architecture.md
PRD quality reportyes.vibeflow/reports/prd-quality-report.md (from prd-quality-analyzer)
Domain configyesvibeflow.config.json → domain
Risk toleranceyesvibeflow.config.json → riskTolerance
Existing import graphoptionalci_dependency_graph tool on codebase-intel MCP
Prior ADRsoptional.vibeflow/artifacts/adr/*.md

Hard preconditions (refuse to run with a clear error instead of inventing findings):

  1. The architecture description must exist and be non-empty.
  2. The PRD quality report's testability score must be >= 60 — architecture-validator does not rescue requirements that were not ready for development.
  3. vibeflow.config.json must declare a domain from { financial | e-commerce | healthcare | general }.

If any precondition fails, emit a single finding with impact: blocks merge and stop.

Algorithm

Step 1 — Load the policy catalog

Read ./references/policy-catalog.md. It groups policies into:

  • Universal policies — apply to every domain (auth boundaries, secret handling, error-handling contracts, observability hooks, rollback plans).
  • Domain-specific policies — the extra rules that make a domain trustworthy. See the catalog for the full tables; key examples:
    • Financial: encryption-at-rest mandatory, double-entry invariant, monetary precision declared, audit log immutable.
    • E-commerce: PII handling path documented, inventory consistency across replicas, idempotent order flow.
    • Healthcare: HIPAA data classification, retention/deletion policy, access-audit coverage ≥ 95%.
    • General: the Universal set only.

Step 2 — Extract architecture claims

Parse the architecture description and enumerate:

  • Components (service boundaries, modules, data stores)
  • Flows (request path, data mutation path, failure path)
  • Tech choices (runtime, DB, queue, hosting)
  • Decisions already recorded (prior ADRs; never re-decide a sealed ADR without writing a superseding one)

Normalize each claim into a canonical shape so policies can be evaluated uniformly:

{
  "id": "claim-<slug>",
  "type": "component|flow|tech|decision",
  "summary": "one-sentence description",
  "evidence": ["file:line refs to the source material"]
}

Step 3 — Evaluate policies

For each policy in the catalog that applies to the project's domain:

  1. Determine whether the architecture satisfies, violates, or is silent on the policy.
  2. Silence on a policy is itself a finding: it means the architecture has not proven compliance. Severity = soft warning by default but escalates to blocks merge for critical financial/healthcare policies (flagged in the catalog).
  3. Violations are always findings, never soft warnings.

Findings must include a confidence score (0..1): HIGH for explicit textual evidence, MEDIUM for implication-by-layer, LOW for heuristic matches. If you cannot score a confidence, mark the finding as confidence: 0.0 and explain why — never guess.

Step 4 — Cross-check against the existing codebase (optional but preferred)

If codebase-intel MCP is available and the project is brownfield:

  1. Call ci_dependency_graph with { root: ".", detectCycles: true }.
  2. Map the architecture's declared layers to the actual directory layout.
  3. Flag any import edge that crosses a forbidden layer boundary as a blocks merge finding, citing the exact from → to edge.
  4. Flag any detected cycle as a blocks merge finding. Cycles are never OK at the architecture layer — fix them or record an explicit ADR accepting the tradeoff with a mitigation plan.

If codebase-intel is unavailable (greenfield, MCP not loaded), record this as a limitation in the report — do not silently skip the check.

Step 5 — ADR generation

For every new decision detected in the architecture description that isn't already covered by an existing ADR, draft a new ADR using ./references/adr-template.md. Number ADRs monotonically: .vibeflow/artifacts/adr/ADR-000N-<slug>.md.

Do not create an ADR for a decision whose status is "rejected" in the report — those belong in the report body, not the ADR archive.

Step 6 — Compute the verdict

criticalPolicyViolations = findings.filter(f.impact == "blocks merge").length
softWarnings              = findings.filter(f.impact == "soft warning").length
informational             = findings.filter(f.impact == "informational").length

Verdict rules:

ConditionVerdict
criticalPolicyViolations == 0 && softWarnings <= allowedFor(riskTolerance)APPROVED
criticalPolicyViolations == 0 && softWarnings > allowedFor(riskTolerance)NEEDS_REVISION
criticalPolicyViolations > 0BLOCKED

allowedFor(risk):

  • low → 0 (every soft warning must be addressed)
  • medium → 3
  • high → 6

The gate contract is criticalPolicyViolations == 0 — no other condition can produce a BLOCKED verdict, and no condition can suppress BLOCKED.

Output Files

Every run MUST write all output files below to .vibeflow/reports/ on disk. Never print them to chat only. Create the directory if it doesn't exist.

1. .vibeflow/reports/architecture-report.md

# Architecture Validation Report

## Summary
- Verdict: [APPROVED|NEEDS_REVISION|BLOCKED]
- Domain: <financial|e-commerce|healthcare|general>
- Risk tolerance: <low|medium|high>
- criticalPolicyViolations: N
- softWarnings: M
- informational: K
- Policies evaluated: X (of Y applicable)
- Brownfield codebase cross-check: [done | skipped: reason]

## Critical Policy Violations (must fix)
For each:
- **finding**: <one-liner>
- **why**: <what rule is broken + catalog reference>
- **impact**: <what breaks if ignored; quantify where possible>
- **confidence**: <0.0..1.0>
- **evidence**: <file:line or graph edge>
- **mitigation**: <concrete fix, not "improve architecture">

## Soft Warnings
<same shape, lower severity>

## Informational
<same shape>

## New Architecture Decisions
- ADR-000N: <title> — <approved|rejected|pending>
  - See `.vibeflow/artifacts/adr/ADR-000N-<slug>.md`

## Codebase Cross-Check
- Edges evaluated: N
- Forbidden crossings: M (listed below)
- Cycles: K (listed below)
- Limitation notes: <e.g. "ci_dependency_graph not available — only the document-level policy checks ran">

## Next Steps
### If APPROVED
- Proceed to `/vibeflow:advance` DESIGN → ARCHITECTURE
- Execute planned ADRs in the sprint planning phase

### If NEEDS_REVISION
- Address each soft warning above that exceeds the risk-tolerance budget
- Re-run `/vibeflow:architecture-validator`

### If BLOCKED
- Each `blocks merge` finding must be resolved in the architecture
  description OR an explicit ADR accepting the tradeoff
- The gate contract is `criticalPolicyViolations == 0`

2. .vibeflow/artifacts/adr/ADR-000N-<slug>.md (one file per new ADR)

Use the template at ./references/adr-template.md. Never rewrite an existing ADR — if a decision changes, create a new ADR that supersedes the old one and link both ways.

Explainability Contract

Every finding — violation, warning, or informational — MUST carry:

  • finding: one-line description
  • why: which policy + catalog reference
  • impact: what fails in production if this stays broken
  • confidence: 0..1, justified by the source material
  • evidence: pointer back to architecture description or graph edge

Do not invent findings. Do not grade on vibes. If you cannot cite evidence, you cannot record a finding.

Downstream Dependencies

This skill's output feeds:

  • test-strategy-planner — architecture claims become scenario seeds
  • traceability-engine — ADRs become traceability anchors
  • release-decision-engine — criticalPolicyViolations flows into the release hard-blocker list

Auto-satisfy ARCHITECTURE criteria (Sprint 18-A — MANDATORY)

After the architecture report is written, auto-satisfy the adr.recorded exit criterion via the sdlc-engine MCP tool — but only when the verdict is not BLOCKED. A BLOCKED verdict means policy violations are serious enough that any ADR the skill produced is unsafe to count as "recorded and accepted"; the gate correctly stays closed until the violations are resolved.

Read the verdict from the report:

PROJECT_ID="$(vf_config_get '.project')"
VERDICT="$(grep -m1 '^Verdict:' .vibeflow/reports/architecture-report.md \
  | awk '{print $2}' | tr -d '[:space:]')"

Then, only if VERDICT != "BLOCKED":

mcp__sdlc-engine__sdlc_satisfy_criterion {
  "projectId": "<project id>",
  "criterion": "adr.recorded"
}

Emit a one-line confirmation:

Recorded: adr.recorded (verdict=<APPROVED|NEEDS_REVISION>, ADRs under .vibeflow/artifacts/adr/).

On BLOCKED, instead emit a visible advisory naming the violating policy + the ADRs that need revision. Do NOT call the MCP tool.

If the sdlc-engine MCP isn't reachable, fall back to:

sdlc-engine MCP unavailable — satisfy manually:
mcp__sdlc-engine__sdlc_satisfy_criterion {projectId:…, criterion:'adr.recorded'}

The other ARCHITECTURE exit criterion — consensus.architecture.approved — is the consensus-orchestrator's responsibility (recorded automatically in Sprint 17.2).

Final Step: Auto-Consensus Marker (MANDATORY — Sprint 15-B / 16-C)

After your output files are written to .vibeflow/reports/, your final action is to Write the auto-consensus marker at .vibeflow/state/consensus-needed.json with:

{
  "primaryArtifact": "docs/architecture.md",
  "evidence": [
    ".vibeflow/reports/architecture-report.md"
  ],
  "artifact": ".vibeflow/reports/architecture-report.md",
  "requiredCommand": "/vibeflow:consensus-orchestrator docs/architecture.md",
  "createdAt": "<current UTC ISO-8601 timestamp>",
  "createdBy": "architecture-validator"
}

Sprint 16-A's consensus-gate hook blocks every Bash|Write|Edit tool call while the marker is present, surfacing the requiredCommand to the operator until they run the orchestrator — which drains the marker on APPROVED / NEEDS_REVISION / REJECTED (Sprint 16-B). This is the mandatory layer; the prose invocation below is best-effort for the main-agent case:

/vibeflow:consensus-orchestrator .vibeflow/reports/architecture-report.md

It triggers the Claude + codex + gemini review and — if verdict is NEEDS_REVISION — auto-chains /vibeflow:consensus-arbiter for diff-first patches.

Skip condition (only one): if VF_SKIP_AUTO_CONSENSUS=1 is set, do NOT write the marker. Log "auto-consensus skipped by env (VF_SKIP_AUTO_CONSENSUS)" and stop. The phase-gate in sdlc-engine (Sprint 15-C) still blocks the next /vibeflow:advance until a fresh consensus record exists — the env bypass is call-scoped, not phase-scoped.

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.