スキル一覧に戻る
Git-Fg

architecting-agents

by Git-Fg

1🍴 0📅 2026年1月18日
GitHubで見るManusで実行

SKILL.md


name: architecting-agents description: "Provides industry-proven design patterns for effective AI agents based on production systems like Claude Code, Manus, and Cursor. Use when designing agent architectures, optimizing context management, or implementing sub-agent patterns." user-invocable: true allowed-tools: [Read, Write, Edit, Glob, Grep, Bash]

Architecting Agents Protocol

Architecting Agents Protocol

Provides design patterns for agent context management.

Cost Warning (CRITICAL)

Before using sub-agents, understand the costs:

ApproachWhen to Use
InlineMost tasks
ForkIsolation needed
SubagentParallelization only (High Cost)

Default Recommendation: Use context: fork in skills for isolation. Subagents are ONLY appropriate when parallelization benefit clearly exceeds 20K token startup cost AND quota overhead.

See references/subagent-risks.md for detailed evidence.


Pattern Index

PatternPurposeWhen to Use
Computer AccessPersistent context via filesystemAgent needs state persistence
Multi-Layer ActionsHierarchical tool designReducing tool definition overhead
Progressive DisclosureReveal actions on demandManaging large action spaces
Context OffloadingFilesystem storage for contextContext window pressure
Context CachingPrompt caching strategiesCost/latency optimization
Context IsolationSub-agent separationLong-running or parallel tasks
Context EvolutionContinual learningBuilding agent memories

1. Computer Access

Components:

  • Filesystem: Persistent context storage, state across sessions
  • Shell: Execute utilities, CLIs, scripts, or generated code

Implementation:

Agent → Bash Tool → Shell Utilities / CLIs / Scripts
Agent → File Tools → Read / Write / Edit filesystem

2. Multi-Layer Action Space

Action Hierarchy:

Level 1: Tool Calling (agent-visible)
  ↓
Level 2: Shell Utilities / CLIs (computer-level)
  ↓
Level 3: Code Execution (generated scripts)

3. Progressive Disclosure

Strategies:

LayerApproach
Tool CallingIndex definitions, retrieve on demand
Shell UtilitiesList available utilities in instructions; use --help when needed
MCP ServersSync descriptions to folder; read full spec only if task requires
SkillsYAML frontmatter indexed; full SKILL.md read on demand

Implementation Pattern:

1. Provide short list of available capabilities
2. Agent reads detailed spec only when task matches
3. Execute with full knowledge loaded just-in-time

4. Context Offloading

Approaches:

  • Write old tool results to files
  • Store agent trajectories for later retrieval
  • Apply summarization only after offloading diminishing returns

Plan File Pattern: Write plan to file → Read periodically to reinforce objectives → Verify work against plan


5. Context Caching

Caching Requirements:

  • Stable prefix (system prompt unchanged)
  • Append-only message history
  • Deterministic serialization (sorted JSON keys)

Anti-Pattern: Mutating history in ways that break cache prefix


6. Context Isolation

Default Approach: Use context: fork

---
name: processing-batch
description: "Processes multiple files in isolated context"
context: fork
allowed-tools: [Read, Write, Bash]
---

Cost: ~3x inline, but FREE as tool call within prompt quota. Use for: Heavy operations (>10 files), parallel processing, isolation needs.

Subagent Alternatives (Use Sparingly)

ONLY when parallelization benefit > 20K token startup cost:

ScenarioPatternRecommendation
Parallelizable tasksMap-reduceUse fork unless >50 parallel units
Long-running tasksRalph LoopUse fork with persistent files
Independent checksParallel reviewersUse fork for cost efficiency

The Ralph Loop:

1. Initializer sets up environment (plan file, tracking file)
2. Sub-agents tackle individual tasks from plan
3. Progress communicated via git history
4. Stop hooks verify work after each iteration
5. Repeat until plan satisfied

Benefits:

  • Prevents single-agent context saturation
  • Enables parallel execution
  • Clear isolation boundaries

7. Context Evolution

Evolution Patterns:

TypeApproach
Task-specific promptsCollect trajectories → Score → Reflect on failures → Propose variants
Memory learningDistill sessions into diary entries → Reflect → Update instructions
Skill learningReflect over trajectories → Distill reusable procedures → Save as new skills

Implementation:

Session Log → Reflection → Memory/Skill Update → Context

Quick Reference

For detailed implementations, see:

Related Skills:

  • agent-orchestration - Multi-agent patterns (Orchestrator, Swarm, Hierarchical)
  • context-engineering - Compression, degradation, KV-cache optimization
  • memory-systems - Long-term memory architectures

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です