Skip to content

Commit f6a1693

Browse files
hanselhanselclaude
andcommitted
docs: add context-cli pivot plan for reference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1ff9154 commit f6a1693

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

docs/context-cli-pivot-plan.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Context CLI Pivot Plan (v2.0.0)
2+
3+
## Overview
4+
Pivot from AEO-CLI (Agentic Engine Optimization) to Context CLI (LLM Readiness Linter).
5+
Reframe around token efficiency, RAG readiness, and LLM extraction quality.
6+
7+
## Phase Summary
8+
9+
| Phase | Status | Description |
10+
|-------|--------|-------------|
11+
| 1. Rebrand | DONE | Rename package, purge jargon, hide retail, rename audit->lint |
12+
| 2. Metrics | TODO | Replace 0-100 score with Token Waste % + Pass/Fail checks |
13+
| 3. UX | TODO | Linter-style terminal output (Ruff/ESLint aesthetic) |
14+
| 4. CI/CD | TODO | Updated CI summary + new action.yml inputs for token waste |
15+
| 5. Leaderboard | TODO | New `context-cli leaderboard` command for batch URL comparison |
16+
17+
## Phase 2: Reframe the Metrics
18+
19+
Replace the 0-100 pillar scoring with Token Waste Ratio as hero metric + Pass/Fail checks.
20+
21+
### New Model Fields (ContentReport)
22+
- `raw_html_chars`: Character count of raw HTML
23+
- `clean_markdown_chars`: Character count of extracted markdown
24+
- `estimated_raw_tokens`: Estimated token count (chars/4)
25+
- `estimated_clean_tokens`: Estimated clean token count (chars/4)
26+
- `context_waste_pct`: Percentage of tokens wasted on HTML bloat
27+
28+
### Token Estimation
29+
Simple heuristic: `len(text) // 4`. No tiktoken dependency.
30+
31+
### Pass/Fail Checks
32+
- AI Primitives: llms.txt or llms-full.txt found
33+
- Bot Access: All AI bots allowed in robots.txt
34+
- Data Structuring: At least 1 JSON-LD block present
35+
- Token Efficiency: Context waste < 70% (configurable)
36+
37+
## Phase 3: Linter UX
38+
39+
Target output format:
40+
```
41+
context-cli lint https://docs.anthropic.com
42+
43+
LINT https://docs.anthropic.com
44+
45+
[PASS] AI Primitives llms.txt found at /llms.txt
46+
[PASS] Bot Access 13/13 AI bots allowed
47+
[PASS] Data Structuring 3 JSON-LD blocks
48+
[WARN] Token Efficiency 85% Context Waste
49+
50+
-- Token Analysis --
51+
Raw HTML tokens: 18,402
52+
Clean MD tokens: 2,760
53+
Context Waste: 85.0%
54+
55+
-- Diagnostics --
56+
WARN-001 Excessive DOM bloat
57+
INFO-001 Readability grade: 12.3
58+
59+
1 warning, 0 errors
60+
```
61+
62+
### Color Rules
63+
- Green [PASS]: check passes, waste <30%
64+
- Yellow [WARN]: warning, waste 30-70%
65+
- Red [FAIL]: check fails, waste >70%
66+
67+
### Diagnostic Codes
68+
| Code | Condition | Message |
69+
|------|-----------|---------|
70+
| WARN-001 | waste > 70% | Excessive DOM bloat |
71+
| WARN-002 | no code blocks | No code blocks detected |
72+
| WARN-003 | no headings | No heading structure |
73+
| WARN-004 | bots blocked | AI bots blocked in robots.txt |
74+
| INFO-001 | always | Readability grade |
75+
| INFO-002 | schema found | JSON-LD blocks detected |
76+
77+
## Phase 4: CI/CD Gatekeeper
78+
79+
### New action.yml Inputs
80+
- `max-context-waste`: Maximum acceptable waste % (default: 80)
81+
- `require-llms-txt`: Fail if no llms.txt (default: false)
82+
- `require-bot-access`: Fail if bots blocked (default: false)
83+
84+
## Phase 5: Leaderboard Command
85+
86+
```bash
87+
context-cli leaderboard urls.txt --output leaderboard.md
88+
```
89+
90+
Output: sorted markdown table by Context Waste % ascending.
91+
92+
## Agent Team Protocol
93+
Every phase uses 2-3 agents with git worktree isolation.
94+
Leader creates worktrees, agents commit to own branches, leader merges.

0 commit comments

Comments
 (0)