agent2: Skill for Claude Code

.agents/skills/adding-knowledge/SKILL.md

adding-knowledge is a skill for Claude Code, Codex from Artesiana/agent2. It costs 44 tokens per session (1,064 once invoked), scanned A, original, MIT.

A procedure for adding documents such as PDFs or reference files to an Agent2 agent's searchable knowledge. The documents are indexed so the agent can look up rules and other information while it runs.

In plain words
What is it for?
Use it to create a knowledge collection, register its documents, ingest them, connect the search service, and configure which agents or tenants can use it.
Why use it?
It replaces hardcoded reference tables and keeps domain material in documents that can be updated and searched. It also supports separate knowledge collections for different clients or contexts.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is Artesiana/agent2's own configuration. It tells Claude Code and Codex how to work on agent2 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent2 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Artesiana/agent2. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Artesiana/agent2/main/.agents/skills/adding-knowledge/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Artesiana/agent2

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for adding-knowledge

README.md
[![agentmods](https://agentmods.dev/badge/skills/artesiana/agent2/adding-knowledge/github.svg)](https://agentmods.dev/skills/artesiana/agent2/adding-knowledge)
Your own site
<a href="https://agentmods.dev/skills/artesiana/agent2/adding-knowledge"><img src="https://agentmods.dev/badge/skills/artesiana/agent2/adding-knowledge/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for adding-knowledge

Your own site · 80×15
<a href="https://agentmods.dev/skills/artesiana/agent2/adding-knowledge"><img src="https://agentmods.dev/badge/skills/artesiana/agent2/adding-knowledge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,064 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.01064
Opus 5.5 $0.00018 $0.00426
Sonnet 5.5 $0.00009 $0.00213
Haiku 4.5 $0.00004 $0.00106

Measured 2mo ago against content hash c877462101da, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

adding-knowledge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/adding-knowledge/SKILL.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Adding Knowledge to Agents

Overview

Agent2 agents access knowledge through R2R (hybrid search) via Knowledge MCP. You add PDFs or documents to a collection, the agent searches them at runtime. No hardcoding of domain rules — the agent learns from books.

When to Activate

  • Agent needs to look up rules, standards, or reference material
  • User says "add knowledge", "add books", "ingest documents", "RAG"
  • Agent needs different knowledge per client/tenant/context
  • User wants to replace hardcoded lookup tables with searchable knowledge

Architecture

PDFs / Documents
  → R2R ingestion (chunking, embedding, indexing)
  → Searchable collection
  → Knowledge MCP server (FastMCP wrapper)
  → Agent calls search() and get_passage() via toolsets=

Step-by-Step

1. Create Collection Directory

mkdir -p knowledge/books/my-collection/
# Place PDFs, markdown, or text files here

2. Register in collections.yaml

# knowledge/collections.yaml
collections:
  my-collection:
    description: "What these documents contain"
    books_dir: books/my-collection/
    agents:
      - my-agent

3. Ingest Documents

# Start the full stack (includes R2R)
docker compose --profile full up -d

# Ingest all collections
python -m shared.ingest --all

# Or a specific collection
python -m shared.ingest --collection my-collection --dir knowledge/books/my-collection/

4. Wire Agent to Knowledge MCP

# agents/my-agent/agent.py
from pydantic_ai.mcp import MCPServerStreamableHTTP

knowledge_mcp_url = os.environ.get("KNOWLEDGE_MCP_URL", "http://localhost:9090/mcp")
knowledge_server = MCPServerStreamableHTTP(knowledge_mcp_url)

agent = create_agent(
    name="my-agent",
    output_type=MySchema,
    instructions="... Use search() to look up relevant information ...",
    toolsets=[knowledge_server],
)

For concurrent or request-scoped agents, create fresh MCPServerStreamableHTTP instances in before_run() and return them as _toolsets; Agent2 passes them to Agent.run(toolsets=...).

Read the full file on GitHub · 149 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 149 lines · 44 tokens per session scan A c877462101da

Subscribe to this mod's changes

adding-knowledge is a skill published in the GitHub repository Artesiana/agent2 (37 stars, last pushed 6mo ago), licensed MIT. It adds 44 tokens to every session and 1,064 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

adding-knowledge compared with skills from other repositories

adding-knowledge next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
adding-knowledgeArtesiana/agent2Skill376mo agoMITA44Claude Code, Codex
markitdownK-Dense-AI/scientific-agent-skillsSkill56k4d agoMITA62Claude Code, Codex
azure-aimicrosoft/skillsSkill3.2kyesterdayMITA66Claude Code
pdf-exploreUnicomAI/wanwuSkill2.4k14d agoApache-2.0A192Claude Code, Codex
smart-data-collectionUnicomAI/wanwuSkill2.4k14d agoApache-2.0A115Claude Code
rag-knowledgevstorm-co/full-stack-ai-agent-templateSkill2.0k7d agoMITA76Claude Code
summarizeUnicomAI/wanwuSkill2.4k14d agoApache-2.0A26Claude Code, Codex