Skip to content

Trim redundant preambles in hand-authored agent docs#351

Merged
brianmhunt merged 5 commits intomainfrom
docs/agent-docs-tighten
Apr 21, 2026
Merged

Trim redundant preambles in hand-authored agent docs#351
brianmhunt merged 5 commits intomainfrom
docs/agent-docs-tighten

Conversation

@brianmhunt
Copy link
Copy Markdown
Member

@brianmhunt brianmhunt commented Apr 21, 2026

Summary

Follow-up to PR #349 — same preamble-strip motivation, applied to three hand-authored agent docs that carried meta-commentary the title + section 1 already communicated.

  • `agents/soul.md`: 4-line "This document describes the philosophical foundation..." collapsed to one sentence that keeps the AI-agent targeting + "why not how" framing.
  • `agents/glossary.md`: 1-line "Domain-specific terms..." preamble removed. Title + "Core Concepts" section carry it.
  • `agents/options.md`: 3-sentence opener compressed to one line (singleton name + file location + scope).

Left alone (explicit non-targets)

  • `agents/testing.md` — 137 lines of how-to with inline code blocks. Compression risks clarity for marginal byte savings.
  • `agents/contract.md` / `agents/guide.md` — preambles already minimal (1–3 lines of pointer prose).

Savings

~400 bytes across the three files. Modest but deterministic, amortized on every agent session load.

Verification

  • `bun run build` in `tko.io/`: 65 pages, clean.
  • Peer tone match checked (preambles compared to `contract.md` + `guide.md`).
  • AI-agent search signal preserved in `soul.md` (adversarial pass caught an initial over-trim; restored).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Refined guidance on replacing ad-hoc DOM handling with bindings.
    • Updated testing guide with new DOM selector references for validating playground functionality.
    • Improved glossary, framework overview, and configuration documentation for enhanced clarity.

Same motivation as the generator-preamble strip in PR #349 —
every agent that loads these docs on session start pays the
cost of redundant metadata that the title and section 1
already carry. Applied to three hand-authored files:

- `agents/soul.md`: collapsed the 4-line "This document
  describes the philosophical foundation..." preamble into a
  single sentence that keeps the AI-agent targeting and the
  "why not how" framing without the meta-commentary wrapper.
- `agents/glossary.md`: removed the 1-line "Domain-specific
  terms..." preamble. Title + "Core Concepts" section already
  carry that signal.
- `agents/options.md`: compressed the 3-sentence opener into
  one line that keeps the singleton name, file location, and
  scope ("two mechanisms for adding options").

Left untouched:
- `agents/testing.md` — 137 lines of how-to with inline code;
  compression risks clarity for marginal byte savings.
- `agents/contract.md` / `agents/guide.md` — preambles already
  minimal (1–3 lines of pointer prose).

Adversarial pass: Explore subagent. Flagged 1 valid item —
the initial soul.md tagline dropped the explicit AI-agent
signal and broke tone parity with peer docs. Resolved by
rewriting to a longer sentence that restores both. Also
identified options.md as a follow-up candidate from the same
pass; applied inline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 21, 2026 14:31
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Warning

Rate limit exceeded

@brianmhunt has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 23 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 43 minutes and 23 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 278443ea-a0db-48ed-86d8-f2c4e3a3a941

📥 Commits

Reviewing files that changed from the base of the PR and between d485d73 and 0154e72.

📒 Files selected for processing (2)
  • .gitignore
  • tko.io/public/agents/soul.md
📝 Walkthrough

Walkthrough

These changes update documentation across multiple agent guides in tko.io/public/agents/, primarily clarifying introductory text, refining wording for clarity, and updating DOM selector references from ID-based selectors to attribute-based selectors using data-role attributes.

Changes

