Agent Skills
› NeverSight/learn-skills.dev
› context-state-tracker
context-state-tracker
GitHub用于在自主编码会话间持久化和恢复状态。支持保存进度、加载上下文、管理功能列表及追踪Git历史,确保跨会话的上下文快速恢复与状态一致性。
Trigger Scenarios
保存当前编码进度
加载上次会话上下文
管理功能实现列表
追踪Git提交历史
Install
npx skills add NeverSight/learn-skills.dev --skill context-state-tracker -g -y
SKILL.md
Frontmatter
{
"name": "context-state-tracker",
"layer": "foundation",
"version": "1.0.0",
"category": "autonomous-coding",
"description": "State persistence across autonomous coding sessions. Use when saving progress, loading context, managing feature lists, tracking git history, or restoring session state."
}
Context State Tracker
Persists and restores state across autonomous coding sessions using structured artifacts.
Quick Start
Save Progress
from scripts.state_tracker import StateTracker
tracker = StateTracker(project_dir)
tracker.save_progress(
accomplishments=["Implemented login form", "Added validation"],
blockers=["Need API endpoint for auth"],
next_steps=["Create auth service", "Add tests"]
)
Load Progress
state = tracker.load_progress()
print(f"Last session: {state.accomplishments}")
print(f"Blockers: {state.blockers}")
Manage Feature List
from scripts.feature_list import FeatureList
features = FeatureList(project_dir)
features.create([
{"id": "auth-001", "description": "User login", "passes": False},
{"id": "auth-002", "description": "User logout", "passes": False},
])
# Mark feature as passing
features.update_status("auth-001", passes=True)
State Artifacts
project/
├── feature_list.json # Immutable feature tracking (passes: true/false)
├── claude-progress.txt # Human-readable session log
└── .git/ # Git history for detailed rollback
feature_list.json
[
{
"id": "feat-001",
"category": "functional",
"description": "User can log in with email",
"steps": ["Navigate to login", "Enter credentials", "Click submit"],
"passes": false
}
]
claude-progress.txt
# Session Progress
## Session 5 - 2025-01-15 14:30
### Accomplishments
- Implemented user authentication
- Added password validation
- Created login tests
### Blockers
- Need to set up email verification
### Next Steps
- Implement email service
- Add password reset flow
Key Rules
- Features are immutable: Can only transition from
false→true - Never delete features: Removing features is CATASTROPHIC
- Update progress after each session: Enables quick context restoration
- Use git for detailed history: Commits provide granular rollback
Workflow
┌─────────────────────────────────────────────────────────────┐
│ STATE TRACKING FLOW │
├─────────────────────────────────────────────────────────────┤
│ │
│ SESSION START │
│ ├─ Read feature_list.json │
│ ├─ Read claude-progress.txt │
│ └─ Get git log (recent commits) │
│ │
│ SESSION WORK │
│ ├─ Select next incomplete feature │
│ ├─ Implement feature │
│ └─ Verify feature passes │
│ │
│ SESSION END │
│ ├─ Update feature_list.json (passes: true) │
│ ├─ Append to claude-progress.txt │
│ └─ Commit with descriptive message │
│ │
└─────────────────────────────────────────────────────────────┘
Integration Points
- autonomous-session-manager: Uses state for session detection
- coding-agent: Uses feature list for work selection
- progress-tracker: Uses state for metrics
References
references/STATE-ARTIFACTS.md- Artifact specificationsreferences/PROGRESS-FORMAT.md- Progress file format
Scripts
scripts/state_tracker.py- Core StateTracker classscripts/progress_file.py- Progress file managementscripts/feature_list.py- Feature list managementscripts/git_state.py- Git history integration
Version History
- e0220ca Current 2026-07-05 23:09


