本文へ移動
cccskills
無料GitHub で公開

ai-agents

AI agent architecture, graph and loop composition, protocol choice, evaluation, and observability. Use when scoping or reviewing systems before implementation.

インストール方法を見る

含まれるファイル(58)

  • SKILL.md25.6 KB
  • agents/openai.yaml372 B
  • assets/agent-template-ainative-sdlc.md2.3 KB
  • assets/checklists/agent-safety-checklist.md5.2 KB
  • assets/core/agent-template-quick.md3.5 KB
  • assets/core/agent-template-specialized.md8.9 KB
  • assets/core/agent-template-standard.md9.9 KB
  • assets/knowledge-base/kb-architecture.md15.5 KB
  • assets/multi-agent/evaluator-router-template.md6.7 KB
  • assets/multi-agent/manager-worker-template.md6.0 KB
  • assets/pricing-template.json1.0 KB
  • assets/tools/tool-definition.md3.7 KB
  • assets/tools/tool-validation-checklist.md3.6 KB
  • data/sources.json25.9 KB
  • learnings.consolidated.md585 B
  • learnings.md1.2 KB
  • references/24-7-operating-model.md15.0 KB
  • references/a2a-handoff-patterns.md16.4 KB
  • references/agent-debugging-patterns.md17.7 KB
  • references/agent-delivery-methods.md13.9 KB
  • references/agent-economics.md11.7 KB
  • references/agent-maturity-governance.md9.5 KB
  • references/agent-operations-best-practices.md12.6 KB
  • references/ai-engine-layers.md14.6 KB
  • references/api-contracts-for-agents.md2.0 KB
  • references/autonomous-loop-patterns.md22.3 KB
  • references/build-vs-not-decision.md11.9 KB
  • references/claude-agent-sdk-patterns.md15.1 KB
  • references/code-swe-agents.md14.5 KB
  • references/coding-agent-usage-tracking.md26.6 KB
  • references/context-engineering.md9.6 KB
  • references/context-graph-patterns.md12.9 KB
  • references/context-rotation-and-state.md4.0 KB
  • references/deployment-ci-cd-and-safety.md12.5 KB
  • references/escalation-patterns.md7.8 KB
  • references/evaluation-and-observability.md13.5 KB
  • references/framework-landscape.md16.3 KB
  • references/game-theory-multi-agent-systems.md14.9 KB
  • references/graph-and-loop-engineering.md6.4 KB
  • references/guardrails-implementation.md17.7 KB
  • references/inbox-engine-patterns.md15.9 KB
  • references/index.md8.3 KB
  • references/memory-systems.md5.6 KB
  • references/modern-best-practices.md13.8 KB
  • references/multi-agent-patterns.md16.8 KB
  • references/ooda-loop-agent-architecture.md12.0 KB
  • references/os-agent-capabilities.md8.9 KB
  • references/principal-agent-theory.md12.9 KB
  • references/protocol-decision-tree.md13.6 KB
  • references/pydantic-ai-patterns.md14.6 KB
  • references/rag-patterns.md4.1 KB
  • references/tool-design-specs.md15.3 KB
  • references/voice-multimodal-agents.md15.7 KB
  • scripts/agent_eval_runner.py6.6 KB
  • scripts/claude-usage.py31.4 KB
  • scripts/codex-usage.py30.1 KB
  • scripts/test_codex_usage.py18.3 KB
  • scripts/test_fail_closed_scripts.py21.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

AI Agents Development — Architecture Hub

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.

When to Use This Skill

Use this skill when the user asks for:

  • agent architecture or operating-model decisions
  • build-vs-not-agent assessment
  • MCP vs A2A protocol choice
  • production readiness review for an existing agent system
  • evaluation, observability, rollout, or safety planning
  • framework selection after requirements are already clear
  • a starting template for a new agent spec
  • graph engineering, agent/workflow graphs, state-machine orchestration, cyclic graphs, or DAG-versus-loop design
  • loop engineering, run-until-done coding agents, self-improving workflows, evaluator feedback loops, or bounded autonomous iteration
  • uncertainty over whether a "graph" means execution control flow, an improvement network, or a knowledge/context graph

