feat: workspace skills and knowledge first, a starter after linking, and the start-screen box back

Merged
SA
2mo ago
+1158-62

Issue for this PR

No GitHub issue; tracked internally.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Three commits.

1. Skill source labels and a precedence rule.

  • Every skill the agent sees now carries source="workspace|project|built-in|personal|other", set from where altimate-code found it (altimate/skill-source.ts).
  • The skills preamble says to prefer them in that order and not to ask "which team's skill?".
  • Before this, a workspace skill, a repo skill and another team's copy looked identical. With near-duplicates the agent asked which team's policy to follow, or went exploring.
  • Listings stay in name order. An earlier version sorted by source; that pushed the built-ins behind every project skill and out of the skill tool's 50-entry list, and they were loaded less (12/30 vs 18/30).

2. The start-screen workspace box is back.

  • 0.12.6 removed it because every keybinding died once it loaded. I bisected with builds.
  • Cause: the view's root was a <Show> that renders nothing until the binding resolves. OpenTUI's Slot shows the fallback for an empty first render and renders the view again when its output changes, so each arrival mounted a fresh view that started empty and resolved again. The lines never stayed and the box remounted without end.
  • Fix: WelcomeBlock keeps a <box> root.
  • The upstream sidebar views with a <Show> root (todo, files, mcp) read shared state, so they remount once rather than loop; I left them alone.

3. A fixed-format workspace starter, and knowledge used without being asked.

  • After a link, a deterministic message: which workspace, its skills, knowledge, integrations, memory setting, and up to three prompts. No model call.
  • Shown by altimate-code link, in the TUI's post-link dialog, and from a new /workspace → Get started. Picking a prompt fills the input without sending it.
  • GET /altimate/workspace/starter serves it for the IDE extension's chat. The extension still needs to call it.
  • When the workspace has knowledge, the workspace section tells the agent to check it (ask_knowledge_base) for best practices and conventions unprompted.

How did you verify your code works?

  • Tests: new tests for each part. 13 mutation checks, all caught: removing the labels, the rule, the knowledge line, the route's stale-link check, the welcome <box> root, and so on.
  • Full suite: 9 failures and 1 error. I ran the 9 failing tests on a clean origin/main and they fail there too.
  • Routing harness, workspace asks: 11/11, against 8/12 on 0.12.6.
  • Routing harness, built-in asks: 18/30, the same as 0.12.6.
  • Over-steering: no built-in ask loaded a workspace skill.
  • Harness setup: a real linked workspace with 6 skills, plus 150 other-team near-duplicates in .claude/skills, using altimate-backend/altimate-default.
  • Knowledge: ask_knowledge_base called unprompted on 4/4 best-practice questions, against 0/4 on 0.12.6 with the tool available.
  • E2E on a test tenant:
    • headless and TTY link print the starter;
    • the route returns linked, unlinked, and 403 for a browser origin;
    • TUI: the link dialog shows the prompts, a chosen prompt fills the input, and /workspace → Get started works;
    • the welcome box renders and Ctrl+P opens the palette, checked in tmux.

Screenshots / recordings

Terminal captures from tmux are in the verification notes above. No recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

šŸ¤– Generated with Claude Code

https://claude.ai/code/session_018fJ3X7pcGT4R9yzjsJnqsV


Summary by cubic

Makes the linked workspace's own skills and knowledge win over near-duplicates and general advice, shows a fixed starter message after linking, and brings back the start-screen workspace box without the dead keybindings that took it out in 0.12.6.

Skills: sources and precedence

  • Every skill in the agent's listings now carries source="workspace|project|built-in|personal|other", set from where altimate-code found it.
  • workspace is only this project's own snapshot, judged on both the matched and resolved path; a session started in a subdirectory of the repository still owns its snapshot there. A symlink or configured path into another project's snapshot is other, and a project skill with the exact name of a workspace skill replaces it.
  • The skills preamble tells the agent to load the highest-source skill that fits a task and not to ask which team's skill it is.
  • Listings stay in name order; sorting by source pushed built-ins out of the skill tool's 50-entry list, and they were loaded less.

Starter, knowledge, and the welcome box

  • After a link, the TUI's post-link dialog and /workspace → Get started show the workspace's skills, knowledge, integrations, memory setting, and up to three prompts; the dialog opens at once and the starter fills in when it arrives. Prompts land below the existing rows, so a late arrival doesn't move the selection, and choosing one fills the input without sending it.
  • GET /altimate/workspace/starter serves the same message to the IDE extension's chat, which still needs to call it.
  • When the workspace has knowledge, the agent is told to check it for best practices and conventions unprompted.
  • The welcome box is registered again with a <box> root, which stops OpenTUI from remounting it endlessly and killing keybindings, and it now refreshes right away on an in-process link or unlink.