Skip to content

feat(project-memory): split situation-specific AGENTS.md detail into project skills - #291

Closed
BenWilcox8 wants to merge 4 commits into
kunchenguid:mainfrom
BenWilcox8:fm/audit-context-g6
Closed

BenWilcox8 wants to merge 4 commits into
kunchenguid:mainfrom
BenWilcox8:fm/audit-context-g6

Conversation

@BenWilcox8

Copy link
Copy Markdown

Summary

Adds a firstmate-level mechanism so project AGENTS.md files stop accumulating situation-specific detail inline, which bloats every crewmate's spawn context. An audit found project AGENTS.md files reaching 488-538 lines (~12k-20k tokens) almost entirely from inlined per-subsystem/per-script contracts that a given crewmate rarely all needs at once - a cost paid on every spawn for that project.

The design splits sometimes-relevant subsystem/script/screen contracts out of AGENTS.md into on-demand project skills under .agents/skills/<name>/SKILL.md (user-invocable: false), with a .claude/skills -> ../.agents/skills symlink, mirroring firstmate's own skills pattern and the existing consider-it-done project-skill precedent. AGENTS.md keeps always-needed operating facts plus a compact ## Skills index (one line per skill stating its load trigger).

Changes

  • bin/fm-ensure-agents-md.sh: new --skill <name> flag that idempotently scaffolds the project skills layout (.agents/skills/ + .claude/skills symlink + a SKILL.md stub), refusing to clobber an existing skill or a wrong .claude/skills symlink and validating the slug. The existing AGENTS.md/CLAUDE.md reconciliation is refactored into a function so --skill runs after it; behavior is unchanged when --skill is absent.
  • bin/fm-brief.sh: the ship-brief project-memory contract is now split-aware - general operating facts stay inline, while situation-specific subsystem contracts (or any growth past ~300 lines / ~10k tokens) route into a project skill via --skill. Written self-contained (a project crewmate cannot load firstmate's own skills) and pointing to docs/project-skills.md.
  • AGENTS.md: states the routing contract once in section 6 (prose + knowledge-routing table row), with a one-line cross-reference from section 11, honoring the one-owner rule.
  • docs/project-skills.md (new): mechanism, threshold rationale, layout, split procedure, and the consider-it-done precedent. Linked from README.md and docs/scripts.md.
  • tests/fm-ensure-agents-md.test.sh (new): covers scaffolding, idempotency, clobber refusal, wrong-symlink refusal, and slug validation. Registered in CONTRIBUTING.md.

The ~300 line / ~10k token figures are deliberate, tunable heuristics, not hard gates; the underlying rule is the knowledge-placement decision tree in the firstmate-coding-guidelines skill.

Test plan

  • shellcheck bin/*.sh bin/backends/*.sh tests/*.sh clean
  • tests/fm-ensure-agents-md.test.sh passes (scaffolding, idempotency, clobber/wrong-symlink refusal, slug validation)
  • tests/fm-brief.test.sh regression passes
  • Live --skill run produces exactly the .claude/skills -> ../.agents/skills structure
  • Validated end-to-end through the no-mistakes pipeline (review, test, document, lint all green)

…project skills

Add a firstmate-level mechanism so project AGENTS.md files stop accumulating
situation-specific detail inline, keeping every crewmate's spawn context cheap.

- fm-ensure-agents-md.sh: add --skill <name> to scaffold the project skills
  layout (.agents/skills/ + .claude/skills symlink + a user-invocable:false
  SKILL.md stub), mirroring firstmate's own pattern; idempotent, conflict-refusing.
- fm-brief.sh: make the ship-brief project-memory contract split-aware - general
  operating facts inline, situation-specific subsystem contracts (or growth past
  ~300 lines / ~10k tokens) into a project skill; self-contained, points to
  docs/project-skills.md.
- AGENTS.md: state the routing contract once in section 6 (prose + knowledge
  routing table); cross-reference from section 11.
- docs/project-skills.md: mechanism, threshold rationale, layout, and the
  consider-it-done precedent. Linked from README and docs/scripts.md.
- tests/fm-ensure-agents-md.test.sh: cover scaffolding, idempotency, clobber
  refusal, and slug validation.
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: closing this as stale. It has been waiting on a contributor update for 14+ days with no author push or comment. Reopen if you want to pick it back up.

fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
…henguid#291)

* feat(bin): add a Windows desk floater for Starship inside WSL 2

* fix(bin): make the Windows desk floater hold up on a real Windows machine

Proving the floater on Windows Server 2025 with WSL 2 found four faults.

- install and start hung while the floater ran, because cmd.exe's start
  keeps WSL waiting on the child; the floater is now started with
  PowerShell's Start-Process, which returns at once.
- About one dictation paste in eight was lost: clipboard listeners hold
  the clipboard for a moment after it changes. The floater now waits
  150 ms, and while another window holds it, before Ctrl+V.
- Dictation could send words meant for another terminal tab into the
  chat, since tmux keeps a stale focused flag on clients that attached
  before focus-events was on. send --front-focused now trusts only
  clients attached after focus tracking began (@fm-focus-since or the
  server start), and install adds focus-events to ~/.tmux.conf.
- The C# self-test skipped inside WSL because tests/lib.sh clears
  WSL_DISTRO_NAME; it now detects WSL from the kernel name.

uninstall also removes the empty Starship folder, and bridge log lines
no longer repeat "bridge".

* no-mistakes(review): Prune claims, guard tmux.conf newline, fail closed on focus marker

* no-mistakes(lint): Split tmux.conf newline check from append to fix SC2094
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.

2 participants