# Context Discovery

Use when coding standards, security patterns, or project conventions need to be...

- Repository: https://github.com/darrenhinde/OpenAgentsControl (4967 stars)
- Category: Security
- License: MIT
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add darrenhinde/OpenAgentsControl --skill context-discovery -g -a claude-code -y`
Codex: `npx skills add darrenhinde/OpenAgentsControl --skill context-discovery -g -a codex -y`
Cursor: `npx skills add darrenhinde/OpenAgentsControl --skill context-discovery -g -a cursor -y`
Gemini CLI: `npx skills add darrenhinde/OpenAgentsControl --skill context-discovery -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add darrenhinde/OpenAgentsControl`

## Description

Use when coding standards, security patterns, or project conventions need to be discovered before implementation begins.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Context Discovery

## Overview
Discover project standards and patterns before implementing features. Context-scout resolves the context root using the [OAC Context Discovery Protocol](./context-discovery-protocol.md), then finds and ranks relevant files based on your request.

**Announce at start:** "I'm using the context-discovery skill to find relevant standards for [feature/task]."

## The Process

### Step 1: Invoke Context-Scout

Run the skill with your implementation topic:

```bash
/context-discovery [what you're implementing]
```

**Examples:**
- `/context-discovery JWT authentication`
- `/context-discovery React form validation`
- `/context-discovery database migration workflow`

### Step 2: Load Critical Priority Files

Read EVERY file marked **Critical Priority** (paths returned by context-scout, relative to the resolved context root):

```bash
Read: {context_root}/core/standards/code-quality.md
Read: {context_root}/core/standards/security-patterns.md
```

These are **mandatory**, proceed only after loading.

### Step 3: Load High Priority Files

Read files marked **High Priority**:

```bash
Read: {context_root}/core/workflows/approval-gates.md
```

These are **strongly recommended** for your implementation.

### Step 4: Load Medium Priority (If Needed)

Read **Medium Priority** files for additional context:

```bash
Read: {context_root}/project-intelligence/architecture.md
```

These are **optional but helpful**.

### Step 5: Apply to Implementation

- Follow standards from loaded files
- Apply patterns to your code
- Use naming conventions discovered
- Check workflows before executing

## Delegation Pattern

When invoking subagents, pass discovered context files:

```markdown
Invoke coder-agent:

Task: Implement JWT service

Context to load:
- .opencode/context/core/standards/code-quality.md
- .opencode/context/core/standards/security-patterns.md

Instructions: Follow functional patterns and security best practices.
```

## Error Handling

The rest: https://github.com/darrenhinde/OpenAgentsControl/blob/HEAD/plugins/claude-code/skills/context-discovery/SKILL.md
