RCP-001-001-001-CHAT-INIT – Chat Session Initialization with Master Template Detection
The foundational recipe that establishes CRAFT session context, loads project files, detects master templates, and activates all framework protocols. This recipe ensures proper initialization of every CRAFT interaction, setting up the communication system, loading handoffs, and preparing the AI assistant for project-specific work.
Establishes CRAFT session context by loading project files,detecting master templates, and activating frameworkprotocols. This foundational recipe ensures every CRAFTsession starts with proper initialization, securityverification, and continuity from previous handoffs. Usethis at the beginning of every CRAFT chat session.
Before triggering this recipe, ensure you have the requiredCRAFT project files ready to attach: REQUIRED FILES: – Framework Specification (CFT-FWK-SPEC-*.txt) – Project Implementation (CFT-PROJ-CP-XXX_*.txt) – Chat History (CFT-PROJ-CP-XXX_AI-CHAT-HISTORY-*.txt) – Core Cookbook (CFT-FWK-COOKBK-CORE-*.txt) OPTIONAL FILES: – Additional cookbooks for your project – Persona definition files – Previous handoff documents
STEP 2: TRIGGER THE RECIPE
Start your CRAFT session by providing the initializationdirective with your project parameters: #H->AI::Directive: (Please execute the Chat-Session-Initialization recipe with these parameters: * session_type: [new/continue/handoff] * project_id: [your 3-digit project ID] * handoff_id: [H00X if continuing] )
STEP 3: FILE LOADING AND SCAN
The AI will load your files in the optimal order: 1. Framework Specification – Loads core CRAFT rules 2. Project Implementation – Loads your variables 3. Chat History – Loads handoff context 4. Cookbooks – Loads available recipesYou will see status messages for each file loaded.
STEP 4: TEMPLATE DETECTION
If your files contain master templates (marked with[MASTER-TEMPLATE] in filename or first line), the AI will: – Alert you that templates were detected – Offer to create customized project files – Give you options: Create, Skip, or ReviewThis helps first-time users set up their projects.
STEP 5: STANDARD INITIALIZATION
The AI performs these initialization steps: – Verifies framework security components – Loads previous handoff context if continuing – Initializes the persona system – Activates all CRAFT protocols – Activates the CRAFT-OPERATIONS-MANAGER (COM)
STEP 6: SESSION CONFIRMATION
Upon completion, you receive a session summary: – Files loaded count – Project identifier – Session type – Template detection status – COM activation status – Token usage baselineThe AI then asks what you would like to work on.
Recipe FAQ
Q: What happens if I don’t run the Chat Initialization Recipe at the start of a session?A: Without proper initialization, the CRAFT framework won’t function correctly. The AI won’t have access to project context, handoff information, or proper protocol activation. The comment system (H->AI and AI->H), personas, and CRAFT Operations Manager (COM) won’t be available, resulting in a standard AI chat rather than a CRAFT-enhanced session.Q: Can I run CHAT-INIT multiple times in the same session?A: While technically possible, it’s not recommended. CHAT-INIT should only run once at the beginning of each session. Running it multiple times could reset context, duplicate protocol activations, or cause confusion in session continuity. If you need to refresh settings mid-session, use specific update recipes instead.Q: How does CHAT-INIT know whether to start fresh or continue from a previous session?A: The recipe checks the session_type parameter (new/continue/handoff) and looks for a handoff_id if continuing. It automatically scans for master template files and previous handoff snapshots in your project files, then loads the appropriate context based on what it finds.Q: What’s the difference between ‘continue’ and ‘handoff’ session types?A: Both load previous context, but ‘continue’ implies the same user returning to their work, while ‘handoff’ indicates a transition between team members or a formal project milestone. The handoff type triggers more comprehensive context documentation and may activate different reporting protocols.Q: Why does CHAT-INIT check for master templates?A: Master templates indicate you’re starting a brand new project. When detected, CHAT-INIT offers to run the PROJECT_CREATOR_RECIPE instead, which provides a guided project setup experience. This prevents accidentally overwriting template files with incomplete configurations.Q: What if I forget to attach all the files? A: The AI will alert you if required files are missing. You can add files and re-trigger the recipe.Q: Can I skip the template detection? A: Yes, choose option [2] when prompted. Template detection only activates if template markers are found.Q: How do I know initialization succeeded? A: You will receive a complete session summary with file counts and COM status. Any errors are clearly reported.Q: What is COM and why does it activate? A: CRAFT-OPERATIONS-MANAGER (COM) monitors your prompts and suggests relevant recipes automatically. It enhances your CRAFT experience without requiring manual recipe lookup.
Actual Recipe Code
(Copy This Plaintext Code To Use)
# ===========================================================# RECIPE: RCP-001-001-001-CHAT-INIT-v2.10a# Chat Session Initialization with Flavor Detection# ===========================================================CHAT_SESSION_INITIALIZATION = Recipe( recipe_id="RCP-001-001-001-CHAT-INIT-v2.10a", title="Chat Session Initialization", description="Establishes CRAFT session with flavor detection and persona activation", category="CAT-001-CORE", difficulty="beginner", version="2.10a", parameters={ "session_type": { "type": "string", "required": True, "options": ["new", "continue", "handoff"], "description": "Type of session" }, "project_id": { "type": "string", "required": True, "example": "049", "description": "Three-digit project ID" }, "project_files": { "type": "list", "required": True, "description": "Attached CRAFT files" }, "handoff_id": { "type": "string", "required": False, "example": "H039", "description": "Handoff ID if continuing" } }, prompt_template=""" #H->AI::Directive: (Initialize CRAFT session) #H->AI::Context: (Project {project_id}) #H->AI::Context: (Type: {session_type}) # ————————————————— # STEP 1: FILE LOADING AND INITIAL SCAN # ————————————————— #AI->H::Status: (Reading CRAFT project files) Load files in order: 1. Framework Specification (CFT-FWK-SPEC-*.txt) 2. Project Implementation (CFT-PROJ-CP-{project_id}_*.txt) 3. Chat History (CFT-PROJ-CP-{project_id}_AI-CHAT-HISTORY) 4. Framework Cookbooks (CFT-FWK-COOKBK-*.txt) FOR file IN project_files: #AI->H::Status: (Loaded: {file.name}) # ————————————————— # STEP 2: MASTER TEMPLATE DETECTION # ————————————————— #AI->H::Status: (Checking for master template files) detected_templates = [] FOR file IN project_files: IF "[MASTER-TEMPLATE]" in file.name: template_detected = True ELIF file.content.startswith("# [MASTER-TEMPLATE]"): template_detected = True IF template_detected: #AI->H::Alert: (Template in {file.name}) detected_templates.append(file) # ————————————————— # STEP 3: TEMPLATE HANDLING DECISION # ————————————————— IF detected_templates: #AI->H::RequiredQuestion: (Create project files?) #AI->H::Options: ( [1] Yes – Start project creation [2] No – Continue with normal initialization [3] Review – Show what would be created ) IF user_response == "1": EXECUTE PROJECT_CREATOR_RECIPE ELIF user_response == "3": #AI->H::Preview: (PROJECT_CREATOR would: – Ask about project goals – Gather target audience info – Define scope and constraints – Create customized variables – Generate ready-to-use files ) # ————————————————— # STEP 4: FLAVOR DETECTION # ————————————————— #AI->H::Status: (Detecting CRAFT flavor from context) detected_flavor = auto_detect_flavor(project_files) #AI->H::Note: (Detected flavor: {detected_flavor}) # ————————————————— # STEP 5: PERSONA ACTIVATION VIA PERSONA-MGR # ————————————————— #AI->H::Status: (Activating persona via PERSONA-MGR) # Check if handoff contains persona state to restore IF session_type IN ["continue", "handoff"]: IF handoff_id: handoff_data = load_handoff_context(handoff_id) IF handoff_data.persona_state: #AI->H::Note: (Restoring persona from handoff state) restore_persona = handoff_data.persona_state # Call CRAFT-PERSONA-MGR for initialization EXECUTE CRAFT_PERSONA_MANAGER_RECIPE.execute({ "trigger_context": "chat_init", "detected_flavor": detected_flavor, "current_task": None, "current_persona": restore_persona or None, "user_preferences": {} }) # PERSONA-MGR sets ACTIVE_PERSONA based on flavor: # Foundations -> Julia (B) Learning Guide # Express -> Alice (B) Orchestrator # Studio -> Cat (B) Operations Master # ————————————————— # STEP 6: SECURITY AND PROTOCOL ACTIVATION # ————————————————— #AI->H::Status: (Verifying security protocols) verify_security_protocols() #AI->H::Status: (Activating CRAFT protocols) activate_craft_protocols() # ————————————————— # STEP 7: COM ACTIVATION # ————————————————— #AI->H::Status: (Activating CRAFT-OPERATIONS-MANAGER) CRAFT_PROMPT_ACTIVE = True CRAFT_PROMPT_MODE = "production" #AI->H::Note: (COM now monitoring all prompts) # ————————————————— # STEP 8: INITIALIZATION COMPLETE # ————————————————— #AI->H::Status: (CRAFT initialization complete) SESSION SUMMARY: – Files loaded: {len(project_files)} – Project: CFT-PROJ-CP-{project_id} – Session type: {session_type} – Detected Flavor: {detected_flavor} – Active Persona: {SESSION.ACTIVE_PERSONA.name} – Templates detected: {detected_templates or "No"} – COM Status: Active – Token usage: 0% #AI->H::RequiredQuestion: (What would you like to work on today?) """)# ———————————————————–# HELPER FUNCTIONS# ———————————————————–def auto_detect_flavor(project_files): """Detect CRAFT flavor from attached files""" flavor_signals = { "foundations": [ "BEGINNER", "FOUNDATIONS", "FND", "PERSONA-FND", "JULIA" ], "express": [ "EXPRESS", "EXP", "PERSONA-EXP", "ALICE" ], "studio": [ "STUDIO", "STU", "PERSONA-STU", "CAT", "AUGUSTE", "FERNAND" ] } detected_signals = { "foundations": 0, "express": 0, "studio": 0 } FOR file IN project_files: file_upper = file.name.upper() FOR flavor, signals IN flavor_signals.items(): FOR signal IN signals: IF signal IN file_upper: detected_signals[flavor] += 1 # Return flavor with most signals max_flavor = max( detected_signals, key=detected_signals.get ) IF detected_signals[max_flavor] > 0: return max_flavor ELSE: # Default to express if no clear signal return "express"def verify_security_protocols(): """Verify all security components are present""" checks = [ "Recipe Security Protocol active", "Security warnings enabled", "External recipe validation ready" ] FOR check IN checks: #AI->H::SecurityCheck: (Verified: {check})def load_handoff_context(handoff_id): """Load context from previous handoff""" # Parse handoff file for specified ID # Returns handoff data including persona_state #AI->H::Note: (Loaded context from {handoff_id}) return handoff_datadef activate_craft_protocols(): """Activate all CRAFT framework protocols""" protocols = [ "Comment system (H->AI and AI->H)", "Global Instructions active", "Clarifying questions enabled", "Content identification ready", "Recipe system active" ] FOR protocol IN protocols: #AI->H::Protocol: (Activated: {protocol})# ===========================================================# END RECIPE: RCP-001-001-001-CHAT-INIT-v2.10a# ===========================================================
The Expectation Setter recipe analyzes incoming tasks, communicates scope, complexity, deliverables, and limitations upfront before work begins. It automatically initializes progress tracking for complex tasks, preventing miscommunication and building trust through transparency. This recipe transforms ambiguous requests into clear, shared understanding between user and AI.
The CRAFT Brainstormer is a structured ideation engine that generates and evaluates framework enhancement ideas aligned with core philosophical principles. It channels creativity toward solving real problems while maintaining technical elegance, providing scored proposals with implementation pathways, feasibility assessments, and philosophical alignment analysis for strategic framework evolution.
Transparent disclosure of AI capabilities and constraints, ensuring users understand what the AI can and cannot do. This recipe promotes honest communication about knowledge boundaries, potential errors, and areas where human expertise is essential.
Guides users through building a proven 10-part UltraPrompt framework interactively. Assists with template selection, accepts partial completions, and produces…
The CRAFT Persona Manager enables dynamic AI personality adaptation by analyzing task context, evaluating persona fit, proposing optimal switches with clear explanations, obtaining explicit user consent, performing calibration questions, and activating specialized personas (Creative Writing Coach, Code Mentor, Data Analyst, etc.) – transforming communication style to perfectly match each task type while maintaining session continuity and transparency through comprehensive logging.
Comprehensive catalog of all CRAFT recipes with explanations of why each exists, their role in the framework, when to use them, and example executions. Provides three output formats (detailed catalog, compact list, single recipe deep dive) with filtering options by category or specific recipe ID.