From software-craft
Iteratively improve artifacts via parallel reviewers with anchor-based drift prevention. NOT for: one-shot edits, simple fixes, tasks without measurable quality. USE for: skills, prompts, commands, agents needing iterative refinement with score targets. Triggers: "iterate to 9.0", "quality loop", "IAQI", "reviewer loop", "improve until threshold", "iterative quality".
npx claudepluginhub bengous/claude-code-plugins --plugin software-craftThis skill uses the workspace's default tool permissions.
Intent-Anchored Quality Iteration (IAQI) prevents semantic drift during iterative improvement. The problem: each iteration risks optimizing for reviewer preferences rather than original intent. IAQI solves this through anchors—semantic checksums verified after every change.
Applies Acme Corporation brand guidelines including colors, fonts, layouts, and messaging to generated PowerPoint, Excel, and PDF documents.
Builds DCF models with sensitivity analysis, Monte Carlo simulations, and scenario planning for investment valuation and risk assessment.
Calculates profitability (ROE, margins), liquidity (current ratio), leverage, efficiency, and valuation (P/E, EV/EBITDA) ratios from financial statements in CSV, JSON, text, or Excel for investment analysis.
Share bugs, ideas, or general feedback.
Intent-Anchored Quality Iteration (IAQI) prevents semantic drift during iterative improvement. The problem: each iteration risks optimizing for reviewer preferences rather than original intent. IAQI solves this through anchors—semantic checksums verified after every change.
<iaqi_philosophy>
Before iterating, define anchors at three levels:
| Layer | Purpose | Can Change? | Example |
|---|---|---|---|
| Immutable | Core identity phrases | Never | "Skills encode judgment. References encode facts." |
| Semantic | Meaning to preserve | Wording only | "Force intentional choices" (can rephrase, not remove) |
| Structural | Organization patterns | Flexible | 7-section template (order can change, sections preserved) |
Why anchors matter: Without them, iteration 5 optimizes for reviewer 5's preferences, not iteration 0's intent. Anchors are checksums against drift.
A good anchor set has:
<iaqi_workflow>
Parse arguments from invocation:
artifact-path (required): file to improve--reviewers N (default: 5): parallel reviewer count--target X.X (default: 9.0): score threshold for success--max-iterations N (default: 7): iteration limit<iaqi_dimensions> based on typeRun the iteration loop until exit condition:
iteration = 0
LOOP:
iteration += 1
IF iteration > max_iterations:
HALT("Max iterations reached")
Write final report to state file
EXIT
# 1. Spawn reviewers (parallel)
Spawn N Task agents in a SINGLE message (parallel execution):
- subagent_type: "general-purpose"
- model: opus (or configured)
- prompt: reviewer template with filled variables
Wait for all reviewers to complete.
# 2. Aggregate scores
Calculate average per dimension
Calculate overall average
Check all immutable anchors present (unanimous agreement)
# 3. Check exit conditions
IF average >= target AND all_anchors_present:
Write SUCCESS to state file
Report final artifact with improvement summary
EXIT SUCCESS
IF any_anchor_missing:
HALT("Anchor violation detected")
Use AskUserQuestion: "Anchor '[phrase]' is missing. Options:"
- "Revert last fix and continue"
- "Update anchor (it was wrong)"
- "Stop iteration"
Handle response accordingly
IF score_plateau (3 iterations with < 0.1 improvement):
HALT("Diminishing returns - scores plateaued")
Write report to state file
EXIT
# 4. Apply fixes
Collect top fixes from each reviewer
Prioritize by:
1. Anchor safety (never break immutable anchors)
2. Non-negotiable dimension improvement
3. Lowest scoring dimension
Apply fixes using Edit tool
Follow <iaqi_fix_principles>
# 5. Verify anchors
Check all immutable anchors still present after edits
IF any anchor lost:
Revert the problematic edit
Try alternative fix approach
# 6. Update state file
Write iteration details (scores, fixes, anchor status)
GOTO LOOP
</iaqi_workflow>
<iaqi_reviewer_template>
Use this template when spawning reviewer agents. Fill variables before spawning.
You are an IAQI reviewer. Score an artifact against a rubric while verifying anchor preservation.
## Artifact
Read: $ARTIFACT_PATH
## Context
This artifact's intent: $INTENT_STATEMENT
## Immutable Anchors (must appear verbatim)
$IMMUTABLE_ANCHORS
## Scoring Dimensions
$DIMENSIONS_TABLE
Score each dimension 1-10 based on its description.
## Output Format (exactly)
### Scores
| Dimension | Score | Notes |
|-----------|-------|-------|
$DIMENSION_ROWS
| **OVERALL** | **X.X** | |
### Anchor Check
| Anchor | Present? |
|--------|----------|
$ANCHOR_ROWS
### Verdict
**PASS/FAIL** (target: $TARGET_SCORE, all anchors must be present)
### If FAIL: Top Fix
**Issue**: [most critical problem affecting score]
**Location**: [file:line or section name]
**Suggested fix**: [specific improvement, preserving intent]
</iaqi_reviewer_template>
<iaqi_dimensions>
Select the appropriate template based on artifact type. Human can customize during Phase 3.
| Dimension | Description |
|---|---|
| Clarity | Instructions unambiguous? Followable without guessing? |
| Trigger Quality | Keywords specific? Activates correctly? NOT-for disambiguation? |
| Anti-Slop Power | Pushes away from generic output? Opinionated? Distinctive? |
| Structure | Well-organized? Proper semantic tags? Logical flow? |
| Composability | Integrates with other skills/commands? Handles dependencies? |
| Completeness | Everything needed to execute? No gaps? |
| Best Practices | Claude 4 positive framing? Explicit instructions? Good examples? |
| Dimension | Description |
|---|---|
| Clarity | Steps clear? No ambiguous instructions? |
| Argument Design | Hints helpful? Defaults sensible? Required vs optional clear? |
| Error Handling | Failure cases addressed? Graceful degradation? |
| Tool Usage | Correct tools specified? Appropriate permissions? |
| Output Quality | Results actionable? Format appropriate for context? |
| Best Practices | Claude 4 conventions? Positive framing? |
| Dimension | Description |
|---|---|
| Clarity | Intent clear? No ambiguity in request? |
| Specificity | Concrete enough to act on? Measurable outcomes? |
| Tone | Appropriate voice? No condescending words? |
| Structure | Well-organized? Right length for purpose? |
| Best Practices | Positive framing? Examples where needed? Explicit constraints? |
| Dimension | Description |
|---|---|
| Context Clarity | Stateless awareness explained? Role clear? |
| Responsibilities | Clear scope? Actionable tasks? Boundaries defined? |
| Constraints | What NOT to do explicit? Guardrails clear? |
| Return Format | Output structure specified? All required fields documented? |
| Tool Usage | Correct tools? Appropriate permissions? |
| Best Practices | Claude 4 patterns? Context efficiency? |
| Dimension | Description |
|---|---|
| Accuracy | Technically correct? Up to date with code? |
| Clarity | Understandable? Jargon defined? |
| Completeness | All necessary info? No critical gaps? |
| Structure | Well-organized? Easy to navigate? |
| Examples | Concrete? Copy-pasteable? Cover common cases? |
| </iaqi_dimensions> |
<iaqi_state_file>
Location: <artifact-dir>/.iaqi/<artifact-name>-<YYYY-MM-DD>.md
Create the .iaqi/ directory if it doesn't exist. Write state after each phase completes.
# IAQI State: [artifact-name]
**Date**: YYYY-MM-DD
**Artifact**: [full-path]
**Target Score**: X.X/10
**Max Iterations**: N
**Reviewers**: N
**Status**: in_progress | completed | halted
---
## Phase 1: Understanding
### Intent Statement
> "[1-2 sentences: why this artifact exists, its distinctive quality]"
### Workflow Diagram
[ASCII or Mermaid diagram]
**Status**: LOCKED
---
## Phase 2: Anchors
### Immutable Anchors (must appear verbatim)
1. "[exact phrase 1]"
2. "[exact phrase 2]"
...
### Semantic Anchors (meaning preserved)
| Concept | Meaning |
|---------|---------|
| [name] | [what it means] |
...
### Structural Anchors (organization preserved)
1. [pattern 1]
2. [pattern 2]
...
### Forbidden Changes
- [what would violate intent]
...
**Status**: LOCKED
---
## Phase 3: Scoring System
### Artifact Type
[skill | command | prompt | agent | doc]
### Dimensions
| Dimension | Description |
|-----------|-------------|
| [dim1] | [desc] |
...
### Target Score
X.X/10
### Non-Negotiable Dimension
[dimension] >= Y.Y
**Status**: LOCKED
---
## Phase 4: Iteration History
| Iter | Score | Delta | Anchors | Status |
|------|-------|-------|---------|--------|
| 0 | X.X | - | OK | baseline |
| 1 | X.X | +X.X | OK | continue |
...
### Iteration N Details
**Scores**:
| Reviewer | D1 | D2 | ... | Overall |
|----------|----|----|-----|---------|
| R1 | X | X | ... | X.X |
...
| **Avg** | X | X | ... | **X.X** |
**Anchor Check**: All present / VIOLATION: [details]
**Fixes Applied**:
1. [fix] - [rationale]
...
---
## Outcome
**Result**: SUCCESS | HALTED | IN_PROGRESS
**Final Score**: X.X/10
**Total Iterations**: N
**Anchors Preserved**: YES | [violations]
</iaqi_state_file>
<iaqi_fix_principles>
When applying fixes during iteration, follow these principles:
The "Best Practices" dimension checks Claude 4 conventions:
When rewriting any passage:
<iaqi_success_criteria>
Your IAQI run succeeded when:
Signs of a quality IAQI run:
<iaqi_closing>
The goal of IAQI is not perfection—it's preserving intent while improving execution. If your final artifact scores 9.5 but doesn't sound like the original author, you've failed. Anchors exist to keep the soul intact while polishing the surface. </iaqi_closing>