Configures Claude Code hooks and Codex hooks.json/notify. Use when adding PreToolUse guards, Stop hooks, managed hooks, format-on-save, preflight, audits, or worktree/budget hooks.
日本語の概要は準備中です。原文の説明を表示しています。
AI agent architecture, graph and loop composition, protocol choice, evaluation, and observability. Use when scoping or reviewing systems before implementation.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Use this skill to decide whether a workflow should be an agent, which agent shape fits, which protocol boundary to use, and what production controls must exist before rollout.
Default posture: explicit control flow, bounded tools, typed contracts, auditable state, human approval for high-risk actions, and telemetry from day one.
Keep this file lean. Load detail from references/index.md, assets/, and sibling skills only when needed.
Use this skill when the user asks for:
ai-agent-platform../ai-prompt-engineering/SKILL.md../ai-rag/SKILL.md../ai-vector-brain/SKILL.md../ai-bot-builder/SKILL.md../ai-voice-bots/SKILL.md../agents-mcp/SKILL.md../agents-subagents/SKILL.md../software-devtools/SKILL.md../qa-agent-testing/SKILL.md../ai-mlops/SKILL.md../software-security-appsec/SKILL.md../ops-cost-optimization/references/ai-api-cost-guide.md, ../ai-llm-inference/SKILL.md../ai-context-layer/SKILL.md, ../ai-rag/SKILL.md, ../ai-vector-brain/SKILL.mdStart with one bounded workflow or agent and keep it as the control. Promote to multiple agents only when the work has independently executable branches, materially different tool permissions, or a verifier that must be isolated from the producer. Before promotion, record the single-agent failure, the proposed handoff contract, and the extra latency and cost budget. Accept the topology only if the same task set improves the target outcome without increasing unresolved handoff failures; otherwise keep the simpler control.
Measure the cost before promoting: run the same task set both ways and record the token and latency multiplier next to the outcome delta. Promote only if the outcome gain is worth that multiplier at your prices; take prices from the current provider pricing page (see ../ops-cost-optimization/references/ai-api-cost-guide.md), never from memory.
ai-context-layer/patterns-catalog.md to pick a named pattern and ai-context-layer/anti-patterns-catalog.md for the sweep../agents-subagents/SKILL.md § When a Single Strong Agent Beats a Team| Question | Default |
|---|---|
| Should this be an agent? | Start with references/build-vs-not-decision.md; default answer is "no" until volume, ambiguity, and value justify autonomy. |
| What is the task environment? | State the performance measure, environment, percepts/sensors, actions/tools, observability, determinism, horizon, and other agents before choosing a framework. |
| Which control flow fits? | Prefer workflow/FSM/DAG; use planner/executor only when branching cannot be modeled explicitly. |
| MCP or A2A? | MCP for external tools/data, A2A for agent-to-agent coordination, both when a multi-agent system also needs tools. |
| When to use multi-agent? | Only when roles, handoff contracts, and verifier responsibilities are explicit. |
| When to add long-term memory? | Only with provenance, retention rules, user consent, and clear value. Pick a named pattern from ai-context-layer/patterns-catalog.md (P2 for app-orchestrated, P3 for self-editing, P4 for temporal, P6 for conversational). Run the anti-pattern sweep — A1 (no raw transcripts), A11 (forget path required), A13 (provenance mandatory). |
| What must exist before rollout? | Eval suite, telemetry, action limits, human escalation, rollback path, and kill switch. |
| Is this "graph engineering" or "loop engineering"? | Start with references/graph-and-loop-engineering.md; identify the graph's purpose before selecting a runtime or datastore. |
Three deployment shapes for running agents continuously. Pick by the trigger model, not by the framework.
| Shape | Trigger | When to use | Primary guide |
|---|---|---|---|
| A — Triggered / hosted run | Webhook, queue, schedule, /fire | Per-event agent work, scheduled jobs, fan-out from external sources | ../ai-coding-agents-state/references/webhook-and-queue-triggers.md + ../ai-coding-agents-state/references/durable-trigger-integration.md |
| B — Always-on bot / voice server | Sessions, WebSocket, SIP call | Support / sales / voice bots with conversational state | ../ai-bot-builder/references/production-deployment.md + ../ai-bot-builder/references/stateful-rollout-and-blue-green.md + ../ai-voice-bots/references/production-deployment.md |
| C — Autonomous loop | PRD + loop driver until acceptance met | Long-horizon work: refactors, migrations, research, Ralph-Loop class | references/autonomous-loop-patterns.md |
Hosted or self-hosted loop: self-host when you need a custom sandbox or egress policy, tools on a private network, data residency, or deterministic replay; otherwise prefer a vendor-hosted agent runtime. Before committing, check the vendor docs for session persistence, idle billing, and sandbox limits.
Cross-shape requirements:
../agents-hooks/references/budget-and-loop-hooks.md../ai-bot-builder/references/secret-rotation-and-model-fallback.md../software-paas-hosting/SKILL.md and ../software-paas-hosting/references/agent-hosting-matrix.md| Need | Default Agent Shape | Notes |
|---|---|---|
| Deterministic business process | Workflow agent | Best default for auditable production behavior. |
| Bounded external actions | Tool-using agent | Keep tools narrow, typed, and permission-scoped. |
| Knowledge-grounded answers | RAG agent | Require citations, ACL-aware retrieval, and refusal on missing evidence. |
| Long multi-step work with branching | Planner/executor | Use strict step budgets, checkpoints, and replanning limits. |
| Specialized roles with explicit ownership | Multi-agent orchestrator | Handoffs are APIs; add verifier/evaluator roles early. Score the design against the MAST failure taxonomy (Cemri et al., 2025, arXiv:2503.13657) — do not re-derive it: ../agents-subagents/references/mast-failure-taxonomy.md. |
| Desktop or browser control | OS agent | Require sandboxing, UI verification, and action gating. |
| Code changes and CI feedback | SWE agent | Require repo isolation, tests, review gates, and rollback. |
| Autonomous improvement of code, prompts, or artifacts | Research / experiment agent | Fixed eval metric, bounded modification surface, keep/revert loop |
A research/experiment agent iterates autonomously: suggest a change → apply it → evaluate → keep or revert → repeat. The pattern works on anything with a measurable evaluation function.
| Component | Purpose | Example |
|---|---|---|
| Modification surface | What the agent can change | One file (train.py), one prompt, one config |
| Eval function | How to score the result | val_bpb, yes/no checklist (3-6 questions), latency measurement |
| Keep/revert rule | When to keep a change | Score improves; revert if it regresses |
| Termination | When to stop | N rounds, target score reached, or manual stop |
| Ledger | Experiment history | Git commits, results.tsv, changelog with reasoning |
Design constraints:
See: autoresearch (ML training), Lehmann's skill-optimization adaptation (prompt/skill improvement).
| If the system needs... | Use |
|---|---|
| tool calls, database access, file access, prompts, resources | MCP |
| task handoffs, agent cards, multi-agent routing | A2A |
| both tools and collaborating agents | MCP + A2A |
Protocol defaults:
trace_id propagation.stdio and Streamable HTTP; SSE-only servers are legacy. A2A discovery is the Agent Card at /.well-known/agent-card.json; a handoff without a task id and state enum is not A2A, whatever it is called. Verified wire-level facts: references/protocol-decision-tree.md § Protocol Facts.stdio server config is a command the client runs: never build it from untrusted input, and sandbox the host that launches servers. Local-transport security controls: ../agents-mcp/references/mcp-security.md § Local stdio.Define agent personas as structured, versioned artifacts with explicit expertise, constraints, and expected outputs. This pattern treats agent definitions as reviewable code rather than ad-hoc prompt strings.
A well-defined agent spec includes:
| Field | Purpose |
|---|---|
| Role | What the agent is responsible for (e.g., "Architect", "QA reviewer") |
| Expertise | Domain knowledge and capabilities |
| Constraints | What it must not do, boundaries of authority |
| Expected outputs | Artifacts it produces (specs, reviews, plans, code) |
| Interaction rules | How it communicates with other agents or the human |
Benefits: agents can be reviewed in PRs, diffed between versions, and composed into teams with explicit role boundaries.
For current delivery methods and when to borrow from GSD, BMAD, Spec Kit, OpenSpec, MADD, or AI-SDLC, see references/agent-delivery-methods.md.
Match agent sophistication to task complexity. Do not use a full multi-agent orchestration for a bug fix, and do not use a single prompt for a platform migration.
| Task Complexity | Agent Approach |
|---|---|
| Config change, typo | Direct prompt, no agent infrastructure |
| Bug fix, small feature | Single agent with bounded tools |
| Multi-module feature | Lead + 2-3 specialized workers |
| Cross-service migration | Full orchestration with persona definitions, debate, and verification |
The decision to scale up should be driven by observed ambiguity, not assumed complexity.
For fresh-context workers, durable state, and session-vs-project boundaries, see references/context-rotation-and-state.md.
../ai-rag/SKILL.md assets/; agent-side retrieval rules → references/rag-patterns.md; knowledge-base layout → assets/knowledge-base/kb-architecture.md--pricing file → assets/pricing-template.json (ships no rates)| Script | Purpose |
|---|---|
scripts/agent_eval_runner.py | Read JSONL task/expected/actual triples and report pass rates (offline). Fails closed: malformed or incomplete records count as failures. For adversarial suites and multi-turn harnesses, delegate to ../qa-agent-testing/SKILL.md. |
scripts/claude-usage.py | Parse Claude Code usage logs, including subagent transcripts under each session, into token reports, counting each API response once (lines deduplicated on message ID plus request ID). Cost only with --pricing <file> (rates you copy from the provider's pricing page; schema in assets/pricing-template.json); without it cost is unpriced. With it, an unknown model or a 1-hour cache write without its own 1-hour rate is unpriced (exit 3), never priced at a default rate. daily from stats-cache.json has no tokens to price and exits 3 under --pricing; models --pricing reads the logs instead, where the cache-write TTL split exists. |
scripts/codex-usage.py | Parse Codex usage logs into token reports, skipping re-sent token events. Cost only with --pricing <file>, same fail-closed rules and exit 3. Every report prices per event, as traces does. Codex logs carry no service tier or context class, so the script assumes the standard tier and base context, prints that it did, and marks the cost estimated. |
data/sources.json; when browsing is unavailable, answer framework-ranking, lifecycle, transport/auth, A2A-maturity, and pricing questions from it, say what is assumed, and label the claim unverified../ai-architecture-advisor/SKILL.md../ai-bot-builder/SKILL.md../ai-rag/SKILL.md../ai-vector-brain/SKILL.md../agents-mcp/SKILL.md../agents-subagents/SKILL.md../agents-swarm-orchestration/SKILL.md../agents-hooks/SKILL.md../agents-skills/SKILL.md../agents-memory/SKILL.md../qa-agent-testing/SKILL.md../qa-observability/SKILL.md../software-security-appsec/SKILL.mdWhen prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present; use learnings.md only for needed history or as the available fallback. Otherwise skip both.
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Configures Claude Code hooks and Codex hooks.json/notify. Use when adding PreToolUse guards, Stop hooks, managed hooks, format-on-save, preflight, audits, or worktree/budget hooks.
日本語の概要は準備中です。原文の説明を表示しています。
Configures and hardens Claude Code and Codex MCP servers. Use when connecting databases, APIs, SaaS, building servers, or serving a clearance-filtered knowledge base.
日本語の概要は準備中です。原文の説明を表示しています。
Owns instruction files: AGENTS.md, CLAUDE.md, personal and repo rules. Use when writing, pruning, auditing them, sharing rules across Claude and Codex, or fixing ignored rules.
日本語の概要は準備中です。原文の説明を表示しています。
Creates and audits agent skills: SKILL.md, references, scripts, runtime metadata. Use when writing, validating, or security-reviewing a skill, or fixing truncated skill listings.
日本語の概要は準備中です。原文の説明を表示しています。
Adds per-skill learnings loops for dated patterns, mistakes, and domain facts. Use when wiring skill memory, consolidation, or drift audits.
日本語の概要は準備中です。原文の説明を表示しています。
Chooses subagent, team, workflow, or debate and launches it on Claude Code or Codex. Use when delegating, running agent review boards, or installing shared agents.
日本語の概要は準備中です。原文の説明を表示しています。