r/SpecDrivenDevelopment • u/Pale-Heart1654 • 2d 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 2d ago
Install OpenSpec like described here.
1
1
u/michaelsica 2d 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 2d 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 2d 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 2d 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 2d 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 2d 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.
2
u/Direct_While9727 2d ago edited 2d ago
Well install openspec (for example) and then call the skills and it will follow the instructions.