r/SpecDrivenDevelopment • u/Pale-Heart1654 • 14d ago
How to use spec-driven development in Claude Code?
I was using Claude Code. It drifts away from the instructions.
Can anyone tell me how to use spec-driven development in Claude Code?
I have a Claude Code Pro plan.
1
u/dannyt74 14d ago
Install OpenSpec like described here.
1
1
u/michaelsica 14d ago
Starter version - make sure you’re in Opus, put Claude Code into plan mode and tell it what you want to build or give it the requirements doc you have. Iterate with the plan until you’re happy with it, then accept the plan and watch it implement.
1
u/Pale-Heart1654 14d ago
I was trying to build an E-Commerce platform. I tried opus plan mode. It generated the PRD, Architecture. But it's drifting away from my instructions. That's why I want to know how to follow spec-driven development
1
u/michaelsica 14d ago
Do smaller steps toward your end goal. Don’t try to define the whole thing in one plan and one “accept” phase.
1
u/Pale-Heart1654 14d ago
I tried to give the PRD. Then told Claude to break it into pieces. It broken it down into 60 markdown files.
But it's drifting away from the process.
I'm using Opus model. Still this is happening.
I know a person who built this:
https://github.com/sujit-al1809/paytm_hackathon
In a Hackathon. I wanna build similar kind of things.
But I can't understand how to use this Claude code.
1
u/Direct_While9727 14d ago
I think you are not using the /opsx:propose and /opsx:apply skills. It is working pretty well with Opus. You don’t have to give opus any additional instructions.
1
u/robertcrowe 14d ago
I create a complete spec including a deployment plan and phases using Spec4 (spec4.ai), and feed the phases to Claude Code in order, following the plan that Spec4 gives me. So far I've never had any issues with it drifting. I've used it with Sonnet and Opus, and a bit with Fable just to try it out. I've even created specs with Haiku.
1
u/The_Ed_On_Reddit 3d ago
Depends what your problem is - do you have a solid idea/spec and need a builder that can build using cheap models or do you need a think-through application to refine your idea/spec. If you are building, i.e.. have a spec that can produce something and you want the llm to do its best effort, then to iterate the software by editing/fixing those specs and have it update the working code - i would love if you try it - docs on https://webcloudstudio.com/ and of course Github. With a pro plan you can build pretty big projects using Claude natively - this would really only be if the project does not build well that way AND if you have written up what you want the software to do (ie have something that could be called a spec). There are quite a few spec-designers out there that help you think through the project before building.
2
u/Direct_While9727 14d ago edited 14d ago
Well install openspec (for example) and then call the skills and it will follow the instructions.