Back to Discover
Prompt
Generate a detailed Cursor rule named `tdd`, under the `.cursor/rules/workflows` directory, designed to guide an AI assistant through a structured planning and brainstorming process. The ultimate goal of this process is to thoroughly understand technical requirements (potentially from a PRD or user input), collaboratively determine the optimal technical solution and architecture, and finally produce a comprehensive Technical Design Document (TDD).
The generated rule should define a clear, step-by-step workflow, including:
1. **Requirement Ingestion & Discovery:** How to start by gathering the user's technical objectives, system constraints, performance goals, scalability requirements, security considerations, and integration points. This phase may involve reading an existing Product Requirement Document (PRD) or directly querying the user. Mention using available tools (like codebase inspection, existing architecture diagrams, or web search for technology research) for initial context gathering.
2. **Iterative Clarification & PRD Alignment:** Emphasize asking focused, single questions to resolve ambiguities in technical requirements and confirm understanding. If a PRD is provided, ensure the technical design aligns with its goals. Stress the importance of summarizing confirmed technical details and design considerations back to the user periodically.
3. **Technical Solution Brainstorming & Evaluation:** Instruct the assistant to generate multiple potential technical designs or architectural approaches. These should be compared based on relevant criteria such as scalability, performance, maintainability, development effort, cost, security implications, and ease of integration with existing systems. Guide the user in selecting or refining the best technical path forward.
4. **Technical Proposal Drafting:** Detail the step where the assistant presents a structured proposal of the chosen technical solution. This proposal should clearly state the design rationale, key architectural decisions, technology stack choices, and any remaining open technical questions or trade-offs, requiring explicit user approval before proceeding.
5. **TDD Finalization:** Specify that upon user approval, the assistant must create/edit an AsciiDoc file in the workspace. The file should be named `DESIGN.adoc` if it directly corresponds to a `PRD.adoc`, or `DESIGN-[task_identifier].adoc` (e.g., `DESIGN-user-authentication.adoc`) if it's for a specific task or component. The rule should list the essential sections this TDD must contain (e.g., Introduction/Overview, Goals and Non-Goals, Current Architecture (if applicable), Proposed Architecture, High-Level Design, Detailed Design (including Components, Modules, Data Models, API Specifications, Sequence Diagrams), Technology Stack, Deployment Considerations, Scalability and Performance, Security Considerations, Risk Assessment and Mitigation Plan, Testing Strategy, Open Issues/Future Considerations).
The rule must also include:
* Clear **Goals** for the technical planning process itself (e.g., to create a clear, actionable, and robust technical design).
* Specific **Interaction Guidelines** for the assistant (e.g., confirming technical assumptions, breaking down complex systems into manageable components, proactively identifying potential risks).
* A strict constraint that during this planning phase, the assistant should **only modify Markdown (`.md`) or AsciiDoc (`.adoc`) files**, primarily the final TDD file (`DESIGN.adoc` or `DESIGN-[task_identifier].adoc`). No other code or configuration files should be edited.
* Defined **Exit Criteria** indicating when the planning process is complete (i.e., user approval of the technical proposal and generation/update of the TDD file).
* Instructions to leverage mermaid diagrams for visualization of concepts, relations and flows, and avoid including code snippets.
Optionally, the rule can suggest including a tool usage cheat sheet table to explain appropriate tool usage for different information-gathering needs during the planning process with the need vs the actual tool name.