Help developers create and maintain `docs/c4/architecture-validated.md` and `docs/c4/validated/model.c4` - the human-validated goal for C4 generation improvement.
/plugin marketplace add pietgk/vivief/plugin install devac@viviefThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Help developers create and maintain docs/c4/architecture-validated.md and docs/c4/validated/model.c4 - the human-validated goal for C4 generation improvement.
From the Architecture Documentation Improvement Loop:
┌─────────────────────────────────────────────────────────────────────────┐
│ IMPROVEMENT LOOP │
│ │
│ validated/model.c4 ◄──── Human validates ◄──── Developer │
│ (GOAL) │
│ │ │
│ │ compare │
│ ▼ │
│ GAP ────────────────────► effect-domain-rules │
│ ▲ │ │
│ │ │ generate │
│ generated/model.c4 ◄──────────────────┘ │
│ (GENERATED) │
└─────────────────────────────────────────────────────────────────────────┘
DO:
.md (comprehensive docs with diagrams) AND .c4 (LikeC4 DSL for comparison)DON'T:
This skill activates when users ask about:
Analyze package to understand:
Generate documents in a separate directory to avoid LikeC4 merge conflicts:
architecture-validated.md: Full docs with ASCII C4 diagrams, sequence diagrams, explanationsvalidated/model.c4: LikeC4 DSL for structural comparison with generated .c4validated/spec.c4: Shared specification (copy from generated/spec.c4)validated/likec4.config.json: LikeC4 project configAccept refinement commands:
Use devac MCP tools to understand the package:
# Get high-level structure
devac query "SELECT DISTINCT kind, COUNT(*) as count FROM nodes WHERE package_id = 'devac-core' GROUP BY kind"
# Find key exported symbols
devac query "SELECT name, qualified_name, kind FROM nodes WHERE package_id = 'devac-core' AND is_exported = true ORDER BY name"
# Get effect patterns
devac effects list -p packages/devac-core --type Store
devac effects list -p packages/devac-core --type Send
Create documentation files in a separate directory to avoid LikeC4 merge conflicts:
CRITICAL: Relationship Parity by Construction
As you reason about each relationship for the ASCII diagram, immediately add it to:
- A relationships table (human-readable)
- A LikeC4 code block (machine-usable)
This ensures parity by construction rather than by validation. The
model.c4file is derived from concatenating the LikeC4 code blocks in the markdown.
architecture-validated.md (at docs/c4/ root)
validated/model.c4 (LikeC4 model file)
validated/spec.c4 (copy from generated/spec.c4)
validated/likec4.config.json
{
"$schema": "https://likec4.dev/schemas/config.json",
"name": "{package}-validated",
"title": "{Package} Architecture (Human-Validated)"
}
Document the analysis in docs/c4/architecture.reasoning.md:
# Architecture Reasoning: @package/name
## Queries Used
- `SELECT ...` - Purpose: understand X
- `devac effects ...` - Purpose: find external integrations
## Inferences Made
- ⚠️ Grouped Parser modules into "Analysis Layer" based on naming pattern
- ✓ Identified DuckDB as storage from effect patterns
## Gaps in Data
- Could not determine relationship direction for X
- Missing metadata for internal module Y
## Assumptions
- Assumed "hub" module is part of Federation layer (needs validation)
Present documents for review:
.md for quick review.c4 visual reviewWhen developer approves:
devac architecture statusCheck if architecture documentation needs updating.
devac architecture status -p packages/devac-core
# Output: STALE - seed hash changed since last validation
devac architecture scoreCalculate gap metrics between validated and generated.
devac architecture score -p packages/devac-core
# Output: Gap Score: 42% (Container F1: 35%, Relationship F1: 50%, ...)
devac architecture diffShow structural differences between validated and generated.
devac architecture diff -p packages/devac-core
# Output: Missing containers: Federation Layer, Extra: Utils, Types, ...
query_sqlExecute SQL queries against the code graph.
query_sql("SELECT name, kind FROM nodes WHERE package_id = 'devac-core' AND is_exported")
find_symbolFind a specific symbol by name.
find_symbol("analyzePackage")
get_call_graphGet function call relationships.
get_call_graph("analyzePackage", depth: 2)
get_dependenciesGet package dependencies.
get_dependencies("packages/devac-core")
query_effectsQuery extracted effects.
query_effects(package: "devac-core", type: "Store")
docs/c4/architecture-validated.mdThe markdown serves as the single source of truth. After each ASCII diagram, include:
# DevAC Core Architecture
> **Package:** @pietgk/devac-core
> **Validated:** 2026-01-07
> **Status:** Verified ✓
## Overview ✓
DevAC Core is a federated code analysis engine...
## C4 Context Diagram
┌─────────────────────────────────────────────────────────────────┐ │ CONTEXT │ │ ┌─────────────┐ ┌──────────────────┐ │ │ │ Developer │─────────►│ DevAC Core │ │ │ │ [Person] │ queries │ [System] │ │ │ └─────────────┘ └──────────────────┘ │ │ │ │ │ ┌─────────┼─────────┐ │ │ ▼ ▼ ▼ │ │ ┌──────────┐ ┌──────┐ ┌────────┐ │ │ │ Source │ │ File │ │Central │ │ │ │ Code │ │System│ │Hub │ │ │ └──────────┘ └──────┘ └────────┘ │ └─────────────────────────────────────────────────────────────────┘
### Context Relationships
| From | To | Label |
|------|-----|-------|
| Developer | DevAC Core | Uses for analysis |
| DevAC Core | Source Code | Reads |
| DevAC Core | File System | Reads/Writes Parquet |
| DevAC Core | Central Hub | Reads/Writes |
```likec4
// Context relationships
developer -> devac_core "Uses"
devac_core -> source_code "Reads"
devac_core -> filesystem "Reads/Writes Parquet"
devac_core -> central_hub_db "Reads/Writes"
┌─────────────────────────────────────────────────────────────────┐
│ ANALYSIS LAYER ✓ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Parsers │◄─│ Analyzer │──►│ Semantic │ │
│ └────┬─────┘ └──────────┘ └────┬─────┘ │
│ │ │ │
│ ▼ ▼ │
│ Source Code Source Code │
├─────────────────────────────────────────────────────────────────┤
│ STORAGE LAYER ✓ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ DuckDB │◄─│ Seeds │ │ Effects │ │
│ └──────────┘ └────┬─────┘ └──────────┘ │
│ │ │
│ ▼ │
│ File System │
└─────────────────────────────────────────────────────────────────┘
| From | To | Label |
|---|---|---|
| Analyzer | Parsers | Calls for structural parsing |
| Analyzer | Semantic | Calls for resolution |
| Parsers | Source Code | Reads |
| Semantic | Source Code | Reads |
// Analysis layer relationships
devac_core.analyzer -> devac_core.parsers "Calls for structural parsing"
devac_core.analyzer -> devac_core.semantic "Calls for resolution"
devac_core.parsers -> source_code "Reads"
devac_core.semantic -> source_code "Reads"
| From | To | Label |
|---|---|---|
| Analyzer | Storage | Writes results |
| Storage | File System | Reads/Writes Parquet |
| Seeds | DuckDB | Queries via |
// Storage layer relationships
devac_core.analyzer -> devac_core.storage "Writes results"
devac_core.storage -> filesystem "Reads/Writes Parquet"
devac_core.storage.seeds -> devac_core.storage.duckdb_pool "Queries via"
| System | Type | Technology |
|---|---|---|
| Source Code | Input | TS/Py/C# files |
| File System | Storage | Parquet seeds |
| Central Hub | Federation | DuckDB |
This section consolidates all relationships for easy model.c4 generation:
// =====================================================
// ALL RELATIONSHIPS (copy to model.c4)
// =====================================================
// Context level
developer -> devac_core "Uses"
devac_core -> source_code "Reads"
devac_core -> filesystem "Reads/Writes Parquet"
devac_core -> central_hub_db "Reads/Writes"
// Analysis layer
devac_core.analyzer -> devac_core.parsers "Calls for structural parsing"
devac_core.analyzer -> devac_core.semantic "Calls for resolution"
devac_core.parsers -> source_code "Reads"
devac_core.semantic -> source_code "Reads"
// Storage layer
devac_core.analyzer -> devac_core.storage "Writes results"
devac_core.storage -> filesystem "Reads/Writes Parquet"
## File Format: `docs/c4/validated/model.c4`
The `model.c4` file is **derived from the markdown** by:
1. Defining elements (containers, components, external systems)
2. **Copying relationships from the "All Relationships Summary" code block** in the markdown
```likec4
// validated/model.c4
// Human-validated architecture for gap comparison
// devac:validated: true
// devac:validated-at: 2026-01-07
// devac:package-path: packages/devac-core
model {
devac_core = system 'DevAC Core' {
description 'Federated code analysis engine'
analyzer = container 'Analyzer' {
description 'Orchestrates analysis flow'
}
parsers = container 'Parsers' {
description 'TS/Py/C# AST extraction'
}
semantic = container 'Semantic' {
description 'Cross-file resolution'
}
storage = container 'Storage Layer' {
duckdb_pool = component 'DuckDBPool' {
description 'Connection pooling'
}
seeds = component 'Seeds' {
description 'Parquet I/O'
}
}
}
// External systems
source_code = external_system 'Source Code' {
description 'TS/Py/C# files'
}
filesystem = external_system 'File System' {
description 'Parquet storage'
}
// =====================================================
// RELATIONSHIPS (copied from architecture-validated.md)
// =====================================================
// Context level
developer -> devac_core "Uses"
devac_core -> source_code "Reads"
devac_core -> filesystem "Reads/Writes Parquet"
// Analysis layer
devac_core.analyzer -> devac_core.parsers "Calls for structural parsing"
devac_core.analyzer -> devac_core.semantic "Calls for resolution"
devac_core.parsers -> source_code "Reads"
devac_core.semantic -> source_code "Reads"
// Storage layer
devac_core.analyzer -> devac_core.storage "Writes results"
devac_core.storage -> filesystem "Reads/Writes Parquet"
devac_core.storage.seeds -> devac_core.storage.duckdb_pool "Queries via"
}
views {
view containers of devac_core {
title 'DevAC Core Containers'
include *
autoLayout TopBottom
}
}
Note: The spec.c4 file defines element kinds with notations (for the diagram legend) and relationship types (for visual distinction):
specification {
// Element kinds
element person {
notation "Person"
style {
shape person
color blue
}
}
element system {
notation "Software System"
style {
shape rectangle
color indigo
}
}
element container {
notation "Container"
style {
shape rectangle
color sky
}
}
element component {
notation "Component"
style {
shape rectangle
color slate
}
}
element external_system {
notation "External System"
style {
shape rectangle
color gray
}
}
// Relationship kinds (notations not yet supported)
relationship reads {
color green
line solid
}
relationship writes {
color amber
line solid
}
relationship calls {
color sky
line dashed
}
relationship queries {
color indigo
line dashed
}
relationship uses {
color slate
line dashed
}
relationship ipc {
color secondary
line dotted
}
}
Use typed relationships in model.c4: source -[reads]-> target "label"
User: "Validate the architecture for packages/devac-core"
Response approach:
architecture-validated.md with ASCII diagramsvalidated/ directory with:
model.c4 (LikeC4 DSL, no specification block)spec.c4 (copy from generated/)likec4.config.jsonarchitecture.reasoning.md documenting analysisUser: "Move the Rules module into the Analysis Layer"
Response approach:
.c4 model block.mdUser: "Looks good, mark as verified"
Response approach:
After validation, the files enable:
# Calculate how close generated is to validated
devac architecture score -p packages/devac-core
# See what's missing/extra in generated
devac architecture diff -p packages/devac-core
# Regenerate .c4 and compare
devac c4 -p packages/devac-core
devac architecture score -p packages/devac-core
The gap score drives improvement of effect-domain-rules so that generated .c4 gets closer to validated .c4 over time.
CRITICAL: Always validate model.c4 before marking as complete.
# Validate the generated files
cd docs/c4/validated && npx likec4 validate .
If validation fails, fix the errors before proceeding. Common issues:
These identifiers are reserved in LikeC4 and cannot be used as element names:
views - Use diagram_views or view_layer insteadmodel - Use data_model or model_layer insteadspecification - Use spec_layer instead}source -> target "label").md and validated/model.c4 together (keep in sync)/define-effects skill (effects inform architecture)validated/ directory must have its own spec.c4 and likec4.config.json to avoid LikeC4 merge conflicts with generated/views, model, specification as element identifiersBefore marking as validated, verify:
npx likec4 validate . returns no errorsThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.