agent2: Skill for Claude Code

.agents/skills/building-domain-experts/SKILL.md

building-domain-experts is a skill for Claude Code, Codex from Artesiana/agent2. It costs 59 tokens per session (1,703 once invoked), scanned A, original, MIT.

A workflow for building AI agents that review documents using professional reference material, ask people for missing information, and return structured results.

In plain words
What is it for?
Use it for legal, medical billing, accounting, compliance, insurance, HR, or procurement tasks involving document reading, knowledge searches, clarifying questions, approvals, and structured output.
Why use it?
It helps when an agent must apply domain rules reliably rather than answer from the document alone.

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 →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is # Seed: bash scripts/seed_knowledge.sh (or python -m shared.ingest --all).

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/building-domain-experts/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 building-domain-experts

README.md
[![agentmods](https://agentmods.dev/badge/skills/artesiana/agent2/building-domain-experts/github.svg)](https://agentmods.dev/skills/artesiana/agent2/building-domain-experts)
Your own site
<a href="https://agentmods.dev/skills/artesiana/agent2/building-domain-experts"><img src="https://agentmods.dev/badge/skills/artesiana/agent2/building-domain-experts/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 building-domain-experts

Your own site · 80×15
<a href="https://agentmods.dev/skills/artesiana/agent2/building-domain-experts"><img src="https://agentmods.dev/badge/skills/artesiana/agent2/building-domain-experts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,703 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.00059 $0.01703
Opus 5 $0.00030 $0.00851
Sonnet 5 $0.00012 $0.00341
Haiku 4.5 $0.00006 $0.00170

Measured 11d ago against content hash 5a3f28a62f47, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

building-domain-experts 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 11d 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/building-domain-experts/SKILL.md · 188 lines

How it starts

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

Building Domain Expert Agents

Overview

A domain expert agent is the most powerful pattern in Agent2. It combines: document reading (OCR), domain knowledge (R2R search), context-aware reasoning, human-in-the-loop, and structured output. Think: an experienced professional sitting at a desk with reference books, tools, and the ability to ask questions.

Before building a serious domain expert, study docs/brain-clone-pattern.md and agents/procurement-compliance-officer. The procurement agent is the canonical public example for the full Agent2 pattern.

When to Activate

  • User wants an agent that processes documents against professional standards
  • Agent needs to "look things up" in reference material before deciding
  • Agent needs to ask clarifying questions and resume after human answers
  • Agent must produce structured output that follows domain-specific rules
  • Industries: legal, medical billing, accounting, compliance, insurance, HR, procurement

The Domain Expert Pattern

Document arrives (PDF, email, text)
  → Agent reads it (OCR via Docling MCP or text input)
  → Agent checks context (who is this for? what rules apply?)
  → Agent searches knowledge (R2R via Knowledge MCP)
  → Agent decides: complete? or needs clarification?
  → If complete: structured result + confidence score
  → If incomplete: clarifying question → pause → human answers → resume
  → Human approves final result

Architecture

1. The Schema — Your Domain Contract

Design the output schema around the three possible outcomes every domain expert faces:

class ExpertResult(BaseModel):
    status: Literal["complete", "needs_clarification", "rejected"]
    # Domain-specific structured output
    findings: list[Finding] = Field(default_factory=list)
    # Clarification path
    question: ClarificationRequest | None = None
    # Rejection path
    rejection_reason: str | None = None
    # Always present
    reasoning: str  # The expert's thought process
    confidence: float = Field(ge=0.0, le=1.0)
    review_steps: list[str] = Field(default_factory=list)

Read the full file on GitHub · 188 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. 11d ago First seen · 188 lines · 59 tokens per session scan A 5a3f28a62f47

Subscribe to this mod's changes

building-domain-experts is a skill published in the GitHub repository Artesiana/agent2 (36 stars, last pushed 4mo ago), licensed MIT. It adds 59 tokens to every session and 1,703 once invoked, about $0.0003 per session on Opus 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

Other skills, from other repositories

pydantic-ai

Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.

davila7/claude-code-templates · 32 tokens

frontend-feature

Build a new page, view, or data-driven feature in the Next.js frontend. Use when adding a route under the dashboard/marketing area, wiring UI to a backend endpoint, adding client state, or creating a localized page. Covers App Router, data fetching, Zustand stores, and i18n.

vstorm-co/full-stack-ai-agent-template · 64 tokens

rag-knowledge

Work with the RAG knowledge base — ingest documents, run semantic search, manage collections, or add a sync source/connector (Google Drive, S3). Use when populating or debugging the knowledge base, tuning retrieval, or adding a new document source. This project uses {{ cookiecutter.vectorstore }} + {{…

vstorm-co/full-stack-ai-agent-template · 76 tokens

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

billing-stripe

Work with Stripe billing — subscriptions, plans/prices, the Customer Portal, credits, usage metering, invoices, and webhook events. Use when changing plans, handling a new Stripe webhook, debugging a payment/subscription flow, or touching credit balances and usage.

vstorm-co/full-stack-ai-agent-template · 56 tokens

Agent Management

Create, edit, upgrade, delete, and audit agents.

sseshachala/conductai · 14 tokens