From skill-design
Design iterative document-generation pipelines with rubric-based evaluation. Use when setting up AI-driven content production with quality gates, heuristic evaluation, and revision loops. Applies the Principle of Least Action to minimize iteration cost while maximizing quality.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skill-design:heuristic-templateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A methodology for designing **iterative document-generation pipelines** where AI agents produce content, evaluate it against rubrics, and refine until approval.
A methodology for designing iterative document-generation pipelines where AI agents produce content, evaluate it against rubrics, and refine until approval.
Minimize total iteration cost while achieving quality:
Total Cost = Σ (generation_cost + evaluation_cost + revision_cost) per iteration
Optimization levers:
Before building, extract minimum viable alignment. See Clarification Protocol for full details.
| Tier | When | Questions |
|---|---|---|
| 1: Must-Have | Always | What's the purpose? Who reads it? Source of truth? |
| 2: Quality | Ambiguous | Good enough vs. reject? Blocking vs. polish issues? |
| 3: Process | Complex | Iteration budget? Human checkpoints? Approval bias? |
| 4: Deep | High-stakes | Evidence requirements? Versioning? Audit trail? |
Create a GENERATION_SPEC.md capturing intent, audience, quality priorities, sources, constraints, and iteration budget. See Generation Spec Template.
Design evaluation rubrics using the types in Contracts.
interface RubricGate {
id: string; // "gate-1-topic-alignment"
name: string; // "Topic Alignment"
evaluationType: "binary" | "score" | "checklist";
threshold: number | boolean; // Pass condition
mandatory: boolean; // Failure stops all evaluation
criteria: RubricCriterion[];
}
interface RubricCriterion {
id: string;
description: string;
weight: number; // 0-1, sum to 1 within gate
mandatory: boolean; // Must pass regardless of score
evaluator: "deterministic" | "model-graded" | "human";
check?: DeterministicCheck; // For deterministic
gradingPrompt?: string; // For model-graded
}
| Gate | Purpose | Type | Cost |
|---|---|---|---|
| 1: Topic Alignment | Is this the right topic? | Score >=70% | Low |
| 2: Structure | Are required sections present? | Checklist (all) | Low |
| 3: Content Quality | Is the content good? | Score >=7/8 | Medium |
| 4: Language & Style | Is the tone right? | Checklist >=7/9 | Medium |
| Heuristic | Rule |
|---|---|
| Gate ordering | Cheapest first (deterministic before model-graded) |
| Criteria per gate | Max 10 (avoid cognitive overload) |
| Mandatory criteria | 1-2 per gate for non-negotiable quality |
| Threshold calibration | Start strict, loosen based on false negatives |
| Weight distribution | Equal unless clear priority difference |
See Rubric Design Guide and Rubric Template.
For rubric design patterns and TypeScript contracts, see
../../evaluation-framework/RUBRIC-SCHEMA.mdand../../evaluation-framework/CONTRACTS.md.
Cost: deterministic < model-graded < human
Order gates by cost, with cheap gates catching obvious failures early.
| Mode | Cost | Reliability | Use When |
|---|---|---|---|
| Deterministic | Lowest | Highest | Pattern matching, presence checks, length |
| Model-graded | Medium | Medium | Subjective quality, semantic understanding |
| Human | Highest | Varies | Edge cases, final approval, calibration |
Rule: If you can write a regex for it, don't use a model.
Templates embed structural constraints that survive across iterations. See Document Template.
## Section A: Introduction
<!--
CONSTRAINT: 50-100 words
MUST CONTAIN: Speaker introduction, topic statement
MUST NOT CONTAIN: Conclusions or calls-to-action
-->
[Content here]
| Heuristic | Why |
|---|---|
| Embed constraints in comments | Survives generation, guides revision |
| Define structural invariants | Prevents structural issues, not just detects them |
| Use placeholders consistently | {{TOPIC}}, {{AUDIENCE}} for substitution |
| Include validation checklist | Pre-submission self-check |
iteration = 0
document = generate(spec, template)
while iteration < max_iterations:
result = evaluate(document, rubric)
if result.status == APPROVED:
return document
if result.status == NEEDS_REVISION:
feedback = prioritize(result.issues)
document = revise(document, feedback.priority_1_blocking[0])
iteration++
if result.status == REJECTED or iteration >= max_iterations:
escalate_to_human(document, result)
break
return document
| Priority | Issue Type | Action |
|---|---|---|
| P1 | Blocking (mandatory criteria) | Fix immediately, one at a time |
| P2 | Quality (score-contributing) | Fix after P1 clear |
| P3 | Polish (minor style) | Fix only if budget allows |
issue:
criterionId: "3.1"
description: "Missing concrete details"
location:
section: "Main Content"
paragraph: 2
suggestedFix: "Add specific names, dates, or numbers to support claims"
All artifacts have stable schemas for downstream consumption. See Contracts for full TypeScript definitions:
GenerationSpec - What to generateEvaluationResult - Gate pass/fail + issuesGeneratedDocumentArtifact - Document with provenanceRevisionRequest - Feedback for revisionPipelineMetrics - Aggregate health metrics# 1. Generate sample documents (30-50)
# 2. Have humans rate: Accept/Reject + rationale
# 3. Run automated evaluation
# 4. Compare: false positives vs false negatives
# 5. Adjust thresholds to match human judgment
# 6. Document calibration in rubric changelog
| Metric | Target | Action if Off |
|---|---|---|
| First-pass approval rate | >50% | Improve generation prompt/template |
| Mean iterations to approval | <2 | Improve feedback specificity |
| Escalation rate | <10% | Review edge cases, broaden criteria |
| False positive rate | <10% | Lower threshold, add deterministic guards |
| False negative rate | <20% | Raise threshold, broaden criteria |
When the pipeline fails, diagnose using the quick reference table. See Diagnostics for detailed recovery.
| Symptom | Likely Cause | Quick Fix |
|---|---|---|
| High iteration count | Rubric too strict, vague feedback | Review gate thresholds, add location+fix to feedback |
| Oscillating quality | Conflicting criteria, feedback overload | Reduce to single P1 issue, clarify priority |
| False approvals | Missing mandatory criteria, lenient grading | Add deterministic guards, recalibrate |
| False rejections | Threshold too strict, narrow criteria | Raise threshold, broaden patterns |
| Slow convergence | P2/P3 blocking P1 fixes | Strict priority enforcement |
| Infinite loops | No cap, circular dependencies | Add hard escalation, identify conflicts |
heuristic-template/
├── SKILL.md # This file (entry point)
├── references/
│ ├── clarification-protocol.md # Step 0 details
│ ├── rubric-design-guide.md # Step 1 details
│ ├── contracts.md # TypeScript types
│ └── diagnostics.md # Troubleshooting
└── assets/
├── generation-spec-template.md # Spec template
├── rubric-template.md # 4-gate rubric
└── document-template.md # Content template
| Step | Optimization |
|---|---|
| Clarification | Ask only high-VOI questions |
| Rubric | Cheap gates first, mandatory criteria minimal |
| Pipeline | Deterministic before model-graded |
| Template | Prevent issues at generation |
| Iteration | One P1 issue per revision |
| Monitoring | Calibrate to minimize total cost |
| Failure | Recovery |
|---|---|
| Requirements unclear | Return to Clarification Protocol |
| Rubric too complex | Reduce to 4 gates, 8 criteria max per gate |
| Template not constraining | Add structural comments, placeholders |
| Feedback not actionable | Add location + suggested fix to each issue |
| Thresholds arbitrary | Calibrate with human ratings |
author: Christian Kusmanow / Claude
version: 1.0.0
last_updated: "2026-02-03"
parent_skill: skill-design
changelog:
- "1.0.0: Initial skill from P19 inbox material"
npx claudepluginhub teslasoft-de/claude-skills-marketplace --plugin skill-designGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.