config-audit/hooks/scripts/stop-session-reminder.mjs
Kjell Tore Guttormsen caee558e79 feat(ultraplan-local): v1.6.0 — /ultraresearch-local deep research command
Add /ultraresearch-local for structured research combining local codebase
analysis with external knowledge via parallel agent swarms. Produces research
briefs with triangulation, confidence ratings, and source quality assessment.

New command: /ultraresearch-local with modes --quick, --local, --external, --fg.
New agents: research-orchestrator (opus), docs-researcher, community-researcher,
security-researcher, contrarian-researcher, gemini-bridge (all sonnet).
New template: research-brief-template.md.

Integration: --research flag in /ultraplan-local accepts pre-built research
briefs (up to 3), enriches the interview and exploration phases. Planning
orchestrator cross-references brief findings during synthesis.

Design principle: Context Engineering — right information to right agent at
right time. Research briefs are structured artifacts in the pipeline:
ultraresearch → brief → ultraplan --research → plan → ultraexecute.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 08:58:35 +02:00

66 lines
1.8 KiB
JavaScript

#!/usr/bin/env node
// Remind about current config-audit session phase on session end
// Returns JSON: {} if no active session, systemMessage if active
import { readdirSync, readFileSync, statSync, existsSync } from 'fs';
import { join, basename, dirname } from 'path';
import { homedir } from 'os';
const sessionsDir = join(homedir(), '.config-audit', 'sessions');
if (!existsSync(sessionsDir)) {
console.log('{}');
process.exit(0);
}
function parseYamlValue(content, key) {
const match = content.match(new RegExp(`${key}:\\s*"?([^"\\n]*)"?`));
return match ? match[1].trim() : '';
}
let latestState = '';
let latestTime = 0;
try {
const entries = readdirSync(sessionsDir, { withFileTypes: true });
for (const entry of entries) {
if (!entry.isDirectory()) continue;
const stateFile = join(sessionsDir, entry.name, 'state.yaml');
if (!existsSync(stateFile)) continue;
const fileTime = statSync(stateFile).mtimeMs;
if (fileTime > latestTime) {
latestTime = fileTime;
latestState = stateFile;
}
}
} catch {
console.log('{}');
process.exit(0);
}
if (latestState) {
// Only remind if session was touched in the last 2 hours (active work)
const twoHoursMs = 2 * 60 * 60 * 1000;
if (Date.now() - latestTime > twoHoursMs) {
console.log('{}');
process.exit(0);
}
const content = readFileSync(latestState, 'utf-8');
const currentPhase = parseYamlValue(content, 'current_phase');
const nextPhase = parseYamlValue(content, 'next_phase');
if (currentPhase && currentPhase !== 'verify' && currentPhase !== 'complete') {
const sessionId = basename(dirname(latestState));
console.log(JSON.stringify({
systemMessage: `config-audit: Session ${sessionId} is at phase '${currentPhase}'. Next: /config-audit ${nextPhase}`
}));
process.exit(0);
}
}
console.log('{}');
process.exit(0);