name: tq-forge-queue description: | Show queued forge work — intents deferred while the halt flag was set, plus items flagged "needs_manual_review" because their score stayed below 7 after a refine attempt. Lets you remove, reorder, or run the next item. Use when asked for "/tq-forge-queue", "what's queued", "show pending forges", or "process the queue". allowed-tools: - Bash - Read - Write - AskUserQuestion
/tq-forge-queue — view + manage deferred forge work
When to use
/tq-forge and /tq-forge-skill queue the requested intent (instead of running
it) when $TQ_FORGE_HOME/halt.flag is set, and flag artifacts as
needs_manual_review when scoring stays <7. This skill is the cockpit for both:
inspect what's pending, drop entries you don't want, and run the next one when
you're ready.
Procedure
export TQ_FORGE_HOME="${TQ_FORGE_HOME:-$HOME/.tq-forge}"
S="${CLAUDE_PLUGIN_ROOT:-${TQ_FORGE_HOME:-$HOME/.tq-forge}/install}/scripts"
source "$S/common.sh" && tq_ensure_home
Render both lists.
bash "$S/forge-checkpoint.sh" statusTwo arrays matter:
queue(intents waiting to run) andneeds_manual_review(slugs scored <7).Ask the user what to do next via AskUserQuestion:
- Run next — pop item #1 and process it via the
/tq-forgeprocedure. - Run all — loop through every queued intent. Stop if the halt flag re-appears.
- Drop one — prompt for the index, remove it.
- Clear queue — drop all
queueentries (keepsneeds_manual_review). - Open review — for a
needs_manual_reviewslug, print its sandbox path so the user can edit by hand, then/tq-forge-testit.
- Run next — pop item #1 and process it via the
Run next pops atomically:
INTENT="$(bash "$S/forge-checkpoint.sh" pop)" test -n "$INTENT" && echo "Processing: $INTENT" # then follow /tq-forgeRun all loops, checking the halt flag each iteration:
while INTENT="$(bash "$S/forge-checkpoint.sh" pop)"; [ -n "$INTENT" ]; do test -f "$TQ_FORGE_HOME/halt.flag" && echo "⏸ halt set — stopping." && break echo "Processing: $INTENT" # follow /tq-forge for each doneDrop / clear mutate the queue file safely (read-modify-write):
python3 -c "import json,pathlib,os;p=pathlib.Path(os.environ['TQ_FORGE_HOME'])/'forge-queue.json';q=json.loads(p.read_text());q['queue'].pop(<idx>);p.write_text(json.dumps(q,indent=2))"
Pitfalls
forge-queue.jsonis the source of truth for deferred work. Don't overwrite it blank — always read-modify-write.- Older entries may be bare strings; newer ones are
{intent, at}dicts. Handle both shapes when displaying. - "Run all" without checking the halt flag re-arms the problem the queue solved. Check it every iteration.
Verification
- After running an item, the queue length decreased by exactly one (
popremoves it). forge-queue.jsonis still valid JSON:python3 -c "import json,sys;json.load(open(sys.argv[1]))" "$TQ_FORGE_HOME/forge-queue.json".
Tags
tq-forge queue pending manage