iterative-prompt
Autonomous AI agent workflow โ file-based UPD/RESULT cycle
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Autonomous AI agent workflow โ file-based UPD/RESULT cycle
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Pull GitHub Copilot usage statistics without UI or screenshots. Two Python CLIs: one reads live credit/quota numbers from GitHub's private Copilot API, the other runs fast, context-free queries over the plugin's per-session `main.jsonl` debug log (tokens, requests, tool calls). Use when the user wants to track AI credits, premium-request usage, token counts, or inspect what a chat session actually did.
Export, list, and search GitHub Copilot chat sessions from VS Code (both stable and Insiders) to HTML, JSON, JSONL, or text. Use when the user wants to save, share, back up, summarize, or search past Copilot chat conversations.
Fill a DOCX template interactively โ extracts <placeholder> names via CLI, asks the user for each value with vscode_askQuestions, then produces a filled copy. The original template is never modified.
Analyze git commit history to extract SDLC instruction files. Use when: reverse-engineering workflows from commits, extracting coding patterns from diffs, building agent instructions from real code changes, generating automation knowledge base from commit history. Iterates through commits, extracts per-file diffs, invokes Copilot CLI (Claude Opus 4.6) to identify and document reusable SDLC patterns.
Translate any website to any language using Chrome DevTools MCP โ the AI model extracts text from the page, translates it, and injects the translation back into the DOM.
Convert a list of markdown files (with images, code blocks, quizzes) into a single landscape DOCX with TOC, page breaks between files, shaded inline-code, and uniform image scaling
| name | iterative-prompt |
| description | Autonomous AI agent workflow โ file-based UPD/RESULT cycle |
| version | 3.0.0 |
The Iterative Prompt is a workflow pattern for AI-assisted development: instead of chatting in a chat window and losing context over time, you maintain a living file called main.prompt.md (or any *.prompt.md). Every new idea, clarification, or follow-up request is added as a new ## UPD[N] block at the bottom of that file rather than typed into a chat. After the AI acts on each update, it appends a ### RESULT block with a brief changelog. The file stays in version control alongside your project โ it is your breadcrumb trail, your running specification, and your conversation history all in one artefact.
The key insight: a committed prompt file + git diff gives the AI precise, reliable context about what changed since the last run โ no hallucination, no drift, no lost history.
This file is the runtime-agnostic pattern (file format, conventions, atomic commits). For the actual loop mechanics, pick one runtime:
runtime-ide.mdโ VS Code agent / Copilot Chat with async terminal-notification watcher.runtime-cli.mdโ Copilot CLI in a terminal with--autopilot, single long process.
Under the current GitHub Copilot billing model, every request to a premium model (e.g. Claude Opus) costs exactly 1% of your monthly premium-request budget โ regardless of input/output token count. The most economical strategy is to keep the agent working autonomously for as long as possible per single invocation.
The Iterative Prompt pattern directly supports this:
"chat.agent.maxRequests": 2500 so the agent does not stop every 25 cycles.*.prompt.md is more convenient and produces better results than typing in the chat window.## UPD[N] โ ### RESULT โ ## UPD[N+1] cycle gives the agent clear boundaries.## UPD at your own pace, append go, and the agent picks it up.compact conversation. The prompt file itself is the running summary, so compaction does not lose critical context.main.prompt.md alongside the generated code preserves how those files were produced.<follow>
iterative-prompt/SKILL.md
</follow>
## UPD1
First request from the user. Ends with the magic word: go
### RESULT (UPD1)
Brief changelog. List file paths as clickable markdown links.
## UPD2
Second request. go
### RESULT (UPD2)
โฆ
<follow> header โ optional but recommended. Lists skill files the agent should load on startup.## UPD[N] โ sequential update number starting at 1. Each block is one independent unit of work.go โ magic word at the end of the block (own line or as last word). The watcher only fires when the last unprocessed block ends with go. Without go, the user is still typing.### RESULT (UPD[N]) โ placed inside the corresponding ## UPD[N] block, immediately after the user's text.
[instructions/some-file.agent.md](../../instructions/some-file.agent.md)`instructions/some-file.agent.md`### RESULT, scan the ## UPD[N] text for any file paths written as plain text or backtick code. Convert them to clickable markdown links in-place. Change only the link formatting โ do not alter any other text.### RESULT already written) in a single commit.### RESULT โ it must be part of the same commit as the work.### RESULT (not chat-only) โ chat is breadcrumb only.When invoked or when the watcher fires, scan the file for unprocessed UPDs:
## UPD[N] blocks without a ### RESULT.go โ the user is still typing.### RESULT, atomic commit.## UPD[N], the user may be writing ## UPD[N+1] or ## UPD[N+2]. They get picked up on the next watcher fire.runtime-ide.md or runtime-cli.md).Produce a ready-to-use file with this template:
<follow>
iterative-prompt/SKILL.md
</follow>
## UPD1
Name the file main.prompt.md (or cli.prompt.md for CLI runtime) and place it in the selected folder. The user fills in ## UPD1.
| File | Purpose | Used by |
|---|---|---|
scripts/watch_prompt.py | Polls a prompt file; exits 0 when last UPD ends with go. | CLI runtime (primary); IDE runtime (legacy fallback โ primary IDE mechanism is vscode_askQuestions, see runtime-ide.md). |
scripts/run_cli.py | Thin copilot CLI wrapper with --autopilot and the right flags for iterative-prompt mode. | CLI runtime only. Pure copilot commands, no orchestration framework dependency. |
cli-agent.md | Executable agent-identity file passed to copilot -p. Tells the CLI agent to run the watcher loop. | CLI runtime only. |
ide-agent.md | VS Code custom agent that permanently follows this skill. Select it from the agent picker โ no context drift. | IDE runtime only. |
How each script is invoked differs per runtime โ see the runtime files.
| Code | Meaning |
|---|---|
| 0 | go detected โ agent should process |
| 2 | File not found |
| 130 | User Ctrl+C (clean exit) |
You can create a dedicated VS Code agent mode that permanently follows this skill. This eliminates context drift โ the agent always knows it's running the iterative-prompt loop and never forgets the rules.
For GitHub Copilot in VS Code, the agent must live in .github/agents/ so it shows up in the agent picker. Create .github/agents/iterative-prompt.agent.md with YAML frontmatter (name, description, tools) followed by a one-line body pointing at this skill:
---
name: iterative-prompt
description: "Iterative Prompt agent โ follows the UPD/RESULT cycle permanently, no context drift"
tools: [vscode/askQuestions, execute/runInTerminal, read/readFile, edit/editFiles, edit/createFile, search/codebase, search/changes, ...]
---
Follow the `instructions/iterative-prompt/SKILL.md`. Ask questions after each UPD.
After the file exists, reload VS Code (or the Copilot Chat window). The agent then appears in the agent picker dropdown in Copilot Chat โ select iterative-prompt to activate it:

The companion file ide-agent.md holds the full IDE-runtime agent body (a thin wrapper) that:
SKILL.md + runtime-ide.md on every activation.<follow> header).vscode_askQuestions loop permanently.