Purpose: Extract context from docs, code, or URLs into organized context files
Last Updated: 2026-01-06
/context extract from https://react.dev/hooks
↓
Agent: "Reading source (8,500 lines)...
Analyzing content for extractable items..."
Action: Read and analyze source material
Action: Extract and categorize content by function
Categorization:
concepts/examples/guides/lookup/errors/Output: List of extractable items with previews
Action: User chooses target category and items
Format:
Found 12 extractable items from {source}:
Concepts (8):
✓ [A] useState - State management hook
✓ [B] useEffect - Side effects hook
... (6 more)
Errors (4):
✓ [I] Hooks called conditionally
✓ [J] Hooks in loops
... (2 more)
Which category?
[1] development/
[2] core/
[3] Create new category: ___
Select items (A B I or 'all') + category (1/2/3):
Validation: MUST wait for user input before proceeding
Action: Show what will be created, check for conflicts
Format:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Extraction Plan: development/
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CREATE (new files):
concepts/use-state.md (45 lines)
concepts/use-effect.md (52 lines)
concepts/use-context.md (38 lines)
... (6 more)
guides/custom-hooks.md (87 lines)
guides/debugging-hooks.md (65 lines)
ADD TO (existing files):
errors/react-hooks-errors.md (98 → 124 lines)
+ 4 new error entries
⚠️ CONFLICT (file already exists):
concepts/use-memo.md already exists (42 lines)
Options:
[A] Skip — keep existing file
[B] Overwrite — replace with extracted version
[C] Merge — add new content to existing file (42 → 58 lines)
Choose [A/B/C]: _
NAVIGATION UPDATE:
development/navigation.md
+ 9 new entries in Concepts table
+ 2 new entries in Guides table
+ 1 updated entry in Errors table
Total: 12 files, ~650 lines
Preview content? (type filename, 'all' for batch, or 'skip')
Approve? [y/n/edit]: _
If user types 'all': Show first 10 lines of each file in sequence If user types filename: Show full content of that file If user types 'skip': Proceed to approval
Validation: MUST get approval before proceeding
Action: Create files in function folders
Process:
Enforcement: @critical_rules.mvi_strict + @critical_rules.function_structure
Action: Update navigation.md and add cross-references
Process:
Action: Show comprehensive results
Format:
✅ Extracted X items into {category}
📄 Created Y files
📊 Updated {category}/README.md
Files created:
- {category}/concepts/ (N files)
- {category}/examples/ (N files)
- {category}/errors/ (N files)
/context extract from https://react.dev/hooks
/context extract from docs/api.md
/context extract from docs/architecture/
/context extract from src/utils/