Skip to content

Commit 5657f94

Browse files
authored
Merge pull request #351 from knockout/docs/agent-docs-tighten
Trim redundant preambles in hand-authored agent docs
2 parents 051998f + 0154e72 commit 5657f94

7 files changed

Lines changed: 13 additions & 19 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ builds/**/meta
3636
.playwright-mcp
3737
.playwright-cli
3838
test-results/
39-
.claude/worktrees/
39+
.claude/
4040
__screenshots__
4141
.dts-tmp/
4242
.nx/

tko.io/public/agents/contract.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TKO Agent Contract
22

3-
Use this file when deciding how state, bindings, and DOM work should be divided in TKO examples and prototypes.
3+
Use this file when deciding how to divide state, bindings, and DOM work in TKO examples and prototypes.
44

55
## Core Rule
66

@@ -10,7 +10,8 @@ Use this file when deciding how state, bindings, and DOM work should be divided
1010

1111
## Replace X With Y
1212

13-
- This section is about replacing ad-hoc DOM/event/state handling with bindings, not about binding-syntax style.
13+
Replace ad-hoc DOM/event/state handling with bindings. Not about binding-syntax style.
14+
1415
- If you are about to do `element.textContent = value`, use the `text` binding.
1516
- If you are about to do `element.innerHTML = markup`, first ask whether the content should be plain text instead; prefer the `text` binding by default. Use `html` only when rendering trusted HTML is truly the point.
1617
- If you are about to manually create, replace, or reconcile a repeated set of child nodes, use `foreach`.

tko.io/public/agents/glossary.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# TKO Glossary
22

3-
Domain-specific terms for the TKO (Typed Knockout) framework.
4-
53
## Core Concepts
64

75
- **Observable** (`ko.observable(value)`) — a value wrapper that notifies subscribers when it changes. The fundamental reactive primitive.

tko.io/public/agents/options.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# `ko.options.*` — Configurable Runtime Options
22

3-
`ko.options` is TKO's runtime configuration object. It is a singleton `Options`
4-
instance defined in `packages/utils/src/options.ts`. This page documents how
5-
to add new options and which of the two available mechanisms to reach for.
3+
`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.
64

75
## Two mechanisms — when to use which
86

tko.io/public/agents/process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ For pages with runnable TSX examples, also run the headless Playwright flow:
7777
- Use `playwright-cli` in headless mode. Do not use headed/browser-stealing runs unless the user explicitly asks for them.
7878
- Prefer a live Astro dev server on `127.0.0.1:4321` so markdown/plugin edits reload while you work (`bun run dev` in `tko.io/`).
7979
- Verify each `Open in Playground` button on the page; if a page has multiple TSX examples, check every one, not just the first.
80-
- Standard flow: `playwright-cli close-all`, `playwright-cli open http://127.0.0.1:4321/...`, inspect the snapshot for playground refs, click each button, switch to the playground tab, and confirm `#esbuild-status`, `#compile-time`, and `#error-bar`.
80+
- Standard flow: `playwright-cli close-all`, `playwright-cli open http://127.0.0.1:4321/...`, inspect the snapshot for playground refs, click each button, switch to the playground tab, and confirm `[data-role="status"]` (shows "esbuild ready"), `[data-role="compile-time"]`, and `[data-role="error-bar"]`.
8181
- Treat docs example work as incomplete until the emitted playground payload compiles cleanly on the live site.
8282

8383
Generator-owned files: see the note at the top of this document under "Never ship docs that reference things that don't exist on the target branch."

tko.io/public/agents/soul.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# The Soul of Knockout
22

3-
This document describes the philosophical foundation of Knockout and TKO.
4-
Read this to understand *why* the framework works the way it does, not just
5-
*how* to use it. If you're an AI agent working on this codebase, this is
6-
the context behind every design decision.
3+
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.
74

85
## The Core Insight
96

tko.io/public/agents/testing.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Workflow:
3535
3. Navigate Playwright to `http://localhost:8765/tko-test.html`
3636
4. Read `document.title` or snapshot the DOM to verify
3737

38-
This is the fastest option — no esbuild and no network dependency on the playground, though Option 1 still fetches `https://tko.io/lib/tko.js` unless you vendor that file locally. Works for all `data-bind` code.
38+
Fastest option — no esbuild, no playground. Still fetches `https://tko.io/lib/tko.js` unless vendored locally. Works for all `data-bind` code.
3939

4040
## Option 2: Playground via Playwright (JSX/TSX)
4141

@@ -53,22 +53,22 @@ const url = `https://tko.io/playground#${hash}`
5353
4. The code auto-compiles and runs in the preview iframe
5454
5. Read the iframe content or console output to verify
5555

56-
The playground forwards console messages from the iframe to the parent page — look for `#console-messages` in the DOM for console.log/error output.
56+
The playground forwards console messages from the iframe to the parent page — look for `[data-role="console-messages"]` in the DOM for console.log/error output.
5757

5858
### Checking results
5959

60-
The preview iframe is `#preview`. To read its content:
60+
The preview iframe is `[data-role="preview"]`. To read its content:
6161

6262
```js
63-
const iframe = document.querySelector('#preview')
63+
const iframe = document.querySelector('[data-role="preview"]')
6464
const body = iframe.contentDocument.body
6565
```
6666

67-
Console output appears in `#console-messages` as child elements.
67+
Console output appears in `[data-role="console-messages"]` as child elements.
6868

6969
### Timing
7070

71-
esbuild-wasm takes a few seconds to initialize on first load. The playground shows "esbuild ready" in `#esbuild-status` when it's ready. Code auto-runs after compilation.
71+
esbuild-wasm takes a few seconds to initialize on first load. The playground shows "esbuild ready" in `[data-role="status"]` when it's ready. Code auto-runs after compilation.
7272

7373
## Option 3: Testing doc page examples
7474

0 commit comments

Comments
 (0)