Help us improve
Share bugs, ideas, or general feedback.
From context-engineering
Phase 1-3: Define the problem, collect context candidates, and select only what is needed. The first stage of the 7-Phase Context Engineering pipeline. Keywords: problem definition, context collection, selection, relevance, recency, reliability
npx claudepluginhub seokrae/context-engineering --plugin context-engineeringHow this skill is triggered — by the user, by Claude, or both
Slash command
/context-engineering:gatherThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
The starting point of context engineering. Clarify user intent, collect candidates from relevant sources, and select only what is needed.
Guides technical evaluation of code review feedback: read fully, restate for understanding, verify against codebase, respond with reasoning or pushback before implementing.
Share bugs, ideas, or general feedback.
The starting point of context engineering. Clarify user intent, collect candidates from relevant sources, and select only what is needed.
Purpose: Clarify what the user wants from the AI. This becomes the baseline for all subsequent Phases.
Ask in purpose → constraints → success criteria order, one at a time, using multiple-choice format when possible.
Question 1 (purpose — confirming the Task):
"What is the problem you are trying to solve right now?"
Question 2 (constraints — confirming Phase 2 sources + Constraints):
"What background information would the AI need to do this task well? (e.g., existing code, documentation, prior decisions)"
Question 3 (success criteria — confirming Output Format):
"What form should the output take? (e.g., execution instruction, saved note, project documentation)"
Additional question: Permitted only once if ambiguity remains unresolved after the 3 questions. No more than 4 questions total.
A processing step automatically performed by the AI after collecting answers to the 3 questions (not an additional question):
A. Problem scope reduction
B. Source scope declaration
C. Output Session Scope declaration block
--- Session Scope ---
Minimum problem: {reduced purpose}
Must-have sources: {list}
Nice-to-have sources: {list}
Excluded: {explicitly out of scope}
Automatically infer the role the AI should take from the three answers. Do not ask the user directly about the role.
The AI automatically evaluates the following criteria:
| Criterion | Evaluation |
|---|---|
| purpose clear | Is the problem to be solved specifically defined? |
| constraints clear | Is the scope of background information needed understood? |
| success criteria clear | Is the form of the output confirmed? |
| Role inferable | Can the AI's role be inferred from the three answers? |
| scope reduction complete | Has the Session Scope declaration block been generated? |
Auto-pass: Criteria clearly met → proceed to Phase 2
User confirmation (when ambiguous or unmet):
Phase 1 result: {summary}
Unmet items: {item name} — {reason}
Please revise or approve to continue.
After G1 passes, record in _phase1-result.md to prevent loss during context compaction:
--- Phase 1 Result ---
purpose: {confirmed purpose}
constraints: {confirmed constraints}
success criteria: {confirmed success criteria}
Role: {inferred role}
scope-declaration: {session scope declaration block}
At the start of Phase 2, if Phase 1 results are absent from the conversation context, restore from _phase1-result.md.
Delete after pipeline completion (G6 pass or G7 pass).
Purpose: Determine sources based on Phase 1 answers and collect candidate context.
Collect Must-have sources from Phase 1 Session Scope declaration first, then add Nice-to-have sources when budget allows.
Determine sources from the constraints answer signals in Phase 1:
| Phase 1 Signal | Collection Source |
|---|---|
| Document / file / URL provided | Read full text of that file / fetch URL |
| Project / codebase mentioned | Explore codebase, existing spec, CLAUDE.md |
| "저장해줘" (save it) / user data input | Full text of the input |
| Question / task request | Scan KB index.md → read matching entries |
| Composite (multiple signals mixed) | Combine above sources — run sub-agents in parallel |
Strategy classification (RAG / Memory / Tool Result / System Prompt) → Context Source Strategy
Check KB existence:
index.md file path (use the configured KB path if set, otherwise scan common locations)index.md does not exist:
index.md exists → execute the 4 KB search steps below:When finding candidates in KB index.md, search in the following order:
tags field of matched entries and add other entries with the same tags as candidatesrelated field of matched entries to add linked entries as candidatesreliability: highIf search results exceed 5, filter in Phase 3.
For project/codebase sources, dynamically check the latest state at collection time:
git log --oneline -5find . -name "*.md" -maxdepth 2 -not -path "./.git/*"head -20 package.json or head -20 build.gradle (if the file exists)Include results in candidate context to use as a basis for Phase 3 Keep/Skip decisions.
The AI automatically evaluates the following criteria:
| Criterion | Evaluation |
|---|---|
| Source completeness | Have all sources needed to achieve Phase 1 purpose been collected? |
| No obvious omissions | Are all materials mentioned in the constraints answer included? |
Auto-pass: Criteria clearly met → proceed to Phase 3
User confirmation (when omissions are suspected):
Phase 2 result: {summary}
Collected sources: {source list}
Unmet items: {item} — Is this source also needed?
Please revise or approve to continue.
Purpose: Retain only what is actually needed for Phase 1 purpose from the collected candidates.
| Criterion | Description |
|---|---|
| Relevance | Is it directly connected to Phase 1 purpose? |
| Recency | If more recent information exists, replace older content |
| Reliability/Confidence | Quality of the source (direct statement > official docs > indirect reference) |
Classify each candidate item:
The AI automatically evaluates the following criteria:
| Criterion | Evaluation |
|---|---|
| Criteria applied consistently | Were Relevance, Recency, and Reliability applied equally to all items? |
| Skip reasons clear | Does each skipped item have a stated reason? |
| Keep items sufficient | Does Keep contain the information needed to achieve Phase 1 purpose? |
Auto-pass: Criteria clearly met → pass to build
User confirmation (when ambiguous or unmet):
Phase 3 result: {summary}
Keep: {N} Skip: {N} Merge: {N}
Unmet items: {item name} — {reason}
Please revise or approve to continue.
With gather artifacts (Phase 1 analysis + selected context set), proceed to the next stage:
/context-engineering:build — Phase 4-5 structuring and compression