mindforge-cc 10.0.2 → 10.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mindforge/config.json +73 -2
- package/.mindforge/engine/autonomous/cross-iteration-bridge.md +96 -0
- package/.mindforge/engine/cost-tracking/budget-enforcer.md +68 -0
- package/.mindforge/engine/cost-tracking/router.md +58 -0
- package/.mindforge/engine/cost-tracking/token-ledger.md +77 -0
- package/.mindforge/engine/council/council-protocol.md +96 -0
- package/.mindforge/engine/council/council-templates.md +85 -0
- package/.mindforge/engine/council/synthesis-engine.md +71 -0
- package/.mindforge/engine/cross-model-eval.md +74 -0
- package/.mindforge/engine/instincts/capture-engine.md +63 -0
- package/.mindforge/engine/instincts/instinct-schema.md +76 -0
- package/.mindforge/engine/instincts/promotion-engine.md +77 -0
- package/.mindforge/engine/proactive/signal-detector.md +60 -0
- package/.mindforge/engine/proactive/suggestion-engine.md +100 -0
- package/.mindforge/engine/skills/composition.md +83 -0
- package/.mindforge/engine/skills/loader.md +16 -0
- package/.mindforge/personas/agent-architect.md +57 -0
- package/.mindforge/personas/agent-evaluator.md +162 -0
- package/.mindforge/personas/agent-memory-designer.md +157 -0
- package/.mindforge/personas/agent-ops-engineer.md +120 -0
- package/.mindforge/personas/agent-orchestrator.md +112 -0
- package/.mindforge/personas/ai-economist.md +57 -0
- package/.mindforge/personas/ai-safety-engineer.md +57 -0
- package/.mindforge/personas/analytics-engineer.md +57 -0
- package/.mindforge/personas/anti-pattern-hunter.md +61 -0
- package/.mindforge/personas/api-gateway-designer.md +132 -0
- package/.mindforge/personas/auth-engineer.md +112 -0
- package/.mindforge/personas/build-engineer.md +57 -0
- package/.mindforge/personas/business-analyst.md +56 -0
- package/.mindforge/personas/cache-architect.md +100 -0
- package/.mindforge/personas/causal-scientist.md +57 -0
- package/.mindforge/personas/cdn-architect.md +118 -0
- package/.mindforge/personas/change-agent.md +104 -0
- package/.mindforge/personas/code-narrator.md +52 -0
- package/.mindforge/personas/codegen-specialist.md +68 -0
- package/.mindforge/personas/communication-architect.md +102 -0
- package/.mindforge/personas/compliance-engineer.md +96 -0
- package/.mindforge/personas/consensus-engineer.md +116 -0
- package/.mindforge/personas/contract-tester.md +60 -192
- package/.mindforge/personas/cost-optimizer.md +71 -0
- package/.mindforge/personas/council-architect.md +66 -0
- package/.mindforge/personas/council-critic.md +67 -0
- package/.mindforge/personas/council-pragmatist.md +71 -0
- package/.mindforge/personas/council-skeptic.md +73 -0
- package/.mindforge/personas/data-architect.md +108 -0
- package/.mindforge/personas/data-mesh-architect.md +57 -0
- package/.mindforge/personas/data-pipeline-architect.md +120 -0
- package/.mindforge/personas/de-sloppifier.md +60 -0
- package/.mindforge/personas/debt-manager.md +66 -0
- package/.mindforge/personas/decision-architect.md +82 -51
- package/.mindforge/personas/deployment-captain.md +74 -0
- package/.mindforge/personas/design-system-lead.md +112 -0
- package/.mindforge/personas/dmux-orchestrator.md +75 -0
- package/.mindforge/personas/doc-auditor.md +84 -0
- package/.mindforge/personas/dx-engineer.md +96 -0
- package/.mindforge/personas/ecommerce-engineer.md +57 -0
- package/.mindforge/personas/edge-engineer.md +94 -0
- package/.mindforge/personas/edtech-architect.md +106 -0
- package/.mindforge/personas/embedding-architect.md +57 -0
- package/.mindforge/personas/environment-engineer.md +57 -0
- package/.mindforge/personas/eval-judge.md +55 -0
- package/.mindforge/personas/event-architect.md +102 -0
- package/.mindforge/personas/experiment-designer.md +138 -0
- package/.mindforge/personas/feature-store-engineer.md +57 -0
- package/.mindforge/personas/finops-analyst.md +66 -0
- package/.mindforge/personas/fintech-architect.md +57 -0
- package/.mindforge/personas/flutter-engineer.md +104 -0
- package/.mindforge/personas/gaming-engineer.md +57 -0
- package/.mindforge/personas/graphql-designer.md +73 -0
- package/.mindforge/personas/healthcare-engineer.md +57 -0
- package/.mindforge/personas/hiring-strategist.md +105 -0
- package/.mindforge/personas/hitl-architect.md +165 -0
- package/.mindforge/personas/i18n-architect.md +69 -0
- package/.mindforge/personas/instinct-curator.md +83 -0
- package/.mindforge/personas/iot-architect.md +105 -0
- package/.mindforge/personas/knowledge-curator.md +139 -0
- package/.mindforge/personas/knowledge-engineer.md +57 -0
- package/.mindforge/personas/lakehouse-architect.md +57 -0
- package/.mindforge/personas/llm-orchestrator.md +57 -0
- package/.mindforge/personas/logistics-architect.md +106 -0
- package/.mindforge/personas/market-analyst.md +53 -0
- package/.mindforge/personas/marketplace-engineer.md +105 -0
- package/.mindforge/personas/mcp-designer.md +54 -0
- package/.mindforge/personas/meeting-designer.md +104 -0
- package/.mindforge/personas/mentorship-lead.md +106 -0
- package/.mindforge/personas/migration-architect.md +57 -0
- package/.mindforge/personas/ml-ops-engineer.md +101 -0
- package/.mindforge/personas/mobile-architect.md +105 -0
- package/.mindforge/personas/mobile-security-engineer.md +106 -0
- package/.mindforge/personas/multi-model-bridge.md +86 -0
- package/.mindforge/personas/multi-tenancy-architect.md +71 -0
- package/.mindforge/personas/multimodal-engineer.md +57 -0
- package/.mindforge/personas/offline-specialist.md +105 -0
- package/.mindforge/personas/onboarding-navigator.md +63 -0
- package/.mindforge/personas/payments-engineer.md +135 -0
- package/.mindforge/personas/pipeline-engineer.md +115 -0
- package/.mindforge/personas/platform-engineer.md +97 -0
- package/.mindforge/personas/platform-lead.md +57 -0
- package/.mindforge/personas/privacy-engineer.md +57 -0
- package/.mindforge/personas/product-owner.md +56 -0
- package/.mindforge/personas/productivity-analyst.md +57 -0
- package/.mindforge/personas/prompt-architect.md +101 -0
- package/.mindforge/personas/proofreader.md +53 -0
- package/.mindforge/personas/pwa-architect.md +105 -0
- package/.mindforge/personas/quality-scorer.md +63 -0
- package/.mindforge/personas/react-native-engineer.md +106 -0
- package/.mindforge/personas/resilience-engineer.md +69 -0
- package/.mindforge/personas/rfc-architect.md +64 -0
- package/.mindforge/personas/saga-orchestrator.md +80 -0
- package/.mindforge/personas/secrets-engineer.md +57 -0
- package/.mindforge/personas/skill-smith.md +79 -0
- package/.mindforge/personas/sre-lead.md +107 -0
- package/.mindforge/personas/stream-engineer.md +57 -0
- package/.mindforge/personas/streaming-engineer.md +64 -0
- package/.mindforge/personas/swarm-templates.json +695 -38
- package/.mindforge/personas/system-designer.md +57 -0
- package/.mindforge/personas/team-coach.md +120 -0
- package/.mindforge/personas/tech-lead-coach.md +103 -0
- package/.mindforge/personas/technical-writer-lead.md +111 -0
- package/.mindforge/personas/threat-modeler.md +82 -0
- package/.mindforge/personas/vibe-checker.md +75 -0
- package/.mindforge/personas/worktree-manager.md +56 -0
- package/.mindforge/personas/zero-trust-engineer.md +113 -0
- package/.mindforge/skills/a11y-testing/SKILL.md +143 -0
- package/.mindforge/skills/agent-evaluation-framework/SKILL.md +227 -0
- package/.mindforge/skills/agent-introspection-debugging/SKILL.md +88 -0
- package/.mindforge/skills/agent-loops/SKILL.md +84 -0
- package/.mindforge/skills/agent-memory-design/SKILL.md +199 -0
- package/.mindforge/skills/agent-orchestration-patterns/SKILL.md +129 -0
- package/.mindforge/skills/agent-tool-selection/SKILL.md +204 -0
- package/.mindforge/skills/ai-agent-deployment/SKILL.md +176 -0
- package/.mindforge/skills/ai-cost-management/SKILL.md +57 -0
- package/.mindforge/skills/ai-safety-alignment/SKILL.md +53 -0
- package/.mindforge/skills/analytics-instrumentation/SKILL.md +172 -0
- package/.mindforge/skills/api-gateway-patterns/SKILL.md +177 -0
- package/.mindforge/skills/api-marketplace/SKILL.md +56 -0
- package/.mindforge/skills/api-versioning/SKILL.md +100 -0
- package/.mindforge/skills/app-store-deployment/SKILL.md +44 -0
- package/.mindforge/skills/architecture-tradeoff-analysis/SKILL.md +97 -0
- package/.mindforge/skills/audit-logging/SKILL.md +140 -0
- package/.mindforge/skills/auth-patterns/SKILL.md +148 -0
- package/.mindforge/skills/autonomous-agent-harness/SKILL.md +218 -0
- package/.mindforge/skills/autonomous-agents/SKILL.md +59 -0
- package/.mindforge/skills/autonomous-loops/SKILL.md +105 -0
- package/.mindforge/skills/build-system-optimization/SKILL.md +54 -0
- package/.mindforge/skills/build-vs-buy/SKILL.md +80 -0
- package/.mindforge/skills/bundle-optimization/SKILL.md +174 -0
- package/.mindforge/skills/business-analyst/SKILL.md +82 -0
- package/.mindforge/skills/caching-strategies/SKILL.md +132 -0
- package/.mindforge/skills/capacity-planning/SKILL.md +96 -0
- package/.mindforge/skills/causal-inference/SKILL.md +42 -0
- package/.mindforge/skills/cdn-optimization/SKILL.md +212 -0
- package/.mindforge/skills/change-management/SKILL.md +106 -0
- package/.mindforge/skills/chaos-engineering/SKILL.md +99 -0
- package/.mindforge/skills/ci-cd-pipeline/SKILL.md +118 -0
- package/.mindforge/skills/cli-design/SKILL.md +118 -0
- package/.mindforge/skills/code-generation-patterns/SKILL.md +92 -0
- package/.mindforge/skills/code-review-methodology/SKILL.md +180 -0
- package/.mindforge/skills/code-tour/SKILL.md +145 -0
- package/.mindforge/skills/codebase-onboarding/SKILL.md +95 -0
- package/.mindforge/skills/compliance-as-code/SKILL.md +195 -0
- package/.mindforge/skills/conflict-resolution/SKILL.md +87 -0
- package/.mindforge/skills/connection-pooling/SKILL.md +151 -0
- package/.mindforge/skills/container-security/SKILL.md +151 -0
- package/.mindforge/skills/context-engineering/SKILL.md +114 -0
- package/.mindforge/skills/continuous-learning/SKILL.md +84 -0
- package/.mindforge/skills/contract-testing/SKILL.md +85 -0
- package/.mindforge/skills/cost-aware-routing/SKILL.md +83 -0
- package/.mindforge/skills/cost-estimation/SKILL.md +82 -0
- package/.mindforge/skills/council/SKILL.md +68 -0
- package/.mindforge/skills/cqrs-event-sourcing/SKILL.md +95 -0
- package/.mindforge/skills/cross-platform-testing/SKILL.md +43 -0
- package/.mindforge/skills/data-governance/SKILL.md +42 -0
- package/.mindforge/skills/data-lakehouse/SKILL.md +42 -0
- package/.mindforge/skills/data-mesh/SKILL.md +42 -0
- package/.mindforge/skills/data-modeling/SKILL.md +107 -0
- package/.mindforge/skills/data-pipeline-design/SKILL.md +171 -0
- package/.mindforge/skills/data-privacy-engineering/SKILL.md +42 -0
- package/.mindforge/skills/database-performance/SKILL.md +174 -0
- package/.mindforge/skills/database-sharding-advanced/SKILL.md +206 -0
- package/.mindforge/skills/de-sloppify/SKILL.md +120 -0
- package/.mindforge/skills/defense-in-depth/SKILL.md +84 -0
- package/.mindforge/skills/delegation-patterns/SKILL.md +123 -0
- package/.mindforge/skills/dependency-management/SKILL.md +94 -0
- package/.mindforge/skills/deployment-workflow/SKILL.md +135 -0
- package/.mindforge/skills/design-system/SKILL.md +113 -0
- package/.mindforge/skills/developer-onboarding/SKILL.md +99 -0
- package/.mindforge/skills/developer-productivity-metrics/SKILL.md +59 -0
- package/.mindforge/skills/distributed-consensus/SKILL.md +141 -0
- package/.mindforge/skills/dmux-workflows/SKILL.md +141 -0
- package/.mindforge/skills/dns-architecture/SKILL.md +167 -0
- package/.mindforge/skills/doc-health-audit/SKILL.md +102 -0
- package/.mindforge/skills/ecommerce-architecture/SKILL.md +41 -0
- package/.mindforge/skills/edge-computing/SKILL.md +91 -0
- package/.mindforge/skills/edtech-platform/SKILL.md +41 -0
- package/.mindforge/skills/email-deliverability/SKILL.md +177 -0
- package/.mindforge/skills/embedding-systems/SKILL.md +55 -0
- package/.mindforge/skills/environment-management/SKILL.md +54 -0
- package/.mindforge/skills/error-handling-architecture/SKILL.md +118 -0
- package/.mindforge/skills/estimation-techniques/SKILL.md +113 -0
- package/.mindforge/skills/eval-harness/SKILL.md +180 -0
- package/.mindforge/skills/event-driven-architecture/SKILL.md +162 -0
- package/.mindforge/skills/experiment-design/SKILL.md +139 -0
- package/.mindforge/skills/experiment-platform/SKILL.md +43 -0
- package/.mindforge/skills/feature-engineering/SKILL.md +42 -0
- package/.mindforge/skills/feature-flag-management/SKILL.md +183 -0
- package/.mindforge/skills/fine-tuning-workflow/SKILL.md +189 -0
- package/.mindforge/skills/fintech-patterns/SKILL.md +41 -0
- package/.mindforge/skills/flutter-architecture/SKILL.md +42 -0
- package/.mindforge/skills/gaming-backend/SKILL.md +41 -0
- package/.mindforge/skills/git-workflow-design/SKILL.md +129 -0
- package/.mindforge/skills/graceful-degradation/SKILL.md +95 -0
- package/.mindforge/skills/graphql-patterns/SKILL.md +243 -0
- package/.mindforge/skills/guardrails-and-safety/SKILL.md +137 -0
- package/.mindforge/skills/healthcare-systems/SKILL.md +40 -0
- package/.mindforge/skills/hiring-engineering/SKILL.md +119 -0
- package/.mindforge/skills/human-in-the-loop-design/SKILL.md +234 -0
- package/.mindforge/skills/i18n-architecture/SKILL.md +147 -0
- package/.mindforge/skills/idempotency-patterns/SKILL.md +84 -0
- package/.mindforge/skills/incident-communication/SKILL.md +96 -0
- package/.mindforge/skills/incident-management/SKILL.md +97 -0
- package/.mindforge/skills/infrastructure-as-code/SKILL.md +98 -0
- package/.mindforge/skills/instinct-clustering/SKILL.md +190 -0
- package/.mindforge/skills/internal-developer-platform/SKILL.md +51 -0
- package/.mindforge/skills/iot-platform/SKILL.md +41 -0
- package/.mindforge/skills/k8s-deployment/SKILL.md +358 -0
- package/.mindforge/skills/knowledge-graphs/SKILL.md +56 -0
- package/.mindforge/skills/knowledge-sharing-systems/SKILL.md +112 -0
- package/.mindforge/skills/llm-cost-optimization/SKILL.md +198 -0
- package/.mindforge/skills/llm-orchestration/SKILL.md +56 -0
- package/.mindforge/skills/load-testing/SKILL.md +84 -0
- package/.mindforge/skills/logistics-optimization/SKILL.md +40 -0
- package/.mindforge/skills/market-researcher/SKILL.md +99 -0
- package/.mindforge/skills/marketplace-trust/SKILL.md +40 -0
- package/.mindforge/skills/mcp-server-patterns/SKILL.md +264 -0
- package/.mindforge/skills/media-streaming/SKILL.md +41 -0
- package/.mindforge/skills/meeting-architecture/SKILL.md +146 -0
- package/.mindforge/skills/mentoring-patterns/SKILL.md +77 -0
- package/.mindforge/skills/microservices-patterns/SKILL.md +83 -0
- package/.mindforge/skills/migration-platform/SKILL.md +61 -0
- package/.mindforge/skills/migration-strategies/SKILL.md +129 -0
- package/.mindforge/skills/ml-feature-store/SKILL.md +56 -0
- package/.mindforge/skills/ml-monitoring/SKILL.md +42 -0
- package/.mindforge/skills/mobile-performance/SKILL.md +44 -0
- package/.mindforge/skills/mobile-security/SKILL.md +45 -0
- package/.mindforge/skills/model-evaluation/SKILL.md +53 -0
- package/.mindforge/skills/monorepo-management/SKILL.md +100 -0
- package/.mindforge/skills/multi-llm-consult/SKILL.md +75 -0
- package/.mindforge/skills/multi-tenancy-patterns/SKILL.md +145 -0
- package/.mindforge/skills/multi-turn-conversation-design/SKILL.md +206 -0
- package/.mindforge/skills/multimodal-ai/SKILL.md +51 -0
- package/.mindforge/skills/mutation-testing/SKILL.md +97 -0
- package/.mindforge/skills/notification-system-design/SKILL.md +168 -0
- package/.mindforge/skills/observability-stack/SKILL.md +136 -0
- package/.mindforge/skills/offline-first-design/SKILL.md +43 -0
- package/.mindforge/skills/on-call-design/SKILL.md +111 -0
- package/.mindforge/skills/pagination-patterns/SKILL.md +230 -0
- package/.mindforge/skills/payment-integration/SKILL.md +176 -0
- package/.mindforge/skills/performance-reviews/SKILL.md +140 -0
- package/.mindforge/skills/platform-observability/SKILL.md +58 -0
- package/.mindforge/skills/platform-reliability/SKILL.md +52 -0
- package/.mindforge/skills/post-incident-learning/SKILL.md +96 -0
- package/.mindforge/skills/product-manager/SKILL.md +104 -0
- package/.mindforge/skills/progressive-web-app/SKILL.md +44 -0
- package/.mindforge/skills/prompt-engineering/SKILL.md +94 -0
- package/.mindforge/skills/proofreader/SKILL.md +158 -0
- package/.mindforge/skills/push-notification-architecture/SKILL.md +45 -0
- package/.mindforge/skills/python-performance/SKILL.md +183 -0
- package/.mindforge/skills/quality-audit/SKILL.md +171 -0
- package/.mindforge/skills/queue-design/SKILL.md +85 -0
- package/.mindforge/skills/rag-architecture/SKILL.md +176 -0
- package/.mindforge/skills/rate-limiting-design/SKILL.md +94 -0
- package/.mindforge/skills/react-native-patterns/SKILL.md +42 -0
- package/.mindforge/skills/react-performance/SKILL.md +229 -0
- package/.mindforge/skills/real-time-analytics/SKILL.md +42 -0
- package/.mindforge/skills/real-time-sync/SKILL.md +83 -0
- package/.mindforge/skills/responsive-native/SKILL.md +44 -0
- package/.mindforge/skills/responsive-patterns/SKILL.md +141 -0
- package/.mindforge/skills/rfc-pipeline/SKILL.md +114 -0
- package/.mindforge/skills/saas-multi-tenant/SKILL.md +41 -0
- package/.mindforge/skills/santa-method/SKILL.md +134 -0
- package/.mindforge/skills/search-implementation/SKILL.md +98 -0
- package/.mindforge/skills/secrets-platform/SKILL.md +56 -0
- package/.mindforge/skills/secrets-rotation/SKILL.md +173 -0
- package/.mindforge/skills/self-serve-infrastructure/SKILL.md +51 -0
- package/.mindforge/skills/serverless-patterns/SKILL.md +119 -0
- package/.mindforge/skills/skill-creator-meta/SKILL.md +146 -0
- package/.mindforge/skills/sprint-retrospective-facilitation/SKILL.md +112 -0
- package/.mindforge/skills/stakeholder-communication/SKILL.md +85 -0
- package/.mindforge/skills/state-management/SKILL.md +104 -0
- package/.mindforge/skills/stream-processing/SKILL.md +43 -0
- package/.mindforge/skills/streaming-architecture/SKILL.md +81 -0
- package/.mindforge/skills/supply-chain-security/SKILL.md +145 -0
- package/.mindforge/skills/synthetic-data-generation/SKILL.md +52 -0
- package/.mindforge/skills/system-design/SKILL.md +88 -0
- package/.mindforge/skills/team-topology-design/SKILL.md +107 -0
- package/.mindforge/skills/technical-debt-management/SKILL.md +86 -0
- package/.mindforge/skills/technical-interview-design/SKILL.md +98 -0
- package/.mindforge/skills/technical-leadership/SKILL.md +75 -0
- package/.mindforge/skills/technical-writing/SKILL.md +237 -0
- package/.mindforge/skills/technology-radar/SKILL.md +88 -0
- package/.mindforge/skills/testing-anti-patterns/SKILL.md +288 -0
- package/.mindforge/skills/threat-modeling/SKILL.md +109 -0
- package/.mindforge/skills/tool-design/SKILL.md +138 -0
- package/.mindforge/skills/typescript-advanced/SKILL.md +198 -0
- package/.mindforge/skills/using-git-worktrees/SKILL.md +139 -0
- package/.mindforge/skills/verification-loop/SKILL.md +97 -0
- package/.mindforge/skills/vibe-security/SKILL.md +165 -0
- package/.mindforge/skills/visual-regression-testing/SKILL.md +97 -0
- package/.mindforge/skills/websocket-patterns/SKILL.md +203 -0
- package/.mindforge/skills/writing-plans/SKILL.md +170 -0
- package/.mindforge/skills/writing-skills/SKILL.md +216 -0
- package/.mindforge/skills/zero-trust-architecture/SKILL.md +166 -0
- package/CHANGELOG.md +195 -0
- package/MINDFORGE.md +4 -4
- package/README.md +2 -2
- package/RELEASENOTES.md +66 -0
- package/bin/installer-core.js +1 -1
- package/bin/wizard/theme.js +2 -2
- package/docs/commands-reference.md +18 -1
- package/package.json +2 -2
- package/.mindforge/personas/data-privacy-engineer.md +0 -187
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-memory-design
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.0.4
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: agent memory design, short-term memory, long-term memory, memory retrieval, memory consolidation, memory decay, episodic memory, semantic memory, memory architecture, working memory, memory indexing, knowledge persistence
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill — Agent Memory Design (Multi-Layer Knowledge Persistence)
|
|
10
|
+
|
|
11
|
+
## When this skill activates
|
|
12
|
+
When designing memory systems for AI agents, implementing context persistence across
|
|
13
|
+
sessions, building knowledge retrieval mechanisms, or architecting memory consolidation
|
|
14
|
+
pipelines. Use for any agent that needs to remember information beyond a single context
|
|
15
|
+
window.
|
|
16
|
+
|
|
17
|
+
Core principle: **Memory is retrieval, not storage** — the value of a memory system
|
|
18
|
+
is measured by: can the agent find the RIGHT information at the RIGHT time? Storage
|
|
19
|
+
without retrieval is a graveyard.
|
|
20
|
+
|
|
21
|
+
## Mandatory actions when this skill is active
|
|
22
|
+
|
|
23
|
+
### Memory Layer Architecture
|
|
24
|
+
|
|
25
|
+
1. **Four-tier memory model:**
|
|
26
|
+
```
|
|
27
|
+
Layer 1 — Working Memory (context window)
|
|
28
|
+
- Scope: current conversation turn
|
|
29
|
+
- Capacity: model context limit (8K-200K tokens)
|
|
30
|
+
- Persistence: none (gone when context resets)
|
|
31
|
+
- Access: immediate (already in context)
|
|
32
|
+
- Priority: highest — this is what the agent "sees"
|
|
33
|
+
|
|
34
|
+
Layer 2 — Short-Term Memory (session scratchpad)
|
|
35
|
+
- Scope: current session/task
|
|
36
|
+
- Capacity: 10-50 key facts
|
|
37
|
+
- Persistence: session duration
|
|
38
|
+
- Access: explicit retrieval (agent requests it)
|
|
39
|
+
- Format: JSONL scratchpad file
|
|
40
|
+
- Use for: intermediate results, task progress, recent user preferences
|
|
41
|
+
|
|
42
|
+
Layer 3 — Medium-Term Memory (project knowledge)
|
|
43
|
+
- Scope: current project/workspace
|
|
44
|
+
- Capacity: hundreds of entries
|
|
45
|
+
- Persistence: project lifetime
|
|
46
|
+
- Access: semantic search + key lookup
|
|
47
|
+
- Format: structured markdown files, JSON indexes
|
|
48
|
+
- Use for: architectural decisions, user patterns, project conventions
|
|
49
|
+
|
|
50
|
+
Layer 4 — Long-Term Memory (permanent knowledge)
|
|
51
|
+
- Scope: cross-project, cross-session
|
|
52
|
+
- Capacity: unbounded
|
|
53
|
+
- Persistence: permanent (with decay)
|
|
54
|
+
- Access: semantic similarity search + knowledge graph traversal
|
|
55
|
+
- Format: vector DB + knowledge graph
|
|
56
|
+
- Use for: learned patterns, user preferences, domain expertise
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Retrieval Strategies
|
|
60
|
+
|
|
61
|
+
2. **Retrieval by memory layer:**
|
|
62
|
+
```
|
|
63
|
+
Working Memory:
|
|
64
|
+
- Already in context — no retrieval needed
|
|
65
|
+
- Manage carefully: don't waste on retrievable facts
|
|
66
|
+
|
|
67
|
+
Short-Term Memory:
|
|
68
|
+
- Recency-weighted retrieval (most recent = most relevant)
|
|
69
|
+
- Key-based lookup: "what was the last error message?"
|
|
70
|
+
- Cleared at session end (or explicit flush)
|
|
71
|
+
|
|
72
|
+
Medium-Term Memory:
|
|
73
|
+
- Keyword + semantic hybrid search
|
|
74
|
+
- Structured queries: "what auth pattern does this project use?"
|
|
75
|
+
- Indexed by: topic, file path, date, relevance score
|
|
76
|
+
|
|
77
|
+
Long-Term Memory:
|
|
78
|
+
- Semantic similarity search (embedding-based)
|
|
79
|
+
- Knowledge graph traversal (entity → relationship → entity)
|
|
80
|
+
- Confidence-weighted (higher confidence = higher ranking)
|
|
81
|
+
- Decay-adjusted (older unreinforced memories rank lower)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
3. **Retrieval decision flow:**
|
|
85
|
+
```
|
|
86
|
+
When agent needs information:
|
|
87
|
+
1. Check working memory (already in context?) → use it
|
|
88
|
+
2. Check short-term memory (recent session fact?) → retrieve and inject
|
|
89
|
+
3. Check medium-term memory (project knowledge?) → search and inject summary
|
|
90
|
+
4. Check long-term memory (learned pattern?) → search, verify relevance, inject
|
|
91
|
+
5. If not found anywhere → ask user or research from scratch
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Memory Consolidation
|
|
95
|
+
|
|
96
|
+
4. **End-of-session consolidation pipeline:**
|
|
97
|
+
```
|
|
98
|
+
Session ends → Consolidation triggers:
|
|
99
|
+
|
|
100
|
+
1. Extract key learnings from session:
|
|
101
|
+
- New facts learned (user preferences, project decisions)
|
|
102
|
+
- Patterns observed (what worked, what failed)
|
|
103
|
+
- Corrections received (mistakes to avoid next time)
|
|
104
|
+
|
|
105
|
+
2. Classify each learning:
|
|
106
|
+
- Short-term only (task-specific, won't matter next session) → discard
|
|
107
|
+
- Medium-term (project-relevant) → write to project memory
|
|
108
|
+
- Long-term (generalizable pattern) → write to permanent memory
|
|
109
|
+
|
|
110
|
+
3. Summarize, don't dump:
|
|
111
|
+
- Raw conversation → extract 5-10 key facts
|
|
112
|
+
- Include WHY something matters, not just WHAT happened
|
|
113
|
+
- Link to existing memories (reinforce or update)
|
|
114
|
+
|
|
115
|
+
4. Update indexes:
|
|
116
|
+
- Add new entries to search indexes
|
|
117
|
+
- Update confidence scores on existing memories
|
|
118
|
+
- Deprecate contradicted memories
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Rules:
|
|
122
|
+
- Consolidation must be LOSSY (summarize, compress, extract — not raw dump)
|
|
123
|
+
- Every memory entry needs: content, source, timestamp, confidence, tags
|
|
124
|
+
- Contradictions: new information supersedes old (but keep old as "deprecated")
|
|
125
|
+
|
|
126
|
+
### Memory Decay
|
|
127
|
+
|
|
128
|
+
5. **Confidence decay model:**
|
|
129
|
+
```
|
|
130
|
+
Each memory entry has a confidence score [0.0 - 1.0]:
|
|
131
|
+
|
|
132
|
+
Initial confidence:
|
|
133
|
+
- User explicitly stated: 1.0
|
|
134
|
+
- Inferred from behavior: 0.7
|
|
135
|
+
- Assumed from patterns: 0.5
|
|
136
|
+
|
|
137
|
+
Decay rules:
|
|
138
|
+
- Unreinforced memory: confidence -= 0.05 per week
|
|
139
|
+
- Reinforced memory (used successfully): confidence = min(1.0, confidence + 0.1)
|
|
140
|
+
- Contradicted memory: confidence = 0.0 (deprecated, kept for history)
|
|
141
|
+
- Below threshold (confidence < 0.2): excluded from retrieval results
|
|
142
|
+
|
|
143
|
+
Reinforcement triggers:
|
|
144
|
+
- Agent retrieves memory and uses it successfully
|
|
145
|
+
- User confirms a remembered fact
|
|
146
|
+
- Pattern matches current observation
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Implementation Patterns
|
|
150
|
+
|
|
151
|
+
6. **Storage format by layer:**
|
|
152
|
+
```
|
|
153
|
+
Short-term (JSONL scratchpad):
|
|
154
|
+
{"key": "last_error", "value": "TypeError at line 42", "ts": "...", "confidence": 1.0}
|
|
155
|
+
{"key": "user_intent", "value": "refactoring auth module", "ts": "...", "confidence": 0.9}
|
|
156
|
+
|
|
157
|
+
Medium-term (structured markdown):
|
|
158
|
+
## Project: MindForge
|
|
159
|
+
### Architecture Decisions
|
|
160
|
+
- Auth: JWT with refresh tokens (decided 2024-03-15, confidence: 1.0)
|
|
161
|
+
- Database: PostgreSQL with Prisma ORM (decided 2024-03-10, confidence: 1.0)
|
|
162
|
+
### User Preferences
|
|
163
|
+
- Prefers functional style over OOP (confidence: 0.8)
|
|
164
|
+
- Wants verbose error messages in dev (confidence: 0.9)
|
|
165
|
+
|
|
166
|
+
Long-term (vector DB + knowledge graph):
|
|
167
|
+
Entry: {id, embedding, content, source, timestamp, confidence, tags, relationships}
|
|
168
|
+
Graph: (pattern)--[applies_to]-->(domain)--[learned_from]-->(project)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
7. **Working memory budget management:**
|
|
172
|
+
```
|
|
173
|
+
Context window is finite — manage it:
|
|
174
|
+
|
|
175
|
+
Priority for inclusion in working memory:
|
|
176
|
+
1. Current user message and task context (always)
|
|
177
|
+
2. Relevant retrieved memories (top-k by relevance)
|
|
178
|
+
3. System instructions and constraints (always)
|
|
179
|
+
4. Recent conversation history (sliding window)
|
|
180
|
+
|
|
181
|
+
If context is filling up:
|
|
182
|
+
- Summarize older conversation turns (don't drop, compress)
|
|
183
|
+
- Move detailed context to short-term memory (retrieve if needed)
|
|
184
|
+
- Keep only TOP-5 most relevant retrieved memories in context
|
|
185
|
+
- Never sacrifice system instructions for conversation history
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Self-check before task completion
|
|
189
|
+
|
|
190
|
+
Before marking a task done when this skill was active:
|
|
191
|
+
|
|
192
|
+
- [ ] Did I define all four memory layers with clear scope and access patterns?
|
|
193
|
+
- [ ] Is retrieval strategy defined per layer (recency, semantic, key-based)?
|
|
194
|
+
- [ ] Is there a consolidation pipeline that extracts and summarizes key learnings?
|
|
195
|
+
- [ ] Is consolidation lossy (summarize, don't dump raw conversation)?
|
|
196
|
+
- [ ] Is memory decay implemented (confidence decreases without reinforcement)?
|
|
197
|
+
- [ ] Are contradicted memories deprecated (not deleted)?
|
|
198
|
+
- [ ] Is working memory budget managed (prioritized inclusion, compression when full)?
|
|
199
|
+
- [ ] Does every memory entry have: content, source, timestamp, confidence, tags?
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-orchestration-patterns
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.0.7
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: agent orchestration pattern, supervisor worker pattern, agent pipeline topology, agent debate pattern, agent consensus protocol, map reduce agents, handoff protocol design, multi-agent coordination, agent topology design, swarm pattern design, agent composition, failure propagation pattern
|
|
7
|
+
compose:
|
|
8
|
+
- tool-design
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Agent Orchestration Patterns
|
|
12
|
+
|
|
13
|
+
## When this skill activates
|
|
14
|
+
|
|
15
|
+
This skill activates when designing multi-agent systems, choosing coordination topologies, implementing handoff protocols, or debugging agent-to-agent communication failures. It applies to any system where two or more autonomous agents must collaborate, compete, or chain their outputs to accomplish a goal.
|
|
16
|
+
|
|
17
|
+
## Mandatory actions when this skill is active
|
|
18
|
+
|
|
19
|
+
### Before
|
|
20
|
+
|
|
21
|
+
1. **Map the problem space** — Identify all subtasks. Determine which require sequential execution (dependencies) and which are independent (parallelizable).
|
|
22
|
+
2. **Assess complexity** — Single-agent tasks masquerading as multi-agent problems waste coordination overhead. Only orchestrate when genuine specialization or parallelism is needed.
|
|
23
|
+
3. **Define boundaries** — Each agent must have a clear responsibility boundary. Overlapping responsibilities cause conflicts. Gaps cause dropped tasks.
|
|
24
|
+
4. **Choose state strategy** — Decide upfront: shared state (agents read/write common store) or isolated state (agents communicate only via messages).
|
|
25
|
+
|
|
26
|
+
### During
|
|
27
|
+
|
|
28
|
+
#### Pattern Catalog
|
|
29
|
+
|
|
30
|
+
**1. Supervisor/Worker (Hub and Spoke)**
|
|
31
|
+
- **Topology** — One coordinator agent decomposes the task and dispatches subtasks to N worker agents. Workers report results back to the supervisor.
|
|
32
|
+
- **When to use** — Task is decomposable into independent units. Workers are interchangeable or specialized but non-overlapping.
|
|
33
|
+
- **Supervisor responsibilities** — Task decomposition, worker assignment, result aggregation, error handling, timeout enforcement.
|
|
34
|
+
- **Worker responsibilities** — Execute assigned subtask, report structured results, signal failure early.
|
|
35
|
+
- **Pitfall** — Supervisor becomes bottleneck. Mitigate with async dispatch and parallel worker execution.
|
|
36
|
+
|
|
37
|
+
**2. Pipeline (Sequential Chain)**
|
|
38
|
+
- **Topology** — Agent A's output becomes Agent B's input. Linear flow through N stages.
|
|
39
|
+
- **When to use** — Tasks have natural ordering (research → draft → review → publish). Each stage transforms or enriches the previous output.
|
|
40
|
+
- **Stage contract** — Each stage must define its input schema and output schema. Type mismatch between stages is the most common pipeline failure.
|
|
41
|
+
- **Error handling** — Fail the pipeline on any stage failure. Partial results from earlier stages should be preserved for debugging.
|
|
42
|
+
- **Optimization** — Streaming between stages reduces latency. Agent B can begin processing as Agent A emits output.
|
|
43
|
+
|
|
44
|
+
**3. Debate (Adversarial)**
|
|
45
|
+
- **Topology** — Two or more agents argue opposing positions. A synthesizer agent evaluates arguments and produces a final decision.
|
|
46
|
+
- **When to use** — High-stakes decisions where bias is a risk. Architecture choices, security reviews, strategic decisions.
|
|
47
|
+
- **Protocol** — Round 1: each debater states position with evidence. Round 2: each debater rebuts opponent's position. Round 3: synthesizer produces verdict with reasoning.
|
|
48
|
+
- **Constraint** — Debaters must not see each other's initial positions until after Round 1. Prevents anchoring.
|
|
49
|
+
- **Pitfall** — Debates can be unproductive without strict structure. Always time-box rounds.
|
|
50
|
+
|
|
51
|
+
**4. Consensus (Agreement Required)**
|
|
52
|
+
- **Topology** — All agents must agree on the output. Disagreement triggers re-evaluation.
|
|
53
|
+
- **When to use** — Safety-critical decisions. Deployment approvals. Security assessments. Changes where false positives are acceptable but false negatives are dangerous.
|
|
54
|
+
- **Protocol** — Each agent independently evaluates. If all approve: proceed. If any reject: block and surface the dissenting reasoning.
|
|
55
|
+
- **Threshold variants** — Unanimous (all agree), Majority (>50%), Supermajority (>66%), Quorum (minimum N must vote).
|
|
56
|
+
- **Pitfall** — Consensus is expensive. Reserve for decisions where the cost of a wrong answer far exceeds the cost of deliberation.
|
|
57
|
+
|
|
58
|
+
**5. MapReduce (Parallel Processing)**
|
|
59
|
+
- **Topology** — Map phase: split input into N chunks, dispatch to N parallel agents. Reduce phase: aggregate results into final output.
|
|
60
|
+
- **When to use** — Large inputs that can be processed independently (code review across files, document analysis, test execution).
|
|
61
|
+
- **Map function** — Must produce non-overlapping chunks. Overlap causes duplicate work or conflicting results.
|
|
62
|
+
- **Reduce function** — Must handle partial failures gracefully. If 1 of 10 map workers fails, the reduce should still produce useful output from the other 9.
|
|
63
|
+
- **Scaling** — Add more workers linearly. Bottleneck is the reduce step, not the map step.
|
|
64
|
+
|
|
65
|
+
#### Handoff Protocol Design
|
|
66
|
+
|
|
67
|
+
Every agent-to-agent handoff must include a structured message:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"task_id": "unique-identifier",
|
|
72
|
+
"from_agent": "agent-name",
|
|
73
|
+
"to_agent": "agent-name",
|
|
74
|
+
"task": "clear description of what to do",
|
|
75
|
+
"context": "relevant background (minimal, not full history)",
|
|
76
|
+
"constraints": ["must not modify X", "timeout 30s"],
|
|
77
|
+
"acceptance_criteria": ["output matches schema Y", "all tests pass"],
|
|
78
|
+
"artifacts": ["file paths or data references"]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- **Minimal context** — Send only what the receiving agent needs. Full history causes confusion and wastes tokens.
|
|
83
|
+
- **Explicit acceptance criteria** — The receiving agent must know when it has succeeded.
|
|
84
|
+
- **Typed artifacts** — Reference files or data by path/ID, not by embedding content in the message.
|
|
85
|
+
|
|
86
|
+
#### Failure Propagation Strategies
|
|
87
|
+
|
|
88
|
+
| Strategy | Behavior | Use When |
|
|
89
|
+
|----------|----------|----------|
|
|
90
|
+
| Fail-fast | Abort immediately, surface error | Critical path, no recovery possible |
|
|
91
|
+
| Retry | Repeat N times with backoff | Transient failures (network, rate limits) |
|
|
92
|
+
| Escalate | Notify supervisor, request human input | Ambiguous failures, policy decisions |
|
|
93
|
+
| Degrade | Continue with partial results, flag gaps | Non-critical subtasks, best-effort acceptable |
|
|
94
|
+
| Circuit-break | Stop retrying after N failures, return cached/default | Dependency is unreliable |
|
|
95
|
+
|
|
96
|
+
#### State Management
|
|
97
|
+
|
|
98
|
+
- **Shared state** — All agents read/write a common store (database, shared memory). Simpler but requires conflict resolution (optimistic locking, CRDTs).
|
|
99
|
+
- **Isolated state** — Agents maintain private state, communicate only via messages. Safer but requires explicit state transfer in handoffs.
|
|
100
|
+
- **Hybrid** — Shared read-only state (project context, configuration) + isolated write state (each agent's working memory). Best balance for most systems.
|
|
101
|
+
|
|
102
|
+
#### Decision Matrix: When to Use Which Pattern
|
|
103
|
+
|
|
104
|
+
| Scenario | Pattern |
|
|
105
|
+
|----------|---------|
|
|
106
|
+
| Task decomposes into independent subtasks | MapReduce or Supervisor/Worker |
|
|
107
|
+
| Tasks must execute in order | Pipeline |
|
|
108
|
+
| High-stakes decision needs scrutiny | Debate or Consensus |
|
|
109
|
+
| One coordinator manages many executors | Supervisor/Worker |
|
|
110
|
+
| System must tolerate partial failures | MapReduce with degraded reduce |
|
|
111
|
+
| Speed is critical, tasks are independent | MapReduce with max parallelism |
|
|
112
|
+
|
|
113
|
+
### After
|
|
114
|
+
|
|
115
|
+
1. **Validate handoff contracts** — Test that each agent produces output matching the next agent's expected input schema.
|
|
116
|
+
2. **Test failure modes** — Simulate each failure propagation path. Verify the system degrades gracefully, not catastrophically.
|
|
117
|
+
3. **Measure overhead** — Coordination cost should be <20% of total execution time. If higher, simplify the topology.
|
|
118
|
+
4. **Document topology** — Create a diagram showing agent relationships, handoff directions, and failure paths.
|
|
119
|
+
|
|
120
|
+
## Self-check before task completion
|
|
121
|
+
|
|
122
|
+
- [ ] Pattern choice is justified by task structure (not over-engineered)
|
|
123
|
+
- [ ] Each agent has clear, non-overlapping responsibilities
|
|
124
|
+
- [ ] Handoff protocol includes task, context, constraints, and acceptance criteria
|
|
125
|
+
- [ ] Failure propagation strategy is defined for every inter-agent connection
|
|
126
|
+
- [ ] State management approach is explicit (shared vs isolated vs hybrid)
|
|
127
|
+
- [ ] Coordination overhead is measured and acceptable (<20% of total time)
|
|
128
|
+
- [ ] All agent-to-agent contracts are typed and validated
|
|
129
|
+
- [ ] System degrades gracefully under partial failure conditions
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-tool-selection
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
min_mindforge_version: 10.0.4
|
|
5
|
+
status: stable
|
|
6
|
+
triggers: agent tool selection, capability matching, tool routing, cost-aware tool choice, tool fallback chain, tool composition strategy, function selection, tool description optimization, tool disambiguation, tool preference, tool capability matrix, tool ranking
|
|
7
|
+
compose: tool-design
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Skill — Agent Tool Selection (Intelligent Capability Routing)
|
|
11
|
+
|
|
12
|
+
## When this skill activates
|
|
13
|
+
When designing tool selection logic for AI agents, optimizing tool descriptions,
|
|
14
|
+
building fallback chains, or analyzing tool usage patterns. Use for any scenario
|
|
15
|
+
where an agent must choose between multiple tools to accomplish a task.
|
|
16
|
+
|
|
17
|
+
Core principle: **Specificity over generality** — when two tools can both handle a
|
|
18
|
+
task, prefer the more specific one. It will be faster, cheaper, and more reliable.
|
|
19
|
+
A hammer works for screws, but a screwdriver is better.
|
|
20
|
+
|
|
21
|
+
## Mandatory actions when this skill is active
|
|
22
|
+
|
|
23
|
+
### Tool Selection Algorithm
|
|
24
|
+
|
|
25
|
+
1. **Selection pipeline (in order):**
|
|
26
|
+
```
|
|
27
|
+
Input: task description + available tools
|
|
28
|
+
|
|
29
|
+
Step 1 — Capability Match:
|
|
30
|
+
- For each tool: does its capability set cover the task requirements?
|
|
31
|
+
- Eliminate tools that CANNOT handle the task (hard filter)
|
|
32
|
+
|
|
33
|
+
Step 2 — Rank by Specificity:
|
|
34
|
+
- More specific tool > more general tool
|
|
35
|
+
- Example: "Read file" > "Bash (cat)" for reading files
|
|
36
|
+
- Specificity = how narrow is the tool's intended use case?
|
|
37
|
+
|
|
38
|
+
Step 3 — Rank by Cost-Efficiency:
|
|
39
|
+
- Among equally capable tools: prefer cheaper/faster
|
|
40
|
+
- Read (free, instant) > Bash cat (process spawn) > API call (network)
|
|
41
|
+
|
|
42
|
+
Step 4 — Rank by Reliability:
|
|
43
|
+
- Among equal cost: prefer higher success rate
|
|
44
|
+
- Check historical success rate per tool per task type
|
|
45
|
+
|
|
46
|
+
Step 5 — Verify Preconditions:
|
|
47
|
+
- Does the selected tool's preconditions hold?
|
|
48
|
+
- Example: Edit requires file was previously Read
|
|
49
|
+
- If preconditions not met: add prerequisite steps
|
|
50
|
+
|
|
51
|
+
Output: ordered list of tools to try (primary + fallbacks)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
2. **Decision matrix template:**
|
|
55
|
+
```
|
|
56
|
+
| Task Type | Primary Tool | Fallback 1 | Fallback 2 | Anti-pattern |
|
|
57
|
+
|--------------------|--------------|--------------|----------- |------------------|
|
|
58
|
+
| Read file content | Read | Bash (cat) | — | Grep (wrong use) |
|
|
59
|
+
| Search for pattern | Grep | Bash (grep) | Read + scan | Read all files |
|
|
60
|
+
| Edit existing file | Edit | Write | — | Bash (sed) |
|
|
61
|
+
| Create new file | Write | Bash (echo>) | — | Edit (no file) |
|
|
62
|
+
| Run tests | Bash | — | — | Read test output |
|
|
63
|
+
| Check file exists | Bash (ls) | Read (error) | — | Grep for path |
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Tool Description Optimization
|
|
67
|
+
|
|
68
|
+
3. **Writing effective tool descriptions (they ARE prompts):**
|
|
69
|
+
```
|
|
70
|
+
Good description (specific, with examples):
|
|
71
|
+
"Read a file from disk. Use when you need to see file contents.
|
|
72
|
+
Supports text, images, PDFs. Prefer over Bash cat/head/tail.
|
|
73
|
+
NOT for directories (use Bash ls)."
|
|
74
|
+
|
|
75
|
+
Bad description (vague):
|
|
76
|
+
"Reads things from the filesystem."
|
|
77
|
+
|
|
78
|
+
Good description (with when-to-use and when-NOT-to-use):
|
|
79
|
+
"Edit an existing file by replacing exact string matches.
|
|
80
|
+
Use when: modifying 1-5 specific locations in a file.
|
|
81
|
+
Do NOT use when: rewriting >50% of the file (use Write instead).
|
|
82
|
+
Requires: file must have been Read in this session first."
|
|
83
|
+
|
|
84
|
+
Bad description (missing boundaries):
|
|
85
|
+
"Edits files."
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Rules:
|
|
89
|
+
- Include WHEN to use (positive examples)
|
|
90
|
+
- Include when NOT to use (negative examples — prevents misuse)
|
|
91
|
+
- State preconditions explicitly
|
|
92
|
+
- Keep descriptions under 100 words (concise > comprehensive)
|
|
93
|
+
- Use concrete examples, not abstract capabilities
|
|
94
|
+
|
|
95
|
+
### Cost-Aware Selection
|
|
96
|
+
|
|
97
|
+
4. **Cost hierarchy (prefer cheaper when quality is equal):**
|
|
98
|
+
```
|
|
99
|
+
Tier 1 — Free/Instant (prefer these):
|
|
100
|
+
- Read (file content)
|
|
101
|
+
- Edit (modify file)
|
|
102
|
+
- Write (create file)
|
|
103
|
+
- Grep (pattern search in known scope)
|
|
104
|
+
|
|
105
|
+
Tier 2 — Cheap/Fast (use when Tier 1 can't):
|
|
106
|
+
- Bash (shell commands — process spawn overhead)
|
|
107
|
+
- Glob (file path patterns)
|
|
108
|
+
|
|
109
|
+
Tier 3 — Moderate (use when necessary):
|
|
110
|
+
- LSP (language server queries)
|
|
111
|
+
- Web fetch (network requests)
|
|
112
|
+
|
|
113
|
+
Tier 4 — Expensive (use sparingly):
|
|
114
|
+
- Sub-agent spawn (full agent instantiation)
|
|
115
|
+
- Multi-file analysis (token-heavy)
|
|
116
|
+
- External API calls (rate-limited, costly)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Rules:
|
|
120
|
+
- Always check if a Tier 1 tool can handle the task before reaching for Tier 3-4
|
|
121
|
+
- Track cumulative cost during a session (don't let tool costs compound silently)
|
|
122
|
+
- For repeated operations: batch when possible (one Bash with && vs many Bash calls)
|
|
123
|
+
- Cost includes: token consumption, time, API calls, compute resources
|
|
124
|
+
|
|
125
|
+
### Fallback Chains
|
|
126
|
+
|
|
127
|
+
5. **Designing robust fallback sequences:**
|
|
128
|
+
```
|
|
129
|
+
Fallback chain structure:
|
|
130
|
+
1. Try primary tool (most specific, cheapest)
|
|
131
|
+
2. If fails (error, timeout, precondition unmet):
|
|
132
|
+
- Log failure reason
|
|
133
|
+
- Try fallback 1 (broader capability)
|
|
134
|
+
3. If fallback 1 fails:
|
|
135
|
+
- Try fallback 2 (most general/expensive)
|
|
136
|
+
4. If all fail:
|
|
137
|
+
- Escalate to user with: what was tried, why each failed, what's needed
|
|
138
|
+
|
|
139
|
+
Example:
|
|
140
|
+
Task: "Find where function X is defined"
|
|
141
|
+
1. Grep (fast, pattern-based) → found? done
|
|
142
|
+
2. LSP (semantic, language-aware) → found? done
|
|
143
|
+
3. Bash find + grep (brute force) → found? done
|
|
144
|
+
4. Escalate: "I couldn't locate function X. Can you point me to the file?"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Rules:
|
|
148
|
+
- Fallback chains should be pre-defined per task type (not improvised)
|
|
149
|
+
- Each fallback should be DIFFERENT in approach (not just retry)
|
|
150
|
+
- Log which level of the chain succeeded (optimize primary over time)
|
|
151
|
+
- Max 3 fallback levels before escalation (avoid infinite retry loops)
|
|
152
|
+
|
|
153
|
+
### Tool Composition
|
|
154
|
+
|
|
155
|
+
6. **Combining tools for complex tasks:**
|
|
156
|
+
```
|
|
157
|
+
Composition patterns:
|
|
158
|
+
|
|
159
|
+
Sequential: Tool A output → Tool B input
|
|
160
|
+
Example: Grep (find file) → Read (get content) → Edit (modify)
|
|
161
|
+
|
|
162
|
+
Parallel: Tool A + Tool B independently → merge results
|
|
163
|
+
Example: Grep (find usages) + Read (get definition) → understand full context
|
|
164
|
+
|
|
165
|
+
Conditional: If Tool A succeeds → Tool B, else → Tool C
|
|
166
|
+
Example: If Read(file) succeeds → Edit, else → Write (file doesn't exist)
|
|
167
|
+
|
|
168
|
+
Iterative: Repeat Tool A until condition met
|
|
169
|
+
Example: Bash(test) → fails → Edit(fix) → Bash(test) → passes → done
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Rules:
|
|
173
|
+
- Plan composition BEFORE executing (don't improvise mid-chain)
|
|
174
|
+
- Minimize total tool calls (combine steps where possible)
|
|
175
|
+
- Never call the same tool twice with identical inputs (cache/reuse results)
|
|
176
|
+
- If composition exceeds 5 sequential steps: consider if there's a more direct tool
|
|
177
|
+
|
|
178
|
+
### Tool Disambiguation
|
|
179
|
+
|
|
180
|
+
7. **When multiple tools seem equally valid:**
|
|
181
|
+
```
|
|
182
|
+
Disambiguation criteria (in priority order):
|
|
183
|
+
1. Fewer side effects: Read-only > Read-write (prefer observation over action)
|
|
184
|
+
2. More specific: Narrow tool > broad tool (Edit > Bash sed)
|
|
185
|
+
3. Cheaper: Less resource consumption > more
|
|
186
|
+
4. More reversible: Undoable > permanent (Edit > Write for existing files)
|
|
187
|
+
5. Better error messages: Tools with clear failure modes > opaque failures
|
|
188
|
+
|
|
189
|
+
If still tied after all criteria: pick the one that appears first in the
|
|
190
|
+
tool list (convention-based tie-breaking, prevents analysis paralysis)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Self-check before task completion
|
|
194
|
+
|
|
195
|
+
Before marking a task done when this skill was active:
|
|
196
|
+
|
|
197
|
+
- [ ] Did I follow the selection pipeline (capability → specificity → cost → reliability)?
|
|
198
|
+
- [ ] Are tool descriptions specific, with positive AND negative usage examples?
|
|
199
|
+
- [ ] Is cost hierarchy respected (cheaper tools preferred when quality is equal)?
|
|
200
|
+
- [ ] Are fallback chains defined for each critical task type (max 3 levels)?
|
|
201
|
+
- [ ] Is tool composition planned before execution (not improvised)?
|
|
202
|
+
- [ ] Are disambiguations resolved by: side effects → specificity → cost → reversibility?
|
|
203
|
+
- [ ] Are tool calls minimized (no redundant calls, batched where possible)?
|
|
204
|
+
- [ ] Is escalation to user defined as the final fallback (not infinite retry)?
|