# Diagram-Driven Coding

> A design-first workflow for AI-assisted coding. Use layered architecture diagrams, explicit component boundaries, and behavioral tests to make changes easier to review and maintain.

Diagram-Driven Coding is a free AI agent skill on Agensi by Icarus, in Prompt & Skill Engineering. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Icarus](https://www.agensi.io/creators/icarus)
- Category: [Prompt & Skill Engineering](https://www.agensi.io/skills/prompt-skill-engineering)
- Version: 1.0
- Last updated: 2026-11-30
- Security: scan passed (2026-11-30); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/diagram-driven-coding
- Tags: prompt-engineering, python, software-architecture, mermaid-diagrams, documentation

## About this skill

Diagram-Driven Coding guides coding agents through changes to long-lived codebases. It uses layered `ARCHITECTURE.md` files to document component responsibilities, data contracts, and key flows. When a change affects a public contract or a main flow, the agent updates the relevant diagram first, checks downstream impact, and verifies the implementation with behavioral tests. Includes Python examples and guidance for other languages.

## Requires

- Git

## Known limitations

Not for small scripts or throwaway prototypes. Requires manual verification of Mermaid syntax if no renderer is available. Documentation must be updated before code implementation.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Diagram-Driven Coding skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill prevent AI-written code from becoming a maintenance liability?

This skill enforces a design-first workflow where the AI must update architectural diagrams and documentation before writing any code. It solves the black box problem of AI-generated code by ensuring that implementation details remain isolated within strict component boundaries.

### Are there any specific project requirements or files needed to start using this skill?

The skill is designed for long-lived Python or multi-language codebases and requires either an existing ARCHITECTURE.md structure or a commitment to build one. It uses standard tools like Mermaid for diagrams and Google-style docstrings for documentation.

### What specific documentation and code outputs should I expect to see?

You get a highly organized codebase where every component has its own ARCHITECTURE.md containing class diagrams, responsibility tables, and sequence diagrams. It also produces strict data contracts using TypedDict and behavior-only test suites.

### When should I avoid using this skill for a project?

This skill is not intended for small scripts, one-off prototypes, or throwaway code. It is optimized for medium-to-large repositories where maintaining readability and containing the blast radius of changes is critical.

### How should I instruct my AI agent to trigger this workflow?

You can ask your agent to apply this skill when adding or refactoring a component, changing a public interface, or migrating legacy code into isolated modules. Simply instruct the agent to follow the diagram-driven workflow for your specific task.

### How does the skill handle changes to public interfaces or data contracts?

The skill treats interface changes as protected events that require the AI to estimate the blast radius and seek human approval before proceeding. This ensures that the AI cannot unilaterally alter public signatures or data structures that other parts of your system rely on.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
