AGENT SKILL

unix-design

Designs the internals of one program or sub-project as small single-purpose modules with plain-text interfaces, separated mechanism and policy, and one build/run command each, following the Unix philosophy. Writes arch.md. Use when designing a new feature's architecture inside a program, a CLI, module or data flow; for splitting a system into several programs use decompose.

License 许可
Apache-2.0
最近更新
2026-10-15
Stars
★ 0
Forks
0

01 前言 Front Matter

name
unix-design
description
Designs the internals of one program or sub-project as small single-purpose modules with plain-text interfaces, separated mechanism and policy, and one build/run command each, following the Unix philosophy. Writes arch.md. Use when designing a new feature's architecture inside a program, a CLI, module or data flow; for splitting a system into several programs use decompose.

02 资源文件 1

03 SKILL.md 正文

Unix design

Output: .dev-docs/features/<slug>/arch.md, following ${CLAUDE_SKILL_DIR}/../workflow/references/artifacts.md. Read product.md and design.md first if they exist. Read the existing code before proposing new parts. Per-rule checks: ${CLAUDE_SKILL_DIR}/references/unix-rules.md.

Procedure

  1. Stay inside the map. If .dev-docs/system.md exists, design only inside the sub-projects this feature touches. A new cross-project interface goes to decompose, never into arch.md.
  2. List the jobs. One component per job, named by the job (fetch, parse, dedupe, not manager, service, utils). If you need "and" to describe it, split it.
  3. Pick interfaces before code. Prefer text: CLI args, stdin/stdout lines, JSON Lines, files, exit codes. Use a network API only when the boundary really is a network; then write the OpenAPI or JSON Schema file in contracts/ first and implement against it. Write the exact format (fields, one example line, exit codes) into arch.md.
  4. Separate mechanism from policy. The engine does how; config/data tables say what (limits, rules, routes, thresholds). Policy changes must not touch engine code.
  5. Prefer data over code. Table-driven dispatch instead of if/else chains; rules as data rows the engine interprets.
  6. Reuse first. New code last; every new dependency gets a one-line justification.
  7. One command each. Each component builds, runs and tests alone with one command (make test-parse, ./parse < sample.jsonl). Put that command in the Run column of every Components row, including in a chat-only answer; a row without one is unfinished.
  8. Silence and loud failure. No output on success; on failure a specific message on stderr naming the input and cause, and a non-zero exit. Never swallow errors.
  9. Contradiction scan. When a trade-off appears, write it as "need X and not-X" (e.g. "need fresh data and not slow requests"). Try to separate it in time (cache now, refresh later), space (different component holds each side) or condition (X only when Y) before accepting a compromise. Record the result under Decisions.
  10. STRIDE. One line per row: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege — threat at which boundary and the mitigation, or n/a — reason.
  11. Write arch.md with Status: draft, then ask the user to approve.

Composition patterns between programs and the general rules (adapters, message passing, pipelines over orchestrators, contract first): ${CLAUDE_SKILL_DIR}/../decompose/references/patterns.md.

arch.md sections

# <Feature> architecture
Status: draft

## Components
| Name | One job | Input | Output | Run |
|---|---|---|---|---|

## Interfaces
<exact CLI usage / line format / JSON Schema / exit codes, with one example each>

## Data flow
```mermaid
flowchart LR
  a[fetch] -->|JSONL| b[parse] --> c[dedupe] --> d[upload]
```

## Mechanism vs policy
<engine parts vs config/data tables, where each policy lives>

## Threats
| STRIDE | Threat | Mitigation |
|---|---|---|

## Decisions
<one paragraph each: decision, alternatives, why, contradictions resolved>

04 同仓库更多 Skills

VolkovIlia
VolkovIlia/deadlion-studio

write-plan

Turns approved product/design/architecture artifacts or a clear request into plan.md: small ordered tasks, each with exact files, a test written first and a verification command. Use before implementing anything larger than a one-file change.

★ 0
VolkovIlia
VolkovIlia/deadlion-studio

workflow

Runs the deadlion pipeline (product → design → decompose → architecture → plan → build → review → verify) through plain-text artifacts in .dev-docs/. Use when the user starts a new product, system, feature or multi-step change, or asks what to do next.

★ 0
VolkovIlia
VolkovIlia/deadlion-studio

verify

Evidence before claims: before saying work is done, fixed or passing, run the proving command fresh, read its output and the git diff, and report VERIFIED and NOT VERIFIED items separately. Use before declaring any task complete and after any subagent reports success.

★ 0
VolkovIlia
VolkovIlia/deadlion-studio

ux-design

Designs the user interface of a program at the lowest rung that serves the job — CLI, filter (dmenu/fzf style), terminal UI, native GUI or web — with flows, states, a key map, design tokens kept in config.def and numeric gates per rung, so every UI works alone and embeds; avoids generic AI-looking UI. Includes the dl-contrast checker. Writes design.md. Use when building or changing any user interface, screen, TUI, GUI, component or visual style.

★ 0
VolkovIlia
VolkovIlia/deadlion-studio

ui-verify

Verifies a running UI against the gates in design.md — web pages in a real browser via the Playwright MCP (screenshots at 375/768/1280 px, console errors, axe scan, touch targets), terminal programs through dl-tui in a headless tmux (screens at 80×24, 40×12 and 20×5, NO_COLOR, key scripts per state, terminal restore, stdout purity), and token contrast with dl-contrast. Use after implementing or changing any UI, or when the user asks to check how a screen looks or works.

★ 0
VolkovIlia
VolkovIlia/deadlion-studio

testing

Test strategy and execution: test-first, isolated unit tests, then integration, then regression; tests assert behaviour, boundaries and errors, never wiring or mock echoes; make test and test.sh for programs, fixture tests for contracts; memory-safe fixtures for large suites. Use when writing tests, choosing what to test, or when a test suite is slow, flaky or runs out of memory.

★ 0