plugins/agile-workflow/skills/ln-316-review-refinement-worker/SKILL.md
Use when an evaluation run requires bounded iterative refinement with trace and cleanup evidence.
npx skillsauth add levnikolaevich/claude-code-skills ln-316-review-refinement-workerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Paths: File paths (
references/,../ln-*) are relative to this skill directory.
Type: L3 Worker Category: 3XX Planning
MANDATORY READ: Load references/evaluation_worker_runtime_contract.md, references/evaluation_summary_contract.md, references/refinement_trace_contract.md, references/cleanup_evidence_contract.md
MANDATORY READ: Load references/agents/prompt_templates/iterative_refinement.md, references/agents/prompt_templates/refinement_perspectives.md
MANDATORY READ: Load references/monitor_integration_pattern.md, references/agent_review_workflow.md (Step: Iterative Refinement)
agent_runner.mjsCritical: refinement launches the advisor externally. Do NOT use host-native sub-agents for this phase.
Runtime family:
evaluation-worker-runtimeRequired manifest fields:
identifierphase_ordersummary_kind=review-refinementoperation=refinementRecommended phase_order:
PHASE_0_CONFIGPHASE_1_STAGE1_PARALLELPHASE_2_STAGE2_FINAL_SWEEPPHASE_3_WRITE_SUMMARYPHASE_4_SELF_CHECKEach perspective MUST be a separate node agent_runner.mjs --agent {advisor_agent} invocation.
Do NOT combine multiple perspectives into a single advisor prompt or session.
Each iter{N}/ subdirectory = independent advisor process with its own PID.
| Stage | Perspective | Execution | Purpose |
|-------|------------|-----------|---------|
| 1 | dry_run_executor | parallel | Catch unexecutable steps, sequencing errors |
| 1 | new_dev_tester | parallel | Catch implicit knowledge gaps, undefined terms |
| 1 | adversarial_reviewer | parallel | Catch guaranteed failures, silent corruption |
| 2 | final_sweep | after merge | Catch regressions and drift from Stage 1 fixes |
All 4 perspectives are MANDATORY. generic_quality is not included — it is covered by the Phase 2 advisor review (review_base.md + mode template).
refinement_perspectives.md matching the perspective name.
b. Build prompt: fill iterative_refinement.md placeholders ({artifact_type}, {artifact_content}, {project_context}, {review_perspective}, {iteration_number}, {max_iterations}, {previous_findings_summary}).
c. Save prompt to .hex-skills/agent-review/refinement/{identifier}/iter{N}/prompt.md
node references/agents/agent_runner.mjs --agent {advisor_agent} \
--prompt-file .hex-skills/agent-review/refinement/{identifier}/iter{N}/prompt.md \
--output-file .hex-skills/agent-review/refinement/{identifier}/iter{N}/result.md \
--cwd {project_dir}
sync-agent; Claude hosts may use Monitor for observability (see Waiting section below).## Structured Data section.node agent_runner.mjs --verify-dead {pid} per session. MANDATORY on Windows.cleanup_evidence_contract.md for each session.{previous_findings_summary} for Stage 2.If ALL 3 advisor sessions fail → EXIT(ERROR), skip Stage 2. If some fail → continue with available results, record partial errors.
final_sweep perspective from refinement_perspectives.md.{previous_findings_summary} from Stage 1..hex-skills/agent-review/refinement/{identifier}/iter4/prompt.md.sync-agent; Claude hosts may use Monitor for observability.Use the active runtime sync-agent command before parsing or merge gates. Monitor is optional Claude Code observability only.
For EACH launched advisor process:
When running under Claude Code, optional observability:
Monitor(command="tail -f {agent_log} | grep --line-buffered -E 'Phase|ERROR|DONE'", timeout_ms=120000, description="advisor refinement {perspective_name}")
After each sync/monitor cycle:
<!-- END_AGENT_REVIEW_RESULT --> marker.agent_review_workflow.md).Do NOT use sleep or manual stat-polling as the primary wait mechanism.
After each advisor call (both stages):
pid from runner stdout or metadata.node references/agents/agent_runner.mjs --verify-dead {pid}.cleanup_evidence_contract.md.| State | Meaning |
|-------|---------|
| COMPLETED | Both stages done, all results merged |
| PARTIAL_ERROR | Stage 1 had failures but Stage 2 completed |
| ERROR | All Stage 1 advisor sessions failed (Stage 2 skipped) |
| SKIPPED | No advisor available in health check |
Emit summary_kind=review-refinement.
Payload must include:
worker=ln-316statusoperation=refinementwarningsPrefer these fields:
stages_completed (int: 1 or 2)exit_reason (enum: COMPLETED, PARTIAL_ERROR, ERROR, SKIPPED)applied (int: total suggestions applied across all stages)architecture_gate_rejections (count)stage1_perspectives (list of completed perspective names)stage1_failed (list of failed perspective names)metadata.refinement_traceagent_runner.mjs (not host-native sub-agents)sync-agent used for waiting; Claude Monitor is optional observabilityrefinement_trace_contract.mdreview-refinement summary writtenVersion: 2.0.0 Last Updated: 2026-04-13
testing
Checks runtime lifecycle and config validation: bootstrap, shutdown, probes, cleanup, env sync, and fail-fast startup. Use for runtime readiness.
testing
Checks races, deadlocks, async hazards, TOCTOU, blocking I/O, and shared resource contention. Use when auditing concurrency correctness.
testing
Checks diagnosability through structured logs, metrics, traces, correlation IDs, and useful log levels. Use when auditing incident visibility.
development
Finds code that can be safely deleted: unreachable, unused, obsolete compatibility, and commented-out code. Use when pruning dead code.