원클릭으로
ln-316-review-refinement-worker
Use when an evaluation run requires bounded iterative refinement with trace and cleanup evidence.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when an evaluation run requires bounded iterative refinement with trace and cleanup evidence.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when bootstrapping or managing VPS agent environments: fresh install, add project, hex-relay redeploy, diagnostics, or fleet plan/apply.
Use when installing, verifying, or updating the shared VPS host runtime for Claude Code, Codex, MCP, and marketplace plugins.
Use when creating or verifying one project runtime on a prepared VPS, including god-session, provider credentials, and local dispatcher setup.
Use when deploying, redeploying, verifying, migrating, or syncing users for the hex-relay Telegram/API control plane on a VPS.
Use when inspecting health, drift, logs, auth, ports, systemd, tmux, or safe repair needs for one VPS project environment.
Reviews skills (D1-D11 + M1-M6 criteria) or .claude/commands for quality. Use when validating skill correctness before release.
| name | ln-316-review-refinement-worker |
| description | Use when an evaluation run requires bounded iterative refinement with trace and cleanup evidence. |
| license | MIT |
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root.
Type: L3 Worker Category: 3XX Planning
MANDATORY READ: Load shared/references/evaluation_worker_runtime_contract.md, shared/references/evaluation_summary_contract.md, shared/references/refinement_trace_contract.md, shared/references/cleanup_evidence_contract.md
MANDATORY READ: Load shared/agents/prompt_templates/iterative_refinement.md, shared/agents/prompt_templates/refinement_perspectives.md
MANDATORY READ: Load shared/references/monitor_integration_pattern.md, shared/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 shared/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 shared/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