Skip to content

sno-ai/sno-station-skills / skills/R-recursive-self-improvement/rem-reflect/skill

rem-reflect

Verified

Self Learning from this machine's Claude Code, Codex, Hermes, OpenClaw and Cursor sessions. Decide skill changes and lessons with accept/reject/tbd; recall lessons at session start.

FileKindSize
SKILL.mdskill md14.1 KB
references/labeler.mdmarkdown1.2 KB
references/labeler.schema.jsonconfig1.7 KB
references/local-settings.jsonconfig126 B
references/local-writer.schema.jsonconfig2.3 KB
references/proposal.schema.jsonconfig3.2 KB
references/render.jsonconfig245 B
references/signals.jsonconfig71 B
references/text.jsonconfig4.0 KB
scripts/adopt.test.tsscript13.0 KB
scripts/adopt.tsscript14.3 KB
scripts/agent-sessions.tsscript9.1 KB
scripts/allowance-fallback.test.tsscript16.0 KB
scripts/allowance-request-isolation.test.tsscript7.1 KB
scripts/backend.tsscript9.1 KB
scripts/calls.tsscript8.6 KB
scripts/catalogue-cloud.test.tsscript1.5 KB
scripts/catalogue.tsscript3.2 KB
scripts/chunk.tsscript2.1 KB
scripts/cloud-apply.test.tsscript25.2 KB
scripts/cloud-batch.test.tsscript11.2 KB
scripts/cloud-day.test.tsscript6.8 KB
scripts/cloud-verdict.test.tsscript12.1 KB
scripts/cloud-wait.test.tsscript1.3 KB
scripts/cloud.tsscript24.4 KB
scripts/config.tsscript8.1 KB
scripts/cursor.test.tsscript16.1 KB
scripts/cursor.tsscript6.7 KB
scripts/evidence.tsscript1.5 KB
scripts/first-message.test.tsscript10.3 KB
scripts/harvest.test.tsscript16.5 KB
scripts/harvest.tsscript22.6 KB
scripts/hermes-openclaw.test.tsscript25.6 KB
scripts/identity.test.tsscript3.3 KB
scripts/identity.tsscript3.5 KB
scripts/installed-roots.test.tsscript11.0 KB
scripts/journey-adopt-lesson.test.tsscript4.1 KB
scripts/journey-ops.test.tsscript8.0 KB
scripts/labeler.test.tsscript3.6 KB
scripts/labeler.tsscript9.5 KB
scripts/ledger.tsscript2.1 KB
scripts/lessons.tsscript4.7 KB
scripts/local-filter.test.tsscript3.9 KB
scripts/local-first-output.test.tsscript22.1 KB
scripts/local-settings.tsscript1.4 KB
scripts/local-writer.tsscript12.6 KB
scripts/login-in-place.test.tsscript5.8 KB
scripts/model-json.tsscript4.1 KB
scripts/no-network.test.tsscript5.0 KB
scripts/observe.tsscript1.4 KB
scripts/page-journey.test.tsscript6.7 KB
scripts/pages.test.tsscript4.1 KB
scripts/pages.tsscript4.8 KB
scripts/proposer-loop.test.tsscript1.5 KB
scripts/proposer-validate.test.tsscript9.1 KB
scripts/proposer.tsscript8.7 KB
scripts/recall-hook.test.tsscript20.9 KB
scripts/recall.test.tsscript31.4 KB
scripts/recall.tsscript18.2 KB
scripts/reflect.test.tsscript9.3 KB
scripts/reflect.tsscript14.3 KB
scripts/rem-reflectexecutablescript823 B
scripts/rem-reflect.tsscript17.8 KB
scripts/render-chunk.test.tsscript7.2 KB
scripts/render.tsscript9.7 KB
scripts/report.tsscript8.2 KB
scripts/run-status.test.tsscript19.1 KB
scripts/sampling.test.tsscript2.1 KB
scripts/sampling.tsscript915 B
scripts/selftest-guard.test.tsscript4.2 KB
scripts/selftest/bin/claudeexecutablescript94 B
scripts/selftest/bin/codexexecutablescript93 B
scripts/selftest/bin/shim-core.cjsscript4.6 KB
scripts/selftest/bin/snoexecutablescript5.7 KB
scripts/selftest/fixtures/hermes-session-export.jsonlother1.5 KB
scripts/selftest/fixtures/openclaw-events.jsonlother3.7 KB
scripts/selftest/fixtures/verdict-traces.jsonconfig16.6 KB
scripts/selftest/journey-e2e.shexecutablescript1.4 KB
scripts/selftest/journey.mjsscript9.5 KB
scripts/selftest/observe-journey.mjsscript12.5 KB
scripts/selftest/run-selftest.shexecutablescript7.0 KB
scripts/selftest/spawn-python.mjsexecutablescript765 B
scripts/session.test.tsscript5.2 KB
scripts/session.tsscript251 B
scripts/signal-local.test.tsscript7.0 KB
scripts/skill-impact.test.tsscript6.2 KB
scripts/station-settings.test.tsscript13.6 KB
scripts/store-memory.test.tsscript3.4 KB
scripts/store.tsscript7.7 KB
scripts/test-helpers.tsscript15.3 KB
scripts/text.tsscript760 B
scripts/trigger.test.tsscript3.6 KB
scripts/trigger.tsscript2.5 KB
scripts/verdicts.test.tsscript8.1 KB
scripts/verdicts.tsscript8.0 KB

