Spec-First, Looping, and Embedded AI

Detailed specifications up front can help deliver better AI coding results.

What you’ll learn:

  • What is spec-first or spec-driven development (SDD) AI design?
  • What is looping?
  • What is the difference between SDD and prompt-first?

Generative AI and chatbots have taken over internet search whether you like it or not, since they’re embedded into every major search engine. Added to that mix are dozens, if not hundreds, of standalone chatbots to choose from. It comes as no surprise, then, that most users are overwhelmed by artificial intelligence (AI) alternatives.

Basic chatbot prompting is what many people do these days. Prompt programming was all the rage, but there are challenges with this approach. Hence, we’re seeing the emergence of spec-driven development (SDD) and loop engineering, two terms that aren’t even in Wikipedia yet. So, is it worth diving down these rabbit holes yet?

What is Spec-Driven Development?

SDD or spec-first development puts specification of an application or task first. It’s actually not much different from doing a high-level, model-based design where requirements are the starting point. From a prompt engineering perspective, this means including specifications at the start of the process. The approach more often targets software generation, where requirements are typically spelled out ahead of time rather than having the generative AI system deliver responses based on the prompt and assumed requirements.

The SDD approach focuses on AI agents and continuous-integration (CI) pipelines; specifically, explicit constraints as well as verification rules that can be utilized by the chatbots to create solutions as well as test them. An SDD approach can work in conjunction with existing test-driven development (TDD), behavior-driven development (BDD), and domain-driven design (DDD).

SDD requires a more detailed presentation than what I’m able to include here right now. So stay tuned, or engage your favorite chatbot for a more detailed explanation.

What is Loop Engineering?

Loop engineering is a new genAI paradigm that moves development into an agentic AI mode of operation. The term came up in an X discussion started by Peter Steinberger, the creator of OpenClaw. That’s not surprising, as OpenClaw is a local AI system designed to tie chatbots, large language models (LLMs), and tasks together. You can install OpenClaw using this command line on Linux, MacOS, or Windows but I would not recommend that until you have read the docs, examples, etc.:

powershell -c "irm https://openclaw.ai/install.ps1 | iex"

I tend to run it and other AI stuff in a sandbox or virtual machine where it doesn’t have access to my real-world applications and data. As noted in the past:

“To err is human; to really foul things up requires a computer.”

It should now be:

“To err is human; to really foul things up requires agentic AI.”

Anyway, back to loop engineering, which is essentially a form of agentic AI.

With loop engineering, we’re designing a system with an LLM AI agent that examines the current state, determines the next action to perform using an LLM, and performs the action. The agent needs a goal to work toward when the loop is started. This can be modified over time.

Developers can blend SDD and loop engineering. Whether any of this will find its way into an embedded application is up to developers, who need to determine whether it’s possible, what are the benefits that it can provide, and will it be reliable enough to deploy in the field?

Keep in mind that these tools may not necessarily be deployed in the field in an application. However, they can be used to assist in the application-development or quality-control processes. Developers and management will need to determine whether the AI costs — monetary and security costs — warrant their use.

About the Author

William G. Wong

Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sign up for our eNewsletters
Get the latest news and updates

Comment About the Article

To join the conversation, and become an exclusive member of Electronic Design, create an account today!