一键导入
inject
Inject relevant knowledge into session context from .agents/ artifacts. Triggers: "inject knowledge", "recall context", SessionStart hook.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Inject relevant knowledge into session context from .agents/ artifacts. Triggers: "inject knowledge", "recall context", SessionStart hook.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Process documents with the Nutrient DWS API. Use this skill when the user wants to convert documents (PDF, DOCX, XLSX, PPTX, HTML, images), extract text or tables from PDFs, OCR scanned documents, redact sensitive information (PII, SSN, emails, credit cards), add watermarks, digitally sign PDFs, fill PDF forms, or check API credit usage. Activates on keywords: PDF, document, convert, extract, OCR, redact, watermark, sign, merge, compress, form fill, document processing.
When the user wants to optimize images for search engines and performance. Also use when the user mentions "image SEO," "alt text," "image captions," "figcaption," "image optimization," "WebP," "lazy loading," "LCP," "image sitemap," "responsive images," "srcset," "image format," or "hero image optimization."
Diagnose and fix bugs with root-cause analysis and verification. Use when you have a concrete issue report, failing behavior, runtime error, or test regression that should be resolved safely. For ambiguous, high-risk, or broad-scope issues, stop and route to write-plan first.
Stores decisions and patterns in knowledge graph. Use when saving patterns, remembering outcomes, or recording decisions.
Unified decision tree for web research and competitive monitoring. Auto-selects WebFetch, Tavily, or agent-browser based on target site characteristics and available API keys. Includes competitor page tracking, snapshot diffing, and change alerting. Use when researching web content, scraping, extracting raw markdown, capturing documentation, or monitoring competitor changes.
Never test mock behavior. Never add test-only methods to production classes. Understand dependencies before mocking. Language-agnostic principles with TypeScript/Jest and Python/pytest examples.
| name | inject |
| description | Inject relevant knowledge into session context from .agents/ artifacts. Triggers: "inject knowledge", "recall context", SessionStart hook. |
| skill_api_version | 1 |
| user-invocable | false |
| metadata | {"tier":"background","dependencies":[],"internal":true} |
DEPRECATED (removal target: v3.0.0) — Use
ao lookup --query "topic"for on-demand learnings retrieval, or see.agents/AGENTS.mdfor knowledge navigation. This skill and theao injectCLI command still work but are no longer called from hooks or other skills.
On-demand knowledge retrieval. Not run automatically at startup (since ag-8km).
Inject relevant prior knowledge into the current session.
In the default manual startup mode, MEMORY.md is auto-loaded by Claude Code and no startup injection occurs. Use /inject or ao inject for on-demand retrieval when you need deeper context.
In lean or legacy startup modes (set via AGENTOPS_STARTUP_CONTEXT_MODE), the SessionStart hook runs:
# lean mode (MEMORY.md fresh): 400 tokens
ao inject --apply-decay --format markdown --max-tokens 400 \
[--bead <bead-id>] [--predecessor <handoff-path>]
# legacy mode: 800 tokens
ao inject --apply-decay --format markdown --max-tokens 800 \
[--bead <bead-id>] [--predecessor <handoff-path>]
This searches for relevant knowledge and injects it into context.
When --bead is provided (via HOOK_BEAD env var from Gas Town):
When --predecessor is provided (path to a handoff file):
Given /inject [topic]:
With ao CLI:
ao inject --context "<topic>" --format markdown --max-tokens 1000
Without ao CLI, search manually:
# 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
Use the Read tool to load the most relevant artifacts based on topic.
Present the injected knowledge:
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 "{\"learning_file\": \"$injected_file\", \"timestamp\": \"$(date -Iseconds)\", \"session\": \"$(date +%Y-%m-%d)\"}" >> .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.
| Source | Location | Priority | Weight |
|---|---|---|---|
| Learnings | .agents/learnings/ | High | 1.0 |
| Patterns | .agents/patterns/ | High | 1.0 |
| Global Learnings | ~/.agents/learnings/ | High | 0.8 (configurable) |
| Global Patterns | ~/.agents/patterns/ | High | 0.8 (configurable) |
| Research | .agents/research/ | Medium | — |
| Retros | .agents/learnings/ | Medium | — |
| Legacy Patterns | ~/.claude/patterns/ | Low | 0.6 (read-only, no new writes) |
Knowledge relevance decays over time (~17%/week). More recent learnings are weighted higher.
Hook triggers: session-start.sh runs at session start with AGENTOPS_STARTUP_CONTEXT_MODE=lean or legacy
What happens:
ao inject --apply-decay --format markdown --max-tokens 400 (lean) or --max-tokens 800 (legacy).agents/learnings/, .agents/patterns/, .agents/research/ for relevant artifactsResult: Prior learnings, patterns, research automatically available at session start without manual lookup.
Note: In the default manual mode, MEMORY.md is auto-loaded by Claude Code and this hook emits only a pointer to on-demand retrieval commands (ao search, ao lookup).
User says: /inject authentication or "recall knowledge about auth"
What happens:
ao inject --context "authentication" --format markdown --max-tokens 1000Result: Topic-specific knowledge retrieved and summarized, enabling faster context loading than full artifact reads.
| Problem | Cause | Solution |
|---|---|---|
| No knowledge injected | Empty knowledge pools or ao CLI unavailable | Run /post-mortem to seed pools; verify ao CLI installed |
| Irrelevant knowledge | Topic mismatch or stale artifacts dominate | Use --context "<topic>" to filter; prune stale artifacts |
| Token budget exceeded | Too many high-relevance artifacts | Reduce --max-tokens or increase topic specificity |
| Decay too aggressive | Recent learnings not prioritized | Check artifact modification times; verify --apply-decay flag |