scripts/selftest/bin/sno

View on GitHub
#!/usr/bin/env node
// Recording cloud boundary for the installed two-day fixture; the local product still
// serializes the request, invokes this CLI, validates its reply and writes the answer.
const fs = require('node:fs');
const path = require('node:path');

if (process.env.EXEC_LOG) fs.appendFileSync(process.env.EXEC_LOG, 'sno\n');
const argv = process.argv.slice(2);
// `sno observe append`: validates nothing; records the argv line after `observe` for the observe journey,
// and exits 2 for the event type named in REM_OBSERVE_FAIL (else 0).
if (argv[0] === 'observe' && argv[1] === 'append') {
  if (process.env.REM_OBSERVE_CAPTURE) fs.appendFileSync(process.env.REM_OBSERVE_CAPTURE, `${argv.slice(1).join(' ')}\n`);
  process.exit(argv[2] === process.env.REM_OBSERVE_FAIL ? 2 : 0);
}
// `sno rem verdict <judgment-id> <verdict>`: the acknowledgment flushCloudVerdicts checks.
if (argv[0] === 'rem' && argv[1] === 'verdict' && argv.length === 4) {
  process.stdout.write(`${JSON.stringify({ schema_version: 1, judgment_id: argv[2], verdict: argv[3], acknowledged: true })}\n`);
  process.exit(0);
}
// `sno heartbeat --list`: prints the armed rem-reflect line so `status` sees the daily job as armed.
if (argv[0] === 'heartbeat' && argv.includes('--list')) {
  process.stdout.write('rem-reflect 1440m -- sno rem-reflect run\n');
  process.exit(0);
}
const command = argv.join(' ');
if (command === 'station consent --json') {
  process.stdout.write('{"consent":"full"}\n');
  process.exit(0);
}
if (command !== 'rem judge --json') {
  process.stderr.write(`unexpected sno command: ${command}\n`);
  process.exit(2);
}

const batch = JSON.parse(fs.readFileSync(0, 'utf8'));
if (process.env.REM_SNO_CAPTURE) {
  fs.mkdirSync(path.dirname(process.env.REM_SNO_CAPTURE), { recursive: true });
  fs.appendFileSync(process.env.REM_SNO_CAPTURE, `${JSON.stringify(batch)}\n`);
}
const target = batch.catalogue.find(entry => entry.name === 'heartbeat' && entry.path.includes('/.claude/'))
  ?? batch.catalogue.find(entry => entry.name === 'heartbeat');
if (!target || !target.skill_md.includes('name: heartbeat')) throw new Error('complete installed heartbeat body was not uploaded');

