#!/usr/bin/env node /** * Add inst_078: "ff" Framework Trigger * Adds instruction about the "ff" codeword for manual framework invocation */ const fs = require('fs'); const path = require('path'); const INSTRUCTION_FILE = path.join(__dirname, '../.claude/instruction-history.json'); // Load current instruction history const history = JSON.parse(fs.readFileSync(INSTRUCTION_FILE, 'utf8')); // New instruction const newInstruction = { "id": "inst_078", "text": "When user prefixes prompt with 'ff' (Framework Full), invoke framework-audit-response.js script BEFORE responding. This triggers ALL 6 framework services (BoundaryEnforcer, PluralisticDeliberationOrchestrator, MetacognitiveVerifier, CrossReferenceValidator, ContextPressureMonitor, InstructionPersistenceClassifier) for conversational responses that don't use Edit/Write/Bash tools. Usage: node scripts/framework-audit-response.js --prompt \"user question\" --type \"boundary_question\". Include audit IDs in response.", "timestamp": new Date().toISOString(), "quadrant": "SYSTEM", "persistence": "HIGH", "temporal_scope": "PROJECT", "verification_required": "MANDATORY", "explicitness": 0.95, "source": "user", "session_id": "2025-10-25-ff-trigger-implementation", "parameters": { "trigger": "ff", "script": "scripts/framework-audit-response.js", "purpose": "manual_framework_invocation", "services": ["BoundaryEnforcer", "PluralisticDeliberationOrchestrator", "MetacognitiveVerifier", "CrossReferenceValidator", "ContextPressureMonitor", "InstructionPersistenceClassifier"] }, "active": true, "notes": "Extends PreToolUse hook architecture to conversational responses. Provides audit trail for VALUES/WISDOM/INNOVATION boundary decisions." }; // Check if inst_078 already exists const existingIndex = history.instructions.findIndex(i => i.id === 'inst_078'); if (existingIndex >= 0) { console.log('⚠️ inst_078 already exists - updating...'); history.instructions[existingIndex] = newInstruction; } else { console.log('✅ Adding new instruction: inst_078'); history.instructions.push(newInstruction); } // Update metadata history.version = "3.9"; history.last_updated = new Date().toISOString(); // Write back fs.writeFileSync(INSTRUCTION_FILE, JSON.stringify(history, null, 2)); console.log('✅ inst_078 added successfully'); console.log('📄 File:', INSTRUCTION_FILE); console.log('📊 Total instructions:', history.instructions.length); console.log('\nInstruction content:'); console.log(' ID:', newInstruction.id); console.log(' Trigger:', newInstruction.parameters.trigger); console.log(' Script:', newInstruction.parameters.script); console.log(' Persistence:', newInstruction.persistence); console.log(' Quadrant:', newInstruction.quadrant);