New task automation

Workflow for starting new task when context window reaches 50%

--- description: Workflow for starting new task when context window reaches 50% author: https://github.com/cline version: 1.0 tags: ["context-management", "new-task"] globs: ["*"] --- # You MUST use the `new_task` tool: Task Handoff Strategy Guide **⚠️ CRITICAL INSTRUCTIONS - YOU MUST FOLLOW THESE GUIDELINES ⚠️** This guide provides **MANDATORY** instructions for effectively breaking down complex tasks and implementing a smooth handoff process between tasks. You **MUST** follow these guidelines to ensure continuity, context preservation, and efficient task completion. ## ⚠️ CONTEXT WINDOW MONITORING - MANDATORY ACTION REQUIRED ⚠️ You **MUST** monitor the context window usage displayed in the environment details. When usage exceeds 50% of the available context window, you **MUST** initiate a task handoff using the `new_task` tool. Example of context window usage over 50% with a 200K context window: \`\`\`text # Context Window Usage 105,000 / 200,000 tokens (53%) Model: anthropic/claude-3.7-sonnet (200K context window) \`\`\` **IMPORTANT**: When you see context window usage at or above 50%, you MUST: 1. Complete your current logical step 2. Use the `ask_followup_question` tool to offer creating a new task 3. If approved, use the `new_task` tool with comprehensive handoff instructions ## Task Breakdown in Plan Mode - REQUIRED PROCESS Plan Mode is specifically designed for analyzing complex tasks and breaking them into manageable subtasks. When in Plan Mode, you **MUST**: ### 1. Initial Task Analysis - REQUIRED - **MUST** begin by thoroughly understanding the full scope of the user's request - **MUST** identify all major components and dependencies of the task - **MUST** consider potential challenges, edge cases, and prerequisites ### 2. Strategic Task Decomposition - REQUIRED - **MUST** break the overall task into logical, discrete subtasks - **MUST** prioritize subtasks based on dependencies (what must be completed first) - **MUST** aim for subtasks that can be completed within a single session (15-30 minutes of work) - **MUST** consider natural breaking points where context switching makes sense ### 3. Creating a Task Roadmap - REQUIRED - **MUST** present a clear, numbered list of subtasks to the user - **MUST** explain dependencies between subtasks - **MUST** provide time estimates for each subtask when possible - **MUST** use Mermaid diagrams to visualize task flow and dependencies when helpful \`\`\`mermaid graph TD A[Main Task] --> B[Subtask 1: Setup] A --> C[Subtask 2: Core Implementation] A --> D[Subtask 3: Testing] A --> E[Subtask 4: Documentation] B --> C C --> D \`\`\` ### 4. Getting User Approval - REQUIRED - **MUST** ask for user feedback on the proposed task breakdown - **MUST** adjust the plan based on user priorities or additional requirements - **MUST** confirm which subtask to begin with - **MUST** request the user to toggle to Act Mode when ready to implement ## Task Implementation and Handoff Process - MANDATORY PROCEDURES When implementing tasks in Act Mode, you **MUST** follow these guidelines for effective task handoff: ### 1. Focused Implementation - REQUIRED - **MUST** focus on completing the current subtask fully - **MUST** document progress clearly through comments and commit messages - **MUST** create checkpoints at logical completion points ### 2. Recognizing Completion Points - CRITICAL You **MUST** identify natural handoff points when: - The current subtask is fully completed - You've reached a logical stopping point in a larger subtask - The implementation is taking longer than expected and can be continued later - The task scope has expanded beyond the original plan - **CRITICAL**: The context window usage exceeds 50% (e.g., 100,000+ tokens for a 200K context window) ### 3. Initiating the Handoff Process - MANDATORY ACTION When you've reached a completion point, you **MUST**: 1. Summarize what has been accomplished so far 2. Clearly state what remains to be done 3. **MANDATORY**: Use the `ask_followup_question` tool to offer creating a new task: \`\`\`xml <ask_followup_question> <question>I've completed [specific accomplishment]. Would you like me to create a new task to continue with [remaining work]?</question> <options>["Yes, create a new task", "No, continue in this session", "Let me think about it"]</options> </ask_followup_question> \`\`\` ### 4. Creating a New Task with Context - REQUIRED ACTION If the user agrees to create a new task, you **MUST** use the `new_task` tool with comprehensive handoff instructions: \`\`\`xml <new_task> <context> # Task Continuation: [Brief Task Title] ## Completed Work - [Detailed list of completed items] - [Include specific files modified/created] - [Note any important decisions made] ## Current State - [Description of the current state of the project] - [Any running processes or environment setup] - [Key files and their current state] ## Next Steps - [Detailed list of remaining tasks] - [Specific implementation details to address] - [Any known challenges to be aware of] ## Reference Information - [Links to relevant documentation] - [Important code snippets or patterns to follow] - [Any user preferences noted during the current session] Please continue the implementation by [specific next action]. </context> </new_task> \`\`\` ### 5. Detailed Context Transfer - MANDATORY COMPONENTS When creating a new task, you **MUST** always include: #### Project Context - REQUIRED - **MUST** include the overall goal and purpose of the project - **MUST** include key architectural decisions and patterns - **MUST** include technology stack and dependencies #### Implementation Details - REQUIRED - **MUST** list files created or modified in the current session - **MUST** describe specific functions, classes, or components implemented - **MUST** explain design patterns being followed - **MUST** outline testing approach #### Progress Tracking - REQUIRED - **MUST** provide checklist of completed items - **MUST** provide checklist of remaining items - **MUST** note any blockers or challenges encountered #### User Preferences - REQUIRED - **MUST** note coding style preferences mentioned by the user - **MUST** document specific approaches requested by the user - **MUST** highlight priority areas identified by the user ## Best Practices for Effective Handoffs - MANDATORY GUIDELINES ### 1. Maintain Continuity - REQUIRED - **MUST** use consistent terminology between tasks - **MUST** reference previous decisions and their rationale - **MUST** maintain the same architectural approach unless explicitly changing direction ### 2. Preserve Context - REQUIRED - **MUST** include relevant code snippets in the handoff - **MUST** summarize key discussions from the previous session - **MUST** reference specific files and line numbers when applicable ### 3. Set Clear Next Actions - REQUIRED - **MUST** begin the handoff with a clear, actionable next step - **MUST** prioritize remaining tasks - **MUST** highlight any decisions that need to be made ### 4. Document Assumptions - REQUIRED - **MUST** clearly state any assumptions made during implementation - **MUST** note areas where user input might be needed - **MUST** identify potential alternative approaches ### 5. Optimize for Resumability - REQUIRED - **MUST** structure the handoff so the next session can begin working immediately - **MUST** include setup instructions if environment configuration is needed - **MUST** provide a quick summary at the top for rapid context restoration ## Example Task Handoff ### Example #1 of an effective task handoff: \`\`\`xml <new_task> <context> # Task Continuation: Implement User Authentication System ## Completed Work - Created basic Express.js server structure - Implemented MongoDB connection and user schema - Completed user registration endpoint with password hashing - Added input validation using Joi - Created initial test suite for registration endpoint ## Current State - Server runs successfully on port 3000 - MongoDB connection is established - Registration endpoint (/api/users/register) is fully functional - Test suite passes for all registration scenarios ## Next Steps 1. Implement login endpoint (/api/users/login) - Use bcrypt to compare passwords - Generate JWT token upon successful login - Add proper error handling for invalid credentials 2. Create authentication middleware - Verify JWT tokens - Extract user information - Handle expired tokens 3. Add protected routes that require authentication 4. Implement password reset functionality ## Reference Information - JWT secret should be stored in .env file - Follow the existing error handling pattern in routes/users.js - User schema is defined in models/User.js - Test patterns are established in tests/auth.test.js Please continue by implementing the login endpoint following the same patterns established in the registration endpoint. </context> </new_task> \`\`\` ### Example #2 of an ineffective task handoff: *(Note: The example provided in the original rules showing "YOLO MODE Implementation" seems less like a direct handoff context block and more like a general status update with future considerations. A true ineffective handoff might lack detail in 'Current State' or 'Next Steps').* ## When to Use Task Handoffs - MANDATORY TRIGGERS You **MUST** initiate task handoffs in these scenarios: 1. **CRITICAL**: When context window usage exceeds 50% (e.g., 100,000+ tokens for a 200K context window) 2. **Long-running projects** that exceed a single session 3. **Complex implementations** with multiple distinct phases 4. **When context window limitations** are approaching 5. **When switching focus areas** within a larger project 6. **When different expertise** might be beneficial for different parts of the task **⚠️ FINAL REMINDER - CRITICAL INSTRUCTION ⚠️** You **MUST** monitor the context window usage in the environment details section. When it exceeds 50% (e.g., "105,000 / 200,000 tokens (53%)"), you **MUST** proactively initiate the task handoff process using the `ask_followup_question` tool followed by the `new_task` tool. You MUST use the `new_task` tool. By strictly following these guidelines, you'll ensure smooth transitions between tasks, maintain project momentum, and provide the best possible experience for users working on complex, multi-session projects. ```markdown ## User Interaction & Workflow Considerations * **Linear Flow:** Currently, using `new_task` creates a linear sequence. The old task ends, and the new one begins. The old task history remains accessible for backtracking. * **User Approval:** You always have control, approving the handoff and having the chance to modify the context Cline proposes to carry forward. * **Flexibility:** The core `new_task` tool is a flexible building block. Experiment with `.clinerules` to create workflows that best suit your needs, whether for strict context management, task decomposition, or other creative uses.

