Agentic Coding Guide
In the context of Human-AI Co-Design, agentic coding involves humans providing high-level guidance while AI agents handle implementation details: It represents a powerful approach to software development where humans are freed up to focus solely in strategic decisions. This guide will help you create effective design documents that enable successful Caskada implementations.
The AI Implementation Brief
AI-Driven Structuring: Convert vague requests into technical specifications through dialogue
Essentialism: Only capture requirements that directly impact implementation
Living Documentation: Design evolves organically through implementation insights
Before writing any code, create a comprehensive AI Implementation Brief at docs/design.md. This document serves as the foundation for human-AI collaboration and should contain all the essential sections listed below.
1. Requirements Definition
Clearly articulate what you're building and why:
Problem Statement: Define the problem being solved in 1-2 sentences
User Needs: Describe who will use this and what they need
Success Criteria: List measurable outcomes that define success
Constraints: Note any technical or business limitations
Example:
2. Flow Design
Outline the high-level architecture using Caskada's nested directed graph abstraction:
Flow Diagram: Create a mermaid diagram showing node connections
Processing Stages: Describe each major stage in the flow
Decision Points: Identify where branching logic occurs
Data Flow: Explain how information moves through the system
Example:
3. Utility Functions
List all external utilities needed:
Function Name: Clear, descriptive name
Purpose: What the function does
Inputs/Outputs: Expected parameters and return values
External Dependencies: Any APIs or libraries required
Example:
4. Node Design
For each node in your flow, define:
Purpose: One-line description of what the node does
Shared Store Access: What data it reads from and writes to the shared store
Lifecycle Implementation: How
prep,exec, andpostwill be implementedAction Returns: What actions the node might return to direct flow
Error Handling: How failures will be managed
Example:
5. Shared Store Schema
Define the structure of your shared store. Using interfaces (TypeScript) or type hints (Python) is highly recommended.
Key Namespaces: Major sections of your shared store (often represented as nested objects or distinct keys).
Data Types: Expected types for each key.
Data Flow: How data evolves through processing (which nodes read/write which keys).
Example:
Best Practices for Your Design Document
Start Simple: Begin with the minimal viable solution
Be Explicit: Clearly define all components and their interactions
Visualize Flows: Use diagrams to illustrate complex relationships
Define Boundaries: Clarify what's in and out of scope
Consider Edge Cases: Note how the system handles failures
Be Concise: Keep it short and to the point; Do not add any other section to the design document other than the ones listed above
Implementation Process
After completing your design document:
Review with Stakeholders: Ensure the design meets requirements. If you are the AI agent, ask the user to verify the design document and confirm it fits their needs.
Refine as Needed: Iterate on the design based on feedback
Hand Off to AI: Provide the design document to your AI assistant - If you are the AI agent, start working on the solution based on the design document
Collaborative Implementation: Work with AI to implement the design
Test and Validate: Verify the implementation against success criteria
Once the AI assistant starts working on the implementation it's common for it to get lazy midway through the implementation. Whenever it claims to be done, you can give it an extra push with the following prompt:
Conclusion: Precision Through Structure
This approach ensures all Caskada solutions maintain:
Human Focus: Strategic requirements and validation
AI Precision: Structured implementation targets
System Integrity: Clear component boundaries
By enforcing these four pillars through adaptive dialogue rather than rigid templates, we achieve flexible yet reliable AI system development. The design document becomes a living contract between human intent and AI execution.
You provide your AI assistant with the clear direction needed to implement an effective Caskada solution while maintaining human oversight of the critical design decisions.
Remember: The quality of your design document directly impacts the quality of the implementation. Invest time in creating a comprehensive brief to ensure successful outcomes.
Last updated