skills/draft-agent-loop/SKILL.md
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 approval before execution, evidence-logged execution, and result sign-off before closure. Trigger phrases: "work on this with my oversight", "check with me before you start", "use HITRL for this", "I want to review your plan first", "use draft-agent-loop". DO NOT use for tasks where the user simply asks to do something without requesting approval gates. Use draft-cli for raw Draft commands. This skill depends on the canonical draft-cli skill. It assumes headless page workflows, which fit remote OpenClaw-style isolated environments.
npx skillsauth add innosage-llc/draft-skills draft-agent-loopInstall 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.
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
draftCLI. All persistence is through Draft pages (via the canonicaldraft-clidependency). It does not write to local disk or agent memory.
Trigger this skill when:
Do NOT trigger this skill when:
draft-cli).draft-cli startup pattern.draft-cli.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 headless session, follow the draft-cli recovery pattern:
DAEMON_OFFLINE → re-run draft start-serverdraft status --json shows a healthy headless sessionBefore executing any code or changes:
Create Journal: Create a new Draft page titled <Task Name> - Task Journal.
draft page create "<Task Name> - Task Journal" --json
Submit Plan: Author a detailed Task Journal using the mandatory template. Append it to the Journal.
cat << 'EOF' | draft page append <id> --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
Confirm Before Publishing: Before publishing, explicitly confirm with the user: "I am about to publish the Task Journal for external review. Please confirm."
Handoff: On confirmation, publish the page and ask for approval.
draft page publish <id> --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."
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.
Once approved:
# 📜 Execution Log section. Do NOT include raw command output, file contents, or credentials.
cat << 'EOF' | draft page append <id> --json
### [Timestamp] Action: [Description]
- **Status**: Success/Failure
- **Evidence**: [e.g., "Modified src/components/Button.tsx — added reveal prop"]
EOF
Once the execution is complete:
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.
Confirm Before Publishing: Explicitly confirm with the user before re-publishing.
Handoff: On confirmation, re-publish the page.
draft page publish <id> --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."
Wait: STOP. If the user provides sign-off (DONE / ✅), proceed to Phase 4. If feedback is received, enter the Iteration Loop.
After sign-off, append a final summary to the existing Task Journal page. This keeps all persistence within Draft — no local filesystem writes.
cat << 'EOF' | draft page append <id> --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.
If the user provides feedback or requests changes after Phase 3:
# 📋 Iteration [N]: Addressing Feedback.TASK_LOG.md, no knowledge/ writes).tools
Retired compatibility alias for the former headless Draft page skill. Use `draft-cli` instead for all new `draft` and `draft page ...` work.
tools
Use the repo-local Draft CLI for development and testing with an isolated development port. Trigger this skill when working on `products/notion-editor/cli`, testing local Draft CLI changes, or avoiding collisions with an installed/global Draft CLI.
tools
Run the local-first authoring plus Draft review handoff loop for workspace markdown files. Use this skill when the user asks to write or revise a document and explicitly wants human review in Draft, or when the task is to apply Draft comments back to a local file. DO NOT use this skill for pure Draft command questions (use draft-cli) or generic writing tasks with no Draft review intent. Keep local workspace markdown as source of truth and use Draft GUI as the human review surface. Requires the draft-cli skill and @innosage/draft-cli (Node.js >= 18).
tools
Manage InnoSage Draft pages and hosted Secret Shares using the @innosage/draft-cli. Use this skill for `draft`, `draft page ...`, `draft secret ...`, and `draft auth ...`. Live page commands use the headless v2 daemon. Do not use this skill when "draft" is only a verb or when the task is a generic local-file writing task unrelated to Draft CLI.