Cohort / File(s) Summary
Agent guide clarifications
tko.io/public/agents/contract.md, tko.io/public/agents/glossary.md, tko.io/public/agents/options.md, tko.io/public/agents/soul.md
Refined introductory and overview text across agent docs. Updated phrasing in contract.md regarding binding guidance, removed redundant description in glossary.md, rephrased ko.options documentation in options.md, and condensed introductory context in soul.md.
Testing and selector updates
tko.io/public/agents/process.md, tko.io/public/agents/testing.md
Updated Playwright test verification and testing guide documentation with DOM selectors changed from ID-based (#element-id) to attribute-based ([data-role="..."]) format for status indicators, console messages, and preview elements.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 The docs bloom fresh with words refined,
Old selectors fade, new paths we find,
Data-roles guide the testing way,
Agent wisdom grows brighter each day! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: trimming redundant introductory preambles from hand-authored agent documentation files, which aligns with the core purpose of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/agent-docs-tighten

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR trims redundant introductory preambles in three hand-authored agent-facing docs under tko.io/public/agents/, reducing repeated “what this doc is” meta-commentary while keeping the key “why/when to read” framing in place.

Changes:

  • Condensed the intro paragraph in soul.md into a single sentence.
  • Compressed the opener in options.md into one line while keeping the file-location pointer.
  • Removed the one-line preamble from glossary.md so it starts directly at “Core Concepts”.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tko.io/public/agents/soul.md Collapses the multi-line preamble into a single intro sentence.
tko.io/public/agents/options.md Compresses the ko.options intro while preserving location/scope info.
tko.io/public/agents/glossary.md Removes redundant preamble so the glossary begins at core terms.

Comment thread tko.io/public/agents/soul.md Outdated
Read this to understand *why* the framework works the way it does, not just
*how* to use it. If you're an AI agent working on this codebase, this is
the context behind every design decision.
Read this to understand *why* TKO is shaped the way it is, not just *how* to use it. AI agents working on this codebase: this is the context behind every design decision.
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new intro line mentions only “TKO”, but the document title and early sections describe Knockout’s core model (and then TKO’s extensions). Consider referencing “Knockout/TKO” (or “Knockout’s model as implemented by TKO”) in the opener to better match the title and the content that follows.

Suggested change
Read this to understand *why* TKO is shaped the way it is, not just *how* to use it. AI agents working on this codebase: this is the context behind every design decision.
Read this to understand *why* Knockout/TKO is shaped the way it is, not just *how* to use it. AI agents working on this codebase: this is the context behind every design decision.

Copilot uses AI. Check for mistakes.
Brian M Hunt and others added 2 commits April 21, 2026 10:35
Two more preamble/prose tightening candidates found in the
same pass as the previous commit:

- `agents/contract.md`: The meta-bullet under "## Replace X
  With Y" ("This section is about replacing ad-hoc
  DOM/event/state handling with bindings, not about binding-
  syntax style.") was mixed into a list of actionable
  replacement rules. Lifted out into a one-sentence lead-in
  above the list so the bullets stay pure guidance.
- `agents/testing.md`: Trailing paragraph after the Option 1
  example was three clauses that repeated what the example
  already showed. Compressed to one line, kept the
  `tko.js`-vendoring caveat intact.

Adversarial pass: Explore subagent. Flagged 3 items; 2 valid,
1 rejected:
- (valid) An earlier attempt to tighten the opener to
  `Scope: ...` broke tonal parity with peer agent docs and
  read as a metadata tag. Reverted to the original
  "Use this file when..." phrasing.
- (valid) "unless vendored" alone was too generic in JS
  ecosystem terms (could imply npm / bundled). Restored
  "vendored locally" to preserve the specific workflow
  (manual `tko.js` copy into the project).
- (rejected) Reviewer preferred the meta-bullet stay inside
  the Replace X With Y list for "softer framing". Kept the
  reorg — the meta-statement was a formatting bug in the
  actionable bullet list, not an aside.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
testing.md + process.md instructed agents to query the
playground DOM by `#id` (e.g. `#preview`, `#console-messages`,
`#esbuild-status`, `#compile-time`, `#error-bar`). None of
those IDs exist. The playground uses `data-role` attribute
selectors throughout (`tko.io/src/playground/shell.ts`):

- `[data-role="preview"]`         — iframe (line 54)
- `[data-role="console-messages"]` — console output container (line 61)
- `[data-role="status"]`          — generic status element
                                    shows "esbuild ready" label
                                    (shell.ts:67 + runner-iife.ts:64)
- `[data-role="compile-time"]`    — compile elapsed (line 68)
- `[data-role="error-bar"]`       — hidden until a build error
                                    (line 55)

Replaced every `#foo` playground reference in both files with
the correct attribute selector. The `#esbuild-status` →
`[data-role="status"]` mapping is worth calling out
specifically: the element is generic (handles loading → ready
→ error states), not esbuild-specific; the doc notes that the
label text becomes "esbuild ready" so an agent grepping the
snapshot still has the right string to look for.

Not a regression — these selector bugs pre-date this branch.
Found while reviewing testing.md for correctness after the
earlier preamble-strip pass; AGENTS.md had already migrated
its playwright flow to process.md in PR #349, so the fix had
a single home (no stale copy left behind).

Adversarial pass: Explore subagent cross-referenced every
selector against `tko.io/src/playground/shell.ts` +
`runner-iife.ts`. Result: clean, all five mappings match
actual DOM.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
tko.io/public/agents/options.md (1)

3-3: Consider clarifying the pronoun reference.

The phrase "which to reach for" leaves "which" without a clear antecedent. Consider making it more explicit:

  • "Two mechanisms for adding options — this page explains which mechanism to reach for."
  • "Two mechanisms for adding options — this page explains when to use each."

The meaning is still clear from context, but directness helps readers (especially agents parsing the docs).

✍️ Optional phrasing alternatives

Option 1 (more explicit):

-`ko.options` is TKO's runtime configuration singleton, defined in `packages/utils/src/options.ts`. Two mechanisms for adding options — this page explains which to reach for.
+`ko.options` is TKO's runtime configuration singleton, defined in `packages/utils/src/options.ts`. Two mechanisms for adding options — this page explains which mechanism to use.

Option 2 (more direct):

-`ko.options` is TKO's runtime configuration singleton, defined in `packages/utils/src/options.ts`. Two mechanisms for adding options — this page explains which to reach for.
+`ko.options` is TKO's runtime configuration singleton, defined in `packages/utils/src/options.ts`. Two mechanisms for adding options — this page explains when to use each.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tko.io/public/agents/options.md` at line 3, The sentence "Two mechanisms for
adding options — this page explains which to reach for" uses an unclear pronoun;
update the wording to explicitly reference what "which" refers to (e.g., "Two
mechanisms for adding options — this page explains which mechanism to reach for"
or "Two mechanisms for adding options — this page explains when to use each") in
the document that describes ko.options (runtime config singleton defined in
packages/utils/src/options.ts) so readers and agents clearly understand the
intended choice between the two mechanisms.
tko.io/public/agents/contract.md (1)

13-13: Effective compression with useful clarification.

The compressed intro clearly states the section's purpose and includes a valuable negative clarification ("Not about binding-syntax style") that prevents confusion with the syntax preference discussion in lines 141-145.

Optional: Style refinement

The second sentence is a fragment. If you prefer more formal grammar:

-Replace ad-hoc DOM/event/state handling with bindings. Not about binding-syntax style.
+Replace ad-hoc DOM/event/state handling with bindings. This is not about binding-syntax style.

However, the current terse form aligns well with the PR's compression goal.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tko.io/public/agents/contract.md` at line 13, The intro currently reads
"Replace ad-hoc DOM/event/state handling with bindings. Not about binding-syntax
style."—make the second fragment a complete sentence for grammatical clarity by
rephrasing the lines around the phrase "Not about binding-syntax style" (or
combine them into one sentence such as keeping the clarified negative) while
preserving the intended meaning and the existing emphasis on replacing ad-hoc
DOM/event/state handling with bindings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tko.io/public/agents/contract.md`:
- Line 13: The intro currently reads "Replace ad-hoc DOM/event/state handling
with bindings. Not about binding-syntax style."—make the second fragment a
complete sentence for grammatical clarity by rephrasing the lines around the
phrase "Not about binding-syntax style" (or combine them into one sentence such
as keeping the clarified negative) while preserving the intended meaning and the
existing emphasis on replacing ad-hoc DOM/event/state handling with bindings.

In `@tko.io/public/agents/options.md`:
- Line 3: The sentence "Two mechanisms for adding options — this page explains
which to reach for" uses an unclear pronoun; update the wording to explicitly
reference what "which" refers to (e.g., "Two mechanisms for adding options —
this page explains which mechanism to reach for" or "Two mechanisms for adding
options — this page explains when to use each") in the document that describes
ko.options (runtime config singleton defined in packages/utils/src/options.ts)
so readers and agents clearly understand the intended choice between the two
mechanisms.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dbf22fa9-9af9-4f01-a8c3-677d87a7c4a3

📥 Commits

Reviewing files that changed from the base of the PR and between 051998f and d485d73.

📒 Files selected for processing (6)
  • tko.io/public/agents/contract.md
  • tko.io/public/agents/glossary.md
  • tko.io/public/agents/options.md
  • tko.io/public/agents/process.md
  • tko.io/public/agents/soul.md
  • tko.io/public/agents/testing.md
💤 Files with no reviewable changes (1)
  • tko.io/public/agents/glossary.md

Brian M Hunt and others added 2 commits April 21, 2026 10:47
Copilot review on PR #351 noted that the file title ("The Soul
of Knockout") and early sections describe Knockout's core
model before discussing TKO's extensions (the Provider
Architecture section explicitly differentiates TKO from
Knockout 3.x). The previous trimmed opener said "TKO is shaped
the way it is" — understated the lineage. Changed to
"Knockout/TKO is shaped the way it is" so the opener matches
the file title + the model-first framing that follows.

Adversarial pass: Copilot (external reviewer on PR #351).
Flagged 1, valid, addressed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Claude Code drops local tooling artifacts under `.claude/` —
`scheduled_tasks.lock` from `ScheduleWakeup`, `settings.local.json`
from per-user settings, stray files from various subagent flows.
Only `.claude/worktrees/` was previously ignored; the rest sat
untracked-but-unignored, one accidental `git add .` away from
landing on a branch.

Broadened the pattern to `.claude/`. Verified: `git ls-files
.claude/` returns empty, no historical commits have ever tracked
anything under that directory (`git log --all -- .claude/` is
empty), so no risk of masking existing tracked files.

Fix prompted by finding `.claude/scheduled_tasks.lock` in the
working tree after the earlier `ScheduleWakeup` call on this
branch — a lockfile that "should not be possible" to leave
around is now not possible.

Adversarial pass: spot-verified inline — checked `git ls-files`
+ `git log --all` for any prior tracking of `.claude/` paths
(none), confirmed the broadened pattern ignores every
observable artefact (`scheduled_tasks.lock`,
`settings.local.json`, stray `launch.json`, `worktrees/`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brianmhunt brianmhunt merged commit 5657f94 into main Apr 21, 2026
9 checks passed
@brianmhunt brianmhunt deleted the docs/agent-docs-tighten branch April 21, 2026 15:17
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