Context Management

Your project depends on external services, APIs, and libraries. Context management gives agents structured knowledge about these dependencies so they make decisions based on real documentation, not training data.

Why this matters

When an Executor writes code that integrates with Stripe, or a Reviewer checks that your Auth0 flow follows best practices, they need current documentation. Without it, agents fall back on training data — which may be outdated, incomplete, or wrong for your specific version.

The context/ directory is a structured knowledge base that sits at your project root. Agents read it automatically during planning and execution.

The context directory

Each external system gets its own subdirectory with a consistent layout:

context/
├── README.md                     # Index of all external systems
├── stripe/
│   ├── docs/                     # API docs, webhook guides, specs
│   │   ├── api-reference.md
│   │   └── webhook-guide.md
│   └── code/                     # Git submodules, SDKs, samples
│       └── stripe-node/          # (git submodule)
├── auth0/
│   ├── docs/
│   │   └── oidc-flow.md
│   └── code/
└── internal-api/
    ├── docs/
    │   └── api-spec.md
    └── code/

Adding external systems

/uc:context-management add stripe

This creates the directory structure and asks what information to add — API docs, SDK submodule, configuration guides, or all of the above.

Documentation from URLs

When you provide a URL, the skill fetches key content via Ref.tools and saves it as structured markdown. No raw HTML dumps — it extracts and organizes the facts that matter.

/uc:context-management add auth0 OIDC flow documentation

Code references and SDKs

Add git submodules for SDKs and libraries your project depends on:

/uc:context-management add submodule https://github.com/stripe/stripe-node

Submodules land in context/{system}/code/ and can be updated later with /uc:context-management update submodules.

How agents use context

Context is not documentation. The context/ directory lives at the project root, separate from documentation/. It contains reference material about external systems — not your own specs, architecture, or standards. Think of it as "things we depend on" vs "things we build."

What to add

Good candidates for the context directory:

System typeWhat to includeExample
Payment providerAPI reference, webhook events, SDKStripe, PayPal
Auth providerOIDC/OAuth flows, token handling, SDKAuth0, Clerk, Supabase Auth
DatabaseQuery patterns, migration guides, ORM docsPrisma, Drizzle, Supabase
Internal APIOpenAPI spec, endpoint docs, auth schemeYour own microservices
Cloud servicesSDK docs, config patterns, IAM setupAWS, GCP, Cloudflare
Third-party APIsRate limits, response formats, error codesSendGrid, Twilio, OpenAI
File naming conventions
  • API references: api-reference.md, api-v2.md
  • Guides: {topic}-guide.md (e.g., webhook-guide.md)
  • Specs: {topic}-spec.md (e.g., openapi-spec.md)
  • Config: configuration.md, {topic}-config.md
  • Migration: migration-{from}-to-{to}.md

Keep files focused — one topic per file, under 200 lines. Include the source URL at the top of each file so agents know where the information came from.

Managing git submodules

Git submodules let you include external code repositories as references:

# Add a submodule
/uc:context-management add submodule https://github.com/stripe/stripe-node

# Update all submodules to latest
/uc:context-management update submodules

Submodules are added with your confirmation (they modify .gitmodules). They're useful for having SDK source code available locally so agents can read actual implementations, not just API docs.

Generating an overview

/uc:context-management summarize context

Scans all systems and regenerates context/README.md with a comprehensive index — what each system provides, what documentation is available, and what code references exist.