// REM_CLOUD_LESSONS: a JSON array of [lesson_id, applies_to]; the first half issues one lesson each.
const fixtureLessons = pageId => JSON.parse(process.env.REM_CLOUD_LESSONS || '[]').map(([id, appliesTo]) => {
  const situation = { task_type: 'debug', trigger: `trigger ${id}`, tools: [] };
  return { judgment_id: `j-${id}`, lesson: { lesson_id: id, page_id: pageId, status: 'candidate', count: 1, helped: 0,
    harmful: 0, measured: false, created_run: batch.run_id, project_id: 'github.com/example/project', agent_id: 'codex',
    user_id: 'u', skill_target: null, scenario: situation, situation, advice: `advice ${id}`, because: `because ${id}`,
    applies_to: appliesTo, polarity: 'from_failure', evidence: [], counter_examples: { searched: true, traces_checked: [], found: [] },
    listed: true } };
});
const halves = batch.halves.map(half => {
  const pages = half.sessions.map((session, index) => {
    const part = session.chunks[0];
    const line = part.text.split('\n').find(text => /^\d+: /.test(text));
    if (!line) throw new Error(`missing numbered uploaded evidence for ${session.trace_id}`);
    const lineNumber = Number(line.slice(0, line.indexOf(':')));
    const pageId = `${batch.run_id}-${half.harness}-${index + 1}`;
    const page = {
      page_id: pageId, summary: `Recorded root cause from ${session.trace_id}`, class: 'SKILL_DEFECT',
      root_cause: { subject: 'fixture task', relation: 'needs', fact: 'a check after the write',
        valid_at: new Date(session.source_mtime_ms).toISOString(), evidence_pages: [], evidence_traces: [session.trace_id] },
      fix: 'verify the result', scenario: { task_type: 'write', trigger: 'result missing', tools: [] },
      skills_used: session.skills_loaded, skill_target: target.path.replace(/\/SKILL\.md$/, ''), knowledge_used: [],
      outcome: session.local_outcome, agent_id: half.harness, project_id: session.project_id, user_id: session.user_id,
      evidence: [session.trace_id], citations: [{ trace_id: session.trace_id, line_start: lineNumber,
        line_end: lineNumber, quote: line.slice(line.indexOf(': ') + 2, line.indexOf(': ') + 14) }],
      counter_examples: 'not searched', superseded: false, body: `Cited ${session.trace_id}.\n`,
      count: 1, task_ids: [session.session_id], last_seen: new Date(session.source_mtime_ms).toISOString(),
      skills_observed: session.skills_loaded,
    };
    return { judgment_id: `${batch.run_id}-${half.harness}-page-${index + 1}`, page };
  });
  const proposal = {
    kind: 'patch', target: target.path, region: 'body', class: 'SKILL_DEFECT',
    purpose: { summary: 'verify the fixture result after writing', page_ids: [pages[0].page.page_id] },
    scenario: { task_type: 'write', trigger: 'result missing', tools: [] },
    skills_used: [], skill_target: target.path.replace(/\/SKILL\.md$/, ''), knowledge_used: [],
    outcome: 'fail', evidence: [half.sessions[0].trace_id],
    ops: [{ op: 'append', text: 'Verify the fixture result after writing.\n' }],
  };
  return { harness: half.harness,
    attention: half.sessions.map(session => ({ trace_id: session.trace_id, jev_outcome: null,
      fail_probability: null, basis: 'local-fallback' })),
    pages, lessons: half === batch.halves[0] ? fixtureLessons(pages[0].page.page_id) : [], proposals: [{ judgment_id: `${batch.run_id}-${half.harness}-proposal`, proposal }],
    read_judgments: [], log_entry: `Recorded ${half.sessions.length} cited sessions for ${half.harness}` };
});
process.stdout.write(`${JSON.stringify({ schema_version: 1, run_id: batch.run_id, history_acknowledged: true,
  history_links: [], halves })}\n`);
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexUnverifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall