Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

shahabsalehi/AgentSkills-localcontext

Repository files navigation

⚠️ ARCHIVED - Agent ContextPacks

Status: Archived as of January 2025
Reason: This project has been superseded by modern alternatives like MCP (Model Context Protocol) and LSP-based tooling.
Value: This repo remains as a reference implementation for VS Code extension architecture, multi-adapter patterns, and Tree Provider APIs.


Original Description:

Forked from Copilot DocsSync.

Download framework documentation and activate AI agent capabilities through context packs.

Why This Mattered (Historical Context)

This project was designed to help local AI models (TinyLlama, Phi-3, Qwen2.5) handle complex coding tasks by providing pre-digested, condensed documentation that fits within their limited context windows (4K-8K tokens). While modern cloud models have made this less critical, the architecture patterns here remain relevant for:

  • VS Code extension development
  • Multi-adapter system design
  • Tree Data Provider implementations
  • Webview integration patterns

What is a Context Pack?

A context pack is a self-contained knowledge bundle that:

  • Downloads framework documentation offline
  • Generates instructions that activate multiple agent capabilities
  • Works with any AI agent (OpenCode, Claude Code, GitHub Copilot)

Quick Start

npm install
npm run compile
# Press F5 to test in VS Code Extension Development Host

Architecture

src/
  extension.ts          - Entry point, command registration
  codebaseAnalyzer.ts   - Detect frameworks and patterns
  smartScanner.ts       - Intelligent documentation fetching
  contextPackService.ts - Orchestrate documentation sync
  scraperService.ts     - Web scraping (axios, cheerio)
  cacheService.ts       - Caching with 7-day TTL
  instructionsGenerator.ts - Generate agent instructions

packages/core/llm/      - LLM providers for relevance filtering
  llmProvider.interface.ts
  vscodeLmProvider.ts   - Claude Code, Copilot support
  opencodeLmProvider.ts - OpenCode support
  relevanceAnalyzer.ts  - Filter relevant docs

packages/adapters/      - Agent-specific integrations
  opencode.ts
  claude-code.ts
  github-copilot.ts

Supported Frameworks

Frontend: React, Vue.js, Angular, Next.js, Nuxt, Svelte, Astro, SolidJS, Qwik

Backend: Express, FastAPI, Django, Rails, Hono, NestJS, Fastify

ORM: Prisma, TypeORM, Sequelize, Drizzle, Kysely, SQLAlchemy

Auth: Auth0, Firebase Auth, NextAuth, Passport, Better Auth, Clerk, Lucia

CSS: TailwindCSS, Styled Components, Emotion, UnoCSS

Testing: Jest, Vitest, Mocha, Pytest, Cypress, Playwright, Testing Library

State: Redux, Zustand, MobX, Jotai, Signals

Forms: React Hook Form, Formik, Zod, Yup

UI: Shadcn UI, Radix UI, Headless UI, Mantine, Chakra UI, Ant Design, Vuetify

Multi-Agent Support

Agent Integration Priority
OpenCode Skill registration, OPENCODE_RUNTIME 5
Claude Code .claude/config.json, 200K tokens 10
GitHub Copilot .github/copilot-instructions.md 30

Auto-detection chooses the highest priority available agent.

Smart Scan

Analyzes your codebase and fetches only relevant documentation:

  1. Scans for dependencies, imports, patterns
  2. Uses LLM to score documentation relevance
  3. Downloads relevant sections only (reduces ~80% of unnecessary docs)

Custom Frameworks

Add custom frameworks that Smart Scan should detect and fetch docs for:

{
  "agent-contextpacks.customFrameworks": [
    {
      "name": "MyFramework",
      "docUrl": "https://myframework.dev/docs",
      "patterns": ["*.myfw", "myfw.config.js"],
      "keywords": ["my-framework", "@myorg/fw"]
    }
  ]
}

Detection methods:

  • keywords - Match in package.json dependencies
  • patterns - Match file names in workspace
  • keywords - Match in source file contents

Output Structure

.github/docs/
  <framework>/
    page1.md
    page2.md
    ...
  .cache/
    cache.json
agent-instructions.md

Configuration

{
  "agent-contextpacks.defaultOutputDirectory": ".github/docs",
  "agent-contextpacks.cacheExpiration": 24,
  "agent-contextpacks.maxPagesPerSite": 100
}

Development

npm run compile    # Build once
npm run watch      # Auto-recompile on changes
npm run lint       # Run ESLint
npm test           # Run tests (64 tests)

License

MIT License. See LICENSE file.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published