Skip to content
Back to skills

Architecture

ASecurity

Apply mergegate's architecture (domain ownership, ports and adapters, dependency boundaries) when adding or changing code, crates, adapters, or dependencies. Use before deciding where code lives or what it may depend on.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 16, 2026
ai-agentstypescriptpythonrustgoshellgitapidatabase

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 18, 2026

npx -y skills add damian-kolasinski/mergegate --skill architecture --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Architecture?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Architecture
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/damian-kolasinski-architecture/badge)](https://www.skillsdirectory.com/skills/damian-kolasinski-architecture)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: architecture
description: Apply mergegate's architecture (domain ownership, ports and adapters, dependency boundaries) when adding or changing code, crates, adapters, or dependencies. Use before deciding where code lives or what it may depend on.
---

# Architecture

mergegate is one Rust binary, `mg` (hub daemon and CLI), with a web UI embedded in it. `mergegate` is `mg` under a name nothing else takes, for PATHs where macOS's `/usr/bin/mg` editor comes first: a release ships it as a copy of `mg`, and a source build gets `crates/cli/src/bin/mergegate.rs`, which runs the `mg` beside it. Code is organized as ports and adapters, and the crate graph enforces the boundaries.

## Rules

- Domain logic goes in `core`. `core` has no I/O: no async runtime, network, filesystem, subprocess, database or git crates.
- `core` depends on no other workspace crate, `api` included, and has no serde: it doesn't know the wire format.
- `core` reaches every external system through a port trait it defines. Check the existing ports before adding one; a new external system means a new port or an extension of an existing one.
- Define ports from the perspective of the domain logic. Do not reshape domain logic to fit an adapter.
- Adapters depend on `core` and `api` only, never on each other. Wiring happens only in `hub` and `cli`.
- Wire types live in `api`. TypeScript types are generated from them; never hand-write API types in `ui/`. A type the UI reads gets `#[cfg_attr(feature = "ts", derive(ts_rs::TS), ts(export))]`.
- The edge maps domain to wire: `core` defines its own types, and the `hub` route module or `cli` command that serves them converts to and from `api`.
- Adapters are chosen per project through config, optional ones sit behind cargo features, and third-party extensions run out of process (JSON over stdio).
- Expensive work runs when data arrives and is cached; request paths only read.
- Build a new slice the way existing slices are built.
- Web features own their behavior; the application shell wires features without owning them. Styling uses the shared design system.
- Edit colors and typography in `appearance/tokens.json` and syntax colors in `appearance/syntax.json`, then run `python3 appearance/generate.py` to regenerate the web's tokens.

## Dependencies

Choose for runtime speed and correctness, not human ergonomics. Before adding a crate or package, check that it is maintained, that it doesn't pull I/O into `core`, and that it doesn't add work to the CLI's startup path.

## Before finishing

- The code lives in the slice that owns the behaviour.
- `core` gained no I/O dependency and no `api` import; no adapter imports another adapter. `crates/testkit/tests/boundaries.rs` checks the crate graph.
- This skill reflects any change to the architectural rules above.

Files in this skill

  • SKILL.md3.3 KB
  • agents/openai.yaml209 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.