opencode-auto-agent 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -0
- package/bin/cli.js +104 -0
- package/package.json +54 -0
- package/src/commands/doctor.js +91 -0
- package/src/commands/init.js +190 -0
- package/src/commands/run.js +147 -0
- package/src/commands/setup.js +40 -0
- package/src/lib/constants.js +33 -0
- package/src/lib/fs-utils.js +63 -0
- package/templates/agents/developer.md +58 -0
- package/templates/agents/docs.md +47 -0
- package/templates/agents/orchestrator.md +67 -0
- package/templates/agents/planner.md +55 -0
- package/templates/agents/qa.md +66 -0
- package/templates/agents/reviewer.md +58 -0
- package/templates/context/README.md +4 -0
- package/templates/presets/java.md +55 -0
- package/templates/presets/nextjs.md +80 -0
- package/templates/presets/springboot.md +69 -0
- package/templates/rules/universal.md +31 -0
- package/templates/sample-config.json +21 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Preset: Spring Boot
|
|
2
|
+
|
|
3
|
+
Extends the Java preset with Spring Boot-specific conventions.
|
|
4
|
+
|
|
5
|
+
## Framework
|
|
6
|
+
- Spring Boot 3.x (Java 17+)
|
|
7
|
+
- Spring Web MVC or WebFlux (detect from dependencies)
|
|
8
|
+
- Spring Data JPA (if relational DB)
|
|
9
|
+
|
|
10
|
+
## Project Structure Conventions
|
|
11
|
+
```
|
|
12
|
+
src/main/java/com/example/app/
|
|
13
|
+
config/ # @Configuration classes
|
|
14
|
+
controller/ # @RestController classes
|
|
15
|
+
service/ # @Service classes (business logic)
|
|
16
|
+
repository/ # @Repository interfaces (data access)
|
|
17
|
+
model/ # @Entity / DTO classes
|
|
18
|
+
exception/ # Custom exceptions + @ControllerAdvice
|
|
19
|
+
security/ # Security config (if applicable)
|
|
20
|
+
src/main/resources/
|
|
21
|
+
application.yml # or application.properties
|
|
22
|
+
db/migration/ # Flyway/Liquibase migrations
|
|
23
|
+
src/test/java/
|
|
24
|
+
... # Mirror of main structure
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Naming Conventions
|
|
28
|
+
- Controllers: `<Entity>Controller` (e.g., `UserController`)
|
|
29
|
+
- Services: `<Entity>Service` / `<Entity>ServiceImpl`
|
|
30
|
+
- Repositories: `<Entity>Repository`
|
|
31
|
+
- DTOs: `<Entity>Request`, `<Entity>Response`
|
|
32
|
+
- Entities: match domain model name (e.g., `User`, `Order`)
|
|
33
|
+
- Config: `<Feature>Config` (e.g., `SecurityConfig`)
|
|
34
|
+
|
|
35
|
+
## Testing Expectations
|
|
36
|
+
- Unit tests: JUnit 5 + Mockito for service layer
|
|
37
|
+
- Integration tests: `@SpringBootTest` for controller + full stack
|
|
38
|
+
- Slice tests: `@WebMvcTest`, `@DataJpaTest` for isolated layers
|
|
39
|
+
- Run: `mvn test` or `gradle test`
|
|
40
|
+
- Test database: H2 in-memory or Testcontainers
|
|
41
|
+
- API tests: use MockMvc for controller tests
|
|
42
|
+
|
|
43
|
+
## Build & Verification
|
|
44
|
+
- Build: `mvn clean package -DskipTests` (compile check) or `gradle build`
|
|
45
|
+
- Full verify: `mvn verify` or `gradle check`
|
|
46
|
+
- Run: `mvn spring-boot:run` or `gradle bootRun`
|
|
47
|
+
- Check actuator health: `GET /actuator/health`
|
|
48
|
+
|
|
49
|
+
## Spring-Specific Rules
|
|
50
|
+
- Use constructor injection (not field injection with `@Autowired`)
|
|
51
|
+
- Use `@Transactional` at the service layer, not the controller
|
|
52
|
+
- Return `ResponseEntity<>` from controllers for explicit HTTP status control
|
|
53
|
+
- Use DTOs for API input/output — do not expose entities directly
|
|
54
|
+
- Use `@Valid` / `@Validated` for request body validation
|
|
55
|
+
- Configure CORS via `WebMvcConfigurer`, not per-controller annotations
|
|
56
|
+
- Put sensitive config in environment variables, not `application.yml`
|
|
57
|
+
|
|
58
|
+
## API Conventions
|
|
59
|
+
- REST endpoints: `GET /api/v1/users`, `POST /api/v1/users`, etc.
|
|
60
|
+
- Use plural nouns for resource paths
|
|
61
|
+
- Return appropriate HTTP status codes (201 for creation, 204 for delete, etc.)
|
|
62
|
+
- Use `@ExceptionHandler` / `@ControllerAdvice` for consistent error responses
|
|
63
|
+
|
|
64
|
+
## Common Pitfalls
|
|
65
|
+
- Do not use `@Autowired` on fields — use constructor injection
|
|
66
|
+
- Do not put business logic in controllers — delegate to services
|
|
67
|
+
- Do not return JPA entities directly from controllers — use DTOs
|
|
68
|
+
- Do not forget to add `@Transactional(readOnly = true)` for read-only queries
|
|
69
|
+
- Do not hardcode profiles — use `application-{profile}.yml`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Universal Engineering Rules
|
|
2
|
+
|
|
3
|
+
These rules apply to ALL agents in ALL presets. They are non-negotiable.
|
|
4
|
+
|
|
5
|
+
## Process Rules
|
|
6
|
+
1. **Plan before coding.** Every non-trivial change must have a plan reviewed before implementation begins.
|
|
7
|
+
2. **Test after implementing.** No implementation step is complete until tests pass.
|
|
8
|
+
3. **Review before merging.** Code review is mandatory for all changes.
|
|
9
|
+
4. **One thing at a time.** Complete one task fully (plan → implement → test → verify) before starting the next.
|
|
10
|
+
|
|
11
|
+
## Code Quality Rules
|
|
12
|
+
1. **Keep changes minimal.** Only modify what the task requires. Do not refactor unrelated code.
|
|
13
|
+
2. **No dead code.** Do not leave commented-out code, unused imports, or unreachable branches.
|
|
14
|
+
3. **No hardcoded secrets.** Never commit passwords, API keys, tokens, or connection strings.
|
|
15
|
+
4. **Consistent naming.** Follow the project's existing naming conventions. When in doubt, read nearby code.
|
|
16
|
+
5. **Error handling.** All external calls (I/O, network, parsing) must have error handling.
|
|
17
|
+
|
|
18
|
+
## Documentation Rules
|
|
19
|
+
1. **Update docs when behavior changes.** If the public interface or behavior changes, docs must be updated in the same task.
|
|
20
|
+
2. **Do not duplicate.** Reference existing documentation rather than repeating it.
|
|
21
|
+
3. **Keep README current.** Setup instructions, environment variables, and usage examples must stay accurate.
|
|
22
|
+
|
|
23
|
+
## Communication Rules
|
|
24
|
+
1. **Be specific.** Reference file paths and line numbers, not vague descriptions.
|
|
25
|
+
2. **Report blockers immediately.** If a step cannot be completed, say so with a clear reason.
|
|
26
|
+
3. **Structured output.** Use the output format defined in your agent specification.
|
|
27
|
+
|
|
28
|
+
## Context Rules
|
|
29
|
+
1. **Always load context first.** Read the runtime context file before starting any work.
|
|
30
|
+
2. **Respect the preset.** Framework-specific rules in the active preset override general conventions.
|
|
31
|
+
3. **Read existing code.** Understand what exists before creating something new.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://github.com/ai-starter-kit/config-schema",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"preset": "java",
|
|
5
|
+
"docsPath": "./Docs",
|
|
6
|
+
"tasksPath": "./PRD.md",
|
|
7
|
+
"outputPath": "./",
|
|
8
|
+
"engine": "opencode",
|
|
9
|
+
"agents": {
|
|
10
|
+
"orchestrator": { "enabled": true },
|
|
11
|
+
"planner": { "enabled": true },
|
|
12
|
+
"developer": { "enabled": true },
|
|
13
|
+
"qa": { "enabled": true },
|
|
14
|
+
"reviewer": { "enabled": true },
|
|
15
|
+
"docs": { "enabled": true }
|
|
16
|
+
},
|
|
17
|
+
"orchestrator": {
|
|
18
|
+
"workflowSteps": ["plan", "implement", "test", "verify"],
|
|
19
|
+
"requirePlanApproval": false
|
|
20
|
+
}
|
|
21
|
+
}
|