Skip to content

docs(contexts): sub-system docs for AI navigation - #22

Merged
JeanBaptisteRenard merged 1 commit into
mainfrom
docs/context-engineering
May 30, 2026
Merged

docs(contexts): sub-system docs for AI navigation#22
JeanBaptisteRenard merged 1 commit into
mainfrom
docs/context-engineering

Conversation

@JeanBaptisteRenard

Copy link
Copy Markdown
Collaborator

What

Adds 5 focused context docs under `.ai/contexts/*.md` for the natural sub-systems of Switchboard. Audience: AI agents (and future-me) who need to make a focused change without re-reading 1849 LOC of `main.js`.

Doc Lines Covers
session-cache 73 SQLite + FTS5 + watcher + heatmap aggregation
schedule-runner 76 In-process cron + `.md` storage + `claude --resume -p`
subagent-observability 68 Parent→child JSONL grouping + transcript view
viewer-panel 79 Reusable CodeMirror panel (Plans / Memory / .work-files)
ipc-bridge 133 Trust boundary inventory (every IPC, every event)
README 35 Index + reading order
_issues 81 Observations captured while writing (~12 opportunistic follow-ups, none blocking)

Each context doc follows the same shape: Purpose → Key files → Public surface → Invariants → Non-obvious behaviors → Change-also checklist. Optimized for one-page scannability.

Why

Adapting the `/context-engineering` skill (designed for Skaleet PHP/TS DDD projects) to an Electron app: the spirit (progressive disclosure, hot/warm/cold) is preserved, but the structure is flat (no `Domain/Application/Infrastructure` layers exist here).

The shared-guidelines.md quick-orientation table now routes to these context docs instead of raw files. `.ai/project.json` gets a `contexts` map so `/dispatch` planners can discover them programmatically.

Side-effect

`_issues.md` captures observations made while writing: `main.js` size, IPC return-shape inconsistencies, missing DST handling in scheduler, watcher cleanup risk in viewer-panel, etc. None are blockers — picked up opportunistically when adjacent work happens.

Risk

Docs only. No runtime change.

Add 5 focused context docs at .ai/contexts/*.md covering the natural
boundaries inside Switchboard:

- session-cache: SQLite + FTS5 + watcher + targeted refresh
- schedule-runner: in-process cron + .md storage + claude --resume -p
- subagent-observability: parent->child grouping + transcript view
- viewer-panel: reusable CodeMirror panel for Plans / Memory / .work-files
- ipc-bridge: trust boundary inventory (every IPC, every event)

Each doc: ~70-130 lines, structured around purpose, key files, public
surface, invariants, non-obvious behaviors, and "if you change this,
also check..." cross-references. Audience is AI agents who need to make
a focused change without re-reading 1800 LOC of main.js.

Also adds:
- .ai/contexts/README.md   index + recommended reading order
- .ai/contexts/_issues.md  observations captured while writing (not
                           blockers, opportunistic follow-ups)
- .ai/project.json contexts map
- shared-guidelines.md quick-orientation table now points at the
  context docs instead of raw files
@JeanBaptisteRenard
JeanBaptisteRenard merged commit 8b9ef68 into main May 30, 2026
6 checks passed
@JeanBaptisteRenard
JeanBaptisteRenard deleted the docs/context-engineering branch May 30, 2026 02:05
abasiri pushed a commit that referenced this pull request Aug 1, 2026
The push-to-talk handler (#22) intercepted every plain-Space keydown,
calling preventDefault() and writing a raw space straight to the PTY.
xterm's _keyDown runs the custom key handler BEFORE its composition
helper, so during Korean/Japanese/Chinese composition this blocked the
commit and reordered/dropped the in-progress syllable (e.g. "녕 " came
out as " 녕").

Gate the direct-send path on !isImeComposing(e) (isComposing, or the
Chromium keyCode 229 sentinel) so it only fires when no IME is composing
— exactly when push-to-talk needs it. During composition the event now
falls through to xterm's composition helper for correct commit behavior.

Extracts the decision as a pure, exported predicate and adds unit tests.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant