code-design

Code Design Principles — Agent Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "code-design" with this command: npx skills add kengz/good-code/kengz-good-code-code-design

Code Design Principles — Agent Skill

You are setting up agent instructions for this project based on the 6 Principles of Good Code Design: Consistent, Correct, Clear, Concise, Simple, Salient.

Step 1: Check for Existing Files

Before writing anything, check if any of these files already exist in the project root:

  • CLAUDE.md

  • AGENTS.md

  • .cursorrules

  • .github/copilot-instructions.md

If any exist, show the user what was found and ask whether to:

  • Merge the principles into the existing file

  • Replace the existing file

  • Cancel

Do not overwrite without explicit confirmation.

Step 2: Detect Project Stack

Scan the project root for configuration files to determine the stack:

File Stack

package.json

Node.js / TypeScript / JavaScript

tsconfig.json

TypeScript

pyproject.toml

Python (modern)

setup.py / setup.cfg

Python (legacy)

Cargo.toml

Rust

go.mod

Go

Gemfile

Ruby

pom.xml / build.gradle

Java / Kotlin

mix.exs

Elixir

Package.swift

Swift

Also detect:

  • Package manager: Look for uv.lock , poetry.lock , pnpm-lock.yaml , yarn.lock , package-lock.json , Pipfile.lock

  • Test framework: Look for pytest.ini , jest.config.* , vitest.config.* , .mocharc.* , test directories

  • Linter/formatter: Look for .eslintrc.* , biome.json , ruff.toml , .prettierrc.* , rustfmt.toml

Step 3: Read the Template

Read the CLAUDE.md file located in this skill's directory (next to this SKILL.md file). This is the base template you will customize. For the full rationale behind each principle, see PRINCIPLES.md in the same directory.

Step 4: Generate the Instructions File

Using the template from Step 3, create a CLAUDE.md (or AGENTS.md if the user's agent platform prefers it) in the project root. The template includes Python and TypeScript as examples — adapt the language-specific sections to match the detected stack:

  • Style Guide — Replace the Python/TypeScript subsections with idiomatic style entries for the detected language(s).

  • Project Setup — Replace with actual setup instructions: package manager commands, build/test/lint scripts found in the project's config files (package.json scripts, Makefile , pyproject.toml , etc.). The Python section in the template shows the level of detail expected.

Step 5: Confirm

After writing the file, tell the user:

  • What file was created and where

  • What stack was detected

  • What sections were customized

  • Suggest they review and adjust the Project Setup section for any project-specific tooling

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

good-code

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated