AgentSkillsCN

design

为应用提供架构与设计咨询。

SKILL.md
--- frontmatter
name: design
description: Architecture and design consultation for applications.

Design Consultation

Use this skill when discussing architecture, design patterns, or system structure.

Use preview skill to validate the plan before implementation.

Unix/Linux Philosophy (for CLI tools and system architecture)

Core Principles

  1. Do one thing well - Each program/function should have a single purpose
  2. Compose with others - Design for pipelines and composition
  3. Text streams - Use text as universal interface
  4. Small, sharp tools - Prefer focused tools over monolithic solutions
  5. Fail fast, fail loudly - Exit on error with clear messages

Design Guidelines

  • Prefer explicit over implicit behavior
  • Make default behavior safe; require flags for dangerous operations
  • Support stdin/stdout for composition
  • Use exit codes meaningfully (0=success, non-zero=error)
  • Write to stderr for diagnostics, stdout for output

Checklist

  • Single responsibility per module/function
  • Composable via standard I/O
  • Clear error messages to stderr
  • Meaningful exit codes
  • No hidden side effects

The Twelve-Factor App (for web applications and microservices)

Factors

#FactorPrinciple
ICodebaseOne codebase tracked in VCS, many deploys
IIDependenciesExplicitly declare and isolate dependencies
IIIConfigStore config in environment variables
IVBacking servicesTreat backing services as attached resources
VBuild, release, runStrictly separate build and run stages
VIProcessesExecute app as stateless processes
VIIPort bindingExport services via port binding
VIIIConcurrencyScale out via the process model
IXDisposabilityFast startup and graceful shutdown
XDev/prod parityKeep development and production similar
XILogsTreat logs as event streams
XIIAdmin processesRun admin tasks as one-off processes

Checklist

  • No hardcoded config (use env vars)
  • Dependencies in manifest (package.json, go.mod, etc.)
  • Stateless processes (no local session state)
  • Logs to stdout (no local log files)
  • Graceful shutdown handling
  • Health check endpoints