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
Format:
Would create in development/:
concepts/use-state.md (45 lines)
concepts/use-effect.md (52 lines)
errors/react-hooks-errors.md (124 lines)
Total: 12 files, ~650 lines
Preview file? (type filename or 'skip')
Approve? (yes/no/preview):
If user types filename: Show first 30 lines of that file
Validation: MUST get approval before proceeding
Action: Create files in function folders
Process:
Enforcement: @critical_rules.mvi_strict + @critical_rules.function_structure
Action: Update README.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/