Skip to content

Commit b054a4b

Browse files
committed
docs: update CHANGELOG and AGENTS for navigation features
Update documentation to reflect today's major improvements: CHANGELOG.md ([Unreleased] section): - Added precision-guided navigation feature (6 commands, 8615 lines) - Added analyze command enhancement (Quick/Focused/Full modes) - Documented bug fixes (6 Jinja2 syntax errors) - Added internal audit documentation - Added version control cleanup AGENTS.md (new section): - Added 🧭 Token Optimization: Precision-Guided Navigation - Comprehensive guide for AI agents on using read_file(offset, limit) - Command coverage table (6 commands with line counts) - Language-specific navigation examples (Python/TS/Go/Rust) - Best practices and usage patterns - Real-world token savings examples (88-98%) Impact: - Users can now understand and leverage navigation features - AI agents have clear guidance on token optimization - Complete documentation of v0.5.4 improvements
1 parent af5c399 commit b054a4b

File tree

2 files changed

+177
-0
lines changed

2 files changed

+177
-0
lines changed

AGENTS.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,123 @@ cd my-speckit
646646

647647
---
648648

649+
## 🧭 Token Optimization: Precision-Guided Navigation
650+
651+
**NEW in v0.5.4+**: Major MetaSpec commands now include **precision-guided navigation** with exact line numbers, enabling massive token savings (84-98%).
652+
653+
### What is Precision-Guided Navigation?
654+
655+
Instead of reading entire command files (1000-2300+ lines), AI can now jump directly to specific sections using `read_file` with `offset` and `limit` parameters.
656+
657+
**Example**:
658+
```python
659+
# ❌ Before: Read entire file
660+
read_file("src/metaspec/templates/meta/sdd/commands/specify.md.j2")
661+
# Result: 2378 lines (~8000 tokens)
662+
663+
# ✅ After: Read only CLI design section
664+
read_file("src/metaspec/templates/meta/sdd/commands/specify.md.j2", offset=390, limit=273)
665+
# Result: 273 lines (~900 tokens)
666+
# Token savings: 88.3% 🎉
667+
```
668+
669+
### Commands with Navigation
670+
671+
**Enhanced commands** (6 total, 8615 lines coverage):
672+
673+
| Command | Lines | Navigation Sections | Best Savings |
674+
|---------|-------|---------------------|--------------|
675+
| **SDD/specify** | 2378 | 7 main + 7 subsections | 70-94% |
676+
| **SDS/implement** | 1271 | 6 main + 9 templates | 87-95% |
677+
| **SDS/specify** | 1060 | 6 main + 8 templates | 70-90% |
678+
| **SDS/tasks** | 1054 | 7 main + 5 templates + 4 phases | 84-99% |
679+
| **SDD/implement** | 998 | 7 main + 4 languages + 5 phases | 84-97% |
680+
| **SDD/plan** | 854 | 7 main + 4 languages + 4 components | 90-98% |
681+
682+
### How to Use Navigation
683+
684+
Each enhanced command starts with a **📖 Navigation Guide** table showing:
685+
- **Line ranges** for each section
686+
- **read_file usage** with exact offset/limit
687+
- **Typical usage patterns** with concrete examples
688+
- **Token savings** calculation
689+
690+
**Example from SDD/specify**:
691+
692+
```markdown
693+
📖 Navigation Guide (Quick Reference with Line Numbers)
694+
695+
Core Flow:
696+
| Step | Lines | Size | read_file Usage |
697+
|------|-------|------|-----------------|
698+
| 1. Setup | 55-111 | 56 lines | read_file(target_file, offset=55, limit=56) |
699+
| 3. CLI Design | 390-663 | 273 lines | read_file(target_file, offset=390, limit=273) |
700+
701+
💡 Typical Usage Patterns:
702+
# Minimal: Read only Steps 1-2 (135 lines)
703+
read_file(target_file, offset=55, limit=135)
704+
705+
# CLI Design: Read Component 3 (273 lines)
706+
read_file(target_file, offset=390, limit=273)
707+
```
708+
709+
### Language-Specific Navigation (SDD)
710+
711+
**Special feature** for toolkit development: Jump directly to language-specific context.
712+
713+
```python
714+
# Python toolkit development
715+
read_file("implement.md.j2", offset=210, limit=25) # 97% savings! 🏆
716+
717+
# TypeScript toolkit development
718+
read_file("implement.md.j2", offset=236, limit=25) # 97% savings! 🏆
719+
720+
# Go toolkit development
721+
read_file("plan.md.j2", offset=132, limit=15) # 98% savings! 🏆
722+
723+
# Rust toolkit development
724+
read_file("plan.md.j2", offset=148, limit=16) # 98% savings! 🏆
725+
```
726+
727+
### Best Practices
728+
729+
**When to use navigation**:
730+
1. ✅ You need specific guidance (e.g., CLI design, templates)
731+
2. ✅ You're familiar with the command structure
732+
3. ✅ You want to minimize token usage
733+
734+
**When to read full file**:
735+
1. ⚠️ First time using the command (learn structure)
736+
2. ⚠️ Need comprehensive understanding
737+
3. ⚠️ Unclear which section you need
738+
739+
**Quick Reference Strategy**:
740+
```python
741+
# Step 1: Read navigation guide only (first 100 lines)
742+
read_file(target_file, offset=1, limit=100)
743+
744+
# Step 2: Based on navigation, read specific section
745+
read_file(target_file, offset=390, limit=273)
746+
747+
# Result: ~370 lines vs 2378 lines = 84% savings
748+
```
749+
750+
### Token Savings by Scenario
751+
752+
**Real-world examples**:
753+
754+
| Scenario | Before | After | Savings |
755+
|----------|--------|-------|---------|
756+
| Quick start | 2378 lines | 135 lines | **94.2%** |
757+
| CLI design | 2378 lines | 273 lines | **88.3%** |
758+
| Template reference | 1054 lines | 11 lines | **99.0%** 🏆 |
759+
| Language context | 854 lines | 16 lines | **98.1%** 🏆 |
760+
| Operation template | 1271 lines | 45 lines | **96.5%** |
761+
762+
**Average token savings**: 88-98% in typical usage scenarios.
763+
764+
---
765+
649766
## 🔄 Using Commands with Iteration Support
650767

