project-brain 0.43.0 → 0.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -11
- package/package.json +6 -6
- package/templates/claude-tui/activity-pane/.claude-plugin/plugin.json +7 -0
- package/templates/claude-tui/activity-pane/hooks/feat-agents.tsx +179 -0
- package/templates/claude-tui/activity-pane/hooks/feat-blocked.tsx +232 -0
- package/templates/claude-tui/activity-pane/hooks/feat-ci.tsx +400 -0
- package/templates/claude-tui/activity-pane/hooks/feat-context.tsx +283 -0
- package/templates/claude-tui/activity-pane/hooks/feat-notify.tsx +145 -0
- package/templates/claude-tui/activity-pane/hooks/feat-progress.tsx +413 -0
- package/templates/claude-tui/activity-pane/hooks/feat-running.tsx +528 -0
- package/templates/claude-tui/activity-pane/hooks/feat-savings.tsx +533 -0
- package/templates/claude-tui/activity-pane/hooks/hooks.json +1 -0
- package/templates/claude-tui/activity-pane/hooks/register.tsx +2141 -0
- package/templates/claude-tui/activity-pane/types/index.d.ts +201 -0
- package/templates/claude-tui/context-gate/.claude-plugin/plugin.json +7 -0
- package/templates/claude-tui/context-gate/hooks/hooks.json +1 -0
- package/templates/claude-tui/context-gate/hooks/register.tsx +355 -0
- package/templates/claude-tui/context-gate/types/index.d.ts +28 -0
- package/templates/claude-tui/skill-listing/.claude-plugin/plugin.json +7 -0
- package/templates/claude-tui/skill-listing/hooks/hooks.json +1 -0
- package/templates/claude-tui/skill-listing/hooks/register.tsx +300 -0
- package/templates/claude-tui/skill-listing/types/index.d.ts +22 -0
- package/templates/model-routing.md +10 -0
- package/templates/skills/brain-design-review/SKILL.md +65 -0
- package/templates/skills/brain-design-review/references/audit.md +56 -0
- package/templates/skills/brain-design-review/references/fix-loop.md +36 -0
- package/templates/skills/brain-design-review/references/probes.md +80 -0
- package/templates/skills/brain-qa-only/SKILL.md +59 -0
- package/templates/skills/brain-qa-only/references/report.md +63 -0
- package/templates/skills/brain-worktree/SKILL.md +18 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import type { Hook, Register } from 'claude-code'
|
|
2
|
+
|
|
3
|
+
import type { Listing, ListingEntry, ListingMode, SkillsConfig, SkillUsage } from '../types'
|
|
4
|
+
|
|
5
|
+
type Api = Parameters<Hook<'prompt.attachment'>>[0]
|
|
6
|
+
|
|
7
|
+
const DAY_MS = 24 * 60 * 60_000
|
|
8
|
+
const USAGE_REFRESH_TIMEOUT_MS = 120_000
|
|
9
|
+
/** Past the CLI's own 5 s self-timeout, so it is the CLI that gives up and the delegation goes out unchanged. */
|
|
10
|
+
const DELEGATION_TIMEOUT_MS = 6_000
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_CONFIG: SkillsConfig = { picker: true, general: [], keepTop: 15, keepRecentDays: 7 }
|
|
13
|
+
|
|
14
|
+
export const OTHER_SKILLS_PREFIX = '- Other skills (name only; invoke by name when one fits the request): '
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* `- name: description`, `- name (alias): description` or `- name`. Names carry no spaces, so the
|
|
18
|
+
* first `: ` ends the name even in `plugin:skill`.
|
|
19
|
+
*/
|
|
20
|
+
const ENTRY = /^- (\S+?)(?:: | \(\S+\)(?:: |$)|$)/
|
|
21
|
+
|
|
22
|
+
/** The listing's skills in order, each with its continuation lines; null when the text holds none. */
|
|
23
|
+
export function parseListing(text: string): Listing | null {
|
|
24
|
+
const preamble: string[] = []
|
|
25
|
+
const entries: ListingEntry[] = []
|
|
26
|
+
for (const line of text.split('\n')) {
|
|
27
|
+
const name = ENTRY.exec(line)?.[1]
|
|
28
|
+
if (name !== undefined) entries.push({ name, lines: [line] })
|
|
29
|
+
else if (entries.length === 0) preamble.push(line)
|
|
30
|
+
else entries[entries.length - 1]!.lines.push(line)
|
|
31
|
+
}
|
|
32
|
+
return entries.length === 0 ? null : { preamble, entries }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Full lines for the skills in `keep`, in their original order, then every other name on one
|
|
37
|
+
* trailing line. Every name survives; the text comes back unchanged when nothing would be cut.
|
|
38
|
+
*/
|
|
39
|
+
export function compactListing(text: string, keep: ReadonlySet<string>): string {
|
|
40
|
+
const listing = parseListing(text)
|
|
41
|
+
if (listing === null) return text
|
|
42
|
+
const kept = listing.entries.filter(entry => keep.has(entry.name))
|
|
43
|
+
const named = listing.entries.filter(entry => !keep.has(entry.name)).map(entry => entry.name)
|
|
44
|
+
if (named.length === 0) return text
|
|
45
|
+
const trailing = (lines: string[]) => {
|
|
46
|
+
let end = lines.length
|
|
47
|
+
while (end > 0 && lines[end - 1]!.trim() === '') end--
|
|
48
|
+
return lines.slice(0, end)
|
|
49
|
+
}
|
|
50
|
+
return [
|
|
51
|
+
...listing.preamble,
|
|
52
|
+
...kept.flatMap(entry => trailing(entry.lines)),
|
|
53
|
+
`${OTHER_SKILLS_PREFIX}${named.join(', ')}`,
|
|
54
|
+
].join('\n')
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The skills that keep their full line. With the Jev picker, only the general-use ones: the picker
|
|
59
|
+
* brings each prompt's skills in full. Without it, also the `brain-*` core, the most used and the
|
|
60
|
+
* recently used, counted only among `listed` so a slash command like `/clear` never takes a slot.
|
|
61
|
+
*/
|
|
62
|
+
export function keepSet(listed: string[], mode: ListingMode, config: SkillsConfig, usage: SkillUsage | null, now: number): Set<string> {
|
|
63
|
+
const names = new Set(listed)
|
|
64
|
+
const general = config.general.filter(name => names.has(name))
|
|
65
|
+
if (mode === 'jev' || usage === null) return new Set(general)
|
|
66
|
+
const used = Object.entries(usage.skills).filter(([name]) => names.has(name))
|
|
67
|
+
const top = [...used].sort((a, b) => b[1].count - a[1].count || b[1].lastUsed - a[1].lastUsed).slice(0, config.keepTop)
|
|
68
|
+
const recentSince = now - config.keepRecentDays * DAY_MS
|
|
69
|
+
return new Set([
|
|
70
|
+
...general,
|
|
71
|
+
...listed.filter(name => name.startsWith('brain-')),
|
|
72
|
+
...top.map(([name]) => name),
|
|
73
|
+
...used.filter(([, entry]) => entry.lastUsed >= recentSince).map(([name]) => name),
|
|
74
|
+
])
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const isObject = (value: unknown): value is Record<string, unknown> =>
|
|
78
|
+
typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
79
|
+
|
|
80
|
+
const positiveInt = (value: unknown, fallback: number): number =>
|
|
81
|
+
typeof value === 'number' && Number.isInteger(value) && value > 0 ? value : fallback
|
|
82
|
+
|
|
83
|
+
export function parseConfig(text: string): SkillsConfig {
|
|
84
|
+
try {
|
|
85
|
+
const raw: unknown = JSON.parse(text)
|
|
86
|
+
if (!isObject(raw)) return DEFAULT_CONFIG
|
|
87
|
+
return {
|
|
88
|
+
picker: typeof raw.picker === 'boolean' ? raw.picker : DEFAULT_CONFIG.picker,
|
|
89
|
+
general: Array.isArray(raw.general) ? raw.general.filter((name): name is string => typeof name === 'string') : [],
|
|
90
|
+
keepTop: positiveInt(raw.keepTop, DEFAULT_CONFIG.keepTop),
|
|
91
|
+
keepRecentDays: positiveInt(raw.keepRecentDays, DEFAULT_CONFIG.keepRecentDays),
|
|
92
|
+
}
|
|
93
|
+
} catch {
|
|
94
|
+
return DEFAULT_CONFIG
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Fewer recorded invocations than this rank nothing: the listing passes through until there is history. */
|
|
99
|
+
export const MIN_USAGE_INVOCATIONS = 10
|
|
100
|
+
|
|
101
|
+
export function parseUsage(text: string): SkillUsage | null {
|
|
102
|
+
try {
|
|
103
|
+
const raw: unknown = JSON.parse(text)
|
|
104
|
+
if (!isObject(raw) || typeof raw.generatedAt !== 'number' || !isObject(raw.skills)) return null
|
|
105
|
+
const usage = raw as SkillUsage
|
|
106
|
+
const total = Object.values(usage.skills).reduce((sum, entry) => sum + (typeof entry?.count === 'number' ? entry.count : 0), 0)
|
|
107
|
+
return total >= MIN_USAGE_INVOCATIONS ? usage : null
|
|
108
|
+
} catch {
|
|
109
|
+
return null
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** After this many Jev failures in a row the listing keeps descriptions until a pick succeeds again. */
|
|
114
|
+
export const MAX_PICK_FAILURES = 3
|
|
115
|
+
|
|
116
|
+
/** `~/.project-brain/skill-pick-health.json`, written by the suggest CLI after every Jev request it makes. */
|
|
117
|
+
export function picksHealthy(text: string): boolean {
|
|
118
|
+
try {
|
|
119
|
+
const raw: unknown = JSON.parse(text)
|
|
120
|
+
return !isObject(raw) || typeof raw.failures !== 'number' || raw.failures < MAX_PICK_FAILURES
|
|
121
|
+
} catch {
|
|
122
|
+
return true
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** A token worth trying: one non-empty string with no whitespace, read from the env or from `{ "token": … }`. */
|
|
127
|
+
export function tokenShaped(envToken: string | undefined, fileText: string): boolean {
|
|
128
|
+
const shaped = (value: unknown) => typeof value === 'string' && /^\S{8,}$/.test(value)
|
|
129
|
+
if (shaped(envToken)) return true
|
|
130
|
+
try {
|
|
131
|
+
const raw: unknown = JSON.parse(fileText)
|
|
132
|
+
return isObject(raw) && shaped(raw.token)
|
|
133
|
+
} catch {
|
|
134
|
+
return false
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Whether Claude Code would run the suggest hook: installed under UserPromptSubmit, and hooks not disabled. */
|
|
139
|
+
export function suggestHookActive(settingsText: string): boolean {
|
|
140
|
+
try {
|
|
141
|
+
const raw: unknown = JSON.parse(settingsText)
|
|
142
|
+
if (!isObject(raw) || raw.disableAllHooks === true || !isObject(raw.hooks)) return false
|
|
143
|
+
const groups = raw.hooks.UserPromptSubmit
|
|
144
|
+
if (!Array.isArray(groups)) return false
|
|
145
|
+
return groups.some(group =>
|
|
146
|
+
isObject(group) && Array.isArray(group.hooks) && group.hooks.some(hook => isObject(hook) && typeof hook.command === 'string' && hook.command.includes('project-brain suggest')))
|
|
147
|
+
} catch {
|
|
148
|
+
return false
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The listing for one attachment. `stats` without usage numbers passes the text through: cutting
|
|
154
|
+
* descriptions with nothing to rank them by would hide the skills the owner relies on.
|
|
155
|
+
*/
|
|
156
|
+
export function rewriteListing(text: string, mode: ListingMode, config: SkillsConfig, usage: SkillUsage | null, now: number): string {
|
|
157
|
+
if (mode === 'stats' && usage === null) return text
|
|
158
|
+
const listing = parseListing(text)
|
|
159
|
+
if (listing === null) return text
|
|
160
|
+
return compactListing(text, keepSet(listing.entries.map(entry => entry.name), mode, config, usage, now))
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const ENTRY_HEAD = /^- \S+?(?: \(\S+\))?(?:: |$)/
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Each listed skill's description, as Claude Code worded it. The picker reads them from
|
|
167
|
+
* `skill-listing.json` so built-in and connector skills, which have no SKILL.md on disk, can be picked too.
|
|
168
|
+
*/
|
|
169
|
+
export function listedDescriptions(text: string): Record<string, string> {
|
|
170
|
+
const listing = parseListing(text)
|
|
171
|
+
if (listing === null) return {}
|
|
172
|
+
return Object.fromEntries(
|
|
173
|
+
listing.entries.map(entry => {
|
|
174
|
+
const [head = '', ...rest] = entry.lines
|
|
175
|
+
return [entry.name, [head.replace(ENTRY_HEAD, ''), ...rest].join('\n').trim()]
|
|
176
|
+
})
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async function readOr($: Api, path: string, fallback: string): Promise<string> {
|
|
181
|
+
try {
|
|
182
|
+
return await $.fs.read(path)
|
|
183
|
+
} catch {
|
|
184
|
+
return fallback
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Jev can pick skills: on in config and env, a token of the right shape, and no run of recent failures. */
|
|
189
|
+
async function pickerReady($: Api, config: SkillsConfig, home: string): Promise<boolean> {
|
|
190
|
+
if (!config.picker || (await $.env.get('BRAIN_SKILL_PICKER')) === '0') return false
|
|
191
|
+
const fileToken = await readOr($, `${home}/.project-brain/reranker.json`, '')
|
|
192
|
+
if (!tokenShaped(await $.env.get('TYPESAFE_API_KEY'), fileToken)) return false
|
|
193
|
+
return picksHealthy(await readOr($, `${home}/.project-brain/skill-pick-health.json`, ''))
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Subagents whose spawn carried a skills block, and the spawns still resolving their ids. */
|
|
197
|
+
const pickedAgents = new Set<string>()
|
|
198
|
+
const pendingSpawns = new Set<Promise<unknown>>()
|
|
199
|
+
/** How long a subagent's listing waits for its own spawn to report its id before falling back to `stats`. */
|
|
200
|
+
const SPAWN_WAIT_MS = 1_500
|
|
201
|
+
|
|
202
|
+
async function spawnCarriedSkills($: Api, agentId: string): Promise<boolean> {
|
|
203
|
+
if (pickedAgents.has(agentId)) return true
|
|
204
|
+
if (pendingSpawns.size === 0) return false
|
|
205
|
+
await Promise.race([Promise.allSettled([...pendingSpawns]), $.clock.sleep(SPAWN_WAIT_MS)])
|
|
206
|
+
return pickedAgents.has(agentId)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* `jev` when something brings this loop's skills back in full: on the main loop the suggest hook,
|
|
211
|
+
* per prompt; in a subagent the skills block its spawn carried. Anything else keeps descriptions.
|
|
212
|
+
*/
|
|
213
|
+
async function modeOf($: Api, config: SkillsConfig, home: string, agentId: string | undefined): Promise<ListingMode> {
|
|
214
|
+
if (!(await pickerReady($, config, home))) return 'stats'
|
|
215
|
+
if (agentId !== undefined) return (await spawnCarriedSkills($, agentId)) ? 'jev' : 'stats'
|
|
216
|
+
const claudeDir = (await $.env.get('CLAUDE_CONFIG_DIR')) || `${home}/.claude`
|
|
217
|
+
return suggestHookActive(await readOr($, `${claudeDir}/settings.json`, '')) ? 'jev' : 'stats'
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
async function rememberDescriptions($: Api, home: string, text: string, now: number): Promise<void> {
|
|
221
|
+
const path = `${home}/.project-brain/skill-listing.json`
|
|
222
|
+
let known: Record<string, string> = {}
|
|
223
|
+
try {
|
|
224
|
+
const raw: unknown = JSON.parse(await readOr($, path, '{}'))
|
|
225
|
+
if (isObject(raw) && isObject(raw.skills)) known = raw.skills as Record<string, string>
|
|
226
|
+
} catch {
|
|
227
|
+
// Unreadable: rebuilt from this listing.
|
|
228
|
+
}
|
|
229
|
+
const merged = { ...known, ...listedDescriptions(text) }
|
|
230
|
+
if (JSON.stringify(merged) === JSON.stringify(known)) return
|
|
231
|
+
await $.fs.write(path, `${JSON.stringify({ updatedAt: now, skills: merged }, null, 2)}\n`)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async function compactAttachment($: Api, text: string, agentId: string | undefined): Promise<string> {
|
|
235
|
+
const home = await $.env.get('HOME')
|
|
236
|
+
if (!home) return text
|
|
237
|
+
const now = await $.clock.now()
|
|
238
|
+
await rememberDescriptions($, home, text, now).catch(() => undefined)
|
|
239
|
+
const config = parseConfig(await readOr($, `${home}/.project-brain/skills.json`, ''))
|
|
240
|
+
const usage = parseUsage(await readOr($, `${home}/.project-brain/skill-usage.json`, ''))
|
|
241
|
+
return rewriteListing(text, await modeOf($, config, home, agentId), config, usage, now)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The skills block goes first, so a delegation that ends with its own output contract still ends
|
|
246
|
+
* with it; the prompt comes back unchanged when nothing was picked or anything failed.
|
|
247
|
+
*/
|
|
248
|
+
export const withDelegationSkills = (prompt: string, block: string): string =>
|
|
249
|
+
block.trim() === '' ? prompt : `${block.trim()}\n\n${prompt}`
|
|
250
|
+
|
|
251
|
+
/** The CLI owns the pick (one Jev request, the same floor and ceiling as the prompt hook); the mod only carries its answer. */
|
|
252
|
+
async function delegationSkills($: Api, prompt: string, description: string): Promise<string> {
|
|
253
|
+
const home = await $.env.get('HOME')
|
|
254
|
+
if (!home) return ''
|
|
255
|
+
const config = parseConfig(await readOr($, `${home}/.project-brain/skills.json`, ''))
|
|
256
|
+
if (!(await pickerReady($, config, home))) return ''
|
|
257
|
+
const { exitCode, stdout } = await $.process.run(['project-brain', 'suggest', '--agent', '--stdin'], {
|
|
258
|
+
stdin: JSON.stringify({ prompt, description }),
|
|
259
|
+
timeoutMs: DELEGATION_TIMEOUT_MS,
|
|
260
|
+
})
|
|
261
|
+
return exitCode === 0 ? stdout : ''
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Daily at most: the CLI skips a file under a day old, and a second session waits on the first one's lock. */
|
|
265
|
+
async function refreshUsage($: Api): Promise<void> {
|
|
266
|
+
await $.process.run(['project-brain', 'skill-usage', '--write', '--if-stale'], { timeoutMs: USAGE_REFRESH_TIMEOUT_MS })
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export const register: Register = on => {
|
|
270
|
+
on('session.start', async ($, e, next) => {
|
|
271
|
+
void refreshUsage($ as unknown as Api).catch(() => undefined)
|
|
272
|
+
return next(e)
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
on('prompt.attachment', { type: 'skill_listing' }, async ($, e, next) => {
|
|
276
|
+
if (e.origin.kind !== 'engine') return next(e)
|
|
277
|
+
try {
|
|
278
|
+
return next({ ...e, text: await compactAttachment($, e.text, e.agentId) })
|
|
279
|
+
} catch {
|
|
280
|
+
return next(e)
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
on('agent.spawn', async ($, e, next) => {
|
|
285
|
+
let block = ''
|
|
286
|
+
try {
|
|
287
|
+
block = (await delegationSkills($ as unknown as Api, e.prompt, e.description)).trim()
|
|
288
|
+
} catch {
|
|
289
|
+
block = ''
|
|
290
|
+
}
|
|
291
|
+
const spawning = next(block === '' ? e : { ...e, prompt: withDelegationSkills(e.prompt, block) })
|
|
292
|
+
if (block === '') return spawning
|
|
293
|
+
const tracked = spawning.then(spawned => {
|
|
294
|
+
if (spawned.agentId !== undefined) pickedAgents.add(spawned.agentId)
|
|
295
|
+
})
|
|
296
|
+
pendingSpawns.add(tracked)
|
|
297
|
+
void tracked.catch(() => undefined).finally(() => pendingSpawns.delete(tracked))
|
|
298
|
+
return spawning
|
|
299
|
+
}).catch(($, e, next) => next(e))
|
|
300
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** `~/.project-brain/skill-usage.json`, written by `project-brain skill-usage --write`. */
|
|
2
|
+
export type SkillUsage = {
|
|
3
|
+
generatedAt: number
|
|
4
|
+
windowDays: number
|
|
5
|
+
skills: Record<string, { count: number; lastUsed: number }>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** `~/.project-brain/skills.json`, shared with the suggest hook's skill picker. */
|
|
9
|
+
export type SkillsConfig = {
|
|
10
|
+
picker: boolean
|
|
11
|
+
general: string[]
|
|
12
|
+
keepTop: number
|
|
13
|
+
keepRecentDays: number
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** One skill of the listing: its first line and any continuation lines of its description. */
|
|
17
|
+
export type ListingEntry = { name: string; lines: string[] }
|
|
18
|
+
|
|
19
|
+
export type Listing = { preamble: string[]; entries: ListingEntry[] }
|
|
20
|
+
|
|
21
|
+
/** `jev`: the per-prompt picker supplies descriptions. `stats`: the most-used skills keep theirs. */
|
|
22
|
+
export type ListingMode = 'jev' | 'stats'
|
|
@@ -25,6 +25,16 @@ cheaper inline. Delegate when the work is 4+ files of exploration, or any
|
|
|
25
25
|
read-then-write pair where the reading would otherwise land in your context and
|
|
26
26
|
stay there.
|
|
27
27
|
|
|
28
|
+
### Close every delegation with the report contract
|
|
29
|
+
|
|
30
|
+
A sub-agent's hand-back stays in your context until it compacts, so ask for a
|
|
31
|
+
short one and keep the detail on disk. End the delegation prompt with this
|
|
32
|
+
block, unless the prompt already sets its own output format (JSON, a schema):
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
{{reportContract}}
|
|
36
|
+
```
|
|
37
|
+
|
|
28
38
|
### Escalate, don't start deep
|
|
29
39
|
|
|
30
40
|
Run the cheapest tier the task table allows. On a failed or empty result,
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brain-design-review
|
|
3
|
+
description: "Trigger: design review, design audit, visual QA, revisa el diseño, AI slop, polish this UI, audit and fix the design, does this look designed. Audits a rendered UI like a designer, scores it, then fixes the findings one commit each and re-verifies."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: jcsoftdev
|
|
7
|
+
version: "1.0"
|
|
8
|
+
generator: project-brain
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
`generator: project-brain` is an ownership marker, not decoration.
|
|
13
|
+
`project-brain setup` overwrites this directory only when it finds that line;
|
|
14
|
+
without it, setup treats the directory as hand-written and leaves it alone.
|
|
15
|
+
Strip it and you pin this copy forever — no upgrade will ever reach it.
|
|
16
|
+
-->
|
|
17
|
+
|
|
18
|
+
## Activation Contract
|
|
19
|
+
|
|
20
|
+
Use when a live or local UI must be judged on how it looks and feels, and the findings should be fixed. Report-only: use `brain-qa-only`. Whole-product MVP verdict: `mvp-ui-review`. Building new UI: `impeccable`.
|
|
21
|
+
|
|
22
|
+
## Hard Rules
|
|
23
|
+
|
|
24
|
+
- Judge the rendered page, never the source. Source is read only in the fix phase.
|
|
25
|
+
- Every finding carries a screenshot and a measured value from `evaluate_script`. "Spacing feels off" is not a finding: "gap is 13px, scale is 8/16, use 16" is.
|
|
26
|
+
- Browser ladder: `chrome-devtools` first; `claude-in-chrome` only for a session the user said to reuse; never Playwright by default.
|
|
27
|
+
- Own the tab you open and close it before finishing. Never type passwords or payment data; on a login wall ask the user to sign in, then continue.
|
|
28
|
+
- Non-local targets are read-only: no submit, create or delete.
|
|
29
|
+
- Calibrate against the project's own system: `DESIGN.md`, then `:root` tokens and the tailwind or theme config. A departure from a token ranks higher; name the token.
|
|
30
|
+
- Fix only on a clean tree and on a branch. One fix, one commit, message by `brain-commit`. Code follows `brain-style`.
|
|
31
|
+
- Information on screen must be real data or an honest empty state; fixtures that look real are a finding.
|
|
32
|
+
|
|
33
|
+
## Decision Gates
|
|
34
|
+
|
|
35
|
+
| Situation | Action |
|
|
36
|
+
|-----------|--------|
|
|
37
|
+
| No URL, feature branch | Diff-aware: `git diff <base>...HEAD --name-only`, map files to routes, audit those. Base from `gh pr view`, else the default branch, never assumed |
|
|
38
|
+
| No URL, default branch | Detect a dev server through `port_acquire` leases or ask |
|
|
39
|
+
| Dirty tree | Ask once: commit, stash, or abort. Prefer a `brain-worktree` when other work is in flight |
|
|
40
|
+
| Surface is native (SwiftUI, AppKit) | Render offscreen and read the image. `ImageRenderer` draws AppKit-backed controls as yellow placeholders: say so, do not grade them |
|
|
41
|
+
| `impeccable` installed | Run its detector and `audit` as a second opinion; dedupe against your findings |
|
|
42
|
+
| Finding is a third-party widget or copy | Defer, do not fix |
|
|
43
|
+
| Needs the cause in code | `search_context` / `find_symbol` to reach the component, not grep |
|
|
44
|
+
|
|
45
|
+
## Execution Steps
|
|
46
|
+
|
|
47
|
+
1. Classify each surface first: Persuade (landing), Operate (app UI), Read (docs), Experience (showcase). Rules differ; see `references/audit.md`.
|
|
48
|
+
2. Capture the system: tokens and `DESIGN.md`, then the rendered one with `references/probes.md` (fonts, colors, heading scale, touch targets).
|
|
49
|
+
3. First impression: full-page screenshot, then write what it says, the first three things the eye lands on, one word. Run the Trunk Test (6 questions) per page.
|
|
50
|
+
4. Per page: `take_snapshot`, `take_screenshot` at 375, 768, 1440 via `resize_page` or `emulate`, `list_console_messages`, `list_network_requests`, `lighthouse_audit` for a11y and perf. Score the ten categories in `references/audit.md`.
|
|
51
|
+
5. Walk 2-3 flows and keep the goodwill meter from `references/audit.md`. Check consistency across pages.
|
|
52
|
+
6. Report baseline: Design Score and AI Slop Score (A-F), per-category grades, quick wins (3-5, under 30 minutes each).
|
|
53
|
+
7. Triage by impact, then fix loop (`references/fix-loop.md`): locate, smallest CSS-first change, commit, re-render, classify verified, best-effort or reverted.
|
|
54
|
+
8. Re-audit affected pages. If a score got worse, say so first.
|
|
55
|
+
9. Save pitfalls worth keeping to engram (`mem_save`, topic `design-review/<project>`); a lasting constraint goes to the OKF bundle through `brain-okf`.
|
|
56
|
+
|
|
57
|
+
## Output Contract
|
|
58
|
+
|
|
59
|
+
Report in `.design-review/<date>/report.md` (git-excluded, never tracked): scores before and after, findings (id, category, impact, evidence, fix status, commit SHA), before/after screenshot pairs, deferred list, one-line PR summary. Show the key screenshots inline with `Read`. Update `TODOS.md` only if it exists. State what was not covered.
|
|
60
|
+
|
|
61
|
+
## References
|
|
62
|
+
|
|
63
|
+
- `references/audit.md` — ten-category checklist, AI-slop list, scoring, goodwill meter, hard rules.
|
|
64
|
+
- `references/probes.md` — `evaluate_script` functions for the rendered design system.
|
|
65
|
+
- `references/fix-loop.md` — fix, commit, re-test, risk cap.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Design audit reference
|
|
2
|
+
|
|
3
|
+
Each finding: category, impact (high, medium, polish), screenshot, measured value.
|
|
4
|
+
|
|
5
|
+
## Surface mode
|
|
6
|
+
|
|
7
|
+
| Mode | Visitor's win | Rules |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Persuade (landing, pricing) | decides and acts | brand > headline > body > CTA; one composition in the first viewport; one job per section; cards only when the card is the interaction; one authored motion moment |
|
|
10
|
+
| Operate (app, dashboard, settings) | finishes a task | scanability and native expectations; calm surfaces, few colors; utility copy; headings say what the area is |
|
|
11
|
+
| Read (docs, articles) | understands | 65-75ch measure, one column, wayfinding; no hero or CTA theater |
|
|
12
|
+
| Experience (portfolio) | is inside the work | artifact owns the first viewport; one transition, no scroll-jacking |
|
|
13
|
+
| Hybrid | per section | classify each section |
|
|
14
|
+
|
|
15
|
+
Instant-fail patterns: generic SaaS card grid as first impression; strong headline with no clear action; busy imagery behind text; carousel with no narrative; app UI made of stacked cards.
|
|
16
|
+
|
|
17
|
+
## Trunk test (per page)
|
|
18
|
+
|
|
19
|
+
Answer at once: what site, what page, major sections, my options, where am I, how do I search. All six pass; four or five partial; three or fewer is a high finding.
|
|
20
|
+
|
|
21
|
+
## Ten categories
|
|
22
|
+
|
|
23
|
+
1. **Hierarchy**: one focal point, one primary CTA per view, squint test, intentional white space, purpose clear in 3 seconds.
|
|
24
|
+
2. **Typography**: at most 3 families; scale ratio 1.25-1.333; line-height 1.5 body and 1.15-1.25 headings; 45-75 chars per line; no skipped heading levels; at least 2 weights; body at least 16px, labels at least 12px; `text-wrap: balance` on headings; `tabular-nums` on number columns; curly quotes and `…`.
|
|
25
|
+
3. **Color and contrast**: at most 12 non-gray colors; AA 4.5:1 body, 3:1 large text and UI; no color-only encoding; semantic colors consistent; dark mode uses elevation, off-white text and `color-scheme`.
|
|
26
|
+
4. **Spacing and layout**: 4 or 8 base scale; consistent grid and alignment; related items closer than sections; radius hierarchy, inner radius = outer minus gap; max content width; URL reflects state.
|
|
27
|
+
5. **Interaction states**: hover, `focus-visible` ring, active, disabled; skeletons match content; empty states with an action; specific errors with the next step; targets at least 44px; every decision a mindless click.
|
|
28
|
+
6. **Responsive**: 375, 768, 1024, 1440; mobile is designed, not stacked; no horizontal scroll; no `user-scalable=no`.
|
|
29
|
+
7. **Motion**: ease-out enter, 50-700ms, purposeful, `prefers-reduced-motion` honored, no `transition: all`, animate transform and opacity only.
|
|
30
|
+
8. **Content**: specific button labels, no lorem, truncation handled, active voice, destructive actions confirmed or undoable, happy-talk word count reported, instructions longer than a sentence mean the design failed.
|
|
31
|
+
9. **AI slop**: purple or blue-to-purple gradients; the 3-column icon-circle feature grid; icons in colored circles; everything centered; uniform bubbly radius; blobs and wavy dividers; emoji as design; colored left-border cards; generic hero copy; cookie-cutter section rhythm; system-ui as the display face; gradient buttons; stock hero; testimonial rows with invented quotes; three big vanity numbers; same-shape card grids; frosted glass everywhere; generated SVG mascots; sparklines or avatars as filler; only the happy path designed. Polish-only: bounce easing, pulsing dots, thin border plus wide shadow, numbered section labels, em-dash overuse.
|
|
32
|
+
10. **Performance as design**: LCP under 2.0s (1.5s informational), CLS under 0.1, image dimensions and lazy loading, `font-display: swap`. Use `lighthouse_audit` and a performance trace for the numbers.
|
|
33
|
+
|
|
34
|
+
## Reflexes no detector catches
|
|
35
|
+
|
|
36
|
+
Shadows have an offset; a zero-offset colored halo is decoration. Secondary text on a colored surface is tinted, not gray. More space above a heading than below. Light or dark follows the use scene (who, where, under what light), not the category. Labels never live only as placeholders. Visited links differ.
|
|
37
|
+
|
|
38
|
+
## Scoring
|
|
39
|
+
|
|
40
|
+
Each category starts at A. High impact: minus one letter. Medium: minus half. Polish: no change. Floor F.
|
|
41
|
+
|
|
42
|
+
| Category | Weight |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Hierarchy, Typography, Spacing | 15% each |
|
|
45
|
+
| Color, Interaction, Responsive, Content | 10% each |
|
|
46
|
+
| AI slop, Motion, Performance | 5% each |
|
|
47
|
+
|
|
48
|
+
Report Design Score (weighted) and AI Slop Score (standalone, with a one-line verdict). Regression: load the prior baseline, print per-category deltas, new and resolved findings.
|
|
49
|
+
|
|
50
|
+
## Goodwill meter
|
|
51
|
+
|
|
52
|
+
Start 70. Drains: hidden info the user wants -15; interstitial or forced tour -15; format punishment -10; unnecessary data request -10; sloppy look -10; ambiguous choice -5. Fills: obvious top task +10. Print one line per step and a final value. Under 30 critical, 30-60 needs work, over 60 healthy.
|
|
53
|
+
|
|
54
|
+
## Rules
|
|
55
|
+
|
|
56
|
+
Specific and actionable, "change X to Y because Z". Depth over breadth: 5-10 documented findings beat 20 vague ones. Name AI slop directly. Document each finding as found.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Fix loop
|
|
2
|
+
|
|
3
|
+
Runs only after the report is written and the user has not said report-only.
|
|
4
|
+
|
|
5
|
+
## Preconditions
|
|
6
|
+
|
|
7
|
+
- `git status --porcelain` is empty, on a feature branch. Otherwise ask once: commit, stash or abort, and offer a `brain-worktree` first.
|
|
8
|
+
- Findings triaged: high, then medium, then polish. Mark as deferred what source cannot fix: third-party widgets, copy the team must supply.
|
|
9
|
+
|
|
10
|
+
## Per finding
|
|
11
|
+
|
|
12
|
+
1. **Locate.** `search_context` for the concept, `find_symbol` and `find_callers` for the component. Touch only files the finding needs. Prefer CSS, tokens and class changes over structure.
|
|
13
|
+
2. **Target.** For layout or hierarchy fixes where the intent is not obvious, describe the target in words from the captured system (same colors, fonts, radii) and show it next to the screenshot. Skip for a wrong hex or a missing padding.
|
|
14
|
+
3. **Fix.** Smallest change that resolves it. No refactor, no unrelated improvement. New code follows `brain-style`: no comments, name things, reuse the existing token or component.
|
|
15
|
+
4. **Commit.** `git add` the changed files only. One finding per commit, message in the convention `brain-commit` reads from the log, referencing the finding id.
|
|
16
|
+
5. **Re-test.** Re-render the page, take the after screenshot, compare with the before one. `list_console_messages` must be no worse than baseline.
|
|
17
|
+
6. **Classify.** verified (re-test confirms, no new errors); best-effort (applied, state could not be reproduced); reverted (regression: `git revert HEAD`, mark deferred).
|
|
18
|
+
7. **Regression test.** Only for fixes that change JavaScript behavior (dropdowns, conditional rendering, interaction state). CSS-only fixes get none; re-running the review catches them. Add the test beside the existing ones, never edit existing tests or CI config.
|
|
19
|
+
|
|
20
|
+
## Self-regulation
|
|
21
|
+
|
|
22
|
+
Every 5 fixes, and after any revert, compute the risk:
|
|
23
|
+
|
|
24
|
+
| Event | Risk |
|
|
25
|
+
|---|---|
|
|
26
|
+
| Revert | +15% |
|
|
27
|
+
| Component file touched (tsx, jsx, vue, svelte) | +5% per file |
|
|
28
|
+
| Fix after the 10th | +1% each |
|
|
29
|
+
| Unrelated file touched | +20% |
|
|
30
|
+
| CSS-only file | +0% |
|
|
31
|
+
|
|
32
|
+
Above 20%: stop, show what is done, ask. Hard cap of 30 fixes.
|
|
33
|
+
|
|
34
|
+
## Closing
|
|
35
|
+
|
|
36
|
+
Re-audit affected pages, recompute both scores. Worse than baseline: say so first. Never push or open the PR; hand over the one-line summary: "Design review found N issues, fixed M. Design score X to Y, AI slop score X to Y."
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Rendered-design probes
|
|
2
|
+
|
|
3
|
+
Pass each body as the `function` of chrome-devtools `evaluate_script`. They return JSON-serializable values. Scans cap at 500 elements.
|
|
4
|
+
|
|
5
|
+
## Fonts, colors, headings
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
() => {
|
|
9
|
+
const els = [...document.querySelectorAll("*")].slice(0, 500);
|
|
10
|
+
const cs = els.map((e) => getComputedStyle(e));
|
|
11
|
+
const count = (xs) => Object.entries(xs.reduce((m, x) => ((m[x] = (m[x] || 0) + 1), m), {})).sort((a, b) => b[1] - a[1]);
|
|
12
|
+
return {
|
|
13
|
+
fonts: count(cs.map((s) => s.fontFamily)),
|
|
14
|
+
colors: count(cs.flatMap((s) => [s.color, s.backgroundColor]).filter((c) => c !== "rgba(0, 0, 0, 0)")).slice(0, 30),
|
|
15
|
+
headings: [...document.querySelectorAll("h1,h2,h3,h4,h5,h6")].map((h) => ({
|
|
16
|
+
tag: h.tagName,
|
|
17
|
+
text: h.textContent.trim().slice(0, 50),
|
|
18
|
+
size: getComputedStyle(h).fontSize,
|
|
19
|
+
weight: getComputedStyle(h).fontWeight,
|
|
20
|
+
textWrap: getComputedStyle(h).textWrap,
|
|
21
|
+
})),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Flag more than 3 families, more than 12 non-gray colors, skipped heading levels, non-systematic size jumps.
|
|
27
|
+
|
|
28
|
+
## Touch targets under 44px
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
() => [...document.querySelectorAll("a,button,input,select,textarea,[role=button]")]
|
|
32
|
+
.map((e) => ({ e, r: e.getBoundingClientRect() }))
|
|
33
|
+
.filter(({ r }) => r.width > 0 && (r.width < 44 || r.height < 44))
|
|
34
|
+
.slice(0, 20)
|
|
35
|
+
.map(({ e, r }) => ({ tag: e.tagName, text: (e.textContent || "").trim().slice(0, 30), w: Math.round(r.width), h: Math.round(r.height) }))
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Spacing values in use
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
() => {
|
|
42
|
+
const vals = new Map();
|
|
43
|
+
for (const e of [...document.querySelectorAll("*")].slice(0, 500)) {
|
|
44
|
+
const s = getComputedStyle(e);
|
|
45
|
+
for (const p of ["paddingTop", "paddingLeft", "marginTop", "marginBottom", "rowGap", "columnGap"]) {
|
|
46
|
+
const v = s[p];
|
|
47
|
+
if (v && v !== "0px" && v !== "normal") vals.set(v, (vals.get(v) || 0) + 1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return [...vals].sort((a, b) => b[1] - a[1]).slice(0, 25);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Compare against the 4 or 8 scale; list the off-scale values with counts.
|
|
55
|
+
|
|
56
|
+
## Contrast of text against its background
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
() => {
|
|
60
|
+
const lum = ([r, g, b]) => { const f = (c) => { c /= 255; return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4; }; return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b); };
|
|
61
|
+
const rgb = (s) => s.match(/\d+(\.\d+)?/g).slice(0, 3).map(Number);
|
|
62
|
+
const bg = (e) => { for (let n = e; n; n = n.parentElement) { const c = getComputedStyle(n).backgroundColor; if (c !== "rgba(0, 0, 0, 0)") return c; } return "rgb(255,255,255)"; };
|
|
63
|
+
return [...document.querySelectorAll("p,span,a,li,label,button,h1,h2,h3,td")]
|
|
64
|
+
.filter((e) => e.childNodes.length && e.textContent.trim())
|
|
65
|
+
.slice(0, 300)
|
|
66
|
+
.map((e) => { const a = lum(rgb(getComputedStyle(e).color)), b = lum(rgb(bg(e))); const r = (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05); return { text: e.textContent.trim().slice(0, 30), ratio: +r.toFixed(2), size: getComputedStyle(e).fontSize }; })
|
|
67
|
+
.filter((x) => x.ratio < 4.5)
|
|
68
|
+
.slice(0, 20);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Background with gradients or images is not resolved; confirm those by eye on the screenshot.
|
|
73
|
+
|
|
74
|
+
## Other single reads
|
|
75
|
+
|
|
76
|
+
- Reduced motion honored: `() => matchMedia("(prefers-reduced-motion: reduce)").matches` after `emulate` with the media feature.
|
|
77
|
+
- Horizontal scroll: `() => document.documentElement.scrollWidth > innerWidth`.
|
|
78
|
+
- Viewport meta: `() => document.querySelector('meta[name=viewport]')?.content`.
|
|
79
|
+
- Navigation timing: `() => JSON.stringify(performance.getEntriesByType("navigation")[0])`; stringify in the page, entry fields are getters.
|
|
80
|
+
- Page errors: read `list_console_messages` after load, not a hand-installed hook.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brain-qa-only
|
|
3
|
+
description: "Trigger: qa report only, just report bugs, test but don't fix, QA this branch, find bugs without fixing, prueba y reporta, reproduce and document. Explores a browser, API, CLI or worker surface and reports reproducible bugs with evidence; never edits product code."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
metadata:
|
|
6
|
+
author: jcsoftdev
|
|
7
|
+
version: "1.0"
|
|
8
|
+
generator: project-brain
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
`generator: project-brain` is an ownership marker, not decoration.
|
|
13
|
+
`project-brain setup` overwrites this directory only when it finds that line;
|
|
14
|
+
without it, setup treats the directory as hand-written and leaves it alone.
|
|
15
|
+
Strip it and you pin this copy forever — no upgrade will ever reach it.
|
|
16
|
+
-->
|
|
17
|
+
|
|
18
|
+
## Activation Contract
|
|
19
|
+
|
|
20
|
+
Use when the ask is to find and document bugs, not to fix them. Design judgment: `brain-design-review`. Every screen of a product and an MVP verdict: `mvp-ui-review`. Recording a demo: `brain-record`.
|
|
21
|
+
|
|
22
|
+
## Hard Rules
|
|
23
|
+
|
|
24
|
+
- Never edit product code, tests, dependencies or config. No commit, stash, install or push. Writes go only to the report directory and owned fixtures.
|
|
25
|
+
- Browser surfaces are black-box: observe behavior, do not read source to explain it. Source and diff reads only map changes to routes and flows.
|
|
26
|
+
- Write the charters to the report and wait for the write before the first probe: expected result, risk, entrypoint, isolation, exit condition. The plan is not invented afterwards.
|
|
27
|
+
- Reproduce before reporting. A finding without steps, expected versus actual and evidence is a note, not a bug. Rerun a failure once in a clean state before calling it product or environment.
|
|
28
|
+
- Isolated synthetic identity and data. Prod or signed-in sessions: no create, submit, send or delete; never ask for passwords in chat.
|
|
29
|
+
- Browser ladder: `chrome-devtools` first, `claude-in-chrome` only for a session the user asked to reuse. Close the tabs you opened.
|
|
30
|
+
- Never invoke a fixing skill from here. A proposed fix is text in the report.
|
|
31
|
+
|
|
32
|
+
## Decision Gates
|
|
33
|
+
|
|
34
|
+
| Surface | Method |
|
|
35
|
+
|---------|--------|
|
|
36
|
+
| Browser | `new_page`, `take_snapshot`, interact, `list_console_messages`, `list_network_requests`, `take_screenshot` on every failure |
|
|
37
|
+
| HTTP API | Real requests against a local instance; assert status, body, headers, idempotency, duplicate delivery |
|
|
38
|
+
| CLI / job / worker / webhook | Run the documented command in a `mktemp -d` HOME; capture exit code, stdout, stderr, persisted state |
|
|
39
|
+
| Feature branch, no scope | Diff-aware: changed and adjacent behavior |
|
|
40
|
+
| `--quick` | Smoke on the critical path only |
|
|
41
|
+
| `--regression <report>` | Replay the prior report's steps; classify fixed, still failing, new |
|
|
42
|
+
| Port needed | `port_acquire`, never assume 3000 or 9222 |
|
|
43
|
+
|
|
44
|
+
## Execution Steps
|
|
45
|
+
|
|
46
|
+
1. Parse target, mode, output dir (default `.qa-reports/`, git-excluded) and scope; ask once if the target is unknown.
|
|
47
|
+
2. Gather context: this session's test plan, `TODOS.md`, known failures in engram (`mem_search`); treat them as leads, not proof.
|
|
48
|
+
3. Create `run-<UTC timestamp>/` and the report file. Write the charters. Check the documented test command and framework; if none, report the gap and propose cases, install nothing.
|
|
49
|
+
4. Probe each charter. Capture per finding: steps, expected, actual, screenshot or log line, console and network evidence, severity (Blocker, Major, Minor, Polish) and a one-line suspected area.
|
|
50
|
+
5. Rank the proposed regression tests with the value bar in `references/report.md`; reject duplicates of existing coverage.
|
|
51
|
+
6. Write the report from `references/report.md`, check it is consistent with the evidence, and finish.
|
|
52
|
+
|
|
53
|
+
## Output Contract
|
|
54
|
+
|
|
55
|
+
Report: charters, health summary, findings table, per-finding repro, proposed tests with value card, coverage not reached and why, cleanup done. Offer the fix as a separate, user-authorized step. Remove scratch you created and say what you removed.
|
|
56
|
+
|
|
57
|
+
## References
|
|
58
|
+
|
|
59
|
+
- `references/report.md` — report template, severity scale, test value bar.
|