Use Other Skills for Depth

Default Workflow

  1. Run the build-vs-not decision gate: if a simpler workflow, form, or tool fits, do not build an agent; proceed only when autonomy is justified.
  2. Define the task environment: performance measure, environment, percepts/sensors, actions/tools, observability, determinism, time horizon, and single-agent vs multi-agent interaction.
  3. Choose control flow; default to workflow/FSM/DAG for production.
  4. Choose protocol boundaries: MCP for tools/data, A2A for agent handoffs.
  5. Define contracts: tool schemas, handoff payloads (with a delegation depth cap: references/multi-agent-patterns.md), state model, success criteria.
  6. Add evaluation and telemetry before shipping.
  7. Add human approval, rollback, and kill-switches for irreversible actions.
  8. Start from templates, then route to specialized skills for implementation depth.

Topology Promotion Gate

Start 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.

Known Traps

  • treating "agent" as the default interaction pattern when a workflow, form, or plain tool call would be simpler
  • using MCP as the overall agent architecture instead of the tool and resource integration layer
  • adding long-term memory without provenance (A13), retention policy, correction flow (A11 — forget path), and user-value proof. Use ai-context-layer/patterns-catalog.md to pick a named pattern and ai-context-layer/anti-patterns-catalog.md for the sweep
  • letting planner loops recurse without explicit step, budget, and escalation limits. A step cap misses oscillation and fabricated observations; diagnose loop failures with references/agent-debugging-patterns.md
  • shipping autonomous actions before evaluator coverage, rollback controls, and human approval paths exist
  • defaulting to a multi-agent topology for reasoning-heavy work when a single strong agent at an equal token budget may match or beat it. Confirm the task is genuinely parallelizable or tool/role-diverse before fanning out; evidence and scope limits live in ../agents-subagents/SKILL.md § When a Single Strong Agent Beats a Team

Common Anti-Patterns

  • chat-first agent design with no state model, contract, or action boundary
  • multi-agent topologies introduced before single-agent failure modes are understood
  • tool surfaces defined by convenience rather than least privilege
  • evaluation added after launch as observability theater instead of a release gate
  • provider or framework selection driven by hype, benchmark screenshots, or marketing taxonomy alone

Quick Reference

QuestionDefault
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.

Autonomy Shapes — How to Host an Agent 24/7

Three deployment shapes for running agents continuously. Pick by the trigger model, not by the framework.

ShapeTriggerWhen to usePrimary guide
A — Triggered / hosted runWebhook, queue, schedule, /firePer-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 serverSessions, WebSocket, SIP callSupport / 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 loopPRD + loop driver until acceptance metLong-horizon work: refactors, migrations, research, Ralph-Loop classreferences/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:

Architecture Selection

NeedDefault Agent ShapeNotes
Deterministic business processWorkflow agentBest default for auditable production behavior.
Bounded external actionsTool-using agentKeep tools narrow, typed, and permission-scoped.
Knowledge-grounded answersRAG agentRequire citations, ACL-aware retrieval, and refusal on missing evidence.
Long multi-step work with branchingPlanner/executorUse strict step budgets, checkpoints, and replanning limits.
Specialized roles with explicit ownershipMulti-agent orchestratorHandoffs 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 controlOS agentRequire sandboxing, UI verification, and action gating.
Code changes and CI feedbackSWE agentRequire repo isolation, tests, review gates, and rollback.
Autonomous improvement of code, prompts, or artifactsResearch / experiment agentFixed eval metric, bounded modification surface, keep/revert loop

Autonomous Improvement Loops

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.

