Restores the entire .claude/ infrastructure that was accidentally deleted
in commit 1df208d ('feat(timeline): add pulse animation for in-flight drag
mutations'). Recovered via git checkout 1df208d^.
Restored:
- .claude/commands/ (gitlooper, sparc/, github/, automation/, monitoring/,
optimization/, hooks/, plan, implement, research, review, perf, visualaudit)
- .claude/agents/ (core/, github/, sparc/, v3/, swarm/, templates/, ...)
- .claude/helpers/ (41 scripts incl. hook-handler.cjs, statusline.cjs)
- .claude/skills/ (20 skills incl. sparc-methodology, github-*, v3-*)
- .claude/settings.json (hooks configuration)
Also updated all CapaKraken → Nexus references in affected command files.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
84 lines
1.8 KiB
JavaScript
84 lines
1.8 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Claude Flow Memory Helper
|
|
* Simple key-value memory for cross-session context
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const MEMORY_DIR = path.join(process.cwd(), '.claude-flow', 'data');
|
|
const MEMORY_FILE = path.join(MEMORY_DIR, 'memory.json');
|
|
|
|
function loadMemory() {
|
|
try {
|
|
if (fs.existsSync(MEMORY_FILE)) {
|
|
return JSON.parse(fs.readFileSync(MEMORY_FILE, 'utf-8'));
|
|
}
|
|
} catch (e) {
|
|
// Ignore
|
|
}
|
|
return {};
|
|
}
|
|
|
|
function saveMemory(memory) {
|
|
fs.mkdirSync(MEMORY_DIR, { recursive: true });
|
|
fs.writeFileSync(MEMORY_FILE, JSON.stringify(memory, null, 2));
|
|
}
|
|
|
|
const commands = {
|
|
get: (key) => {
|
|
const memory = loadMemory();
|
|
const value = key ? memory[key] : memory;
|
|
console.log(JSON.stringify(value, null, 2));
|
|
return value;
|
|
},
|
|
|
|
set: (key, value) => {
|
|
if (!key) {
|
|
console.error('Key required');
|
|
return;
|
|
}
|
|
const memory = loadMemory();
|
|
memory[key] = value;
|
|
memory._updated = new Date().toISOString();
|
|
saveMemory(memory);
|
|
console.log(`Set: ${key}`);
|
|
},
|
|
|
|
delete: (key) => {
|
|
if (!key) {
|
|
console.error('Key required');
|
|
return;
|
|
}
|
|
const memory = loadMemory();
|
|
delete memory[key];
|
|
saveMemory(memory);
|
|
console.log(`Deleted: ${key}`);
|
|
},
|
|
|
|
clear: () => {
|
|
saveMemory({});
|
|
console.log('Memory cleared');
|
|
},
|
|
|
|
keys: () => {
|
|
const memory = loadMemory();
|
|
const keys = Object.keys(memory).filter(k => !k.startsWith('_'));
|
|
console.log(keys.join('\n'));
|
|
return keys;
|
|
},
|
|
};
|
|
|
|
// CLI
|
|
const [,, command, key, ...valueParts] = process.argv;
|
|
const value = valueParts.join(' ');
|
|
|
|
if (command && commands[command]) {
|
|
commands[command](key, value);
|
|
} else {
|
|
console.log('Usage: memory.js <get|set|delete|clear|keys> [key] [value]');
|
|
}
|
|
|
|
module.exports = commands;
|