Progress band, toasts and a phase map for the ssi loop

Simple, reviewable code with the least necessary workflow. Works with Codex and Claude Code. SSI 0.3.0 handles small tasks directly and tracks substantial or risky work when tracking is useful.
Clone the repository, then copy the entire skill folder for your agent:
git clone https://github.com/ssime-git/ssi-ai-skill
cd ssi-ai-skill
# Claude Code
mkdir -p ~/.claude/skills
cp -R skills/ssi ~/.claude/skills/
# Codex
mkdir -p ~/.agents/skills
cp -R skills/ssi ~/.agents/skills/
Choose either installation or both. Invoke /ssi <request> in Claude Code or $ssi <request> in Codex. Claude Code also supports claude --plugin-dir . from this checkout, using /ssi:ssi. Tracked work requires Node 20+ and git. GitHub CLI is needed only for authorized remote work. Updating the checkout does not update a copied installation: repeat its copy command after git pull --ff-only. Project-local Codex installation and an optional routing reminder: Codex guide.
flowchart LR
A[Understand result and verification] --> B{Scope and risk}
B --> C[Direct agent work]
B --> D[Tracked SSI workflow]
C -->|Broader impact or unresolved failures| D
D --> E[Answer, local change or authorized draft PR]
Explicitly invoking SSI still allows direct work. There is no session-start hook or extra routing model. The agent makes the routing decision; it is guidance, not a deterministic classifier. Previously loaded instructions remain in conversation context: SSI does not promise to unload them.
For tracked work only:
sequenceDiagram
participant Agent
participant Engine
Agent->>Engine: start (answer, local or pr)
loop until done or a blocking question
Agent->>Engine: next --compact
Engine-->>Agent: one relevant action
Agent->>Engine: real artifact or executed check
end
check executes commands and ties receipts to the code snapshot. Manual evidence is labelled reported.ci inspects the actual PR commit and check results; absent CI remains unverified. PRs stay draft.Engine commands, configuration and evidence limits: design. Optional display: mods/ssi-cockpit; direct tasks do not appear as tracked runs.
Validation passed 158 engine/package tests and 9 evaluation tests. Four direct implementations passed their held-out assertions across Codex and Claude Code; each host passed eight routing decisions and completed one tracked answer workflow. These are small smoke tests, not proof of production readiness or perfect answers. The entrypoint is 52% shorter in bytes; equivalent token savings have not been established. An earlier engine-only comparison reduced tokens versus SSI 0.2 but cost more than plain Codex on short tasks.
Read the routing results and limits, historical model comparison, workflow text benchmark and run history. The evidence supports using SSI with normal human review, not trusting every answer or route automatically.
Run npm run validate and npm test. See contributing for evaluation checks and opt-in model trials. Design principles: philosophy. Changes: changelog.
Exact source versions and licences: NOTICE.md.
hooks/register.tsx 101 lines1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4import type { Snapshot } from '../types'
5
6const PANE = 'ssi-map'
7const NAMES = ['Analyze', 'Confirm', 'Reproduce', 'Plan', 'Implement', 'Review', 'Visual', 'Land']
8const ETA = [3, 4, 8, 5, 15, 8, 6, 10]
9
10const tick = atom({ plugin: 'ssi-cockpit', key: 'tick' } as const, 0)
11const lastPhase = atom({ plugin: 'ssi-cockpit', key: 'lastPhase' } as const, 0)
12const lastStop = atom({ plugin: 'ssi-cockpit', key: 'lastStop' } as const, '')
13
14async function load($: any): Promise<Snapshot | null> {
15 try {
16 const state = JSON.parse((await $.fs.read('.ssi/state.json')) as string)
17 const open = state.stop && !state.stop.answer
18 // `done` and `action` are what the engine actually answered last: phase 9 alone is not completion.
19 return { phase: Number(state.phase ?? 1), goal: String(state.goal ?? ''), stop: open ? String(state.stop.because) : null, done: state.last?.done === true, action: state.last?.action ? String(state.last.action) : null }
20 } catch {
21 return null
22 }
23}
24
25const bar = (phase: number) => '▓'.repeat(Math.min(phase, 8)) + '░'.repeat(8 - Math.min(phase, 8))
26
27async function refresh($: any) {
28 await update($, tick, n => n + 1)
29 const snap = await load($)
30 if (!snap) {
31 $.ui.status(undefined)
32 return
33 }
34 const p = Math.min(snap.phase, 8)
35 $.ui.status(snap.stop ? 'ssi: stopped' : snap.done ? 'ssi: done' : snap.phase > 8 ? `ssi: finishing (${snap.action ?? '…'})` : `ssi ${p}/8 ${NAMES[p - 1]}`)
36 const before = await read($, lastPhase)
37 const stopBefore = await read($, lastStop)
38 const stopNow = snap.stop ?? ''
39 if (stopNow !== stopBefore) {
40 await update($, lastStop, () => stopNow)
41 if (stopNow) $.ui.toast('I stopped and need you.')
42 }
43 if (before !== snap.phase) {
44 await update($, lastPhase, () => snap.phase)
45 if (before !== 0 && !stopNow) {
46 $.ui.toast(snap.done ? '✓ Done. The PR is ready for you.' : snap.phase > 8 ? `One last step: ${snap.action ?? 'finish the delivery'}` : snap.phase < before ? `↩ Back to ${NAMES[p - 1]}: something needs a fix.` : `✓ Phase done. Now: ${NAMES[p - 1]}`)
47 }
48 }
49}
50
51export const register: Register = on => {
52 on('session.start', async ($, e, next) => {
53 await $.command.register({ name: 'ssi-map', description: 'Show the ssi phase map' })
54 await refresh($)
55 return next(e)
56 })
57
58 on('command.run', { command: 'ssi-map' }, async $ => {
59 await $.ui.open({ id: PANE, title: 'SSI map' })
60 return { text: 'SSI map opened.' }
61 })
62
63 on('turn.complete', async ($, e, next) => {
64 await refresh($)
65 return next(e)
66 })
67
68 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
69 await read($, tick)
70 const snap = await load($)
71 if (!snap || e.props.hasSurvey) return next(e)
72 const { Box, Text } = $.ui.resolve(e)
73 const p = Math.min(snap.phase, 8)
74 const where = snap.done ? `${bar(8)} 8/8 Done` : snap.phase > 8 ? `${bar(8)} 8/8 Finishing: ${snap.action ?? '…'}` : `${bar(p)} ${p}/8 ${NAMES[p - 1]}`
75 return (
76 <Box>
77 <Text>{where}</Text>
78 {snap.stop ? <Text bold> · I stopped: {snap.stop}</Text> : snap.phase <= 8 ? <Text dimColor> · ~{ETA[p - 1]} min</Text> : null}
79 </Box>
80 )
81 })
82
83 on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
84 await read($, tick)
85 const snap = await load($)
86 const { Box, Text } = $.ui.resolve(e)
87 if (!snap) return <Text dimColor>No ssi run here yet. Ask for a fix or a feature with /ssi.</Text>
88 return (
89 <Box flexDirection="column">
90 <Text bold>{snap.goal}</Text>
91 {NAMES.map((name, i) => {
92 const mark = snap.phase > i + 1 ? '✓' : snap.phase === i + 1 ? '▶' : '·'
93 return <Text dimColor={snap.phase < i + 1}>{mark} {i + 1}. {name}{snap.phase === i + 1 ? ` ~${ETA[i]} min` : ''}</Text>
94 })}
95 {snap.stop ? <Text bold>I stopped: {snap.stop}</Text> : null}
96 <Text dimColor>Back edges: review, visual or CI failing returns to 5. Implement.</Text>
97 </Box>
98 )
99 })
100}
101types/index.d.ts 8 lines1export type Snapshot = { phase: number; goal: string; stop: string | null; done: boolean; action: string | null }
2
3declare module 'claude-code' {
4 interface PluginState {
5 'ssi-cockpit': { tick: number; lastPhase: number; lastStop: string }
6 }
7}
8