agent-workflow-kit-cli 1.0.0-mvp → 1.2.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/dist/cli/commands/add.js +134 -0
- package/dist/cli/commands/doctor.js +21 -0
- package/dist/cli/commands/export.js +3 -2
- package/dist/cli/commands/init.js +32 -5
- package/dist/cli/index.js +17 -1
- package/dist/core/analyzer.js +462 -0
- package/dist/core/detector.js +102 -55
- package/dist/core/renderer.js +13 -3
- package/package.json +1 -1
- package/templates/common/AGENTS.md.hbs +15 -20
- package/templates/common/skills/build-skill/SKILL.md +38 -0
- package/templates/fastapi/rules/python-style.md +12 -17
- package/templates/python-ai/AGENTS.md.hbs +36 -0
- package/templates/python-ai/rules/ai-hardware.md +36 -0
- package/templates/python-ai/rules/ai-style.md +30 -0
- package/templates/python-ai/skills/ai-agent/SKILL.md +24 -0
- package/templates/python-ai/skills/ai-debug/SKILL.md +31 -0
- package/templates/python-ai/skills/ai-model/SKILL.md +25 -0
- package/templates/python-ai/skills/ai-pipeline/SKILL.md +24 -0
- package/templates/react-ts/rules/react-style.md +19 -24
- package/templates/spring-boot/AGENTS.md.hbs +60 -6
- package/templates/spring-boot/rules/code-review.md +22 -0
- package/templates/spring-boot/rules/java-style.md +6 -11
- package/templates/spring-boot/rules/microservice-style.md +22 -0
- package/templates/spring-boot/rules/production-ready.md +20 -0
- package/templates/spring-boot/skills/spring-debug/SKILL.md +35 -0
- package/templates/spring-boot/skills/spring-feature/SKILL.md +24 -12
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spring-debug
|
|
3
|
+
description: Systematically diagnoses and fixes a Java Spring Boot bug or runtime error
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Follow this workflow to diagnose, reproduce, and resolve a bug or test failure in the Spring Boot application.
|
|
7
|
+
|
|
8
|
+
Inputs:
|
|
9
|
+
- errorMessage: Stack trace, error logs, or problem description
|
|
10
|
+
- componentName: Name of the suspected class, package, or API endpoint
|
|
11
|
+
|
|
12
|
+
Steps:
|
|
13
|
+
1. **Analyze Exception Stack Traces:**
|
|
14
|
+
- Read the logs to identify the root cause exception type (e.g., `NullPointerException`, `DataIntegrityViolationException`, `LazyInitializationException`).
|
|
15
|
+
- Trace the error to the specific line number in the codebase.
|
|
16
|
+
|
|
17
|
+
2. **Isolate and Create a Reproducer Test Case:**
|
|
18
|
+
- Before editing the code, write a minimal unit test (in `src/test/java/`) that reproduces the error.
|
|
19
|
+
- For Controller errors: Add a test inside the corresponding `@WebMvcTest`.
|
|
20
|
+
- For DB/Repository query errors: Add a test inside the corresponding `@DataJpaTest`.
|
|
21
|
+
- Run the test and confirm it fails with the reported exception.
|
|
22
|
+
|
|
23
|
+
3. **Check Database Queries & Configurations:**
|
|
24
|
+
- If the error involves data persistence, check the console output or enable Hibernate SQL logs:
|
|
25
|
+
`logging.level.org.hibernate.SQL: DEBUG`
|
|
26
|
+
- Inspect database constraints (e.g., non-null columns, unique constraints, foreign keys) and compare them with JPA Entity annotations.
|
|
27
|
+
|
|
28
|
+
4. **Verify Transactions & Proxies:**
|
|
29
|
+
- Verify if `@Transactional` is declared correctly. Check if the error is caused by self-invocation traps (calling transactional methods from within the same class).
|
|
30
|
+
|
|
31
|
+
5. **Apply the Fix & Re-Verify:**
|
|
32
|
+
- Fix the bug in the code.
|
|
33
|
+
- Run the reproducer test case to verify it now passes.
|
|
34
|
+
- Run the full project verification command:
|
|
35
|
+
- `{{buildCommand}} clean test`
|
|
@@ -11,16 +11,28 @@ Inputs:
|
|
|
11
11
|
|
|
12
12
|
Steps:
|
|
13
13
|
1. Examine neighboring feature packages for error handler conventions and mappings.
|
|
14
|
-
2.
|
|
14
|
+
2. Identify or create the target packages under `src/main/java/{{packagePath}}`.
|
|
15
15
|
3. Implement layers:
|
|
16
|
-
|
|
17
|
-
- `
|
|
18
|
-
- `
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
-
|
|
16
|
+
{{#if (eq packageLayout "feature-first")}}
|
|
17
|
+
- `entity/`: Database models inside the feature package (`src/main/java/{{packagePath}}/\{{featureName}}/entity/`).
|
|
18
|
+
- `repository/`: Spring Data JPA interface inside the feature package (`src/main/java/{{packagePath}}/\{{featureName}}/repository/`).
|
|
19
|
+
- `dto/`: Request/Response schemas with `{{validationLibrary}}` annotations (`src/main/java/{{packagePath}}/\{{featureName}}/dto/`).
|
|
20
|
+
- `service/`: Service interfaces and implementations (`src/main/java/{{packagePath}}/\{{featureName}}/service/`).
|
|
21
|
+
- `web/`: Controller class exposing `@RestController` with proper mappings (`src/main/java/{{packagePath}}/\{{featureName}}/web/`).
|
|
22
|
+
{{else}}
|
|
23
|
+
- `entity/`: Database models under `src/main/java/{{packagePath}}/entity/`.
|
|
24
|
+
- `repository/`: Spring Data JPA interface under `src/main/java/{{packagePath}}/repository/`.
|
|
25
|
+
- `dto/`: Request/Response schemas with `{{validationLibrary}}` annotations under `src/main/java/{{packagePath}}/dto/`.
|
|
26
|
+
- `service/`: Service interfaces and implementations under `src/main/java/{{packagePath}}/service/`.
|
|
27
|
+
- `web/`: Controller class under `src/main/java/{{packagePath}}/controller/`.
|
|
28
|
+
{{/if}}
|
|
29
|
+
4. Create comprehensive tests (using {{testFramework}}):
|
|
30
|
+
- **Service Unit Tests**: Mock repository and downstream dependencies using Mockito. Cover the main happy path, exception handling branches, null parameters, and boundary conditions.
|
|
31
|
+
- **Controller Slice Tests (`@WebMvcTest`)**: Verify routing paths, payload serialization, and constraint validation errors. Ensure you test invalid inputs (e.g. missing fields, out of bound size values, incorrect formats) and verify they return HTTP 400 or appropriate error responses.
|
|
32
|
+
- **Repository Slice Tests (`@DataJpaTest`)**: Verify custom database query logic and entity-column bindings.
|
|
33
|
+
5. Perform Code Quality & Production Readiness Checks:
|
|
34
|
+
- Review your changes against `@code-review.md` to check transaction boundaries (`@Transactional`), avoid swallowed exceptions, check thread safety, and prevent SQL injection.
|
|
35
|
+
- Verify that any database schema changes are added as migration scripts, and configurations are profile-isolated under `@production-ready.md`.
|
|
36
|
+
6. Run validations:
|
|
37
|
+
- `{{buildCommand}} clean test`
|
|
38
|
+
- `{{buildCommand}} {{buildVerifyArgs}}`
|