651768
**CRITICAL**: Validation/analysis commands (checklist, analyze, clarify) support **iteration modes** to preserve history and track progress.

CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### 🚀 Features
11+
12+
**Precision-Guided Navigation with Line Numbers**
13+
14+
Added precision-guided navigation to 6 major MetaSpec commands, enabling massive token savings (84-98%) through targeted reading with `read_file(offset, limit)`.
15+
16+
**Commands Enhanced**:
17+
- `specify` (SDS: 1060 lines, SDD: 2378 lines)
18+
- `implement` (SDS: 1271 lines, SDD: 998 lines)
19+
- `tasks` (SDS: 1054 lines)
20+
- `plan` (SDD: 854 lines)
21+
22+
**Key Features**:
23+
- 📋 Precise line numbers for each section (e.g., Lines 390-663)
24+
- 🎯 Language-specific navigation (Python/TS/Go/Rust)
25+
- 📊 Token savings calculation for each usage pattern
26+
- 💡 Typical usage examples with concrete code
27+
28+
**Impact**:
29+
- Total coverage: 8615 lines across 6 commands
30+
- Token savings: 84-98% in typical usage scenarios
31+
- Special achievement: 97-98% savings for language-specific sections
32+
33+
**analyze Command Enhancement**
34+
35+
Added three analysis modes for flexible validation workflows:
36+
- **Quick Mode**: Fast structural integrity checks (<2 min)
37+
- **Focused Mode**: Deep dive into specific dimension
38+
- **Full Mode**: Comprehensive 11-dimension analysis (default)
39+
40+
**Impact**:
41+
- Expected token reduction: 70% average
42+
- Faster validation cycles for iterative development
43+
- Better separation of concerns
44+
45+
### 🐛 Bug Fixes
46+
47+
**Template Syntax Errors**
48+
49+
Fixed 6 Jinja2 syntax errors in command templates:
50+
- Replace `{%}` with `{percent}` to avoid control structure conflicts
51+
- Files: sds/tasks.md.j2, sds/implement.md.j2, sdd/tasks.md.j2, sdd/implement.md.j2
52+
- All 19 command templates now pass validation
53+
54+
### 📚 Documentation
55+
56+
**Internal Audit Reports**
57+
58+
Created comprehensive audit documentation (stored locally in `docs/internal/`):
59+
- COMMAND_AUDIT_REPORT.md: Complete analysis of all 19 MetaSpec commands
60+
- VERSION_COMPARISON_AUDIT.md: Comparison with GitHub published version
61+
62+
### 🧹 Chore
63+
64+
**Version Control Cleanup**
65+
66+
Removed internal documentation from Git tracking to respect `.gitignore` rules:
67+
- Cleaned up `docs/internal/` directory
68+
- Files remain available locally for development use
69+
1070
---
1171

1272
## [0.5.3] - 2025-11-11

0 commit comments

Comments
 (0)