I would like to include a sample prompt (I am playing with it now), for Cursor Composer which generates quite a few files. It;s a Scala one, but it could give others an idea on how to prompt Cursor Composer:
## What I have done (example, in 5 steps)
I developed a feature called Login using Outside in TDD in my Scala project, for a domain entity called User and defined as @ User.scala .
*The path to my GET endpoint is: *
### Step 1: Acceptance test
First I made an acceptance test @ LoginAcceptanceTest.scala (module 03-infra).
It uses a @UserGenerator.scala to generate new Users (module 03-infra).
It also uses the edpClient to make the login http call to the server.
It @LoginRequest.scala and a @ LoginResponse.scala (module http-client).
*In order for it to fail for the right reason, I had to create the endpoint: *
and return some dummy data so the test fails, because the result isn’t the same, but the server works.
### Step 2: TDD using a unit test the controller
*### Step 3: TDD using a unit test the use case *
*I made Unit test @ LoginTest.scala and the @ Login.scala use case (both module 02-app). *
### Step 4: TDD using an integration test the mongo repository functions.
I created an integration test for @ LoginRepositoryIT.scala (module 03-infra) for @ LoginMongoRepository.scala (module 03-infra) which overrides the trait @ LoginRepository.scala (module 02-app).
### Step 5: Acceptance test passes
When all the other tests pass, the acceptance test passes.
## What I need now?
I now want to create a new feature, called FindDocuments, for a domain entity called Document to be defined as:
```
case class Document(
- override val id: UUID,*
- title: String,*
- dateAdded: Instant,*
- size: Int,*
- unread: Boolean = true*
) extends Entity[UUID] derives BaseCirce
```
So we’ll need, a new controller DocumentsController, which extends a new endpoint GET “api/1/documents”, that receives a DocumentsRequest and returns a DocumentsResponse, which will contain a list of DocumentDTO. It will use a DocumentGenerator to write the acceptance test: FindDocumentsAcceptanceTest
- I will also need the use case FindDocuments and the DocumentsMongoRepository that extends DocumentsRepository. *
- Then I will need the DocumentGenerator, for the acceptance test: FindDocumentsAcceptanceTest, then the unit tests FindDocumentsControllerTest and FindDocumentsTest and the interation test for DocumentsMongoRepository*