Skip to content
Back to skills

Project Design

ASecurity

Shared vocabulary for designing deep modules. Enforce Systems Thinking, leverage, locality, and YAGNI.

  • 8 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 5, 2026
developmentgoapi

Works with

  • api

Security analysis

A100/100

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

Scanned September 21, 2026

npx -y skills add anasgets111/dotfiles --skill project-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Project Design?

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

Security grade badge for Project Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anasgets111-project-design/badge)](https://www.skillsdirectory.com/skills/anasgets111-project-design)

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: codebase-design
description: Shared vocabulary for designing deep modules. Enforce Systems Thinking, leverage, locality, and YAGNI.
disable-model-invocation: true
---

# Codebase Design

Design **deep modules**: massive implementation hidden behind a minimal interface, placed at a clean seam, fully testable. Optimize for leverage (caller efficiency) and locality (maintainer efficiency).

## Architectural Glossary

Use these exact terms. Do not substitute with "component," "service," "API," or "boundary."

| Term | Strict Definition |
| :--- | :--- |
| **Module** | Anything with an interface and implementation (function, class, package). |
| **Interface** | Everything a caller must know: type signature, invariants, ordering, errors, config. |
| **Implementation** | The internal body of code hiding behind the interface. |
| **Depth** | Leverage at the interface. High depth = minimal interface + massive implementation. |
| **Seam** | The location where a module's interface lives (where behavior can be swapped). |
| **Adapter** | The concrete logic that satisfies an interface at a seam (e.g., the `niri` and `hyprland` rows in `lib/compositor.lua`). |
| **Leverage** | Caller benefit: capabilities gained per unit of interface learned. |
| **Locality** | Maintainer benefit: bugs, logic, and tests concentrate in one place. Fix once. |

## Deep vs. Shallow

**Deep module** = small interface + deep implementation. High leverage.

```text
┌─────────────────────┐
│   Small Interface   │ ← Minimal functions/params (e.g., `compositor.detach(verb)`)
├─────────────────────┤
│                     │
│ Deep Implementation │ ← Per-compositor argv, unhydrated state, logging hidden
│                     │
└─────────────────────┘
```

**Shallow module** = large interface + thin implementation. A useless pass-through. Delete it.

```text
┌─────────────────────────────────┐
│        Large Interface          │ ← Caller passes cmd, args, compositor
├─────────────────────────────────┤
│       Thin Implementation       │ ← Just calls `process.detach`
└─────────────────────────────────┘
```

## Lazy Senior Dev Principles

*   **The Deletion Test (YAGNI):** If you delete a module and complexity vanishes, it was a useless pass-through. If complexity explodes across N callers, it was earning its keep.
*   **Depth belongs to the interface.** A deep module can use small, swappable local functions. Do not expose them.
*   **The interface is the test surface.** If you have to test past the interface (mocking internal state), the module is the wrong shape.
*   **Seam Discipline:** One adapter = a hypothetical seam (YAGNI violation). Two adapters = a real seam (e.g., niri and Hyprland commands). Do not introduce a seam unless it varies.

## Testability via Interface

**1. Accept dependencies, do not reach for them.**
```lua
-- Testable
local function layout_code(keyboard)
    return keyboard and keyboard.active_layout:sub(1, 2):upper() or ""
end

-- Garbage (Hard to test, hidden coupling to the live capability)
local function layout_code()
    local keyboard = mantle.keyboard:get()
    return keyboard and keyboard.active_layout:sub(1, 2):upper() or ""
end
```

**2. Return results, avoid hidden state mutations.**
```lua
-- Testable
local function next_file(files, current)
    for i, file in ipairs(files) do
        if file == current then return files[i % #files + 1] end
    end
    return files[1]
end

-- Garbage (Hidden side effects)
local function advance_wallpaper(files, output)
    local wallpapers = store.wallpapers:get()
    wallpapers[output] = { path = files[1] }
    store:set("wallpapers", wallpapers)
end
```

## Going Deeper
*   **Deepening a module:** Call `deepening`.
*   **Alternative interface architectures:** Call `design-it-twice`.

Files in this skill

  • DEEPENING.md2.4 KB
  • DESIGN-IT-TWICE.md2.3 KB
  • SKILL.md3.7 KB

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.

Comments

Loading comments…

Newsletter

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