context-extraction
Convert temporary repository analysis into permanent, domain-specific knowledge files for AI reuse.
Install
mkdir -p .claude/skills/context-extraction && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14893" && unzip -o skill.zip -d .claude/skills/context-extraction && rm skill.zipInstalls to .claude/skills/context-extraction
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Distill learnings from a completed repo analysis into reusable knowledge base entries in ~/.copilot/context/. Use after finishing a repo-analysis to make the learnings persistent and searchable.Key capabilities
- →Extract reusable learnings from repo analysis
- →Filter repo-specific observations for generalizability
- →Create new knowledge base entries in `~/.copilot/context/`
- →Enrich existing knowledge base files with new perspectives
- →Organize knowledge entries by domain
- →Attribute source to analyzed repositories
How it works
The skill guides the user through reading specific sections of an `analysis.md` file, filtering for reusable patterns, checking for duplicates, and writing new or enriching existing knowledge base entries.
Inputs & outputs
When to use context-extraction
- →Extracting reusable architectural patterns from a finished repository analysis
- →Organizing domain-specific knowledge into local context files
- →Building a library of best practices for future project reference
- →Filtering project-specific observations into generalizable technical guidance
About this skill
Context Extraction
Overview
After analyzing a reference repository, this skill guides you through extracting the reusable learnings into ~/.copilot/context/ — your permanent knowledge base. The goal is to transform repo-specific observations into general, domain-organized knowledge entries Copilot can draw on for any future task.
When to Use
- You've completed a repo analysis (
~/references/{repo}/analysis.mdexists) - You want to make learnings available beyond this one repo
- You want Copilot to be able to reference techniques without you re-specifying them
- You're building up knowledge in a specific domain (forecasting, auth, etc.)
Preparation
Confirm before starting:
cat ~/references/{repo-name}/analysis.md # should be complete
ls ~/.copilot/context/ # know what domains exist
Extraction Workflow
Step 1 — Read the Analysis
Focus on these sections of analysis.md:
- Section 4 (Strengths) — what's genuinely good and transferable
- Section 6 (Key Patterns) — the concrete techniques
- Section 8 (What to Adopt) — the actionable list
Step 2 — Filter for Reusability
For each item, ask:
"Would this be useful in a different project with a similar tech stack?"
| Item | Reusable? | Domain | Action |
|---|---|---|---|
| "They use a feature store" | ✅ Yes | forecasting/ | Create feature-store-pattern.md |
| "Their main.py imports config" | ❌ No | — | Skip |
| "JWT validation approach" | ✅ Yes | auth/ | Create or update jwt-validation.md |
| "Pandas UDF for distributed scoring" | ✅ Yes | databricks/ | Create pandas-udf-scoring.md |
Step 3 — Check for Duplicates
Before creating a new file:
grep -r "{pattern keyword}" ~/.copilot/context/ -l
- If a file exists → enrich it (add new perspective/example from this repo)
- If no file exists → create it
Step 4 — Write Knowledge Entries
For each new entry, use this template:
# {Concise Pattern Name}
## What It Is
One sentence describing the pattern clearly.
## When to Use
- Situation where this applies
- NOT when: counter-case
## How It Works
Explain the mechanism — not just what it does, but why it works.
## Implementation
\`\`\`python
# Clean, minimal example adapted from the source
# NOT the raw source code — a simplified version
\`\`\`
## Variations
- **Variation A**: when to use it
- **Variation B**: trade-offs
## Adapting to My Stack
Specific notes on applying this to Databricks/Python/Azure AD environment.
## Source
- Analyzed repo: ~/references/{repo-name}
- Original: https://github.com/{owner}/{repo}
- Key file(s): {path}
Step 5 — Update Context Index
If you created entries in a new domain, add a brief AGENTS.md in that subdirectory:
# {Domain} Knowledge Base
Key patterns and techniques for {domain} distilled from reference repositories.
## Entries
- [{Pattern Name}](./{file}.md) — brief description
This lets Copilot CLI discover the context via COPILOT_CUSTOM_INSTRUCTIONS_DIRS.
Step 6 — Verify
ls ~/.copilot/context/{domain}/ # new files present
cat ~/.copilot/context/{domain}/{file}.md # content looks right
Output Checklist
- Each transferable pattern has its own
.mdfile - Existing entries enriched (not duplicated) where applicable
- Code examples are clean and minimal (not verbatim copies)
- Each entry has "Adapting to My Stack" section
- Source attributed back to
~/references/{repo} - Domain
AGENTS.mdupdated if new entries added
Tips
- Aim for 3–7 entries per analyzed repo (more = noise, fewer = waste)
- Think in abstractions, not implementations — the pattern, not the specific code
- If unsure whether something is reusable: ask "would I Google for this?" — if yes, it belongs
- Use
context-curatoragent to automate this workflow
When not to use it
- →When a repo analysis is not yet complete
- →When learnings are not intended to be persistent or searchable
- →When the goal is to analyze a repository, not extract from it
Limitations
- →Requires a completed `analysis.md` file
- →Relies on manual filtering for reusability
How it compares
This process systematically transforms project-specific findings into general, domain-organized knowledge for future use, unlike simply storing raw analysis reports.
Compared to similar skills
context-extraction side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| context-extraction (this skill) | 0 | 3mo | Review | Intermediate |
| agent-handoff | 0 | 5mo | Caution | Advanced |
| gc-onboard | 0 | 3mo | No flags | Intermediate |
| agent-integrator | 0 | 8mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by richardnguyen0715
View all by richardnguyen0715 →You might also like
agent-handoff
diegosouzapw
Generate comprehensive handoff documentation optimized for AI agent takeover by analyzing project structure, design docs, and codebase
gc-onboard
handsupmin
Guided onboarding for the active gc-branch in gctree.
agent-integrator
Reading-Advantage-Thailand
Use this skill to create or update the root AGENTS.md file to register SynthesisFlow skills for AI agent discovery. Triggers include "register SynthesisFlow", "update AGENTS.md", "setup agent guide", or initializing a new project.
skill-development
anthropics
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.
skill-writer
pytorch
Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.
microsoft-skill-creator
MicrosoftDocs
Create agent skills for Microsoft technologies using Learn MCP tools. Use when users want to create a skill that teaches agents about any Microsoft technology, library, framework, or service (Azure, .NET, M365, VS Code, Bicep, etc.). Investigates topics deeply, then generates a hybrid skill storing essential knowledge locally while enabling dynamic deeper investigation.