.claude/skills/guide-sync/SKILL.md
Use when the learning guide may be stale after codebase changes, when types have been renamed or modules deleted, or when verifying guide code examples still compile. Synchronizes gossip-rs-learning-guide with current codebase state.
npx skillsauth add ahrav/gossip-rs guide-syncInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit and update the external learning guide to match the current codebase. Parallel exploration agents compare every guide section against the live source code, then a synthesizer produces a prioritized remediation plan that the orchestrator executes.
Core principle: The guide must describe the code that exists today, not the code that existed when the chapter was written. Every type name, method signature, module path, and architecture claim is verified against the current codebase before the guide is updated.
| Asset | Location |
|-------|----------|
| Learning guide | /Users/ahrav/Projects/gossip-rs-learning-guide |
| Codebase | /Users/ahrav/Projects/Gossip-rs |
docs/ (use /design-doc-audit)diagrams/ (use /doc-code-audit)/doc-rigor)/guide-sync [<scope>] [--flags]
The scope determines which guide sections and crate directories are compared.
If omitted, defaults to --full (all sections).
Section scopes (audit a specific guide section):
| Scope | Guide Directory | Primary Crates |
|-------|----------------|----------------|
| prologue | 00-prologue/ | (cross-cutting) |
| foundations | 01-foundations/ | gossip-contracts/src/identity/ |
| identity | 02-boundary-1-identity-spine/ | gossip-contracts/src/identity/ |
| theory | 03-distributed-systems-theory/ | (conceptual, light code refs) |
| coordination | 04-boundary-2-coordination/ | gossip-contracts/src/coordination/, gossip-coordination/src/, gossip-coordination-etcd/src/ |
| shard-algebra | 05-boundary-3-shard-algebra/ | gossip-frontier/src/ |
| connector | 06-boundary-4-connector/ | gossip-contracts/src/connector/, gossip-connectors/src/, gossip-scanner-runtime/src/ |
| persistence | 07-boundary-5-persistence/ | gossip-contracts/src/persistence/, gossip-persistence-inmemory/src/ |
| cross-cutting | 08-cross-cutting/ | (cross-cutting) |
| appendices | 09-appendices/ | (cross-cutting) |
| scanner-engine | 10-scanner-engine/ | scanner-engine/src/ |
| scan-driver | 11-scan-driver-and-pipeline/ | gossip-scanner-runtime/src/, scanner-scheduler/src/, scanner-git/src/ |
| scanner-git | 12-scanner-git/ | scanner-git/src/ |
| scheduler | 13-scanner-scheduler/ | scanner-scheduler/src/ |
| runtime | 14-scanner-runtime-and-worker/ | gossip-scanner-runtime/src/, gossip-worker/src/ |
| Flag | Default | Effect |
|------|---------|--------|
| --full | on | Audit all guide sections against the full codebase |
| --report-only | off | Produce the diff report but do not apply fixes |
| --delete-obsolete | off | Delete chapters whose entire subject was removed (prompts for confirmation) |
| --renumber | off | Renumber chapters after deletions to close numbering gaps |
| --strict | off | Treat all findings as errors (useful for CI-like checks) |
Build a current-state inventory of the codebase to compare against.
List all crates under crates/ with their source files:
ls /Users/ahrav/Projects/Gossip-rs/crates/
For each crate, collect public types, traits, and functions:
colgrep -e "pub (fn|struct|enum|trait|type|mod)" --include="*.rs" per crateCheck for removed concepts that guides commonly reference:
EnumerationPage, PageValidationError, ConnectorConformance)enumerate_page, enumerate_page_bounds)page_validator, conformance)Build a removal manifest: a list of (concept, was_in, status) tuples
where status is removed, renamed:<new_name>, or moved:<new_location>.
Partition the guide sections into batches of 2-3 sections per agent. Launch all
agents in a single message using the Task tool with subagent_type=general.
Each agent receives this prompt with {GUIDE_SECTIONS}, {CRATE_DIRS}, and
{REMOVAL_MANIFEST} filled in:
You are a learning-guide-vs-codebase consistency auditor. Your job is to read
each guide chapter, extract every verifiable claim, and check it against the
actual codebase at /Users/ahrav/Projects/Gossip-rs.
## Guide Sections to Audit
{GUIDE_SECTIONS}
## Crate Directories to Check Against
{CRATE_DIRS}
## Known Removals / Renames
The following concepts have been removed or renamed since the guide was last
updated. Flag every guide reference to these:
{REMOVAL_MANIFEST}
## What to Check
For each guide chapter, systematically verify:
### 1. Type, Struct, Enum, Trait References
- Does every named type still exist in the codebase?
- Are struct field lists accurate (names, types, count)?
- Are enum variant lists accurate?
- Are trait method signatures accurate?
### 2. Method and Function References
- Does every named method still exist on the type the guide says it does?
- Are method signatures (parameters, return types) accurate?
- Are described behaviors still correct?
### 3. Code Blocks
- Does every inline code block match the current source?
- Are file:line references still accurate?
- Do code comments in examples match the current code comments?
### 4. Module and Crate Structure
- Does the guide's module layout match the current `mod.rs` / `lib.rs`?
- Are "N files" counts accurate?
- Do listed source files still exist?
- Are there new files the guide does not mention?
### 5. Architecture and Data Flow Claims
- Are dependency direction claims still correct?
- Do described data flow paths match the current call graph?
- Are layer/tier descriptions accurate?
### 6. Chapter Cross-References
- Do "Chapter N" references point to the correct content after renumbering?
- Do forward/backward references between chapters still make sense?
### 7. README and Appendix Accuracy
- Does the README project status table match reality?
- Does the glossary reference only types that exist?
- Does the source file map list only files that exist?
## How to Verify
- Use `colgrep` for semantic and exact code search
- Read specific source files to verify method signatures and struct fields
- Use Glob to find files when a guide references a file that may have moved
- Use Grep for exact identifier lookups
IMPORTANT: Actually read the code. Do not guess based on names.
## Classification
| Category | Meaning | Severity |
|----------|---------|----------|
| REMOVED | Guide references a type/method/module that no longer exists | HIGH |
| RENAMED | Guide uses an old name; the concept still exists under a new name | HIGH |
| STALE_CODE | Inline code block does not match current source | HIGH |
| WRONG_SIGNATURE | Method/function signature in guide differs from code | HIGH |
| WRONG_STRUCTURE | Module layout, file counts, or crate structure is wrong | MEDIUM |
| STALE_XREF | Chapter cross-reference points to wrong content | MEDIUM |
| INCOMPLETE | Guide omits significant new functionality | LOW |
| ASPIRATIONAL | Guide describes behavior not yet implemented | LOW |
## Output Format
Return a markdown document with:
# Audit: {section_name}
## Summary
- Chapters audited: N
- Findings: X (Y high, Z medium, W low)
- Chapters with no findings: [list]
- Chapters that may need deletion: [list, if entire subject was removed]
## Findings
| # | Category | Severity | File | Line | Claim | Reality | Code Ref |
|---|----------|----------|------|------|-------|---------|----------|
## Details
### Finding N: {title}
- **Guide says**: {quote}
- **Code says**: {current state, with file:line}
- **Suggested fix**: {specific edit or "delete chapter"}
## Obsolete Chapters
List any chapters whose entire subject has been removed from the codebase.
After all audit agents complete, launch 1 synthesizer agent using the Task
tool with subagent_type=general.
You are the Guide Sync Synthesizer. Multiple audit agents have independently
compared learning guide sections against the Gossip-rs codebase. Merge their
findings into one actionable remediation plan.
## Agent Reports
{ALL_AGENT_REPORTS}
## Your Task
### 1. Deduplicate
Group identical findings (same removed type referenced in multiple chapters).
### 2. Prioritize
- **P0 -- DELETE**: Entire chapters about removed features (e.g., page validation
chapter when page validation was removed)
- **P1 -- REWRITE**: Sections with fundamentally wrong architecture descriptions
(e.g., "five-method convention" when only four methods remain)
- **P2 -- EDIT**: Specific lines with wrong type names, signatures, or counts
- **P3 -- XREF**: Chapter cross-reference numbering fixes after deletions
- **P4 -- LOW**: Minor omissions, aspirational content
### 3. Build Remediation Plan
For each finding, specify the exact action:
- `DELETE file` -- Remove an obsolete chapter file
- `REWRITE section` -- Replace a section with updated content
- `EDIT line` -- Fix a specific line (old text -> new text)
- `RENAME file` -- Renumber a chapter file
- `UPDATE_README` -- Update README.md tables and stats
### 4. Output Format
## Guide Sync Remediation Plan
**Sections audited**: N
**Total findings**: X (P0: A, P1: B, P2: C, P3: D, P4: E)
**Chapters to delete**: [list]
**Chapters to rewrite**: [list]
**Line edits**: N
### Actions (ordered by priority)
| # | Priority | Action | File | Details |
|---|----------|--------|------|---------|
| 1 | P0 | DELETE | 06-boundary-4-connector/04-page-validation.md | Page validation removed |
| 2 | P1 | REWRITE | 06-boundary-4-connector/03-enumeration-and-read-traits.md | Remove enumerate_page |
| 3 | P2 | EDIT | 06-boundary-4-connector/01-connector-problem-space.md:48 | "EnumerationPage" -> remove |
### Systemic Patterns
{Common drift patterns across multiple chapters}
### Post-Fix Actions
- Renumber chapters in affected sections
- Update README.md status table, reading path, topic jump table
- Update glossary (remove deleted terms, fix renamed terms)
- Update source file map (remove deleted files, fix paths)
Work through the synthesizer's remediation plan in priority order.
If --delete-obsolete was set:
For each section requiring rewrite:
For each line edit:
After deletions and renumbering:
--renumber is set)09-appendices/D-glossary.md): Remove entries for deleted
types, update entries for renamed types09-appendices/E-source-file-map.md): Remove entries
for deleted files, update chapter-to-file mappingsAfter all edits, run a targeted search for any remaining stale references:
# Search for known-removed identifiers across the guide
grep -r "EnumerationPage\|enumerate_page\|page_validator" /Users/ahrav/Projects/gossip-rs-learning-guide/ --include="*.md"
Report any remaining issues to the user.
The full mapping from guide sections to primary source directories. All crate
paths are relative to /Users/ahrav/Projects/Gossip-rs/crates/.
00-prologue:
crates: (cross-cutting -- Cargo.toml, crate list)
01-foundations:
crates: gossip-contracts/src/identity/
02-boundary-1-identity-spine:
crates: gossip-contracts/src/identity/
03-distributed-systems-theory:
crates: (conceptual -- light code references to coordination/)
04-boundary-2-coordination:
crates: gossip-contracts/src/coordination/
gossip-coordination/src/
gossip-coordination-etcd/src/
05-boundary-3-shard-algebra:
crates: gossip-frontier/src/
06-boundary-4-connector:
crates: gossip-contracts/src/connector/
gossip-connectors/src/
gossip-scanner-runtime/src/
07-boundary-5-persistence:
crates: gossip-contracts/src/persistence/
gossip-persistence-inmemory/src/
08-cross-cutting:
crates: (cross-cutting -- references all boundaries)
09-appendices:
crates: (cross-cutting -- glossary, source map, TLA+)
10-scanner-engine:
crates: scanner-engine/src/
11-scan-driver-and-pipeline:
crates: gossip-scanner-runtime/src/
scanner-scheduler/src/
scanner-git/src/
12-scanner-git:
crates: scanner-git/src/
13-scanner-scheduler:
crates: scanner-scheduler/src/
14-scanner-runtime-and-worker:
crates: gossip-scanner-runtime/src/
gossip-worker/src/
scanner-rs-cli/src/
Default: 3-5 audit agents (one per 2-3 guide sections) + 1 synthesizer.
For single-section scope, typically 1 audit agent + 1 synthesizer.
For --full mode across all 15 sections, use 5 agents with 3 sections each.
When rewriting guide sections:
/design-doc-audit -- Audit in-tree design docs in docs/ (not the external guide)/doc-code-audit -- Audit Mermaid diagrams in diagrams/ against code/doc-rigor -- Write or improve inline code documentation/doc-verify -- Verify inline docstring accuracy against code/create-task -- Create tracked tasks for major remediation workdevelopment
Deep first-principles code explanation that builds real understanding through phased walkthroughs with diagrams. Covers algorithms, data structures, memory layout, concurrency patterns, and performance tricks — especially for systems code in Rust. Use whenever the user asks to explain, walk through, break down, deep dive into, or understand code. Trigger on "how does this work", "what's happening here", "teach me about this", "why is it done this way", or when the user references a file with @ and wants to understand it. Proactively use when examining code involving lock-free algorithms, atomics/CAS, memory ordering,
development
Use when creating implementation-ready beads tasks that need testing strategy, optimal implementation approach, and documentation requirements baked in — composes /create-task with parallel enrichment agents that analyze the codebase and produce concrete test specifications, algorithm/data-structure guidance, and doc quality standards so implementing agents don't need to re-research
development
--- name: autoresearch description: Autonomous Goal-directed Iteration. Apply Karpathy's autoresearch principles to ANY task. Loops autonomously — modify, verify, keep/discard, repeat. Supports bounded iteration via Iterations: N inline config. version: 1.9.11 --- # Claude Autoresearch — Autonomous Goal-directed Iteration Inspired by [Karpathy's autoresearch](https://github.com/karpathy/autoresearch). Applies constraint-driven autonomous iteration to ANY work — not just ML research. **Core id
development
Use when implementing a new feature and assessing coverage gaps, during periodic test hygiene, when test suites feel bloated, or before merging code that changes coordination or hot paths. Two-phase assess-then-improve testing pipeline.