agentskills.codes
CO

context-extraction

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.

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.zip

Installs 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.
194 charsno explicit “when” trigger

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.md exists)
  • 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?"

ItemReusable?DomainAction
"They use a feature store"✅ Yesforecasting/Create feature-store-pattern.md
"Their main.py imports config"❌ NoSkip
"JWT validation approach"✅ Yesauth/Create or update jwt-validation.md
"Pandas UDF for distributed scoring"✅ Yesdatabricks/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 .md file
  • 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.md updated 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-curator agent to automate this workflow

Search skills

Search the agent skills registry