queue-based-flow

dredd-us's avatarfrom dredd-us

Stack prompts in queue while agent runs, minimizing context switches to achieve sustained 6k lines per day output and preserved flow state. Use for heavy coding sessions, iterative refinements, rapid iteration cycles, or sustained productivity. Queue enables async execution without blocking. Triggers on "flow state", "queue prompts", "heavy coding", "sustained output", "minimize interruptions".

⭐0stars🔀0forks📁View on GitHub🕐Updated Nov 20, 2025

When & Why to Use This Skill

This Claude skill implements a sophisticated prompt queuing mechanism designed to maximize developer productivity and maintain 'flow state' during intensive programming sessions. By allowing users to stack multiple instructions asynchronously, it eliminates the idle time spent waiting for individual agent responses, effectively enabling a sustained output of up to 6,000 lines of code per day while minimizing cognitive context switching.

Use Cases

  • Heavy Coding Sessions: Rapidly queuing multiple feature implementations or file creations in one go to keep the development momentum high.
  • Iterative Refinements: Submitting a series of bug fixes and style adjustments across a codebase without waiting for the agent to complete the previous task.
  • Rapid Prototyping: Dumping a sequence of architectural requirements and logic prompts during the early stages of a project to build out boilerplate and core logic quickly.
  • Context Preservation: Using the queue to offload secondary tasks (like documentation or unit test generation) while the developer focuses on solving the primary logic problem.
namequeue-based-flow
descriptionStack prompts in queue while agent runs, minimizing context switches to achieve sustained 6k lines per day output and preserved flow state. Use for heavy coding sessions, iterative refinements, rapid iteration cycles, or sustained productivity. Queue enables async execution without blocking. Triggers on "flow state", "queue prompts", "heavy coding", "sustained output", "minimize interruptions".

Queue-Based Flow State

Purpose

Stack prompts in queue while agent executes, minimizing context switches to achieve sustained 6k lines/day output.

When to Use

  • Heavy coding sessions
  • Iterative refinements
  • Flow state preservation
  • Rapid iteration cycles
  • High-productivity sessions

Core Instructions

Queue Pattern

from asyncio import Queue
import asyncio

class PromptQueue:
    def __init__(self):
        self.queue = Queue()
        self.running = False

    async def add_prompt(self, prompt):
        """Add prompt to queue"""
        await self.queue.put(prompt)
        if not self.running:
            await self.process_queue()

    async def process_queue(self):
        """Process queued prompts"""
        self.running = True

        while not self.queue.empty():
            prompt = await self.queue.get()
            await self.execute_async(prompt)
            self.queue.task_done()

        self.running = False

    async def execute_async(self, prompt):
        """Execute prompt asynchronously"""
        result = await agent.execute(prompt)
        return result

Usage Example

queue = PromptQueue()

# User rapidly adds prompts without waiting
await queue.add_prompt("Fix bug in auth.py")
await queue.add_prompt("Add tests for new feature")
await queue.add_prompt("Refactor database layer")
await queue.add_prompt("Update documentation")

# All execute in sequence without context switches
# User maintains flow state

Performance

  • 6k lines/day sustained output
  • Minimized context switching
  • Preserved flow state
  • Async execution

Version

v1.0.0 (2025-10-23)