Skip to content
Back to skills

Design

ASecurity

Use when adding a new module, service, API, or data model, choosing between architectural approaches, or when code is hard to test or change. Covers module boundaries, interfaces, domain naming, and recording decisions.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 6, 2026
ai-agentsgogitapidatabase

Works with

  • api

Security analysis

A100/100

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

Scanned November 6, 2026

npx -y skills add PeanutGT/NutsSkills --skill design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Design?

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

Security grade badge for Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/peanutgt-design/badge)](https://www.skillsdirectory.com/skills/peanutgt-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: design
description: "Use when adding a new module, service, API, or data model, choosing between architectural approaches, or when code is hard to test or change. Covers module boundaries, interfaces, domain naming, and recording decisions."
license: Apache-2.0
metadata:
  version: "1.1.0"
  author: PeanutGT
  suite: nuts-engineering
  repository: https://github.com/PeanutGT/NutsSkills
---

# Design modules and interfaces

**Core rule:** Follow the existing pattern unless you can name the concrete problem it fails to solve.

Most tasks need no new architecture. Check the codebase first.

## Principles
- **Deep modules.** A small, simple interface hiding a lot of behavior. Avoid shallow modules whose interface is as complex as their implementation.
- **Information hiding.** Each module owns one decision that is likely to change (a storage format, a vendor, an algorithm) and hides it.
- **Dependencies point inward.** Business logic does not import frameworks, databases, or HTTP. Adapters depend on the core, not the reverse.
- **Domain language.** Name types and functions with the words the users and docs use. If the code says `Item` but the business says `Shipment`, fix the name.
- **Design for testability.** If it needs heavy mocking to test, the boundaries are wrong. Pass dependencies in.
- **YAGNI.** No extension points, plugins, or config for needs that do not exist yet.

## Process
1. Describe the problem and the forces (what changes often, what must stay stable, scale, team).
2. Look at how similar things are done in this codebase. Prefer that.
3. If a new approach is warranted, sketch **two or three options** briefly: interface, data flow, trade-offs.
4. Recommend one. Pick the simplest that meets the forces. If the decision is hard to undo or crosses module boundaries, run `fresh-eyes` on it before committing.
5. Write the public interface (types, function signatures) before the implementation.
6. Record significant decisions as an ADR (template below), default `docs/adr/NNNN-title.md`.

## API checklist
- [ ] Names describe intent, not implementation
- [ ] Inputs validated at the boundary; errors are explicit and typed
- [ ] Hard to misuse: no boolean flag soup, no order-dependent calls
- [ ] Backward compatibility / versioning considered for public APIs
- [ ] Idempotency for anything retried over the network

## ADR template
```markdown
# NNNN. <Decision title>
Status: proposed | accepted | superseded by NNNN
## Context
## Decision
## Options considered
## Consequences (good and bad)
```

## Rationalizations to reject
| Excuse | Answer |
|---|---|
| "We might need this flexibility later" | Add it later, when you know its shape. |
| "Let's use the pattern from <famous system>" | Your forces are not theirs. Name the problem it solves here. |

Related: `tdd`, `simplify`, `spec`, `fresh-eyes`.

Files in this skill

  • CHANGELOG.md186 B
  • SKILL.md2.8 KB
  • evals/behavior/case.yaml146 B
  • evals/behavior/graders/01-expected-behavior.md199 B
  • evals/behavior/prompt.md163 B
  • evals/triggers.json349 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.