xiaohongshu
xiaohongshu
anchor-based-context-recovery
Use when starting work after context compaction, switching features, or gathering context without re-reading entire files - searches anchor tags to find relevant architecture/pattern documentation
Full skill instructions
ALWAYS use when:
DO NOT use when:
After context compaction or in new sessions:
Projects embed HTML comment anchors in their documentation:
<!-- anchor: validation-rules -->
## Validation Architecture
- Foreign language: Warning only
- AP Calculus: Hard block
- Located: App.jsx:229-474
<!-- anchor: state-management -->
## Core State Structure
- courses array: Primary schedule data
- Located: App.jsx:285-290
Key principle: Anchors survive file splits and refactoring. Code locations change, but anchor names remain stable.
Step 1: Search for anchor documentation
# Find all anchor files
find docs/ -name "*anchor*" -o -name "architecture.md" -o -name "context-map.md" 2>/dev/null
# Or search all docs for anchors
grep -r "<!-- anchor:" docs/ 2>/dev/null | head -20
Step 2: Search for task-specific anchors
If working on feature F012:
grep -r "anchor:.*F012" docs/ 2>/dev/null
grep -r "anchor:.*refactor" docs/ 2>/dev/null
If working on validation bug:
grep -r "anchor:.*validation" docs/ 2>/dev/null
grep -r "anchor:.*rules" docs/ 2>/dev/null
Step 3: List all available anchors
grep -r "<!-- anchor:" docs/ 2>/dev/null | sed 's/.*anchor: //' | sed 's/ -->.*//' | sort -u
Step 1: Read anchor sections ONLY
Do NOT read entire files. Use grep with context:
# Read validation anchor + 20 lines after
grep -A 20 "<!-- anchor: validation-rules -->" docs/architecture/core.md
# Or read multiple related anchors
grep -A 15 "<!-- anchor: state-management -->" docs/architecture/core.md
grep -A 15 "<!-- anchor: credit-calculation -->" docs/architecture/core.md
Step 2: Find related code locations
Anchors should reference exact file locations. Extract them:
<!-- anchor: validation-rules -->
Located: App.jsx:229-474
Related: SchedulingEngine.js:150-200
Then use Read tool with those specific line ranges, or use Grep to find the relevant sections.
Step 3: Search for related patterns
Based on anchor info, search for related code:
# If anchor mentions "validation rules", find all validators
grep -r "validate.*course" src/ --include="*.js"
# Find related hooks
grep -r "use.*Validation" src/hooks/
Before making changes, verify:
Architecture constraints from anchors
Current state from code search
Related components from anchor links
When adding new patterns, suggest anchor additions:
If you extract validation logic to a new file:
<!-- anchor: course-validator -->
## Course Validator Module
- Extracted from: App.jsx:229-474 (Nov 2024)
- Located: src/domain/validators/courseValidator.js
- Used by: App.jsx, SchedulingEngine.js
- Related: validation-rules anchor (original pattern)
When modifying existing patterns, note anchor updates needed:
Suggest updating the anchor documentation when you make significant changes to referenced code.
Good anchor names:
<!-- anchor: validation-rules --> - Describes the concept<!-- anchor: F012-refactor-plan --> - References feature ID<!-- anchor: state-management --> - Clear, searchable<!-- anchor: 300-line-enforcement --> - References constraintBad anchor names:
<!-- anchor: important --> - Too vague<!-- anchor: app-stuff --> - Not searchable<!-- anchor: temp-notes --> - Implies temporary<!-- anchor: section-3 --> - Meaningless number# User says: "Fix the foreign language validation bug"
# Phase 1: Find anchors
grep -r "anchor:.*validation" docs/
# Result: <!-- anchor: validation-rules --> in docs/architecture/core.md
# Phase 2: Collect context
grep -A 30 "<!-- anchor: validation-rules -->" docs/architecture/core.md
# Reads: Validation rules are in App.jsx:229-474
# Use Grep to find the exact code
grep -n "foreign.*language" src/App.jsx
# Phase 3: Verify understanding
# - Rule: Foreign language validation is WARNING only (from anchor)
# - Location: App.jsx:229-293 (from anchor)
# - Current behavior: Need to check implementation
# Phase 4: Make the fix with full context
# - Know where the code is
# - Know the expected pattern
# - Know related constraints from anchors
Compared to re-reading full files:
Compared to manual summarization:
<!-- anchor: F012-refactor-plan -->
## Feature F012: Extract Validation Logic
- Status: in_progress
- Files to modify: App.jsx (reduce 940→300 lines)
- Extract to: src/domain/validators/
- Tests: tests/validators/
- Related: validation-rules, 300-line-enforcement anchors
<!-- anchor: bug-foreign-language-validation -->
## Bug: Foreign Language Prerequisites Not Checking
- Reported: 2024-11-27
- Expected: Warning when skipping levels
- Actual: No warning shown
- Root cause: TBD
- Related: validation-rules anchor
<!-- anchor: 300-line-rule -->
## Architecture Constraint: File Size Limit
- Hard limit: 300 lines per file
- Enforcement: .github/workflows/architecture-check.yml
- Current violations: App.jsx (940 lines)
- Refactor priority: HIGH
- Related: F012-refactor-plan
Before claiming you've used this skill:
grep -r "anchor:.*keyword" docs/)DON'T:
DO:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience