workflow: polish — /context groups trackers, /workflow in README, memoize git root

- contextPanel splits 'instructions' from 'trackers' (TODO.md/ROADMAP.md), so
  /context no longer presents project trackers as standing orders, and its
  empty-state mentions both instruction files and trackers
- README: docs table gets Project workflow, command list gets the new commands
- session: gitRoot memoized (one sync fs walk per session, not per prompt
  build); workflowPolicy computed once per systemFor
- test: context panel grouping covered

10 workflow tests, 830+ suite green
This commit is contained in:
asepharyana committed 2026-09-09 19:12:29 +07:00
1 parent a3739eb628
commit 4aeb0d2455
4 files changed
+43 -12

No files matched your search

+10 -7
View File
@@ -72,13 +72,16 @@ export function costPanel(
}
export function contextPanel(files: readonly string[]): Panel {
return {
title: 'project instructions',
body:
files.length > 0
? files.map((f) => `- \`${f}\``).join('\n')
: 'No `AGENTS.md`, `CLAUDE.md`, or `.shiro.md` found. Run `/init` to write one.',
};
const tracker = files.filter((f) => f.endsWith('TODO.md') || f.endsWith('ROADMAP.md'));
const instructions = files.filter((f) => !tracker.includes(f));
const body: string[] = [];
if (instructions.length > 0) body.push('instructions:', ...instructions.map((f) => `- \`${f}\``));
if (tracker.length > 0) body.push('trackers:', ...tracker.map((f) => `- \`${f}\``));
if (body.length === 0) {
body.push('No `AGENTS.md`, `CLAUDE.md`, or `.shiro.md` found. Run `/init` to write one.');
body.push('No `TODO.md` or `ROADMAP.md` found — no project tracker is loaded.');
}
return { title: 'project instructions & trackers', body: body.join('\n') };
}
export const todosPanel = (session: Session): Panel => ({