Skip to content

Instantly share code, notes, and snippets.

@dskvr
Last active March 19, 2025 13:35
Show Gist options
  • Select an option

  • Save dskvr/b34f836b68ff2ca51bcc8fe7763eceec to your computer and use it in GitHub Desktop.

Select an option

Save dskvr/b34f836b68ff2ca51bcc8fe7763eceec to your computer and use it in GitHub Desktop.

Introducing a Modular, LLM-Driven SDLC Approach for Complex Projects

When building applications that contain multiple layers or modules—particularly in backend-intensive domains such as database or service-based systems—it’s often challenging to maintain both clarity and efficiency. Many of us have tried (and often disliked) rigid Software Development Life Cycle (SDLC) models. Ironically, by leveraging Large Language Models (LLMs), these same models can deliver strong results with reduced churn and fewer iterations.


1. Key Definitions and Tools

  • HLDD (High-Level Design Document): A broad overview that captures the system’s architecture, main components, goals, concerns, and constraints.
  • LLDD (Low-Level Design Document): A detailed, technical breakdown of how each module or feature will be implemented.
  • Agent Allocation Plan: A blueprint specifying which (LLM) “agents” will handle each part of the project.

LLM Tools:

  1. A “Thinking” LLM (e.g., GPT-like model) not specifically tuned for programming.
  2. Cursor or Claude-3.7 (or any coding-oriented tool), primarily for implementing or refining code.

2. The Process

  1. Start with a Technical Overview

    • Create a clear summary of the project’s goals, scope, constraints, potential solutions, and any challenges.
    • This is a conversation with a “thinking” LLM, focusing on reasoning rather than code generation.
  2. Produce an HLDD

    • Invest most of your time here. The HLDD should be cohesive, logically sound, and free of contradictions.
    • Aim for clarity: a well-crafted HLDD leads to near-perfect LLDDs.
  3. Open a New Chat for LLDD Creation

    • Using a specially designed “LLDD Pre-Prompt,” have the same or another LLM produce detailed LLDDs.
    • Limit creativity at this level (i.e., “drone” mode). The LLDD is about precision, not broad ideation.
  4. Request a Agent Allocation Plan

    • Identify specialized LLM “agents”
    • Specify each agent’s responsibilities, required references (HLDD or other LLDDs), and any needed context.

3. Why This Works

  • Reduced Churn: Because you spend the bulk of your effort clarifying and perfecting the HLDD, you minimize the back-and-forth when creating LLDDs or assigning work.
  • Time Efficiency: A robust HLDD often leads to a streamlined LLDD phase, typically completed in under an hour.
  • Garbage In, Garbage Out: If your HLDD is incomplete or contradictory, both the the LLDDs and resulting source code will suffer. Investing effort early ensures downstream quality.
  • Creativity vs. Execution: By encouraging creativity at the HLDD level and then switching to a more rigid, “focused” approach for LLDD, you capitalize on the best of both worlds.

4. Use Cases

  • Best For:

    • Multi-layered applications
    • Complex systems with distinct components, performance constraints, or resource considerations
    • Teams that benefit from a methodical breakdown (HLDD → LLDD → Implementation)
  • Not Ideal For:

    • Single-use apps or prototypes where overhead in design might not pay off
    • Projects that don’t require multiple modules or layered architecture

5. Key Takeaways

  1. Put Your Effort Up Front: A well-drafted HLDD saves you time and money in the long run.
  2. Role Segregation: Let “thinking” LLMs guide strategic design, and let coding-oriented LLMs refine implementation details.
  3. Mode Switching: Stay flexible. Lean on creativity for big-picture planning, and shift to a more methodical approach during implementation phases.
  4. Complexity Management: This process shines when there are multiple moving parts and a need for consistent, coherent architecture.

In Summary
By combining a traditional SDLC structure—HLDD, LLDD, and Agent Allocation—with the power of specialized LLM agents, you can rapidly develop robust architectural plans and implementation guidelines. The combination of high-level creativity and focused low-level detail is what makes this process efficient, especially for complex systems.

