Skip to content

Commit daae302

Browse files
hongyi-chenoz-agent
andcommitted
missing_docs: document Kitty keyboard protocol and add --weak-coverage audit mode
Rebases the original PR onto current `main` after PR #75 shipped overlapping path-resolution fixes. The structural cleanup from PR #75 is preserved; this commit reapplies only the additions that PR #75 didn't include. - full-screen-apps.mdx: add a "Kitty keyboard protocol" section so the newly-shipped flag is documented where TUI users will look. - feature_surface_map.md: point KittyKeyboardProtocol at the .mdx file and fix the stale `.warp/skills/...` script-path comment. - audit_docs.py: add an opt-in `--weak-coverage` flag that, on top of the default "mapped == verified" check, also confirms feature keywords actually appear in the mapped doc (low-severity, noisy by design). - SKILL.md: document `--weak-coverage`, the `.md`/`.mdx` resolution behavior, and the correct `crates/warp_features/src/lib.rs` source path. Original author: hongyi-chen <hongyigma@gmail.com> Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent 9f5820c commit daae302

4 files changed

Lines changed: 74 additions & 12 deletions

File tree

.agents/skills/missing_docs/SKILL.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,23 @@ Find documentation gaps and draft missing pages in one workflow.
2121
Run the audit script to identify gaps:
2222

2323
```bash
24-
python3 .warp/skills/missing_docs/scripts/audit_docs.py
24+
python3 .agents/skills/missing_docs/scripts/audit_docs.py
2525
```
2626

2727
Options:
2828
- `--category features|cli|api|staleness` — run a single audit category
2929
- `--severity high|medium|low` — filter by minimum severity
30+
- `--weak-coverage` — also flag GA features whose mapped doc exists but doesn't mention feature keywords (low-severity, noisy)
3031
- `--output report.json` — save JSON report to file
3132
- `--warp-internal PATH` — explicit path to warp-internal (auto-detected from sibling dirs)
3233
- `--warp-server PATH` — explicit path to warp-server (auto-detected from sibling dirs)
3334

35+
The script resolves doc paths from the docs repo root and accepts `.md` and `.mdx`
36+
interchangeably (and `README.md``index.mdx`), so surface-map entries can use the
37+
canonical filename even when the on-disk extension differs.
38+
3439
The script performs 4 audits:
35-
1. **Feature flag coverage** — compares GA flags in `warp_core/src/features.rs` + `app/Cargo.toml` against doc mentions
40+
1. **Feature flag coverage** — compares GA flags in `crates/warp_features/src/lib.rs` + `app/Cargo.toml` against the surface map; default mode trusts a mapped entry as verified, `--weak-coverage` additionally checks the target page mentions feature keywords
3641
2. **CLI command coverage** — compares `warp_cli/src/lib.rs` subcommands against `src/content/docs/reference/cli/`
3742
3. **API endpoint coverage** — compares `router/router.go` routes against `src/content/docs/reference/api-and-sdk/` and the OpenAPI spec
3843
4. **Docs staleness** — checks for outdated terminology in existing docs

