跳到正文
DEV Community· Bervianto Leo Pratama·· 2 小時前AI 評分43

以 IBM Bob 實踐規格優先開發

Spec First with IBM Bob

AI 導讀

IBM Bob v2.1.0 可原生讀取及編輯 Office 檔案,作者以 .docx 格式的 SRS 指引它分析及修復未完成的既有應用程式。IBM Bob 先就規格與現有程式碼的歧義提出問題,再按確認的計劃執行,並協助把前端由 react-scripts 遷移至 Vite、修正 CORS 及 API 與 UI 狀態不一致問題。

正文

Cover image for Spec First with IBM Bob

Bervianto Leo Pratama

Prelude

IBM Bob v2.1.0 has a great feature that allows you to "natively" read and edit Office files, such as docx, xlsx, and pptx. I decided to use a .docx file as a "spec" (specification) to see if this is an effective way to prompt or instruct an AI agent. I believe many of us have heard about the "Spec-First" approach—driving AI development with a list of specifications and breaking down coding tasks from them.

Context

I have an existing project that is broken or unfinished due to limited time. I tried to maintain it previously, but I haven't had the bandwidth to properly debug, fix, and address legacy issues. I decided to involve IBM Bob to understand the existing state of the project and see if it could help drive the remediation.

PersonalWeb

My Personal Web - REVAMP!

Structures

Database Design

Visit here

License

MIT

MIT License
Copyright (c) 2021 Bervianto Leo Pratama's Personal Projects

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

…

IBM Bob's Understanding

  1. Let's start with /init (I was using Agent mode).
  2. Bob's coin usage depends entirely on your codebase. My usage was 2.29 Bob Coins. It will produce AGENTS.md, .bob/rules-agent/AGENTS.md, .bob/rules-ask/AGENTS.md, and .bob/rules-plan/AGENTS.md. So far, this acts primarily as a way to regulate IBM Bob's behavior, which I found to be a great response.

Init result

Let's Prepare the Spec & Implement it!

I created a new session to clear the context window and see how IBM Bob responded to the document I prepared before.

  1. I created a task/session and selected Plan mode, then prompted IBM Bob to read the SRS document.
  2. It gave a great response, asking smart follow-up questions because there were some ambiguities or conflicts with the existing codebase conditions.
  3. Once the answers were clear, I started the implementation. After the plan was finalized, I asked IBM Bob to execute it, and the tool automatically switched to Agent mode.
  4. This step cost around 21.31 Bob Coins—quite high due to the preexisting issues I mentioned earlier.

Notes:

  • You might be warned about reaching the maximum ideal turns. You can try to continue (as I did), though results may vary. It is generally recommended to keep the number of turns manageable.
  • Ensure your changes are intentional. I intended to remove/rename an existing column since I haven't deployed this app yet. If you are working on an already-deployed production app, make sure you maintain backward compatibility!

Extra Steps (Planning First!)

I needed an extra step: modernizing the application from react-scripts to Vite. Let's start with the plan. If you remember my previous article on modernizing a Vue app using IBM Bob, IBM Bob was able to leverage existing skills here as well, using around 6.82 Bob Coins.

Notes: I also asked IBM Bob to fix some issues.

Side Notes

I really appreciate how IBM Bob helped resolve some specific hiccups:

  1. I'm using .NET Aspire to run the admin tools, but I ran into a CORS issue. IBM Bob successfully tracked it down and resolved it by fixing the Nginx template I use to proxy between the API and the frontend.
  2. IBM Bob also resolved partial mismatches and out-of-sync states between the API and UI.

Result

You can review the complete artifacts from this remediation process below:

Lesson Learned

I am quite satisfied with the results from IBM Bob. Even though my codebase wasn't the cleanest starting point, IBM Bob provided a solid framework for enhancing an existing application.

Have you had any experience using IBM Bob, especially for modernization tasks? Let's share our thoughts in the comments section!

GIF Share

來源:DEV Community · dev.to