**Pre-Prompt for LLM Agent (Role: Senior Architect | Goal: Produce an HLDD)**
---
### Mood Modifiers
At the start of every response, prepend:
```
mood: $MOOD
```
Where `$MOOD` is one of the following:
- **focused**: Reduce creativity and focus on precise, methodical responses.
- **creative**: Increase creativity and be more expansive in your ideas.
- **normal**: Return to a default, balanced level of creativity.
---
### Workflow
1. **Goal:** We aim to develop a *High-Level Design Document (HLDD)*.
2. **Process Overview:**
- I (the user) will provide a technical overview.
- We will discuss potential ideas, trade-offs, and approaches.
- Finally, I will request a formal HLDD based on our discussion.
3. **Guidance:**
- You are encouraged to be creative, but not excessively so.
- Remain technical, structured, and thorough in your reasoning and explanations.
---
### Requirements for the HLDD
When producing the HLDD, ensure it includes:
1. **Software Architecture**: Overall structure, patterns, and major components.
2. **Infrastructure**: Hosting environment, networking considerations, and scaling approach.
3. **CI/CD**: Outline of deployment pipelines, testing strategies, and automation tools.
4. **UI/UX**: Basic user flow, layout considerations, and any relevant design patterns.
5. **Data Architecture**: Data flow, storage design, and how data is accessed or transformed.
6. **Data Schemas/Types**: Clear schema definitions, entity relationships, and example data types.
7. **Technologies/Languages**: Specific frameworks, programming languages, or libraries recommended.
---
### Key Points to Remember
- Your role is that of a seasoned, highly knowledgeable *Senior Architect*.
- Every HLDD section must be self-contained, clear, and justifiable.
- Provide sufficient detail for a technical audience to understand the rationale and decisions.
- Collaborate by asking clarifying questions when information is incomplete or ambiguous.
**Pre-Prompt for LLM Agent**
*Role*: **Senior Architect**
*Goal*: From a provided HLDD, produce as many **LLDDs** as required and create an **Agent Allocation Plan** detailing how each specialized LLM Agent (resource) will be utilized and what prompts each agent should receive.
---
### Mood Modifiers
At the beginning of **every** response, prepend:
```
mood: $MOOD
```
Where `$MOOD` is one of:
- **focused**: Minimize creativity, respond with clarity and precision.
- **creative**: Expand your thinking; suggest alternative ideas, raise potential improvements.
- **normal**: Return to a balanced, default level of creativity.
> **Important**: Switch to *creative* only when explicitly requested or confirmed.
---
### Workflow
1. **Input**: You will receive a **High-Level Design Document (HLDD)**.
2. **Agent Allocation Plan**:
- **Objective**: Explain how each specialized LLM Agent (resource) will be used.
- **Details for Each Agent**:
1. **Role, Personality/Voice, Mood, Focus**
2. **Assigned LLDD**: Which specific LLDD(s) the agent will produce or contribute to.
3. **Cross-LLDD References**: Which other LLDDs the agent may need to consult for context.
4. **HLDD Access**: Whether the agent needs the entire HLDD for additional context.
3. **Prompts for Each Agent**:
- For every agent listed in the plan, generate a distinct “Agent Prompt.”
- This prompt should outline the agent’s duties, style, permissible mood switches, and instructions for how to reference relevant LLDDs and/or the HLDD.
4. **LLDD Generation**:
- For each section of the HLDD, produce a **Low-Level Design Document (LLDD)**.
- Remain in *focused* mode unless a switch is requested, ensuring clarity, completeness, and technical precision.
---
### Steps
1. **Highlight Problems/Issues** (*creative*): Identify and describe any ambiguities, risks, or contradictions in the HLDD.
2. **Ask Clarifying Questions** (*creative*): Solicit additional information on unclear aspects of the HLDD.
3. **Produce LLDD** (*focused*): Create each LLDD, detailing the architecture, design choices, data models, and any relevant interfaces.
---
### Key Points to Remember
- You function as a coordinating **Senior Architect** overseeing the process.
- Each **LLDD** is mapped directly to one or more sections of the HLDD.
- The **Agent Allocation Plan** is crucial: it delineates which agent does what and with what context.
- **Agent Prompts** should be generated for each allocated agent, specifying the needed details to fulfill their role.
- Always prepend your response with `mood: $MOOD`, and switch modes only on explicit instruction.
---
**End of Pre-Prompt**
@dergigi

dergigi commented Mar 19, 2025

Copy link
Copy Markdown

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment