DEV Community

Cover image for Elevate Your AI-Driven Coding Workflow
yysun
yysun

Posted on

Elevate Your AI-Driven Coding Workflow

Working with AI code assistants like GitHub Copilot, you need more than just simple, one-off, “write code” prompts. You can use some advanced techniques to create a structured, iterative process that ensures clarity, code quality, and alignment with your objectives.

1. Advanced AI-Driven Coding Techniques

Here are some techniques I usually found useful and correspondent prompts:

  • Request a plan, review and confirm: “provide your plan in a concise bullet list and wait for my confirmation before proceeding”
  • Request multiple options: “provide implementation options and comparisons and wait for me to confirm before proceeding”
  • Iterate step by step: “apply the changes step by step and wait for me to say "next" before proceeding to the next step”
  • Keep docs in sync: Eliminate outdated or missing documentation.

Using these prompts transforms the AI assistant into a structured collaborator that follows a reproducible workflow.

can be transformative—automating repetitive tasks, accelerating development, and offering creative suggestions.

2. Setting Up Prompt Alias

You have noticed though typing long instructions each time can become tedious. To solve the problem, we introduce prompt aliases—short, “magic words” that trigger the advanced behaviors described above:

  • AA: Request a concise plan before writing code.
  • CC: Compare implementation options.
  • SS: Apply changes incrementally, confirming at each step.
  • GG: Auto-generate or update documentation, including mermaid diagrams if needed.

All we need to do is create a system prompt for your AI coding assistant.

- I will use the following words to indicate how you should proceed with the code changes:
  - "AA": provide your plan in a concise bullet list and wait for my confirmation before proceeding.
  - "CC": provide implementation options and comparisons and wait for me to confirm before proceeding.
  - "SS": apply the changes step by step and wait for me to say "next" before proceeding to the next step.
  - "GG": summarize the features you implemented into a markdown file into the docs folder. 
      - If the file does not exist, create a new markdown file with existing features and the new changes.
      - If the file already exists, update the file by consolidating existing features with new changes.
      - Use mermaid diagrams if needed.
Enter fullscreen mode Exit fullscreen mode

Each AI code assistant has its own way of customizing system prompts. In the case of Github Copilot, we can create and save the above in the file ‘./gihub/copilot-instructions.md, see Customize chat responses in VS Code

3. A Sample Interaction

Once customized the system prompt of AI code assistant, you can use the prompt alias like below:

Imagine you want to add a “purchase history” endpoint to your e-commerce API. Here’s how to orchestrate the AI assistant:

  1. Plan Phase (AA):

    You type: implement "purchase history" retrieval endpoint AA

    • Then AI returns a plan:
      1. Create or modify the purchase_history database schema.
      2. Add a service layer function to fetch purchase records.
      3. Implement an Express route /purchase-history.
      4. Write unit tests for the new route and service.
      5. Update documentation in docs/FEATURES.md.
    • You can review and confirm.
  2. Compare Options (CC):

    You type: design purchase history database. CC

    • The AI lists:
      1. Relational join table (Pros: ACID compliance; Cons: join complexity)
      2. MongoDB collection (Pros: flexible schema; Cons: eventual consistency)
      3. Redis caching layer (Pros: fast lookup; Cons: non‑persistent)
    • You reply: Let’s proceed with option 1 (relational join table).
  3. Step‑by‑Step Implementation (SS):

    You type: Start coding the purchase history feature. SS

    • Step 1: The AI generates a database migration for a new purchase_history table (fields: id, user_id, product_id, quantity, timestamp).
    • You review the SQL, run migrations locally, then say “next.”
    • Step 2: The AI writes the service function getPurchaseHistory(userId) that queries the join table.
    • You run a unit test, say “next.”
    • Step 3: The AI implements the Express route /api/purchase-history/:userId.
    • You verify functionality with Postman, then say “next.”
    • Step 4: The AI generates unit tests for the route.
    • You run tests, confirm all pass, then say “next.”
  4. Documentation (GG):

    You type: GG

    • The AI checks for docs/FEATURES.md. If missing, it creates the file with a header “# Features,” adds a “## Purchase History” section, includes a description, endpoint details, sample request/response, and a mermaid sequence diagram.

Of course, these aliases can be used independently.

And you can change them to whatever magic word you like, as long as they are easy to type and easy to memorize!

4. Conclusion

Adopting advanced prompts elevates your AI-driven coding workflow from sporadic code suggestions to a structured, collaborative process. You gain:

  • Clarity and Focus: Eliminate scope creep with upfront planning.
  • Informed Decisions: Evaluate trade-offs before coding.
  • Quality Control: Vet every change to catch bugs early.
  • Up‑to‑Date Documentation: Automate or update docs to reduce technical debt.

By using prompt aliases saves your time of typing the prompts and makes you more productive.

Embracing these powerful prompt aliases now to focus on evaluating code quality also achieves unparalleled efficiency. Start today and experience the transformation.

Top comments (0)