← Back to Skills Marketplace
toliuweijing

Draft Agent Loop

by Jim Liu · GitHub ↗ · v1.6.0 · MIT-0
cross-platform ✓ Security Clean
215
Downloads
1
Stars
0
Active Installs
12
Versions
Install in OpenClaw
/install draft-agent-loop
Description
Enforce a Human-in-the-Right-Loop (HITRL) lifecycle for remote agents. Use this skill when the user wants structured oversight over an agent task: plan appro...
README (SKILL.md)

Draft Agent Loop Skill (HITRL)

Use this skill to implement a rigorous human-agent collaboration loop. This is the "Human-in-the-Right-Loop" (HITRL) method, designed to eliminate "blind box" agent outcomes by forcing plan approval and result verification.

Scope: This skill orchestrates remote agent workflows using the draft CLI. All persistence is through Draft pages (via the canonical draft-cli dependency). It does not write to local disk or agent memory.

Trigger Guidance

Trigger this skill when:

  • "Work on this task and check with me before and after."
  • "I want to review your plan first before you do anything."
  • "Use HITRL / use draft-agent-loop for this."
  • "Apply structured oversight to this task."
  • New task received where the user's intent is high-stakes or complex enough to warrant human gates.
  • A new iteration is requested after a Phase 3 sign-off.

Do NOT trigger this skill when:

  • The user asks to do a task directly with no mention of approval or review gates.
  • The user only asks about raw Draft commands or page automation without approval gates (use draft-cli).
  • The user wants a local-file authoring workflow (authorship in local markdown).

Core Rules

  • Source of Truth: The "Task Journal" Draft page. All plans, logs, and results live there.
  • Environment: Always use headless page mode through draft ... --runtime v2.
  • Runtime dependency: Follow the startup and page-operation rules from draft-cli.
  • Handoff Mode: Blocking. STOP and wait for human approval/sign-off in the chat before proceeding to the next phase.
  • No Sensitive Data in Logs: Do NOT include credentials, secrets, tokens, or PII in execution log entries or plan documents. Limit evidence to status indicators and non-sensitive file names.

Phase 0: Setup & Connection

Before doing anything, establish a stable Draft connection:

# 1. Start the daemon in headless runtime v2
draft start-server

# 2. Confirm the session is READY before proceeding
draft status --json

If draft status does not show a healthy v2 headless session, follow the draft-cli recovery pattern:

  • DAEMON_OFFLINE → re-run draft start-server
  • wrong runtime selected → stop and correct runtime before writing
  • Only proceed once draft status --json shows a healthy headless v2 session

Phase 1: Plan (Proposal & Approval)

Before executing any code or changes:

  1. Create Journal: Create a new Draft page titled \x3CTask Name> - Task Journal.

    draft page create "\x3CTask Name> - Task Journal" --json
    
  2. Submit Plan: Author a detailed Task Journal using the mandatory template. Append it to the Journal.

    cat \x3C\x3C 'EOF' | draft page append \x3Cid> --json
    # 📋 Task: [Title]
    
    ## Context
    [Detailed background and motivation]
    
    ## Problem / Goal
    [Specific issue being solved or feature being added]
    
    ## Acceptance Criteria (Outcome-Focused)
    - [ ] [Criterion 1]
    - [ ] [Criterion 2]
    
    ## Implementation Notes
    [Current state analysis, relevant files, suggested approach, technical considerations]
    
    ## Test Coverage
    [Test strategy, scenarios to test, existing tests to reference]
    EOF
    
  3. Confirm Before Publishing: Before publishing, explicitly confirm with the user: "I am about to publish the Task Journal for external review. Please confirm."

  4. Handoff: On confirmation, publish the page and ask for approval.

    draft page publish \x3Cid> --invite-code "${GLOBAL_INVITE_CODE:-innosage}" --json
    

    Handoff Phrase: "I have initialized the Task Journal with the plan and requirements: [URL]. Please review the context and acceptance criteria. Once you are ready for me to proceed, please reply with APPROVED or LGTM here in the chat."

  5. Wait: STOP. Do not proceed until the user explicitly tells you to continue in the chat. Note: Do not rely on Draft page comments for approval on remote/public pages.

Phase 2: Execute (Action & Logging)

Once approved:

  1. Verify Approval: Confirm the user has provided approval in the chat.
  2. Execute: Perform the tasks outlined in the plan.
  3. Log Evidence: For every significant action, append a concise, non-sensitive log entry to the Journal under a # 📜 Execution Log section. Do NOT include raw command output, file contents, or credentials.
    cat \x3C\x3C 'EOF' | draft page append \x3Cid> --json
    ### [Timestamp] Action: [Description]
    - **Status**: Success/Failure
    - **Evidence**: [e.g., "Modified src/components/Button.tsx — added reveal prop"]
    EOF
    

Phase 3: Verify (Result & Sign-off)