ComponentPurposeExample
Modification surfaceWhat the agent can changeOne file (train.py), one prompt, one config
Eval functionHow to score the resultval_bpb, yes/no checklist (3-6 questions), latency measurement
Keep/revert ruleWhen to keep a changeScore improves; revert if it regresses
TerminationWhen to stopN rounds, target score reached, or manual stop
LedgerExperiment historyGit commits, results.tsv, changelog with reasoning

Design constraints:

  • Keep the modification surface small (one file, one prompt). Broader surfaces compound silent regressions.
  • Use binary or scalar metrics, not subjective ratings. "Does the headline include a specific number?" beats "rate the headline quality 1-10."
  • 3-6 eval criteria is the sweet spot. More causes gaming; fewer misses failure modes.
  • Preserve the changelog — future models pick up where the last agent left off.

See: autoresearch (ML training), Lehmann's skill-optimization adaptation (prompt/skill improvement).

Protocol Choice

If the system needs...Use
tool calls, database access, file access, prompts, resourcesMCP
task handoffs, agent cards, multi-agent routingA2A
both tools and collaborating agentsMCP + A2A

Protocol defaults:

  • Treat MCP as the tool/data integration layer, not as the agent architecture itself.
  • Treat A2A handoffs as versioned APIs with schema validation and trace_id propagation.
  • MCP has two standard transports, 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.
  • For remote MCP, scope authorization and identity explicitly; do not rely on network trust alone.
  • A 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.

Agent-as-Code Pattern

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:

FieldPurpose
RoleWhat the agent is responsible for (e.g., "Architect", "QA reviewer")
ExpertiseDomain knowledge and capabilities
ConstraintsWhat it must not do, boundaries of authority
Expected outputsArtifacts it produces (specs, reviews, plans, code)
Interaction rulesHow 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.

Scale-Adaptive Agent Complexity

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 ComplexityAgent Approach
Config change, typoDirect prompt, no agent infrastructure
Bug fix, small featureSingle agent with bounded tools
Multi-module featureLead + 2-3 specialized workers
Cross-service migrationFull orchestration with persona definitions, debate, and verification

The decision to scale up should be driven by observed ambiguity, not assumed complexity.

Production Defaults

  • Keep state explicit, serializable, and replayable.
  • Externalize all state to files — plan, progress, decisions, and dependency outputs persist in structured files so any agent session can resume without context inheritance.
  • Keep tool surfaces narrow; publish tasks, not raw backend complexity.
  • Bound retries, budgets, context size, and recursion depth.
  • Treat retrieved/tool content as untrusted input.
  • Never put untrusted content, private data, and an exfiltration-capable tool in one model context. Split into a privileged planner that never sees raw untrusted text and a quarantined reader whose output is treated as data, not instructions (Debenedetti et al., 2025, CaMeL); injection classifiers are a second layer, not the boundary.
  • Instrument LLM calls, retrieval, memory ops, and tool calls with consistent tracing.
  • Gate database writes, financial actions, legal/compliance actions, and destructive operations behind human approval.
  • Prefer refusal or degraded mode over hidden unsafe fallbacks.

For fresh-context workers, durable state, and session-vs-project boundaries, see references/context-rotation-and-state.md.

Templates And Entry Points

Scripts

ScriptPurpose
scripts/agent_eval_runner.pyRead 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.pyParse 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.pyParse 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.

Navigation

Related Skills

Usage Notes

  • Start here for architecture and production posture, not for deep implementation walkthroughs.
  • Prefer stable capability guidance over dated framework rankings.
  • Load detailed references only after the user’s direction is clear.
  • Keep recommendations operational: contracts, failure modes, gates, telemetry, and rollback.

Learnings Loop

When 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.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Configures and hardens Claude Code and Codex MCP servers. Use when connecting databases, APIs, SaaS, building servers, or serving a clearance-filtered knowledge base.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Adds per-skill learnings loops for dated patterns, mistakes, and domain facts. Use when wiring skill memory, consolidation, or drift audits.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

vasilyu1983 のスキルをすべて見る

このスキルの問題を報告する