MCPInstall

inject

Load relevant .agents context. Triggers: "inject context", "load .agents context", "pull decay-ranked prior knowledge".

Installs
983
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/boshu2/agentops --skill inject
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads inject automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

RETIRED CLI (memory-moat removal Phase 1b, age-abev) — the ao inject CLI command was removed in Phase 1b; cm/cass + ao lookup own retrieval now. Use ao lookup --query "topic" for on-demand learnings retrieval and phase-scoped context packets. This skill survives only as a manual-retrieval / knowledge-activation adapter routed onto ao lookup + the ao knowledge family; it is not the canonical context path and is not called from default hooks or other skills.

Inject Skill

Install & refresh (absorbed from using-agentops, ag-s43tg)

To update installed skills: re-run the install one-liner — bash <(curl -fsSL https://raw.githubusercontent.com/boshu2/agentops/main/scripts/install.sh). (There is no update skill; skill refresh is an install-script concern.)

On-demand knowledge retrieval. Not run automatically at startup (since ag-8km).

It is read-only: it only reads knowledge for injection and never writes to .agents/.

Load relevant prior knowledge into the current session as a legacy adapter.

Lease

FieldValue
Leaseretire-candidate
Replacement portretrieve_context / assemble_context
Replacement adaptersao lookup, knowledge brief artifacts
Current allowed usemanual compatibility lookup only
Not alloweddefault startup injection, hidden hook delivery, task planning

Folded triggers (ag-s43tg wave 1): session-bootstrap + using-agentops route here

  • session-bootstrap → ao session bootstrap. The Universal AgentOps init prompt for starting or onboarding a fresh agent session is the ao session bootstrap orientation report — run it first, then pull decay-ranked context on demand with ao lookup.
  • using-agentops → this skill (skill dir removed; embedded CLI copy retired with it). Use when asked to Explain AgentOps workflows: start with ao session bootstrap for orientation, then walk the on-demand surfaces here (ao lookup, ao knowledge brief) for the workflow tour.

Claude Code skill orchestration default is /skill chaining. Terminal CLI commands are compatibility adapters unless a workflow explicitly names the CLI as the execution surface.

How It Works

In the default hookless startup path, no startup injection occurs. Run ao session bootstrap for the standard orientation report, then pull context on demand with ao lookup. The /inject trigger is a legacy alias that routes to ao lookup.

On-demand retrieval is ao lookup:

ao lookup --query "<topic>" --limit 5     # top matches by relevance
ao lookup --bead <bead-id>                # learnings from a bead's lineage
ao lookup <artifact-id>                    # one artifact by ID

ao lookup searches the learnings / patterns / sessions corpus and returns a bounded, recency-weighted summary. (The legacy ao inject CLI — token-budgeted markdown injection, --predecessor handoff context, SessionStart-hook delivery — was retired in Phase 1b; ao session bootstrap + ao lookup cover orientation and on-demand retrieval.)

Manual Execution

Given /inject [topic]:

Step 1: Search for Relevant Knowledge

With ao CLI:

ao lookup --query "<topic>" --limit 5

Without ao CLI, search manually:

# Global operating memory
sed -n '1,120p' ~/.agents/MEMORY.md 2>/dev/null

# Recent learnings
ls -lt .agents/learnings/ | head -5

# Recent patterns
ls -lt .agents/patterns/ | head -5

# Recent research
ls -lt .agents/research/ | head -5

# Global learnings (cross-repo knowledge)
ls -lt ~/.agents/learnings/ 2>/dev/null | head -5

# Global patterns (cross-repo patterns)
ls -lt ~/.agents/patterns/ 2>/dev/null | head -5

# Legacy patterns (read-only fallback, no new writes)
ls -lt ~/.claude/patterns/ 2>/dev/null | head -5

Step 2: Read Relevant Files

Use the Read tool to load the most relevant artifacts based on topic.

Step 3: Summarize for Context

Present the injected knowledge:

  • Global principles or constraints that apply everywhere
  • Key learnings relevant to current work
  • Patterns that may apply
  • Recent research on related topics

Step 4: Record Citations (Feedback Loop)

After presenting injected knowledge, record which files were injected for the feedback loop:

mkdir -p .agents/ao
# Record each injected learning file as a citation
for injected_file in <list of files that were read and presented>; do
  echo "{\"artifact_path\": \"$injected_file\", \"cited_at\": \"$(date -Iseconds)\", \"session_id\": \"$(date +%Y-%m-%d)\", \"workspace_path\": \"$PWD\"}" >> .agents/ao/citations.jsonl
done

Citation tracking enables the feedback loop: learnings that are frequently cited get confidence boosts during /post-mortem, while uncited learnings decay faster.

Knowledge Sources

SourceLocationPriorityWeight
Global Memory~/.agents/MEMORY.mdHighest1.0
Learnings.agents/learnings/High1.0
Patterns.agents/patterns/High1.0
Global Learnings~/.agents/learnings/High0.8 (configurable)
Global Patterns~/.agents/patterns/High0.8 (configurable)
Research.agents/research/Medium—
Retros.agents/learnings/Medium—
Legacy Patterns~/.claude/patterns/Low0.6 (read-only, no new writes)

Decay Model

Knowledge relevance decays over time (~17%/week). More recent learnings are weighted higher.

Key Rules

  • Does not run automatically - default context delivery is explicit
  • Context-aware - filters by current directory/topic
  • Token-budgeted - respects max-tokens limit
  • Recency-weighted - newer knowledge prioritized

Examples

Manual Context Injection

User says: /inject authentication or "recall knowledge about auth"

What happens:

  1. Agent calls ao lookup --query "authentication" --limit 5
  2. CLI filters artifacts by topic relevance
  3. Agent reads top-ranked learnings and patterns
  4. Agent summarizes injected knowledge for current work
  5. Agent references artifact paths for deeper exploration

Result: Topic-specific knowledge retrieved and summarized, enabling faster context loading than full artifact reads.

Troubleshooting

ProblemCauseSolution
No knowledge injectedEmpty knowledge pools or ao CLI unavailableRun /post-mortem to seed pools; verify ao CLI installed
Irrelevant knowledgeTopic mismatch or stale artifacts dominateUse ao lookup --query "<topic>" to filter; prune stale artifacts
Too many resultsToo many high-relevance artifactsReduce ao lookup --limit or increase topic specificity
Decay too aggressiveRecent learnings not prioritizedCheck artifact modification times (recency-weighted scoring is applied automatically)

Knowledge Activation (merged from knowledge-activation, cp-auc)

inject and ao lookup retrieve knowledge for the current session. Activation is the complementary capability — folded in here from the former knowledge-activation skill — that operationalizes a mature .agents corpus into durable operator surfaces (beliefs, playbooks, briefings, gaps). Where inject reads, activation promotes; the two are the read and write-to-surface halves of the same flywheel. Activation is the fourth step of the global-corpus workflow:

  1. $curate --mode=harvest — gather artifacts from many rigs into ~/.agents/learnings/
  2. $compile — synthesize raw artifacts into .agents/compiled/
  3. (optional) $curate --mode=dream overnight — bounded compounding loop
  4. knowledge activation — lift compiled knowledge into playbooks, beliefs, and runtime briefings

$compile remains the hygiene loop; activation owns corpus operationalization. Use it when the problem is no longer "capture more knowledge" but: promote the strongest recurring claims into a belief system, turn healthy topics into reusable playbooks, compile a small goal-time briefing, and surface thin topics and promotion gaps before they calcify.

Command Contract

The stable product surface is the ao knowledge command family:

ao knowledge activate --goal "turn agents into usable information"  # full outer loop
ao knowledge beliefs                                                # refresh belief book only
ao knowledge playbooks                                              # refresh candidate playbooks
ao knowledge brief --goal "fix auth startup"                       # goal-time briefing
ao knowledge gaps                                                   # thin topics, promotion gaps, weak claims, next work

ao owns the belief/playbook/brief/gap product surfaces directly; the skill owns routing, sequencing, interpretation, and next-step recommendations. ao lookup and ao codex start consume these outputs as operator context — matched briefings are the preferred dynamic startup surface, while selected beliefs and healthy playbooks provide bounded supporting guidance. When a retrieved briefing, belief, or playbook changes a recommendation, record it with ao metrics cite "<path>" --type applied 2>/dev/null || true (use --type retrieved for loaded-but-unused context).

Activation Steps

  1. Preflight — verify .agents/ exists. To run ao knowledge activate, verify at least one evidence substrate is present: packet builders (source_manifest_build.py, topic_packet_build.py, corpus_packet_promote.py, knowledge_chunk_build.py) under .agents/scripts/; or the harvest fallback .agents/harvest/latest.json; or the native operator surfaces (ao knowledge beliefs|playbooks|brief|gaps).
  2. Consolidate evidence — run packet layers in order: source manifests → topic packets → promoted packets → historical chunk bundles. See references/knowledge-activation-dag.md for the full DAG and its trust gates.
  3. Distill operator surfaces — ao knowledge beliefs then ao knowledge playbooks materialize consumer surfaces under .agents/knowledge/ and .agents/playbooks/.
  4. Compile a goal-time briefing — when there is an active objective: ao knowledge brief --goal "...". Keep it small, cite source surfaces, warn when a selected topic is thin.
  5. Surface gaps — ao knowledge gaps reports thin topics, missing promotions, weak claims needing review, and the next recommended mining work.
  6. Full outer loop — ao knowledge activate --goal "..." sequences evidence consolidation, belief/playbook refresh, optional briefing compilation, and a gap summary in one pass.

Activation Trust Rules

  • packetization is substrate, not the product
  • beliefs, playbooks, and briefings are the real operator surfaces
  • thin topics stay discovery-only until evidence improves
  • every generated surface should name its consumer
  • repeated unchanged runs should stay structurally deterministic

Activation Output Surfaces

Consumer-facing outputs: .agents/knowledge/book-of-beliefs.md, .agents/playbooks/index.md, .agents/playbooks/<topic>.md, .agents/briefings/YYYY-MM-DD-<goal>.md, .agents/retro/. Substrate surfaces: .agents/packets/, .agents/topics/, .agents/packets/chunks/catalog.jsonl. See references/knowledge-activation-output-surfaces.md and references/knowledge-activation-script-contracts.md for trust boundaries and the builder inventory.

Reference Documents

  • references/knowledge-activation.feature — Executable spec: consolidate evidence, distill beliefs/playbooks, compile goal-time briefing, surface gaps (soc-qk4b)
  • references/knowledge-activation-dag.md — DAG and trust gates for evidence consolidation
  • references/knowledge-activation-output-surfaces.md — canonical activation output surfaces and trust boundaries
  • references/knowledge-activation-script-contracts.md — builder inventory and ao knowledge command ownership

FAQ

What does the inject skill do?

Load relevant .agents context. Triggers: "inject context", "load .agents context", "pull decay-ranked prior knowledge".

How do I install inject?

Run npx skills add https://github.com/boshu2/agentops --skill inject in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/inject/ (personal) or .claude/skills/inject/ (project).

Which AI agents can use inject?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is inject safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains inject?

It is published by boshu2 in boshu2/agentops. It has 983 recorded installs.

More from boshu2/agentops

View all →

council

boshu2/agentops

Compare independent opinions from several models or contexts without inflating agreement. Use when: wanting a second opinion or debate, or summarizing several reviewers' results.

3K installs

doc

boshu2/agentops

Write source-checked docs, READMEs, change descriptions and handoffs. Use when: documenting a change, leaving or resuming a handoff, or drafting a questionnaire for someone else.

research

boshu2/agentops

Answer one cited question on code, history, claims or patterns. Use when: asked how it works, why it changed, if a claim or done/shipped report holds, or a pattern warrants a rule.

plan

boshu2/agentops

Shape a request into one end-to-end slice with observable behavior; review write scope and reversible decisions. Use when: planning, breaking down or scoping a change.

swarm

boshu2/agentops

Dispatch explicit disjoint packets exactly once through a caller-selected executor. Triggers: "swarm", "dispatch disjoint packets", "parallel explicit tasks".

1.5K installs

rpi

boshu2/agentops

Drive one accepted change through implementation and checks to done, with one fresh review only where a mistake is costly. Use when: asked to run or orchestrate work through RPI.

Popular other skills

View category →

hyperframes-cli

heygen-com/hyperframes

The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.

1.3M installs

triage

mattpocock/skills

Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

1M installs

ask-matt

mattpocock/skills

Ask which skill or flow fits your situation. A router over the skills in this repo.

778.4K installs

to-questionnaire

mattpocock/skills

Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

508.9K installs

wait-what

mattpocock/skills

Stop. That last message did not land: re-pitch it.

459.7K installs

loop-me

mattpocock/skills

Grill me about specs for the workflows I want to build, within this workspace.

447.9K installs