๐Ÿงถ Context Weaver โ€” Repo Onboarding Tour

A Cline-integrated VS Code extension that automatically scans a repository to extract the true onboarding context โ€” architecture, conventions, DB schema, environment variables, and "gotchas" โ€” then produces an interactive, editor-native guided tour.

Why?

Onboarding to a new codebase is painful. READMEs go stale, tribal knowledge lives in Slack threads, and new devs spend days figuring out what goes where. Context Weaver fixes this by reading the code itself โ€” not relying on docs that may be outdated.

What It Scans

Scanner What It Detects
Architecture Languages, frameworks, tools, runtime versions, directory structure, entry points
Conventions ESLint, Prettier, Biome, EditorConfig, Ruff, Black, test frameworks, git hooks, commitlint, import aliases, barrel exports
DB Schema Prisma, TypeORM, Sequelize, Mongoose, Drizzle, raw SQL migrations, seed files
Environment .env files, process.env / import.meta.env / os.environ references in code, Docker Compose env vars, secret detection
Gotchas Multiple lockfiles, missing .dockerignore, .env not gitignored, deprecated packages, hardcoded localhost, missing test scripts, HACK/FIXME annotations

Installation

# Clone the repo
git clone https://github.com/your-org/cline-context-weaver.git
cd cline-context-weaver

# Install dependencies
npm install

# Compile
npm run compile

Then press F5 in VS Code to launch the Extension Development Host.

Usage

1. Scan & Generate Tour

Open the Command Palette (Ctrl+Shift+P) and run:

Context Weaver: Scan Repo & Generate Onboarding Tour

This will:

  • Run all 5 scanners against your workspace
  • Generate a structured OnboardingContext JSON
  • Produce an interactive GuidedTour with step-by-step navigation
  • Export human-readable Markdown documents
  • Open the interactive tour in the sidebar

2. Open Existing Tour

Context Weaver: Open Onboarding Tour

Opens a previously generated tour from .context-weaver/guided-tour.json.

3. Export as Markdown

Context Weaver: Export Onboarding Context as Markdown

Generates .context-weaver/ONBOARDING.md โ€” a standalone document you can commit to your repo.

Output Files

All outputs are saved to .context-weaver/ in your workspace root:

File Purpose
onboarding-context.json Full structured context (machine-readable)
guided-tour.json Interactive tour steps (machine-readable)
ONBOARDING.md Human-readable onboarding document
TOUR.md Human-readable guided tour with TOC

Interactive Tour UI

The sidebar webview provides:

  • Section navigation โ€” jump between Overview, Architecture, Conventions, Database, Environment, Gotchas
  • Step-by-step progression โ€” with Previous/Next buttons and progress bar
  • File links โ€” click to open referenced files directly in the editor at the relevant line
  • Collapsible step list โ€” see all steps at a glance and jump to any one

Cline Integration

The .clinerules file at the project root instructs Cline to:

  1. Auto-load the onboarding context when it exists
  2. Ground answers in the detected stack, architecture, and conventions
  3. Follow conventions when generating code (formatting, imports, naming)
  4. Warn about gotchas proactively when changes touch affected areas
  5. Reference the correct ORM patterns when writing data layer code

For Your Own Repos

Copy the .clinerules pattern into any repo where you want Cline to leverage Context Weaver's output. After running a scan, Cline will automatically use .context-weaver/onboarding-context.json as grounding context.

Architecture

src/
โ”œโ”€โ”€ types.ts                    # Core type definitions
โ”œโ”€โ”€ extension.ts                # VS Code extension entry point
โ”œโ”€โ”€ contextAggregator.ts        # Orchestrates all scanners
โ”œโ”€โ”€ tourGenerator.ts            # Transforms context โ†’ guided tour
โ”œโ”€โ”€ markdownExporter.ts         # Exports context/tour as Markdown
โ”œโ”€โ”€ tourWebviewPanel.ts         # Interactive sidebar webview UI
โ””โ”€โ”€ scanners/
    โ”œโ”€โ”€ index.ts                # Scanner barrel exports
    โ”œโ”€โ”€ utils.ts                # Shared file I/O utilities
    โ”œโ”€โ”€ architectureScanner.ts  # Stack & directory detection
    โ”œโ”€โ”€ conventionScanner.ts    # Linting, formatting, git conventions
    โ”œโ”€โ”€ dbSchemaScanner.ts      # ORM, migrations, schema detection
    โ”œโ”€โ”€ envScanner.ts           # Environment variable detection
    โ””โ”€โ”€ gotchaScanner.ts        # Pitfall & warning detection

Contributing

  1. Each scanner is independent โ€” add new ones by implementing the Scanner<T> interface
  2. Add new gotcha detections in gotchaScanner.ts
  3. Extend framework detection in architectureScanner.ts by adding to FRAMEWORK_SIGNATURES

License

MIT

Built With

Share this project:

Updates