context-intelligence-tool-design
Skill5 starsChanged 5 days agoMITView on GitHub
Use when selecting a detection strategy and implementation primitive for a context-intelligence signal. Classifies signals as deterministic, probabilistic, llm-evaluated, or hybrid, and applies the cheapest-sufficient-capability principle.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- context-intelligence-derived-metricsSkill
- context-intelligence-eval-designSkill
- context-intelligence-evaluation-methodologySkill
- context-intelligence-gdsSkill
- context-intelligence-graph-querySkill
- context-intelligence-hill-climbingSkill
- context-intelligence-server-data-opsSkill
- context-intelligence-session-navigationSkill
- context-intelligence-session-reconstructionSkill
- transcriptSkill
- workflow-pattern-analysisSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Treat as authoritative reference — do not duplicate.
- Distinctive: line 47
When the domain is specific enough, build a specialized tool that returns exactly what is needed — avoiding discovery round-trips and …
- Distinctive: line 53
Prefer progressive discovery + pagination/navigation over big upfront reads.
- Very specific: line 83
Read the signal entry from domain-signals.md — read only that entry, not the full file.
- Distinctive: line 146
If a signal cannot be classified due to ambiguity (missing definition, unspecified boundary, insufficient probe data):
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context Intelligence Tool Design
Phase 2 specialist skill, called by the context-intelligence-tool-designer agent via self-delegation with context_depth="none", scoped to one signal (or one logical batch of related signals) at a time.
Companion Reference
@context-intelligence:context/context-intelligence-primitives-reference.md
The companion contains:
- Primitive taxonomy
- Reduce-AI-dependency decision order
- Shared library + thin wrapper pattern
- Routing matrix roles
Treat as authoritative reference — do not duplicate.
Wrapper Form, Specialization & Progressive Discovery (R1–R3)
Design depth for how a chosen primitive is shaped. These are mode-only design guidance; they point to existing homes rather than restating them.
R1 — Wrapper form by consumer: module vs CLI
The shared-library → thin-wrapper pattern itself already has a home: it is the mode's
Standing Rule 3 (modes/context-intelligence.md). Do not restate that pattern — point to
Standing Rule 3. R1 adds only the new nuance: once you have a shared library, choose its
wrapper form by who consumes it:
- An agent consumes it → wrap the shared library as an Amplifier module (agent tool).
- A human or script consumes it → wrap it as a CLI (bash subcommand).
Same library, wrapper form chosen by consumer — module vs CLI is a consumer decision, not a default.
R2 — Exploit narrow-domain knowledge
When the domain is specific enough, build a specialized tool that returns exactly what is needed — avoiding discovery round-trips and bloated tool responses. A narrow, purpose-built result beats a general query the caller must post-process.
R3 — Progressive over upfront
Prefer progressive discovery + pagination/navigation over big upfront reads. The operational
rules for this (probe-first, ≤3-strategy ladder, head-limited extraction, summarize-and-discard,
the call budget) live in the authoritative discipline file — open it on demand:
context-intelligence:context/navigation-budget-discipline.md. Do not rephrase those rules
here.
Guard — event semantics: Do not restate the event-semantics authority principle here. It is named once in
context-intelligence:context/context-intelligence-strategy.md— reference it there.
Scope
In Scope
- Classify detection strategy for a signal (deterministic / probabilistic / llm-evaluated / hybrid)
- Select the correct Amplifier primitive for the signal
- Populate the five enrichment fields:
detection_strategy,detection_notes,ai_dependency,reasoning_requirement,suggested_primitive
Out of Scope
- Investigating signals
- Refining concept definitions
- Designing evaluation scenarios
Anything that cannot be classified due to a vague concept → return a structured gap entry, do not investigate.
Per-Signal Classification Process
Step 1: Read the Signal Entry
Read the signal entry from domain-signals.md — read only that entry, not the full file.
Step 2: Apply Detection Strategy Tier Decision
Apply detection strategy tier decision in the following exact order:
Deterministic first — event structure parsing only:
- Event type presence
- Field value match
- Count threshold
- Time window
- Sequence
Probabilistic second — pattern matching + thresholds:
- Regex
- Ratio
- Shape
- Size threshold
LLM-evaluated only if neither deterministic nor probabilistic works. Before committing to pure LLM-evaluated, ask whether deterministic feature extraction can narrow scope. If yes → choose hybrid.
Step 3: Shared Library + Thin Wrapper (Deterministic / Probabilistic)
For deterministic or probabilistic signals, specify three surfaces of the shared library + thin wrapper pattern:
- Shared library function:
context_intelligence/{signal_name}.py - Thin module wrapper:
modules/tool-{signal-name}/ - CLI subcommand:
scripts/context-intelligence.py --{subcommand-name}
Step 4: LLM Signal Declaration (LLM-evaluated / Hybrid)
For LLM-evaluated or hybrid signals:
- Declare
reasoning_requirementusing routing matrix:fast/general/reasoning/coding - Specify the corresponding
model_rolein the artifact recommendation - For hybrid signals: deterministic feature extraction lives in the shared library; the classification call is LLM-dependent
Step 5: Populate suggested_primitive
Populate suggested_primitive with a complete implementation path:
- Code-based signals: concrete file paths
- LLM-based signals: artifact shape (skill / agent with
model_role/ recipe step)
Detection Strategy Decision Table
| Strategy | Definition | Code Pattern |
| Deterministic | Event structure parsing only — no ML, no thresholds, no regex | Field access, type check, count compare, time diff, sequence match |
| Probabilistic | Pattern matching + configurable thresholds — regex, ratio, shape, size | re.match, ratio calc, size compare, configurable threshold |
| LLM-evaluated | Requires language understanding, semantic judgment, or rubric evaluation | Skill or agent call with model_role declaration |
| Hybrid | Deterministic feature extraction narrows scope, then LLM classifies | Shared lib extracts features; LLM call receives structured input |
Output Format
The following fields are ready to write into domain-signals.md:
detection_strategy— one of:deterministic/probabilistic/llm-evaluated/hybriddetection_notes— brief rationale for the chosen strategyai_dependency—none|low|medium|highreasoning_requirement— routing matrix role:fast/general/reasoning/coding(omit for deterministic/probabilistic)suggested_primitive— complete implementation path or artifact shape
Gap Handling
If a signal cannot be classified due to ambiguity (missing definition, unspecified boundary, insufficient probe data):
DO NOT investigate or guess.
Return a structured gap entry as a Markdown section in your result:
## Gap [N] — [status: open | resolved]
Concept: [name]
Gap type: missing-signal | ambiguous-definition | insufficient-data
Question: [specific question for facilitator]
Blocks: [signal name] | additive
Resolution: [filled when resolved]The tool-designer appends the gap entry to signal-gaps.md and continues with other signals. Gaps never block progress.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