Once the execution is complete:

  1. Submit Results: Append a # ✅ Final Results summary to the Journal. Include links to artifacts (e.g., PR URL, Draft page URL). Do not include raw file dumps.

  2. Confirm Before Publishing: Explicitly confirm with the user before re-publishing.

  3. Handoff: On confirmation, re-publish the page.

    draft page publish \x3Cid> --invite-code "${GLOBAL_INVITE_CODE:-innosage}" --json
    

    Handoff Phrase: "I have completed the task. Please verify the results in the Task Journal: [URL]. If satisfied, reply with DONE or here in the chat."

  4. Wait: STOP. If the user provides sign-off (DONE / ), proceed to Phase 4. If feedback is received, enter the Iteration Loop.

Phase 4: Archive (Draft Page Only)

After sign-off, append a final summary to the existing Task Journal page. This keeps all persistence within Draft — no local filesystem writes.

cat \x3C\x3C 'EOF' | draft page append \x3Cid> --json
# 🗂 Task Complete — Summary
- **Outcome**: [Brief description of what was achieved]
- **Key Decisions**: [Any notable trade-offs or design choices]
- **Artifacts**: [Links to PR, relevant files, or external references]
EOF

The Draft page itself (with its page ID and URL) is the durable record. No additional writes to TASK_LOG.md, knowledge/, or other filesystem locations are required or expected.

Iteration Loop

If the user provides feedback or requests changes after Phase 3:

  1. Acknowledge: Acknowledge the feedback in the chat.
  2. Start New Iteration: Enter Phase 1 again to propose how you will address the feedback.
  3. Append to Same Page: Do NOT create a new page. Append the new plan to the existing Task Journal under a new heading: # 📋 Iteration [N]: Addressing Feedback.
  4. Template: Use the mandatory Phase 1 template for each new iteration to maintain context and traceability.

Non-Goals

  • Do NOT use browser-backed v1 or --mode workspace.
  • Do NOT skip the plan approval gate.
  • Do NOT execute multiple un-logged steps.
  • Do NOT write to local agent filesystem (no TASK_LOG.md, no knowledge/ writes).
  • Do NOT include credentials, PII, or sensitive command outputs in Draft page content.
