跳到技能内容
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
词映 AI导航
工具库Skills 技能
我的收藏
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
Skills directory/laurigates/claude-plugins/design-by-contract

Claude Code design-by-contract skill: Specify function contracts

Use design-by-contract to spell out what callers provide, what a function promises on return, and which properties a class must preserve across calls. It also helps decide where to validate an input.

中文

Install in Claude Code

Use a local Claude Code session in a practice project. Supply a short requirement or point the skill at an existing function.

  1. Download the repository snapshot at the linked commit. Copy the entire software-design-plugin/skills/design-by-contract/ directory into .claude/skills/design-by-contract/ in your practice project.
  2. Confirm that SKILL.md is directly inside .claude/skills/design-by-contract/. Open Claude Code from the project root and enter /design-by-contract reserveSeat.

Example task

Run /design-by-contract reserveSeat. Add this requirement: a request for two seats succeeds when four remain, leaving two. A request for five fails and leaves four. Ask for a design report.

What to check

Look for a positive-integer input requirement, a capacity check, and a clear guarantee that a rejected request leaves the seat count unchanged.

Original SKILL.md on GitHub · Updated 2026-11-11

Frequently asked question

Where should reserveSeat check the requested number of seats?

Validate external input at the entry point and return a clear error for an invalid request. Reserve assertions for conditions the application itself has already guaranteed.

词映 AI 导航Skills 技能
工具分类全部工具已本地化技能选型指南AI 快讯