.agents/skills/missing_docs/references/feature_surface_map.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Format: `CodeIdentifier -> docs/path/to/page.md` (one per line within each secti
77
Lines starting with `#` are comments. Blank lines are ignored.
88

99
# Maintenance: when a new GA feature flag ships, add a mapping here.
10-
# Run `python3 .warp/skills/missing_docs/scripts/audit_docs.py` to find unmapped flags.
10+
# Run `python3 .agents/skills/missing_docs/scripts/audit_docs.py` to find unmapped flags.
1111
# This audit is also run as a recurring scheduled cloud agent to catch drift.
1212

1313
## Feature flags -> doc pages
@@ -130,7 +130,7 @@ AIContextMenuEnabled -> src/content/docs/agent-platform/local-agents/agent-conte
130130
AtMenuOutsideOfAIMode -> src/content/docs/agent-platform/local-agents/agent-context/using-to-add-context.mdx
131131
AIContextMenuCode -> src/content/docs/agent-platform/local-agents/agent-context/using-to-add-context.mdx
132132
DriveObjectsAsContext -> src/content/docs/agent-platform/local-agents/agent-context/using-to-add-context.mdx
133-
KittyKeyboardProtocol -> src/content/docs/terminal/more-features/full-screen-apps.md
133+
KittyKeyboardProtocol -> src/content/docs/terminal/more-features/full-screen-apps.mdx
134134
InlineRepoMenu -> src/content/docs/agent-platform/capabilities/codebase-context.mdx
135135
InlineHistoryMenu -> src/content/docs/agent-platform/local-agents/interacting-with-agents/terminal-and-agent-modes.mdx
136136
SkillArguments -> src/content/docs/agent-platform/capabilities/skills.mdx

.agents/skills/missing_docs/scripts/audit_docs.py

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
warp-server to identify gaps. Produces a structured JSON report.
77
88
Usage:
9-
python3 .warp/skills/missing_docs/scripts/audit_docs.py
10-
python3 .warp/skills/missing_docs/scripts/audit_docs.py --category features
11-
python3 .warp/skills/missing_docs/scripts/audit_docs.py --output report.json
9+
python3 .agents/skills/missing_docs/scripts/audit_docs.py
10+
python3 .agents/skills/missing_docs/scripts/audit_docs.py --category features
11+
python3 .agents/skills/missing_docs/scripts/audit_docs.py --output report.json
12+
python3 .agents/skills/missing_docs/scripts/audit_docs.py --weak-coverage
1213
"""
1314

1415
import argparse
@@ -267,8 +268,16 @@ def snake_to_pascal(snake: str) -> str:
267268

268269

269270
def audit_features(warp_internal: Path, docs_root: Path, surface_map: dict,
270-
docs_text: dict[str, str]) -> list[dict]:
271-
"""Audit feature flag coverage in docs."""
271+
docs_text: dict[str, str],
272+
weak_coverage: bool = False) -> list[dict]:
273+
"""Audit feature flag coverage in docs.
274+
275+
By default, a flag is treated as covered if its mapped doc exists (the
276+
surface map maintainer has verified the mapping). When ``weak_coverage``
277+
is True, also verify that the target doc actually mentions feature
278+
keywords — useful for catching pages that have been renamed or trimmed
279+
so the flag is no longer documented in prose.
280+
"""
272281
flags = parse_feature_flags(warp_internal)
273282
default_features = parse_default_features(warp_internal)
274283
ignore_flags = surface_map.get("ignore_flags", set())
@@ -295,8 +304,34 @@ def audit_features(warp_internal: Path, docs_root: Path, surface_map: dict,
295304
# Check if mapped in surface map
296305
if flag in feature_to_doc:
297306
doc_path = feature_to_doc[flag]
298-
if resolve_doc_path(doc_path, repo_root) is not None:
299-
continue # Mapped and doc exists — verified
307+
resolved = resolve_doc_path(doc_path, repo_root)
308+
if resolved is not None:
309+
if not weak_coverage:
310+
# Surface-map presence is treated as verified — the
311+
# maintainer has confirmed the page covers this flag.
312+
continue
313+
# Optional weak-coverage check: verify the target page
314+
# actually mentions feature keywords. Skip the lowercase
315+
# concatenated / snake_case variants since they rarely
316+
# match human-written prose.
317+
try:
318+
doc_content = resolved.read_text(encoding="utf-8").lower()
319+
except Exception:
320+
doc_content = ""
321+
terms = camel_to_search_terms(flag)
322+
check_terms = [t for t in terms if " " in t or t.startswith("/")]
323+
if check_terms and not any(t in doc_content for t in check_terms):
324+
findings.append({
325+
"flag": flag,
326+
"search_terms": terms,
327+
"severity": "low",
328+
"suggested_doc_path": doc_path,
329+
"reason": (
330+
f"Mapped doc {doc_path} exists but does not "
331+
"mention feature keywords (weak coverage)"
332+
),
333+
})
334+
continue
300335
# Mapped path missing — before flagging, fall back to a content
301336
# search so we don't raise false positives when a doc has merely
302337
# been moved.
@@ -698,6 +733,12 @@ def main():
698733
choices=["high", "medium", "low"],
699734
help="Filter results by minimum severity",
700735
)
736+
parser.add_argument(
737+
"--weak-coverage",
738+
action="store_true",
739+
help="Also flag features whose mapped doc exists but doesn't mention "
740+
"feature keywords (noisy; produces low-severity findings)",
741+
)
701742
args = parser.parse_args()
702743

703744
# Find repos
@@ -737,7 +778,10 @@ def main():
737778
print(f"Using warp-internal: {warp_internal}", file=sys.stderr)
738779
if args.category in (None, "features"):
739780
print("Running feature flag coverage audit...", file=sys.stderr)
740-
features_findings = audit_features(warp_internal, docs_root, surface_map, docs_text)
781+
features_findings = audit_features(
782+
warp_internal, docs_root, surface_map, docs_text,
783+
weak_coverage=args.weak_coverage,
784+
)
741785

742786
if args.category in (None, "cli"):
743787
print("Running CLI command coverage audit...", file=sys.stderr)

src/content/docs/terminal/more-features/full-screen-apps.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,16 @@ Some full-screen applications don't behave well when resizing. If you are experi
5353
![alt-screen padding setting](../../../../assets/terminal/padding-settings.png)
5454
<figcaption>The alt-screen padding setting in appearance preferences.</figcaption>
5555
</figure>
56+
57+
## Kitty keyboard protocol
58+
59+
Warp supports the [Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/) (CSI u progressive enhancement) so full-screen apps can read keystrokes that legacy terminal escape sequences can't represent — for example, distinguishing `Ctrl+I` from `Tab`, capturing modifier-only key events, or detecting key release events.
60+
61+
When a running app advertises that it supports the protocol, Warp emits the extended escape sequences automatically. No configuration is required.
62+
63+
* **Supported in**: Vim, Neovim, Emacs, tmux, helix, and other modern TUI apps that opt into CSI u.
64+
* **Falls back to legacy encoding** when the running app doesn't request progressive enhancement, so older programs keep working unchanged.
65+
66+
:::note
67+
If a TUI app reports unexpected key events after upgrading Warp, confirm the app itself supports the Kitty keyboard protocol. Most apps require an explicit opt-in (for example, `:set keyprotocol` in Neovim).
68+
:::

0 commit comments

Comments
 (0)