Usage Guidance
This skill is coherent for enforcing a human-in-the-loop process, but before installing or using it: 1) Review the npm package '@innosage/draft-cli' (source, maintainers, and recent releases) to ensure you trust the binary being installed. 2) Be cautious about what you put into Task Journals — publishing a plan or logs to an external Draft service can leak sensitive context if you include secrets, PII, or proprietary material. 3) Understand that 'draft start-server' runs a background daemon; check whether it writes local state or opens network endpoints in your environment. 4) If you have strict data-handling requirements, test the workflow in an isolated environment and confirm the invite/publish settings (GLOBAL_INVITE_CODE) before sharing pages externally.
Capability Analysis
Type: OpenClaw Skill Name: draft-agent-loop Version: 1.6.0 The skill implements a 'Human-in-the-Right-Loop' (HITRL) workflow designed to increase oversight of agent tasks via the `draft-cli` tool. It enforces mandatory approval gates, structured planning, and execution logging to remote 'Draft' pages while explicitly instructing the agent to exclude sensitive data (PII, credentials) from logs and avoid local filesystem writes. The logic is consistent with its stated purpose of providing structured human oversight.
Capability Assessment
Purpose & Capability
The name/description match the requested artifacts: the skill is built around the 'draft' CLI and the SKILL.md exclusively instructs the agent to run draft commands (start-server, status, page create/append/publish). The declared install (npm @innosage/draft-cli) and required binary ('draft') are proportionate to the stated purpose.
Instruction Scope
Instructions are narrowly scoped to draft CLI operations and human approval gates, which fits the purpose. However, the skill instructs starting a daemon (draft start-server) and publishing pages to the Draft service; those actions can create local processes/state and will store content on an external service. The SKILL.md explicitly says 'does not write to local disk or agent memory,' which could be misleading if the draft daemon or CLI persists state locally. Also, publishing Journals may expose context that unintentionally contains sensitive data despite the 'do not include secrets' guidance.
Install Mechanism
Install is via an npm package (@innosage/draft-cli) that provides the 'draft' binary. This is a common, expected mechanism for a CLI; it is medium-risk compared to instruction-only skills because it pulls executable code from the npm registry. No obscure download URLs or archive extraction are used.
Credentials
No required environment variables or credentials are declared. There is one optional env var (GLOBAL_INVITE_CODE) used for publishing; this is reasonable and scoped to the Draft publish flow. The skill does not ask for unrelated secrets or cloud credentials.
Persistence & Privilege
The skill does not request always:true and is user-invocable (normal). It does instruct starting a draft daemon which may run in the background and persist session state — this is a legitimate runtime need for the draft CLI but is a form of persistence the user should be aware of.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install draft-agent-loop
  3. After installation, invoke the skill by name or use /draft-agent-loop
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.6.0
**Dependency change for compatibility and consolidation.** - Replaced `draft-headless-pages` dependency with the canonical `draft-cli` dependency. - Updated skill description and instructions to reference `draft-cli` throughout. - Adjusted setup and recovery instructions to match `draft-cli` usage and conventions. - No changes to overall workflow logic or HITRL phases.
v1.5.14
- Default invite code now set to "innosage" if GLOBAL_INVITE_CODE is not provided, simplifying publishing during free beta testing. - GLOBAL_INVITE_CODE environment variable is now optional instead of required. - Updated documentation to reflect the new invite code default behavior in publish commands and env var description. - No functional or workflow changes; documentation and setup instructions clarified.
v1.5.13
- Updated all sample bash publish commands to use the environment variable `$GLOBAL_INVITE_CODE` instead of the literal string `innosage`. - Clarified language in the **Scope** note to specifically mention orchestration by the draft CLI. - No logic changes; adjustment improves flexibility and clarity for publishing Draft pages in varied environments.
v1.5.12
- Switched dependency from `draft-cli` to `draft-headless-pages`, enabling support for headless Draft workflows and OpenClaw-style remote environments. - Updated setup and operational instructions to require `draft ... --runtime v2` and follow `draft-headless-pages` runtime checks. - Clarified that page automation and journal workflows now use the headless runtime only—no more local or indexDB-backed modes. - Improved trigger guidance to align with headless/remote use cases and defer direct Draft command workflows to `draft-headless-pages` where no approval gates are needed. - Updated metadata to reflect new dependency and more accurate usage constraints.
v1.5.11
- Added environment and install details to metadata, including required binaries and environment variables. - Now requires the GLOBAL_INVITE_CODE environment variable for safe Draft page publishing. - Specified npm installation instructions for draft-cli dependency in the metadata. - No changes to the core HITRL workflow or operational guidance.
v1.5.10
- Bumped version from 1.5.9 to 1.5.10. - Removed the unused "requires" section under metadata in SKILL.md. - No changes to skill behavior or documentation content.
v1.5.9
- Updated metadata: added a "version" field and changed dependency structure to reference "toliuweijing/draft-cli" with URL and required bin. - Changed metadata key from "clawdbot" to "clawdis" and clarified formatting. - Incremented version to 1.5.9 in the frontmatter. - No changes to the main instructional content or workflow logic.
v1.5.8
**Adds explicit draft page publish commands and tightens non-goals** - Specifies the `draft page publish <id> --invite-code innosage --json` command for both plan and results publishing phases. - Removes generic reference to "refer to the `draft-cli` skill for the canonical publish command," making the publishing process explicit. - Expands Non-Goals with detailed, concrete restrictions and security reminders. - No behavioral or API changes to the core process; documentation and usage instructions improved.
v1.5.7
### draft-agent-loop v1.5.7 - Updated metadata version to 1.5.7. - Clarified publishing instructions in Phase 1 and Phase 3: replaced hardcoded draft-cli commands with references to using canonical publish commands from the draft-cli skill, noting environment-specific requirements. - Added new execution boundaries in Phase 2: explicitly restricts file access, config changes, and use of credentials to the approved plan scope; emphasizes adherence to project standards and avoidance of side effects. - Other usage guidance and operational rules remain unchanged.
v1.5.6
- Clarified that the skill is instruction-only: no install scripts, code files, or local filesystem writes—only Draft page-based persistence. - Updated local mode explanation: operates via indexDB/browser storage with no workspace mount or shared file access required. - Added security guidance: never include credentials, secrets, PII, or raw file/command outputs in logs or plan documents. - Introduced explicit user confirmation before publishing or re-publishing Draft pages at Plan and Verify phases. - Archive/final memory phase now appends a summary only within the Draft page—no writes to `TASK_LOG.md` or local files. - Revised description and rules to emphasize that all task data remains in Draft; local disk or agent memory storage is out of scope.
v1.5.5
- Documentation and metadata update only; no logic or functional changes. - Clarified that local-file authoring workflows are out of scope in trigger guidance. - Removed "compatibility" field from metadata, now using "version":"1.5.5" to track release. - Minor edits for conciseness and accuracy in the SKILL.md description and guidance.
v1.5.4
- Clarified trigger phrases and guidance for when to use draft-agent-loop vs. other skills. - Expanded and detailed the HITRL (Human-in-the-Right-Loop) lifecycle, emphasizing plan approval, execution logging, and result sign-off. - Introduced stricter phase-by-phase procedures, including mandatory command templates and evidence-logging requirements. - Explicitly documented fallback and recovery procedures for Draft connection issues. - Added clear iteration loop process for handling user feedback and re-approvals.
Metadata
Slug draft-agent-loop
Version 1.6.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 12
Frequently Asked Questions

What is Draft Agent Loop?

Enforce a Human-in-the-Right-Loop (HITRL) lifecycle for remote agents. Use this skill when the user wants structured oversight over an agent task: plan appro... It is an AI Agent Skill for Claude Code / OpenClaw, with 215 downloads so far.

How do I install Draft Agent Loop?

Run "/install draft-agent-loop" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Draft Agent Loop free?

Yes, Draft Agent Loop is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Draft Agent Loop support?

Draft Agent Loop is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Draft Agent Loop?

It is built and maintained by Jim Liu (@toliuweijing); the current version is v1.6.0.

💬 Comments