goal-seeking-agent-pattern
Guides architects on when and how to use goal-seeking agents as a design pattern. This skill helps evaluate whether autonomous agents are appropriate for a given problem, how to structure their objectives, integrate with goal_agent_generator, and reference real amplihack examples like AKS SRE automation, CI diagnostics, pre-commit workflows, and fix-agent pattern matching.
What this skill does
# Goal-Seeking Agent Pattern Skill ## 1. What Are Goal-Seeking Agents? Goal-seeking agents are autonomous AI agents that execute multi-phase objectives by: 1. **Understanding High-Level Goals**: Accept natural language objectives without explicit step-by-step instructions 2. **Planning Execution**: Break goals into phases with dependencies and success criteria 3. **Autonomous Execution**: Make decisions and adapt behavior based on intermediate results 4. **Self-Assessment**: Evaluate progress against success criteria and adjust approach 5. **Resilient Operation**: Handle failures gracefully and explore alternative solutions ### Core Characteristics **Autonomy**: Agents decide HOW to achieve goals, not just follow prescriptive steps **Adaptability**: Adjust strategy based on runtime conditions and intermediate results **Goal-Oriented**: Focus on outcomes (what to achieve) rather than procedures (how to achieve) **Multi-Phase**: Complex objectives decomposed into manageable phases with dependencies **Self-Monitoring**: Track progress, detect failures, and course-correct autonomously ### Distinction from Traditional Agents | Traditional Agent | Goal-Seeking Agent | | ----------------------------- | ----------------------------- | | Follows fixed workflow | Adapts workflow to context | | Prescriptive steps | Outcome-oriented objectives | | Human intervention on failure | Autonomous recovery attempts | | Single-phase execution | Multi-phase with dependencies | | Rigid decision tree | Dynamic strategy adjustment | ### When Goal-Seeking Makes Sense Goal-seeking agents excel when: - **Problem space is large**: Many possible paths to success - **Context varies**: Runtime conditions affect optimal approach - **Failures are expected**: Need autonomous recovery without human intervention - **Objectives are clear**: Success criteria well-defined but path is flexible - **Multi-step complexity**: Requires coordination across phases with dependencies ### When to Avoid Goal-Seeking Use traditional agents or scripts when: - **Single deterministic path**: Only one way to achieve goal - **Latency-critical**: Need fastest possible execution (no decision overhead) - **Safety-critical**: Human verification required at each step - **Simple workflow**: Complexity of goal-seeking exceeds benefit - **Audit requirements**: Need deterministic, reproducible execution ## 2. When to Use This Pattern ### Problem Indicators Use goal-seeking agents when you observe these patterns: #### Pattern 1: Workflow Variability **Indicators**: - Same objective requires different approaches based on context - Manual decisions needed at multiple points - "It depends" answers when mapping workflow **Example**: Release workflow that varies by: - Environment (staging vs production) - Change type (hotfix vs feature) - Current system state (healthy vs degraded) **Solution**: Goal-seeking agent evaluates context and adapts workflow #### Pattern 2: Multi-Phase Complexity **Indicators**: - Objective requires 3-5+ distinct phases - Phases have dependencies (output of phase N feeds phase N+1) - Parallel execution opportunities exist - Success criteria differ per phase **Example**: Data pipeline with phases: 1. Data collection (multiple sources, parallel) 2. Transformation (depends on collection results) 3. Validation (depends on transformation output) 4. Publishing (conditional on validation pass) **Solution**: Goal-seeking agent orchestrates phases, handles dependencies #### Pattern 3: Autonomous Recovery Needed **Indicators**: - Failures are expected and recoverable - Multiple retry/fallback strategies exist - Human intervention is expensive or slow - Can verify success programmatically **Example**: CI diagnostic workflow: - Test failures (retry with different approach) - Environment issues (reconfigure and retry) - Dependency conflicts (resolve and rerun) **Solution**: Goal-seeking agent tries strategies until success or escalation #### Pattern 4: Adaptive Decision Making **Indicators**: - Need to evaluate trade-offs at runtime - Multiple valid solutions with different characteristics - Optimization objectives (speed vs quality vs cost) - Context-dependent best practices **Example**: Fix agent pattern matching: - QUICK mode for obvious issues - DIAGNOSTIC mode for unclear problems - COMPREHENSIVE mode for complex solutions **Solution**: Goal-seeking agent selects strategy based on problem analysis #### Pattern 5: Domain Expertise Required **Indicators**: - Requires specialized knowledge to execute - Multiple domain-specific tools/approaches - Best practices vary by domain - Coordination of specialized sub-agents **Example**: AKS SRE automation: - Azure-specific operations (ARM, CLI) - Kubernetes expertise (kubectl, YAML) - Networking knowledge (CNI, ingress) - Security practices (RBAC, Key Vault) **Solution**: Goal-seeking agent with domain expertise coordinates specialized actions ### Decision Framework Use this 5-question framework to evaluate goal-seeking applicability: #### Question 1: Is the objective well-defined but path flexible? **YES if**: - Clear success criteria exist - Multiple valid approaches - Runtime context affects optimal path **NO if**: - Only one correct approach - Path is deterministic - Success criteria ambiguous **Example YES**: "Ensure AKS cluster is production-ready" (many paths, clear criteria) **Example NO**: "Run specific kubectl command" (one path, prescriptive) #### Question 2: Are there multiple phases with dependencies? **YES if**: - Objective naturally decomposes into 3-5+ phases - Phase outputs feed subsequent phases - Some phases can execute in parallel - Failures in one phase affect downstream phases **NO if**: - Single-phase execution sufficient - No inter-phase dependencies - Purely sequential with no branching **Example YES**: Data pipeline (collect → transform → validate → publish) **Example NO**: Format code with ruff (single atomic operation) #### Question 3: Is autonomous recovery valuable? **YES if**: - Failures are common and expected - Multiple recovery strategies exist - Human intervention is expensive/slow - Can verify success automatically **NO if**: - Failures are rare edge cases - Manual investigation always required - Safety-critical (human verification needed) - Cannot verify success programmatically **Example YES**: CI diagnostic workflow (try multiple fix strategies) **Example NO**: Deploy to production (human approval required) #### Question 4: Does context significantly affect approach? **YES if**: - Environment differences change strategy - Current system state affects decisions - Trade-offs vary by situation (speed vs quality vs cost) - Domain-specific best practices apply **NO if**: - Same approach works for all contexts - No environmental dependencies - No trade-off decisions needed **Example YES**: Fix agent (quick vs diagnostic vs comprehensive based on issue) **Example NO**: Generate UUID (context-independent) #### Question 5: Is the complexity justified? **YES if**: - Problem is repeated frequently (2+ times/week) - Manual execution takes 30+ minutes - High value from automation - Maintenance cost is acceptable **NO if**: - One-off or rare problem - Quick manual execution (< 5 minutes) - Simple script suffices - Maintenance cost exceeds benefit **Example YES**: CI failure diagnosis (frequent, time-consuming, high value) **Example NO**: One-time data migration (rare, script sufficient) ### Decision Matrix | All 5 YES | Use Goal-Seeking Agent | | 4 YES, 1 NO | Probably use Goal-Seeking Agent | | 3 YES, 2 NO | Consider simpler agent or hybrid | | 2 YES, 3 NO | Traditional agent likely better | | 0-1 YES | Script or simple automation | ## 3. Architecture Pattern ### Component Architecture Goal-seeking agents have four core components: ```python # Component 1: Goal Definition class GoalDefi
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.