Gather Context
ASecurityGather and save verified context before planning, implementation or review. Resolve the target (a GitHub issue, a pull request, a branch, a URL or a free-text task), read the primary sources and their linked evidence, record contradictions, and write a neutral CONTEXT.md that other workflows can use again. Use it before work on an issue or a PR when nobody gathered its context yet, for "gather context", "research this issue", "research this PR" or "verify requirements", and as the context ste...
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added November 29, 2026
Works with
Security analysis
100/100Pro scans all 3 files and shows the line behind each finding
npx -y skills add bradennapier/intellagents --skill gather-context --agent claude-codeAre you the author of Gather Context?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/bradennapier-gather-context)---
name: gather-context
description: Gather and save verified context before planning, implementation or review. Resolve the target (a GitHub issue, a pull request, a branch, a URL or a free-text task), read the primary sources and their linked evidence, record contradictions, and write a neutral CONTEXT.md that other workflows can use again. Use it before work on an issue or a PR when nobody gathered its context yet, for "gather context", "research this issue", "research this PR" or "verify requirements", and as the context step of superspec, superspec-mini and simplespec.
allowed-tools:
- Bash(${CLAUDE_SKILL_DIR}/scripts/spec-root.sh)
---
# gather-context: verified context before action
Gather the evidence that another workflow needs to plan, implement or review work correctly. Save
it once as a neutral `CONTEXT.md` that others can use again. Do not turn it into a plan, a spec, a
review or a code change. The caller decides what happens next.
Keep identifiers, paths, timestamps and links exactly as the sources write them.
Load the `asd-ste100` skill before you write `CONTEXT.md`.
## Input and output contract
Accept one primary target, plus any seed links or caller context:
- A GitHub issue number or URL
- A GitHub pull request number or URL, or a branch
- A free-text task or incident description
- A documentation URL or another public URL
If the caller gives an artifact path, write there. The spec skills give
`<spec-root>/<spec-name>/00-CONTEXT.md`. Use that exact path. Otherwise write:
```text
<spec-root>/<target-slug>/CONTEXT.md
```
`<target-slug>` is the branch name minus a `feat/`-style prefix, with each other `/` changed to `-`.
When there is no branch, use a slug of the issue, the PR or the task (for example
`issue-42-session-search`).
`<spec-root>` is:
!`${CLAUDE_SKILL_DIR}/scripts/spec-root.sh`
The line above ran in the folder where the session started. Run the script again when you work in
another worktree, or when the line shows a command and not a path. Make the worktree your current
folder, and run `bash <folder of this skill>/scripts/spec-root.sh`. Use only its latest output.
The script prints `docs/specs` in the repository root when it is a real folder and git ignores no
spec file in it. Otherwise (`docs/specs` is missing, is a symlink, or git ignores spec files in it),
the script prints `~/.superspec/projects/<repository name>/specs`, outside the repository. Read and write by that
absolute path.
**When `<spec-root>` is inside the repository, the artifact can become public.** The spec skills
commit it with the work. Follow `docs/specs/README.md`.
Use [references/context-template.md](references/context-template.md). If the artifact already
exists, read it first, refresh old evidence, keep clearly marked human notes, and update the
generated date and the source revisions.
Return the artifact path, the sources that you verified and the sources that were not available,
the blockers, the number of open questions, and a one-line readiness verdict. Callers read the
artifact. They do not gather the same context again.
## Hard rules
- Stay read-only in GitHub and in every other system. Never comment, react, label, close, edit,
approve or merge.
- Write only the requested `CONTEXT.md`. Do not change product code, specs, PR descriptions or
issues.
- Never treat a source that you could not open as empty. Record it as `unavailable`, with the
reason and what stays uncertain.
- Never invent a resolution for a contradiction, and never resolve one silently. Record the
competing claims with their sources.
- Keep secrets, credentials, tokens, setup links, personal data, real session content and private
URLs out of the artifact. Use invented data for examples. Prefer conclusions to raw data.
- Do not start a dev server only to gather context.
- Ask only when the target is missing. Put all other uncertainties in the artifact.
## Workflow
### 0. Resolve the target and its consumers
1. Identify the type of the target, its canonical URL or identifier, and the caller that will use
the result (for example `superspec`, `simplespec`, a review, or a person).
2. For a PR, read its metadata, body, commits, changed files, comments, reviews, branch, base, and
linked issues. For a branch, compare it with `origin/main` (in a fork, with the upstream main
branch), never with an old local `main`.
3. For an issue, read it directly. For free text, search the issues and the PRs of the repository,
and say why a match is a confident match. If no record matches, keep the request itself as the
target.
4. If there is no usable target, ask once for an issue, a PR, a URL, a branch or a task
description.
5. Start a source ledger: for each source, its URL or id, its author, its timestamp or revision,
and its status: `verified`, `not found`, `unavailable`, `not applicable` or `pending`.
### 1. Read the primary sources
These reads are independent. Run them at the same time when your tools allow it, then reconcile
them before you explore code.
#### GitHub
- Issue: `gh issue view <n> --comments`. Read the description, the labels, the milestone, the
assignees, the linked PRs and each comment.
- PR: `gh pr view <n> --comments`, `gh pr diff <n> --name-only`, and the review comments
(`gh api repos/<owner>/<repo>/pulls/<n>/comments`). Do not repeat review findings that already
exist.
- Treat comments as possible scope changes, not footnotes. Record decisions, disagreements, edits
to the acceptance criteria, owners and statements that replace the description.
- Find the issue of a branch in this order: the branch name, the PR title, the PR body, then the
commit messages.
- Search earlier PRs and commits by issue number and by distinctive terms when they can show an
established pattern, an approach that failed, or a constraint on the rollout.
- Read each spec folder in `<spec-root>` that matches the target.
#### Other trackers and discussion tools
Read a linked tracker, chat thread or document only with a read-only tool that is connected. When
no tool can open it, mark it `unavailable`. Do not report that no discussion exists.
### 2. Follow the evidence
Keep a link queue. Start it from the request, the issue, the PR, the specs and the repository docs.
Continue until no relevant unvisited link remains.
For each relevant link:
1. Record where you found it and why it can matter.
2. Read it with the best read-only tool that you have. For a web page, read the page itself, not
the search snippet.
3. Add the substantive links inside it to the queue.
4. Record the result, or the exact access failure, in the link ledger, with the status `read`,
`unavailable`, `irrelevant` or `pending`.
5. Prevent loops by canonical URL or id. Skip links that have no relation to the target, and
explain a skip that is not obvious.
If you cannot open a protected link, state what linked to it and why it matters. Ask the user for a
safe excerpt when it can change the result. Do not skip it silently.
### 3. Data evidence
When a fact about stored data would confirm or reject a requirement, an edge case, a migration
assumption or a bug hypothesis, get it from invented data: a test, a test fixture, or the demo
install (in this repository, `./intellagents demo`). Never read, query or copy the real history of
a person. Record the test, the fixture or the steps, and the limits of the result.
### 4. Load the repository context
Before you analyze what the target means for the code, load the rules of the affected area:
1. The root `AGENTS.md` (Claude Code reads it as `CLAUDE.md`), `CONTRIBUTING.md`, and each nested
`AGENTS.md` or `CLAUDE.md` from each affected folder upward.
2. The docs in `docs/` that cover the affected area.
3. The descriptions of the skills in `.agents/skills/` that apply.
Record the rules that apply in the artifact, with the affected paths. Do not paste whole
instruction files. Record the enforceable rule and its source.
Then read enough real code to ground the context:
- the affected parts and their entry points
- the closest earlier implementation and its tests
- types, callers and data flow (with a language server when your agent has one)
- access checks, stored data, migrations, AI prompts and contracts between parts
- known conventions or load-bearing constraints that the next workflow must keep
Stop at evidence and impact. Do not write a full implementation plan, and do not judge a diff.
### 5. Reconcile the sources
Build one model of the problem only after you gathered all the evidence that you can reach.
- Separate facts, explicit decisions, reported symptoms, hypotheses and recommendations.
- Prefer explicit decisions of the people accountable for the project to the newest comment.
Prefer the current code and the current repository rules for facts about the implementation.
Do not let a newer casual comment silently replace an approved decision.
- For each contradiction, cite both sources, state the consequence, and classify it as a blocker or
an open question.
- Mark each acceptance criterion as `explicit` or `implied`, with its source.
- State what is in scope, what is out of scope, the dependencies, the owners, the deadlines and the
privacy constraints.
- Give a confidence level only from the quality and the coverage of the sources, never from how
well the text reads.
### 6. Save and hand back
Write `CONTEXT.md` from the template. Fill each section. Write `Not applicable` or `Not verified` in
place of an empty section. Do not delete it. Keep the artifact short enough for an agent to load.
Link to detailed sources. Do not paste raw dumps.
In the reply, report:
1. the target and a one-line objective
2. the artifact path
3. the verified, unavailable and pending sources
4. the blockers and the number of open questions
5. the verdict: `context complete`, `complete with caveats`, or `blocked on <source or decision>`
Do not continue into planning, implementation, review, posting or other changes unless the caller
explicitly asked for that next action.
## Relationship to other workflows
- `superspec`, `superspec-mini` and `simplespec` use the artifact as discovery input. They ask only
the decision questions that stay open, and they do not repeat verified reads.
- A review workflow can use the artifact before it reads the code, and add the context of the diff
without a second read of the primary sources.
Files in this skill
- SKILL.md
- references/context-template.md
- scripts/spec-root.sh
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.