AI Prompting Engine
Relevant source files
The following files were used as context for generating this wiki page:The AI Prompting Engine is a collection of communication techniques, strategies, and best practices designed to facilitate effective collaboration with AI systems during the spec-driven development process. Its purpose is to ensure clarity, reduce ambiguity, and improve the quality of AI-generated outputs for requirements, design, and task planning. This engine is not a software component but a methodology for interaction, leveraging structured communication to guide the AI's reasoning and output.
The core of the engine is built on a set of principles that structure the conversation between a user and an AI assistant. By following these guidelines, developers can get better results faster, align the AI's output with project constraints, and create high-quality specifications. The strategies are deeply integrated with the three-phase spec process and can be understood in conjunction with the project's AI Reasoning frameworks.
Sources: spec-process-guide/prompting/README.md:15-28, skills/ai-prompting/SKILL.md:11-16
Core Principles
The prompting methodology is founded on four key principles that form a cyclical process for interaction. This ensures that communication is clear, context is maintained, and outputs are progressively refined.
Sources: spec-process-guide/prompting/README.md:22-28
This diagram illustrates the fundamental interaction loop with the AI.
- Be Specific (Context is King): Always provide rich, relevant context before making a request. This includes project background, technology stack, constraints, and the "why" behind a feature.
Sources: spec-process-guide/prompting/best-practices.md:15-26 - Structure Requests: Break down large, complex asks into smaller, manageable parts. This often aligns with the spec-driven development phases.
Sources: spec-process-guide/prompting/best-practices.md:37-43 - Iterate Thoughtfully: Treat spec development as a conversation. Build on previous AI responses and refine them incrementally rather than starting over with new prompts.
Sources: spec-process-guide/prompting/strategies.md:68-87 - Validate Understanding: Actively verify the AI's output and your own understanding at each step. Ask the AI to review its own work against checklists or requirements.
Sources: skills/ai-prompting/SKILL.md:168-191
Core Prompting Strategies
The engine defines several core strategies to guide AI collaboration effectively. These strategies are designed to be applied throughout the spec-driven development lifecycle.
Sources: spec-process-guide/prompting/strategies.md:15-16, skills/ai-prompting/SKILL.md:18-20
| Strategy | Description |
|---|---|
| Context-First Prompting | Provide sufficient context (project, tech, constraints) before making any request. |
| Phased Interaction | Work sequentially through Requirements, Design, and Tasks phases, completing one before starting the next. |
| Iterative Refinement | Treat interaction as a conversation, building on and refining previous AI responses. |
| Example-Driven Prompting | Provide concrete examples of desired outputs (or what to avoid) to clarify expectations. |
| Constraint-Explicit Prompting | Make all functional and non-functional constraints explicit to prevent invalid solutions. |
| Role-Based Prompting | Frame requests from a specific perspective (e.g., Product Owner, Tech Lead) to get targeted outputs. |
| Validation-Oriented Prompting | Build quality checks into prompts by asking the AI to review outputs against criteria. |
| Trade-Off Exploration | Ask the AI to compare multiple options and evaluate their trade-offs instead of seeking a single "best" answer. |
Sources: spec-process-guide/prompting/strategies.md:17-175, skills/ai-prompting/SKILL.md:22-200
Phased Interaction Model
The Phased Interaction strategy is central to using the prompting engine within spec-driven development. It ensures that each development phase builds upon a solid, validated foundation from the previous one.
The following diagram shows the flow and the type of prompts used to transition between phases.
Iterative Refinement and Validation
Iterative refinement is a conversational process of building upon initial AI outputs. This is often paired with validation-oriented prompting, where the user asks the AI to critique its own work.
The sequence diagram below shows a typical refinement and validation loop.
Prompt Templates and Patterns
The system provides structured templates for each phase of spec development to ensure all necessary information is provided to the AI.
Sources: spec-process-guide/prompting/templates.md:3-9
Requirements Phase Templates
These templates are used to transform an idea into a set of formal requirements.
Basic Feature Requirements Template:
I want to create a spec for [FEATURE_NAME]. Here's my initial idea:
[BRIEF_FEATURE_DESCRIPTION]
Please help me create comprehensive requirements using the EARS format. Focus on:
- User stories that capture the core value proposition
- Acceptance criteria that are testable and specific
- Edge cases and error scenarios
- Integration points with existing systems
The feature should serve [TARGET_USER_TYPE] and solve [CORE_PROBLEM].
Sources: spec-process-guide/prompting/templates.md:13-26
Complex System Requirements Template:
I'm planning a [SYSTEM_TYPE] that needs to handle [CORE_FUNCTIONALITY].
Key constraints:
- Performance: [PERFORMANCE_REQUIREMENTS]
- Scale: [EXPECTED_USAGE_PATTERNS]
- Integration: [EXISTING_SYSTEMS_TO_INTEGRATE]
- Compliance: [REGULATORY_OR_BUSINESS_REQUIREMENTS]
Please help me break this down into well-structured requirements using EARS format.
Sources: spec-process-guide/prompting/templates.md:28-41
Design and Tasks Phase Templates
Similar templates exist for the Design and Tasks phases, which build upon the approved requirements.
- Architecture Design Template: Asks the AI to create a design based on a requirements summary, technical constraints, and stack.
- Implementation Planning Template: Asks the AI to break down an approved design into actionable, sequenced coding tasks, often following TDD principles.
Sources: spec-process-guide/prompting/templates.md:58-72, spec-process-guide/prompting/templates.md:100-113
Best Practices and Troubleshooting
To maximize the effectiveness of the prompting engine, a set of best practices and troubleshooting solutions are provided.
Sources: spec-process-guide/prompting/best-practices.md:13-14
Communication Best Practices
| Do | Don't |
|---|---|
| Start with user problems, not technical solutions. | Jump into implementation details during the requirements phase. |
| Reference specific requirements in design decisions. | Design in isolation from requirements. |
| Request tasks that build incrementally. | Create tasks that are too large or complex. |
| Validate understanding before moving to the next phase. | Assume the AI knows your business context or constraints. |
Sources: spec-process-guide/prompting/best-practices.md:52-101
Troubleshooting Common Issues
| Problem | Solution |
|---|---|
| Responses are too generic | Add more specific context, constraints, and concrete examples. |
| Requirements keep changing (scope creep) | Establish a clear MVP scope first and ask the AI to focus only on that. |
| Design becomes too complex | Refocus the AI on current requirements only, not hypothetical future needs. |
| Tasks are too abstract | Request a breakdown into specific, actionable coding steps (e.g., "Create X file," "Implement Y function"). |
Sources: spec-process-guide/prompting/best-practices.md:136-187
Summary
The AI Prompting Engine is a systematic methodology for communicating with AI assistants to produce high-quality development specifications. It is not a tool, but a set of documented strategies, principles, and templates that guide the user through a structured, iterative, and validated conversation. By leveraging context-setting, phased interactions, and continuous refinement, the engine enables developers to use AI as an effective collaborator in the spec-driven development process, ultimately leading to clearer plans and better software.
Sources: skills/ai-prompting/SKILL.md:11-16, spec-process-guide/prompting/README.md:15-28