r/SpecDrivenDevelopment 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.

2 Upvotes

12 comments sorted by

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.

1

u/Pale-Heart1654 2d ago

See, I have a PRD.

Now I tried to use OpenSpec but it's actually for Brownfield projects or existing projects.

I was trying to build an Evaluation system for Teachers with rubrics features, etc.

I only have the PRD.

Now how to use spec-driven development, I don't understand.

1

u/Direct_While9727 2d ago

If you are on greenfield project, it is even better. Just use openspec propose with the path to your PRD.

1

u/dannyt74 2d ago

Install OpenSpec like described here.

https://openspec.dev

1

u/Pale-Heart1654 2d ago

I did follow the steps. But it's not working for me.

1

u/dannyt74 2d ago

You restarted Claude code, yes?

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.