‹ 首页

constraint-specification

@owl-listener · 收录于 5 天前 · 上游提交 1 个月前

Defining output format, length, tone, and content boundaries within prompts.

适合你,如果你需要精确控制AI输出的格式和风格

/ 通过 npx 安装 校验哈希
npx oh-my-skill add owl-listener/ai-design-skills/constraint-specification
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- owl-listener/ai-design-skills/constraint-specification
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify owl-listener/ai-design-skills/constraint-specification
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
144GitHub stars
~479上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 f41b650 · 表述以原文为准
它做什么

装上后,Claude会根据你指定的格式、长度、语气、内容和质量标准来生成回答,确保输出符合你的精确要求。

什么时候触发

当你在提示中明确要求输出格式(如JSON、列表)、字数范围、语气风格、内容包含/排除项等约束时触发。

装好后可以这样说
Claude会生成指定JSON结构且控制长度。
Claude会调整语气并避免禁词。
Claude会按比例分配内容。
技能原文 SKILL.md作者撰写 · MIT · f41b650

Constraint Specification

Constraints are the rules that shape AI output — what format to use, how long to be, what to include, what to exclude. Well-specified constraints produce predictable, useful outputs. Vague constraints produce inconsistent results.

Types of Constraints

Format constraints:

  • Output structure (JSON, markdown, plain text, bullet points, prose)
  • Section headings and organisation
  • Required fields and optional fields
  • Data types and schemas

Length constraints:

  • Word count ranges (not exact numbers — models are bad at counting)
  • Section length proportions ("spend 60% on analysis, 40% on recommendations")
  • Minimum and maximum bounds
  • Conciseness directives ("be brief" vs. "be thorough")

Content constraints:

  • Topics to include and exclude
  • Required information elements
  • Prohibited content
  • Source restrictions (only use provided context, don't use external knowledge)

Tone constraints:

  • Formality level
  • Emotional register
  • Audience-appropriate language
  • Voice and style guidelines

Quality constraints:

  • Accuracy requirements ("cite sources", "flag uncertainty")
  • Completeness requirements ("address all aspects of the question")
  • Originality requirements ("don't repeat the question back")
  • Actionability requirements ("every recommendation must be implementable")
Writing Effective Constraints
  • Be specific: "Keep responses under 200 words" beats "be concise"
  • Prioritise: When constraints conflict, state which wins. "Accuracy over brevity."
  • Provide examples: Show what a constrained output looks like
  • Test boundaries: What happens at the edge of each constraint?
  • Separate hard and soft constraints: Hard constraints must always be met. Soft constraints are preferences.
Constraint Interactions

Constraints interact and can conflict:

  • "Be thorough" vs. "Keep it under 100 words"
  • "Be creative" vs. "Follow this exact format"
  • "Be helpful" vs. "Don't give medical advice"

Resolve conflicts explicitly in the prompt. Don't make the model guess which constraint takes priority.

Design Artefacts
  • Constraint specification documents per output type
  • Constraint priority hierarchies
  • Constraint test cases (inputs designed to stress each constraint)
  • Constraint violation examples (what bad looks like)
  • Constraint evolution logs (how constraints changed and why)
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。