Context gather

From rjmurillo/ai-agents · View interactive version

Context gather is an AI agent skill from the GitHub repository rjmurillo/ai-agents. Gather comprehensive context from Serena memory, Context7 docs, DeepWiki, and web sources before planning or implementation. Searches across all knowledge tiers and returns a focused summary ending in a CONTEXT_LOADED marker that this skill scans to skip a repeat fetch in the same conversation. Use

How to use this skill

Skill file

Context Gather

Collect multi-source context before planning or implementation. Searches Serena, Context7, DeepWiki, and web sources, then returns a focused summary. The closing CONTEXT_LOADED: marker is read only by this skill's own Phase 1 scan, which skips a repeat fetch for the same topic in one conversation.

Model choice (behavior change from prior /context-gather slash command): this skill's frontmatter carries no model field, so it inherits the harness default rather than the slash command's pinned opus. Context retrieval is search-and-synthesis work, not deep reasoning. Skill behavior is otherwise unchanged.

Triggers

| Phrase | Context |

|--------|---------|

| gather context for | User requests pre-work context collection |

| context-gather | Direct skill invocation, or autoplan routing an unfamiliar topic here before research (SPEC-005) |

| what do we know about | Exploratory context retrieval |

Quick Reference

| Field | Value |

|-------|-------|

| Input | Task description or technology topic (free text) |

| Output | Focused summary with code snippets, architectural insights, and CONTEXT_LOADED: <topic> marker |

| Quality Gate | Summary addresses the stated topic; at least one queried tier reconciled (short-circuit and early-stop exempt); marker line present |

When to Use

Use this skill when:

When to Skip

Skip this skill when:

Process

Phase 1: Check for Prior Invocation

  1. Scan the current conversation for an existing CONTEXT_LOADED: marker line.
  2. If a marker exists whose topic matches the current request, report "Context already loaded for <topic>" and stop. Do not re-fetch.

Phase 2: Search Across Knowledge Tiers

Follow references/context-retrieval.md for

the source-priority strategy, the untrusted-content guard, and the synthesis and

citation discipline.

  1. Search the following tiers, in parallel where possible:
  1. Stop early once the queried tiers give sufficient coverage for the request.
  2. For each tier actually queried, emit a marker line:
TIER_QUERIED: <tier>

Where <tier> is one of: serena, context7, deepwiki, web. Emit one TIER_QUERIED: line per tier actually queried.

Phase 3: Synthesize, Emit Marker, and Return

  1. Combine findings into a focused summary. Include:
  1. Emit the marker line at the end of the summary output:
CONTEXT_LOADED: <topic>

Where <topic> is a short, normalized label for the subject (e.g., pytest-fixtures, session-protocol, react-server-components).

  1. Return the summary and marker to the calling skill or user. Only this skill's Phase 1 scan reads the marker; no other skill checks it.

Extension Points

  1. Additional knowledge tiers: new MCP servers (e.g., a future code-search server) slot into Phase 2 without changing the skill structure.
  2. Marker protocol: the CONTEXT_LOADED: format can be extended with metadata (e.g., CONTEXT_LOADED: <topic> [tier=serena,context7]) to convey which sources were queried.

Tools

This skill searches the knowledge tiers using:

Anti-Patterns

| Avoid | Why | Instead |

|-------|-----|---------|

| Re-fetching when marker exists | Wastes tokens and time; duplicates context | Check for CONTEXT_LOADED: marker first |

| Querying all sources sequentially | Slow; unnecessary when early sources suffice | Query in parallel; stop early if coverage is sufficient |

| Returning raw tool output | Floods context window; not actionable | Synthesize into a focused summary with citations |

| Skipping the marker emission | A repeat invocation in the same conversation cannot detect the prior fetch | Always emit CONTEXT_LOADED: <topic> at the end |

| Using opus model for retrieval | Context gathering is search and synthesis, not deep reasoning | Use sonnet (cost-appropriate) |

Verification

After execution, confirm:

References

| Artifact | Relationship |

|----------|-------------|

| SPEC-005 REQ-005 | Acceptance criteria AC-12 defines runtime-conditional skip via CONTEXT_LOADED: marker |

| SPEC-005 DESIGN-005 | Historical design for per-command preflight wiring; ADR-064 retired the commands, so no current skill checks the marker |

| .claude/skills/steering-matcher/SKILL.md | Sibling preflight skill in the /build chain |

| .claude/skills/chestertons-fence/SKILL.md | Sibling preflight skill in the /build chain |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.