#!/usr/bin/env node /** * Add inst_082: "ffs" Framework Stats Trigger * Adds instruction about the "ffs" codeword for viewing framework statistics */ 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_082", "text": "When user types 'ffs' (Full Framework Stats), invoke framework-stats.js script to display comprehensive session statistics. Usage: node scripts/framework-stats.js. Reports: session state, token usage & checkpoints, context pressure level, instruction counts by quadrant/persistence, audit log counts by service, framework service status. Output formatted report + JSON for programmatic access.", "timestamp": new Date().toISOString(), "quadrant": "SYSTEM", "persistence": "HIGH", "temporal_scope": "PROJECT", "verification_required": "OPTIONAL", "explicitness": 0.95, "source": "user", "session_id": "2025-10-25-ffs-trigger-implementation", "parameters": { "trigger": "ffs", "script": "scripts/framework-stats.js", "purpose": "framework_statistics_display", "reports": [ "session_state", "token_usage", "context_pressure", "instruction_stats", "audit_logs", "service_status" ] }, "active": true, "notes": "Complements 'ff' trigger (inst_078). Provides on-demand visibility into framework operational metrics." }; // Check if inst_082 already exists const existingIndex = history.instructions.findIndex(i => i.id === 'inst_082'); if (existingIndex >= 0) { console.log('⚠️ inst_082 already exists - updating...'); history.instructions[existingIndex] = newInstruction; } else { console.log('✅ Adding new instruction: inst_082'); history.instructions.push(newInstruction); } // Update metadata history.version = "4.1"; history.last_updated = new Date().toISOString(); // Write back fs.writeFileSync(INSTRUCTION_FILE, JSON.stringify(history, null, 2)); console.log('✅ inst_082 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);