Created: 7/2/2025

Keywords: text snippets, slack for ai prompts, slack for ai, AI consulting, AI Cheat Tool, AI Cheat Tool for developers, AI Cheat Tool for AI, AI Cheat Tool for ChatGPT, chatgpt prompt generator, AI Cheat Tool for email, AI Cheat Tool for text, AI Cheat Tool for keyboard shortcuts, AI Cheat Tool for text expansion, AI Cheat Tool for text snippets, AI Cheat Tool for text replacement, AI Cheating Tool, AI Cheating Tool for developers, AI Cheating Tool for AI, AI Cheating Tool for ChatGPT, AI Cheating Tool for email, AI Cheating Tool for text, AI Cheating Tool for keyboard shortcuts, prompt cheating, AI prompt engineering, AI context engineering, context engineering, ai prompt manager, AI prompt manager, AI prompt management, ai consulting, prompt engineering consulting, generative ai consulting, ai implementation services, llm integration consultants, ai strategy for enterprises, enterprise ai transformation, ai prompt optimization, large language model consulting, ai training for teams, ai workflow automation, build ai knowledge base, llm prompt management, ai prompt infrastructure, ai adoption consulting, enterprise ai onboarding, custom ai workflow design, ai integration for dev teams, ai productivity tools, team prompt collaboration, github gists, github snippets, github code snippets, github code snippets automation, github, text expansion, text automation, snippet manager, code snippets, team collaboration tools, shared snippets, snippet sharing, keyboard shortcuts, productivity tools, workflow automation, AI-powered productivity, snippet tool for teams, team knowledge base, AI text completion, text expander for teams, snippet collaboration, multi-platform productivity, custom keyboard shortcuts, snippet sharing platform, collaborative snippet management, knowledge base automation, team productivity software, business productivity tools, snippet management software, quick text input, macOS productivity apps, Windows productivity tools, Linux productivity tools, cloud-based snippets, cross-platform snippets, team workspace tools, workflow enhancement tools, automation tools for teams, text automation software, team knowledge sharing, task automation, integrated team tools, real-time collaboration, AI for team productivity, business text automation, time-saving tools, clipboard manager, multi-device clipboard, keyboard shortcut manager, team communication tools, project management integration, productivity boost AI, text snippet sharing, text replacement software, text management tools, efficient team collaboration, AI workspace tools, modern productivity apps, custom text automation, digital workspace tools, collaborative workspaces, cloud productivity tools, streamline team workflows, smart text management, snippets AI app, snippet management for teams, shared knowledge platforms, team-focused text automation, team productivity platform, AI text expansion tools, snippet taking app, note taking app, note taking software, note taking tools, note taking app for teams, note taking app for developers, note taking app for AI, note taking app for ChatGPT, snippet software, snippet tools, snippet app for teams, snippet app for developers, snippet app for AI, snippet app for ChatGPT, AI agent builder, AI agent snippets, AI agent prompts, prompt management, prompt engineering, ChatGPT snippets, ChatGPT prompts, AI prompt optimization, AI-powered prompts, prompt libraries for AI, prompt sharing for ChatGPT, GPT productivity tools, AI assistant snippets, ChatGPT integrations, custom AI prompts, AI agent workflows, machine learning snippets, automated AI prompts, AI workflow automation, collaborative AI prompts, personalized AI agents, text snippets for ChatGPT, AI prompt creation tools, AI code snippet manager, GPT-4 text automation, AI-powered writing assistants, AI tools for developers, AI agent integrations, developer prompt snippets, AI text generation workflows, AI-enhanced productivity, GPT prompt sharing tools, team collaboration for AI, openAI integrations, text automation for AI teams, AI-powered collaboration tools, GPT-4 team tools, AI-driven text expanders, AI-driven productivity solutions, AI agent for email writing, AI agent for text expansion, AI agent for text automation, AI agent for text snippets, AI agent for text replacement, AI agent for keyboard shortcuts, AI Agent Developer, Prompt engineering, Machine Learning Engineer, AI Engineer, Customer Support, Code snippets for developers, Recruiting, AI agent for automation, AI agent for AI automation, AI agent for ChatGPT automation, AI agent for email automation, electron app for snippets, desktop snippet manager, code snippet organization, AI prompt repository, intelligent text expansion, vibe coding, Claude cli ai prompts, prompt optimizer, buy prompts, sell prompts, snippets store, sell scripts, buy scripts, buy python scripts, scraping scripts, AI prompt marketplace, ChatGPT prompt marketplace, best AI prompts, best ChatGPT prompts, AI prompt database, AI prompt packs, AI prompt bundles, GPT prompt marketplace, prompt engineering masterclass, prompt engineering certification, prompt engineering course, ChatGPT prompt store, AI prompt store, prompt monetization, sell AI prompts, buy AI prompts, prompt marketplace platform, AI prompt plugins, Claude prompt marketplace, AI prompt subscription, Custom GPT, real-time prompt collaboration, developer workflow optimization, team prompt library, knowledge management for developers, code snippet search, searchable code library, reusable code blocks, prompt engineering tools, prompt template management, collaborative coding, cross-team knowledge sharing, code snippet versioning, AI prompt templates, technical documentation tools, developer productivity suite, team snippet repository, AI prompt history, snippet synchronization, cloud snippet backup, markdown snippet support, syntax highlighting for snippets, code categorization, programming language snippets, language-specific code templates, contextual code suggestions, snippets with AI integration, command palette for snippets, code snippet folder organization, team snippet discovery, private and public snippets, enterprise code management, team codebase documentation, prompt engineering best practices, Vibe Coding, Vibe Coding for developers, Vibe Coding for AI, Vibe Coding for ChatGPT, Vibe Coding for email, Vibe Coding for text, Vibe Coding for keyboard shortcuts, Vibe Coding for text expansion, Vibe Coding for text snippets, Vibe Coding for text replacement, free prompt generator, ai prompt generator, prompt generator, promptlayer, promptimize ai, langchain prompt management, lanhsmith prompt management, latitude, langchain, langgraph, langchain documentation, raycast, text expander, raycast snippets, raycast mac, cursor, cursro ai, cursor snippets, cursor rules, cursor ai rules, learn prompting, how to prompt, prompting guide, prompting tutorials, best prompting practices, ai prompt best practices, prompting techniques, prompting, vite, security, php, rest, matplotlib, node, git, jest, api, python, go, deep learning, pytorch, numpy, logging, performance, flask, express, mongodb, jwt, bcrypt, ios, monitoring, testing

AI Prompts, ChatGPT, Code Snippets, Prompt Engineering

New task automation

Workflow for starting new task when context window reaches 50%

Cline - New task automation - AI Prompts & Code Snippets | Snippets AI