@pixelcraft-tw/spec 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/LICENSE +21 -0
- package/README.md +195 -0
- package/dist/bin/pxs.d.ts +2 -0
- package/dist/bin/pxs.js +5 -0
- package/dist/bin/pxs.js.map +1 -0
- package/dist/src/backends/claude.d.ts +9 -0
- package/dist/src/backends/claude.js +80 -0
- package/dist/src/backends/claude.js.map +1 -0
- package/dist/src/backends/codex.d.ts +9 -0
- package/dist/src/backends/codex.js +72 -0
- package/dist/src/backends/codex.js.map +1 -0
- package/dist/src/backends/factory.d.ts +2 -0
- package/dist/src/backends/factory.js +14 -0
- package/dist/src/backends/factory.js.map +1 -0
- package/dist/src/backends/interface.d.ts +15 -0
- package/dist/src/backends/interface.js +2 -0
- package/dist/src/backends/interface.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +94 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/commands/clarify.d.ts +5 -0
- package/dist/src/commands/clarify.js +46 -0
- package/dist/src/commands/clarify.js.map +1 -0
- package/dist/src/commands/diff.d.ts +1 -0
- package/dist/src/commands/diff.js +81 -0
- package/dist/src/commands/diff.js.map +1 -0
- package/dist/src/commands/implement.d.ts +9 -0
- package/dist/src/commands/implement.js +247 -0
- package/dist/src/commands/implement.js.map +1 -0
- package/dist/src/commands/init.d.ts +6 -0
- package/dist/src/commands/init.js +183 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/new.d.ts +5 -0
- package/dist/src/commands/new.js +186 -0
- package/dist/src/commands/new.js.map +1 -0
- package/dist/src/commands/refine.d.ts +8 -0
- package/dist/src/commands/refine.js +158 -0
- package/dist/src/commands/refine.js.map +1 -0
- package/dist/src/commands/reset.d.ts +3 -0
- package/dist/src/commands/reset.js +44 -0
- package/dist/src/commands/reset.js.map +1 -0
- package/dist/src/commands/review.d.ts +4 -0
- package/dist/src/commands/review.js +70 -0
- package/dist/src/commands/review.js.map +1 -0
- package/dist/src/commands/status.d.ts +1 -0
- package/dist/src/commands/status.js +53 -0
- package/dist/src/commands/status.js.map +1 -0
- package/dist/src/discovery/project.d.ts +7 -0
- package/dist/src/discovery/project.js +135 -0
- package/dist/src/discovery/project.js.map +1 -0
- package/dist/src/git/operations.d.ts +10 -0
- package/dist/src/git/operations.js +56 -0
- package/dist/src/git/operations.js.map +1 -0
- package/dist/src/parsers/arguments.d.ts +18 -0
- package/dist/src/parsers/arguments.js +43 -0
- package/dist/src/parsers/arguments.js.map +1 -0
- package/dist/src/parsers/plan.d.ts +23 -0
- package/dist/src/parsers/plan.js +117 -0
- package/dist/src/parsers/plan.js.map +1 -0
- package/dist/src/parsers/spec.d.ts +10 -0
- package/dist/src/parsers/spec.js +46 -0
- package/dist/src/parsers/spec.js.map +1 -0
- package/dist/src/state/manager.d.ts +24 -0
- package/dist/src/state/manager.js +103 -0
- package/dist/src/state/manager.js.map +1 -0
- package/dist/src/state/types.d.ts +48 -0
- package/dist/src/state/types.js +20 -0
- package/dist/src/state/types.js.map +1 -0
- package/dist/src/utils/display.d.ts +7 -0
- package/dist/src/utils/display.js +42 -0
- package/dist/src/utils/display.js.map +1 -0
- package/dist/src/utils/prompt.d.ts +15 -0
- package/dist/src/utils/prompt.js +139 -0
- package/dist/src/utils/prompt.js.map +1 -0
- package/package.json +52 -0
- package/templates/agents-md-snippet.md +20 -0
- package/templates/architectures/clean/csharp-aspnet.md +56 -0
- package/templates/architectures/clean/dart-flutter.md +73 -0
- package/templates/architectures/clean/go-gin.md +50 -0
- package/templates/architectures/clean/go-std.md +49 -0
- package/templates/architectures/clean/kotlin-android.md +70 -0
- package/templates/architectures/clean/python-fastapi.md +49 -0
- package/templates/architectures/clean/swift-ios.md +69 -0
- package/templates/architectures/clean/typescript-express.md +60 -0
- package/templates/architectures/clean/typescript-nestjs.md +61 -0
- package/templates/architectures/ddd/csharp-aspnet.md +55 -0
- package/templates/architectures/ddd/go-gin.md +53 -0
- package/templates/architectures/ddd/python-fastapi.md +52 -0
- package/templates/architectures/ddd/typescript-nestjs.md +62 -0
- package/templates/architectures/hexagonal/csharp-aspnet.md +45 -0
- package/templates/architectures/hexagonal/go-gin.md +47 -0
- package/templates/architectures/hexagonal/python-fastapi.md +43 -0
- package/templates/architectures/hexagonal/typescript-nestjs.md +44 -0
- package/templates/architectures/layered/csharp-aspnet.md +45 -0
- package/templates/architectures/layered/go-gin.md +41 -0
- package/templates/architectures/layered/python-fastapi.md +42 -0
- package/templates/architectures/layered/typescript-nestjs.md +48 -0
- package/templates/architectures/modular/csharp-aspnet.md +45 -0
- package/templates/architectures/modular/dart-flutter.md +64 -0
- package/templates/architectures/modular/go-gin.md +47 -0
- package/templates/architectures/modular/kotlin-android.md +68 -0
- package/templates/architectures/modular/python-fastapi.md +45 -0
- package/templates/architectures/modular/swift-ios.md +55 -0
- package/templates/architectures/modular/typescript-nestjs.md +48 -0
- package/templates/architectures/mvvm/dart-flutter.md +69 -0
- package/templates/architectures/mvvm/kotlin-android.md +79 -0
- package/templates/architectures/mvvm/swift-ios.md +66 -0
- package/templates/claude-commands/sf.clarify.md +18 -0
- package/templates/claude-commands/sf.implement.md +80 -0
- package/templates/claude-commands/sf.new.md +22 -0
- package/templates/claude-commands/sf.refine.md +47 -0
- package/templates/claude-commands/sf.review.md +17 -0
- package/templates/claude-commands/sf.status.md +12 -0
- package/templates/workflow/config.yaml +17 -0
- package/templates/workflow/prompts/clarify.md +39 -0
- package/templates/workflow/prompts/final-review.md +30 -0
- package/templates/workflow/prompts/implement-tdd.md +35 -0
- package/templates/workflow/prompts/implement.md +43 -0
- package/templates/workflow/prompts/refine.md +52 -0
- package/templates/workflow/prompts/review.md +33 -0
- package/templates/workflow/prompts/test.md +14 -0
- package/templates/workflow/templates/spec-template.md +13 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Architecture: MVVM (Android / Kotlin)
|
|
2
|
+
|
|
3
|
+
## Pattern Overview
|
|
4
|
+
Android app organized into model, ui, viewmodel, and data packages. ViewModels extend `ViewModel()` and expose `StateFlow` to Jetpack Compose screens.
|
|
5
|
+
|
|
6
|
+
## Directory Structure
|
|
7
|
+
```
|
|
8
|
+
app/src/main/java/com/example/app/
|
|
9
|
+
├── model/
|
|
10
|
+
│ ├── Order.kt
|
|
11
|
+
│ └── User.kt
|
|
12
|
+
├── ui/
|
|
13
|
+
│ ├── order/
|
|
14
|
+
│ │ ├── OrderListScreen.kt
|
|
15
|
+
│ │ └── OrderDetailScreen.kt
|
|
16
|
+
│ ├── components/
|
|
17
|
+
│ │ └── OrderCard.kt
|
|
18
|
+
│ ├── navigation/AppNavigation.kt
|
|
19
|
+
│ └── theme/Theme.kt
|
|
20
|
+
├── viewmodel/
|
|
21
|
+
│ ├── OrderListViewModel.kt
|
|
22
|
+
│ └── OrderDetailViewModel.kt
|
|
23
|
+
├── data/
|
|
24
|
+
│ ├── repository/
|
|
25
|
+
│ │ ├── OrderRepository.kt # interface
|
|
26
|
+
│ │ └── OrderRepositoryImpl.kt
|
|
27
|
+
│ ├── remote/
|
|
28
|
+
│ │ ├── api/OrderApi.kt # Retrofit interface
|
|
29
|
+
│ │ └── dto/OrderDto.kt
|
|
30
|
+
│ └── local/
|
|
31
|
+
│ ├── dao/OrderDao.kt # Room DAO
|
|
32
|
+
│ └── entity/OrderEntity.kt
|
|
33
|
+
├── di/
|
|
34
|
+
│ ├── AppModule.kt
|
|
35
|
+
│ ├── NetworkModule.kt
|
|
36
|
+
│ └── DatabaseModule.kt
|
|
37
|
+
└── App.kt # Application class
|
|
38
|
+
app/src/test/ # Unit tests
|
|
39
|
+
app/src/androidTest/ # Instrumented tests
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Responsibility Split
|
|
43
|
+
- model → plain Kotlin data classes, no Android dependency
|
|
44
|
+
- ui → Compose screens and components, observe ViewModel StateFlow, send user actions to ViewModel
|
|
45
|
+
- viewmodel → extend `ViewModel()`, hold UI state as `StateFlow`, call Repositories
|
|
46
|
+
- data/repository → data access abstraction; interface in repository/, impl calls remote + local
|
|
47
|
+
- data/remote → Retrofit API interfaces and DTOs
|
|
48
|
+
- data/local → Room DAOs and entities
|
|
49
|
+
- di → Hilt modules wiring everything together
|
|
50
|
+
|
|
51
|
+
## Recommended Dependencies
|
|
52
|
+
- DI: Hilt
|
|
53
|
+
- Networking: Retrofit + OkHttp
|
|
54
|
+
- Local Storage: Room
|
|
55
|
+
- Navigation: Navigation Compose
|
|
56
|
+
- Async: Kotlin Coroutines + Flow
|
|
57
|
+
- State: StateFlow + Compose collectAsStateWithLifecycle
|
|
58
|
+
|
|
59
|
+
## Conventions
|
|
60
|
+
- One ViewModel per screen
|
|
61
|
+
- ViewModel exposes `StateFlow<UiState>` via `MutableStateFlow` + `asStateFlow()`
|
|
62
|
+
- Screens collect state with `collectAsStateWithLifecycle()`
|
|
63
|
+
- Repository interface in data/repository/, implementation calls remote + local sources
|
|
64
|
+
- Hilt @Module classes in di/ package
|
|
65
|
+
|
|
66
|
+
## File Naming
|
|
67
|
+
- PascalCase: OrderListViewModel.kt
|
|
68
|
+
- Screen: *Screen.kt
|
|
69
|
+
- ViewModel: *ViewModel.kt
|
|
70
|
+
- Repository interface: *Repository.kt
|
|
71
|
+
- Repository impl: *RepositoryImpl.kt
|
|
72
|
+
- DAO: *Dao.kt
|
|
73
|
+
- API: *Api.kt
|
|
74
|
+
|
|
75
|
+
## Testing
|
|
76
|
+
- model: pure unit tests, JUnit
|
|
77
|
+
- viewmodel: unit tests with mocked repositories, Turbine for Flow testing
|
|
78
|
+
- data: integration tests with Room in-memory DB
|
|
79
|
+
- ui: Compose UI tests with composeTestRule
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Architecture: MVVM (iOS / SwiftUI)
|
|
2
|
+
|
|
3
|
+
## Pattern Overview
|
|
4
|
+
iOS app organized into Models, Views, ViewModels, and Services under `Sources/`. ViewModels use @Observable macro to drive SwiftUI views via data binding.
|
|
5
|
+
|
|
6
|
+
## Directory Structure
|
|
7
|
+
```
|
|
8
|
+
Sources/
|
|
9
|
+
├── Models/
|
|
10
|
+
│ ├── Order.swift
|
|
11
|
+
│ └── User.swift
|
|
12
|
+
├── Views/
|
|
13
|
+
│ ├── OrderListView.swift
|
|
14
|
+
│ ├── OrderDetailView.swift
|
|
15
|
+
│ └── Components/
|
|
16
|
+
│ └── OrderCard.swift
|
|
17
|
+
├── ViewModels/
|
|
18
|
+
│ ├── OrderListViewModel.swift
|
|
19
|
+
│ └── OrderDetailViewModel.swift
|
|
20
|
+
├── Services/
|
|
21
|
+
│ ├── OrderService.swift
|
|
22
|
+
│ └── AuthService.swift
|
|
23
|
+
├── Repositories/
|
|
24
|
+
│ ├── OrderRepository.swift
|
|
25
|
+
│ └── UserRepository.swift
|
|
26
|
+
└── App.swift
|
|
27
|
+
Tests/
|
|
28
|
+
├── ModelsTests/
|
|
29
|
+
├── ViewModelsTests/
|
|
30
|
+
├── ServicesTests/
|
|
31
|
+
└── RepositoriesTests/
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Responsibility Split
|
|
35
|
+
- Models → plain Swift structs/enums, Codable
|
|
36
|
+
- Views → SwiftUI views, observe ViewModel properties, send user actions to ViewModel
|
|
37
|
+
- ViewModels → @Observable classes, hold UI state, call Services/Repositories
|
|
38
|
+
- Services → network requests (URLSession), external integrations
|
|
39
|
+
- Repositories → data access abstraction over local + remote sources
|
|
40
|
+
|
|
41
|
+
## Recommended Dependencies
|
|
42
|
+
- State Management: @Observable (Observation framework, built-in)
|
|
43
|
+
- Networking: URLSession (built-in)
|
|
44
|
+
- Navigation: NavigationStack (SwiftUI native)
|
|
45
|
+
- Local Storage: SwiftData
|
|
46
|
+
- DI: Factory pattern or manual injection via init
|
|
47
|
+
|
|
48
|
+
## Conventions
|
|
49
|
+
- One ViewModel per screen or major UI section
|
|
50
|
+
- ViewModel is an @Observable class; Views observe it directly
|
|
51
|
+
- Views never import Services or Repositories
|
|
52
|
+
- Models are value types (structs) where possible
|
|
53
|
+
|
|
54
|
+
## File Naming
|
|
55
|
+
- PascalCase: OrderListViewModel.swift
|
|
56
|
+
- View: *View.swift
|
|
57
|
+
- ViewModel: *ViewModel.swift
|
|
58
|
+
- Service: *Service.swift
|
|
59
|
+
- Repository: *Repository.swift
|
|
60
|
+
- Model: descriptive name under Models/
|
|
61
|
+
|
|
62
|
+
## Testing
|
|
63
|
+
- Models: pure unit tests, XCTest
|
|
64
|
+
- ViewModels: unit tests with mocked services/repositories
|
|
65
|
+
- Services: integration tests or URLProtocol mocking
|
|
66
|
+
- Views: ViewInspector or snapshot tests
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run requirement clarification on a spec
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Parse $ARGUMENTS:
|
|
6
|
+
- First word not starting with @ or / is <name>
|
|
7
|
+
- @ prefixed = agent, / prefixed = skill
|
|
8
|
+
- Remaining = supplementary instructions
|
|
9
|
+
|
|
10
|
+
Read `.workflow/specs/<name>.md`.
|
|
11
|
+
|
|
12
|
+
Analyze spec, identify requirements that can be further clarified.
|
|
13
|
+
Present as numbered questions, wait for user answers.
|
|
14
|
+
Update spec based on answers.
|
|
15
|
+
|
|
16
|
+
{If @agent present, involve corresponding agent}
|
|
17
|
+
{If /skill present, use corresponding MCP/skill to assist}
|
|
18
|
+
{Supplementary instructions}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Implement code task by task
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Parse $ARGUMENTS:
|
|
6
|
+
- First word not starting with @, /, or -- is <name>
|
|
7
|
+
- --backend claude|codex
|
|
8
|
+
- --test [tdd] [intg]: test strategy
|
|
9
|
+
- @ prefixed = agent, / prefixed = skill
|
|
10
|
+
- Remaining = supplementary instructions
|
|
11
|
+
|
|
12
|
+
Read `.workflow/state.yaml` to confirm current status.
|
|
13
|
+
Read `.workflow/plans/<name>.md` to get task list.
|
|
14
|
+
|
|
15
|
+
## Pre-flight
|
|
16
|
+
If first run (phase = ready_to_implement):
|
|
17
|
+
1. Create new branch: `git checkout -b <type>/<name>` (branch name MUST be English)
|
|
18
|
+
2. Update state.yaml phase to implementing
|
|
19
|
+
|
|
20
|
+
## Execution Loop
|
|
21
|
+
For the next pending task:
|
|
22
|
+
|
|
23
|
+
1. Read the task spec
|
|
24
|
+
2. First scan codebase to understand relevant existing modules, design patterns, utility functions
|
|
25
|
+
3. Prioritize reusing existing code; implement with minimal changes (don't over-engineer)
|
|
26
|
+
4. Follow git commit convention (refer to CLAUDE.md; default is conventional commits)
|
|
27
|
+
5. On completion: `git add -A && git commit -m "<type>(<name>): task-N <title>"` (commit message MUST be English, no Co-Authored-By trailer)
|
|
28
|
+
|
|
29
|
+
### Testing (based on --test parameter)
|
|
30
|
+
- `--test tdd`: TDD mode
|
|
31
|
+
- Write failing tests first → confirm FAIL
|
|
32
|
+
- Write minimum code → confirm PASS
|
|
33
|
+
- Refactor → confirm still PASS
|
|
34
|
+
- `git add -A && git commit -m "test(<name>): task-N <title>"`
|
|
35
|
+
- `--test tdd intg`: TDD + integration tests
|
|
36
|
+
- Same as above, but tests include integration tests
|
|
37
|
+
- `--test intg`: Post-hoc integration tests
|
|
38
|
+
- Generate integration tests after implementation
|
|
39
|
+
- `git add -A && git commit -m "test(<name>): task-N <title>"`
|
|
40
|
+
- `--test` (no value): Post-hoc unit tests
|
|
41
|
+
- Generate unit tests after implementation
|
|
42
|
+
- `git add -A && git commit -m "test(<name>): task-N <title>"`
|
|
43
|
+
- No --test: don't generate tests
|
|
44
|
+
|
|
45
|
+
### AI Review
|
|
46
|
+
1. Extract git diff for this task
|
|
47
|
+
2. Review against task spec
|
|
48
|
+
3. Label issues by severity (Critical / Warning / Info)
|
|
49
|
+
4. Save review to `.workflow/reviews/<name>-task-N.md`
|
|
50
|
+
|
|
51
|
+
### Present to User
|
|
52
|
+
- Changed file list
|
|
53
|
+
- AI review summary
|
|
54
|
+
- Condensed diff
|
|
55
|
+
- Options: [approve] [request-change] [add-test] [skip]
|
|
56
|
+
|
|
57
|
+
### Handle User Choice
|
|
58
|
+
- approve: update state.yaml, task status = complete
|
|
59
|
+
- request-change: read feedback, reset commits, re-implement
|
|
60
|
+
- add-test: generate tests, commit, re-review
|
|
61
|
+
- skip: update state.yaml, task status = skipped
|
|
62
|
+
|
|
63
|
+
### All Tasks Complete
|
|
64
|
+
Present task summary.
|
|
65
|
+
|
|
66
|
+
#### Final Code Review
|
|
67
|
+
Before presenting merge options (skip if `--skip-review` was passed):
|
|
68
|
+
1. Get full branch diff: `git diff $(git merge-base <base-branch> HEAD)..HEAD` (base branch from state.yaml `base_branch` field, fallback to `main`)
|
|
69
|
+
2. Read spec and plan files
|
|
70
|
+
3. Perform **comprehensive code review** of all changes — read and analyze actual code, not just diff stats
|
|
71
|
+
4. If @agents or /skills were specified, involve them in the review
|
|
72
|
+
5. If no agents/skills specified, proactively use available review tools (e.g., /simplify, /code-review, code-reviewer agent)
|
|
73
|
+
6. Save review to `.workflow/reviews/<name>-final.md`
|
|
74
|
+
7. Present review findings to user with severity labels (Critical/Warning/Info) and verdict (PASS/NEEDS_CHANGES)
|
|
75
|
+
|
|
76
|
+
Options: [merge] [squash-merge] [keep-branch]
|
|
77
|
+
|
|
78
|
+
{@agent instructions}
|
|
79
|
+
{/skill instructions}
|
|
80
|
+
{Supplementary instructions}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create a new spec file
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Create a spec based on user input.
|
|
6
|
+
|
|
7
|
+
Parse $ARGUMENTS:
|
|
8
|
+
- First word is the feature name <name> (MUST be English, kebab-case. If user provides Chinese, translate to English)
|
|
9
|
+
- If `--jira <tickets...>` present, read each ticket's content via Jira MCP (supports multiple, space-separated)
|
|
10
|
+
- If `--desc` present, following text is the description
|
|
11
|
+
- If `-i` present, enter interactive Q&A
|
|
12
|
+
- Remaining text is treated as feature description
|
|
13
|
+
|
|
14
|
+
Steps:
|
|
15
|
+
1. Check if `.workflow/specs/<name>.md` already exists; if so, ask to confirm overwrite
|
|
16
|
+
2. Generate spec based on input method:
|
|
17
|
+
- No extra args: copy `.workflow/templates/spec-template.md` to `.workflow/specs/<name>.md`
|
|
18
|
+
- Has description text: expand into complete spec
|
|
19
|
+
- Has --jira: read Jira content and convert to spec
|
|
20
|
+
- Has -i: ask questions step by step to generate spec
|
|
21
|
+
3. Display generated spec content
|
|
22
|
+
4. Prompt user they can manually edit then run `/pxs:refine <name>`
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Refine spec and decompose implementation plan
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Parse $ARGUMENTS:
|
|
6
|
+
- First word not starting with @ or / is <name>
|
|
7
|
+
- @ prefixed words are agent references
|
|
8
|
+
- / prefixed words are skill/MCP references
|
|
9
|
+
- --skip-clarify skips requirement clarification
|
|
10
|
+
- Remaining text is supplementary instructions
|
|
11
|
+
|
|
12
|
+
Read `.workflow/specs/<name>.md`.
|
|
13
|
+
|
|
14
|
+
## Phase 1: Requirement Clarification
|
|
15
|
+
Unless --skip-clarify is present:
|
|
16
|
+
1. Analyze spec, identify ambiguous or incomplete requirements
|
|
17
|
+
2. Present as numbered questions with suggested options
|
|
18
|
+
3. Wait for user answers
|
|
19
|
+
4. Follow up if needed (max 3 rounds)
|
|
20
|
+
5. If spec is sufficiently clear, inform user and proceed to next phase
|
|
21
|
+
|
|
22
|
+
{If @agent present, involve corresponding agent in requirement analysis}
|
|
23
|
+
{If /skill present, use corresponding MCP/skill to assist analysis}
|
|
24
|
+
|
|
25
|
+
## Phase 2: Refine Spec
|
|
26
|
+
1. First scan codebase to understand existing architecture, modules, design patterns, infrastructure
|
|
27
|
+
2. Refine spec based on confirmed requirements and codebase analysis
|
|
28
|
+
3. Prioritize reusing existing modules; design for minimal change
|
|
29
|
+
4. Add technical details, architecture decisions (with rationale and alternatives), API design, file paths, acceptance criteria
|
|
30
|
+
5. Each architecture suggestion includes justification (why needed, existing alternatives, cost of introduction)
|
|
31
|
+
6. Overwrite `.workflow/specs/<name>.md`
|
|
32
|
+
7. Present refined spec to user for confirmation
|
|
33
|
+
8. User approves to continue; otherwise modify based on feedback
|
|
34
|
+
|
|
35
|
+
## Phase 3: Decompose Plan
|
|
36
|
+
1. Determine feature type (feat/fix/refactor/docs/chore)
|
|
37
|
+
2. Decompose requirements into independently completable tasks
|
|
38
|
+
3. Each task lists: title, affected files, description, dependencies, complexity, acceptance criteria
|
|
39
|
+
4. Generate `.workflow/plans/<name>.md`
|
|
40
|
+
5. Present plan to user:
|
|
41
|
+
- Type and branch naming
|
|
42
|
+
- Each task's content
|
|
43
|
+
6. User approve → update `.workflow/state.yaml`
|
|
44
|
+
7. User edit → wait for modifications
|
|
45
|
+
8. User re-split → re-decompose based on feedback
|
|
46
|
+
|
|
47
|
+
{Supplementary instructions: $REMAINING_TEXT}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: View review records
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Parse $ARGUMENTS:
|
|
6
|
+
- First word not starting with @, /, or -- is <name>
|
|
7
|
+
- --step N: view specific task review
|
|
8
|
+
- --summary: all tasks summary
|
|
9
|
+
- @ prefixed = agent, / prefixed = skill
|
|
10
|
+
|
|
11
|
+
Read `.workflow/state.yaml`.
|
|
12
|
+
|
|
13
|
+
- No options: show current pending review or most recent review
|
|
14
|
+
- --step N: read `.workflow/reviews/<name>-task-N.md` and display
|
|
15
|
+
- --summary: list all tasks' review status
|
|
16
|
+
|
|
17
|
+
{If @agent /skill present, they can provide supplementary analysis on existing reviews}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: View workflow status
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Parse $ARGUMENTS:
|
|
6
|
+
- Has value → show specific feature status
|
|
7
|
+
- No value → list all features
|
|
8
|
+
|
|
9
|
+
Read `.workflow/state.yaml`.
|
|
10
|
+
|
|
11
|
+
- No args: list all features with name, type, phase, task progress, branch
|
|
12
|
+
- Has <name>: show detailed status for that feature, including each task's status
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
You are a senior developer with architect-level vision. Read the following spec and first analyze the project's existing codebase.
|
|
2
|
+
|
|
3
|
+
## Spec Content
|
|
4
|
+
{spec_content}
|
|
5
|
+
|
|
6
|
+
## Step 1: Codebase Analysis
|
|
7
|
+
Before asking questions, scan the project:
|
|
8
|
+
1. Understand existing directory structure, module organization, layered architecture
|
|
9
|
+
2. Identify existing shared modules, utility functions, middleware, design patterns
|
|
10
|
+
3. Confirm third-party packages and infrastructure already in use (caching, MQ, ORM, etc.)
|
|
11
|
+
4. Review CLAUDE.md / AGENTS.md / README for project conventions
|
|
12
|
+
|
|
13
|
+
## Step 2: Requirements Analysis
|
|
14
|
+
Based on codebase analysis, identify:
|
|
15
|
+
1. Ambiguous or incomplete requirements
|
|
16
|
+
2. Potential edge cases
|
|
17
|
+
3. Missing technical decisions (database, API design, error handling, etc.)
|
|
18
|
+
4. Potential conflicts or contradictions
|
|
19
|
+
5. Integration points with existing architecture and possible conflicts
|
|
20
|
+
|
|
21
|
+
## Step 3: Architecture-Level Confirmation
|
|
22
|
+
If requirements may involve architectural changes, proactively confirm:
|
|
23
|
+
- Whether existing modules can be reused (codebase already has similar functionality)
|
|
24
|
+
- Whether shared modules need to be extracted (repeated logic in multiple places)
|
|
25
|
+
- Whether design patterns need to be introduced (first state which patterns the codebase already uses, suggest consistency)
|
|
26
|
+
- Whether new infrastructure is needed (caching, message queues, etc.) — only suggest when existing solutions genuinely cannot satisfy the need
|
|
27
|
+
|
|
28
|
+
## Core Principles
|
|
29
|
+
<HARD-GATE>
|
|
30
|
+
- Minimal change first: if existing code can handle it, don't create new code
|
|
31
|
+
- Reuse first: look for what the codebase already has before considering new additions
|
|
32
|
+
- Simple solution first: don't over-engineer for architectural correctness
|
|
33
|
+
- Every architecture suggestion must include: why it's needed, existing alternatives, cost of introduction
|
|
34
|
+
- If the user's requirement can be solved with a simple implementation, don't proactively suggest complex solutions
|
|
35
|
+
</HARD-GATE>
|
|
36
|
+
|
|
37
|
+
Present questions in numbered format with suggested options.
|
|
38
|
+
For architecture suggestions, explain why it's needed, whether alternatives exist in the codebase, and the cost of introduction.
|
|
39
|
+
If the spec is sufficiently clear and no architectural changes are needed, reply with "Requirements are clear, ready to proceed to refinement phase."
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
You are a senior code reviewer. Perform a comprehensive review of the entire feature branch.
|
|
2
|
+
|
|
3
|
+
## Full Diff
|
|
4
|
+
{branch_diff}
|
|
5
|
+
|
|
6
|
+
## Feature Spec
|
|
7
|
+
{spec_content}
|
|
8
|
+
|
|
9
|
+
## Implementation Plan
|
|
10
|
+
{plan_content}
|
|
11
|
+
|
|
12
|
+
## Review Items
|
|
13
|
+
1. Completeness — do changes fully implement the spec?
|
|
14
|
+
2. Correctness — is the logic correct across all tasks?
|
|
15
|
+
3. Cohesion — do tasks work together consistently?
|
|
16
|
+
4. Minimal Change — no unnecessary changes?
|
|
17
|
+
5. Architecture Consistency — follows existing patterns?
|
|
18
|
+
6. Error Handling — missing error scenarios?
|
|
19
|
+
7. Security — any concerns?
|
|
20
|
+
8. Performance — obvious issues?
|
|
21
|
+
9. Code Quality — readability, naming, structure
|
|
22
|
+
|
|
23
|
+
Label each issue: Critical | Warning | Info
|
|
24
|
+
Final verdict: PASS / NEEDS_CHANGES
|
|
25
|
+
|
|
26
|
+
## IMPORTANT: Review Depth
|
|
27
|
+
You MUST read and analyze the actual code changes — not just summarize file names or diff stats.
|
|
28
|
+
For each significant change, review the implementation logic, check for edge cases, and verify against the spec.
|
|
29
|
+
If @agents or /skills are specified above, use them. Otherwise, perform the review yourself with full rigor.
|
|
30
|
+
If you have access to review-related tools (e.g., /simplify, /code-review, code-reviewer agent), use them proactively.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
You are a senior developer with architect-level vision, strictly following TDD (Test-Driven Development).
|
|
2
|
+
|
|
3
|
+
## Pre-Implementation: Codebase Scan
|
|
4
|
+
Before writing any tests, scan the codebase to understand:
|
|
5
|
+
1. Existing test framework and test style
|
|
6
|
+
2. Existing test helpers, fixtures, mocks
|
|
7
|
+
3. Reusable test utilities and setup functions
|
|
8
|
+
4. Project's test directory structure conventions
|
|
9
|
+
|
|
10
|
+
Write tests following the existing test style; don't introduce new test frameworks or patterns.
|
|
11
|
+
|
|
12
|
+
## Task Spec
|
|
13
|
+
{task_content}
|
|
14
|
+
|
|
15
|
+
## TDD Flow (strictly follow, no skipping)
|
|
16
|
+
|
|
17
|
+
### RED: Write Failing Tests
|
|
18
|
+
1. Write tests based on task acceptance criteria
|
|
19
|
+
2. Run tests, confirm all FAIL
|
|
20
|
+
3. If any test PASSes, the test is wrong — rewrite
|
|
21
|
+
|
|
22
|
+
### GREEN: Write Minimum Code
|
|
23
|
+
1. Write the minimum code to make all tests PASS
|
|
24
|
+
2. Don't write beyond what tests require
|
|
25
|
+
3. Run tests, confirm all PASS
|
|
26
|
+
|
|
27
|
+
### REFACTOR: Refactor
|
|
28
|
+
1. Refactor while all tests PASS
|
|
29
|
+
2. Run tests after each refactoring to confirm still PASS
|
|
30
|
+
|
|
31
|
+
<HARD-GATE>
|
|
32
|
+
- NEVER write implementation code before writing tests
|
|
33
|
+
- If you find yourself writing implementation first, delete it and start over
|
|
34
|
+
- Report status after each phase (RED/GREEN/REFACTOR)
|
|
35
|
+
</HARD-GATE>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
You are a senior developer with architect-level vision. Implement code based on the following task spec.
|
|
2
|
+
|
|
3
|
+
## Task Spec
|
|
4
|
+
{task_content}
|
|
5
|
+
|
|
6
|
+
## Previous Task Change Summary
|
|
7
|
+
{previous_diff}
|
|
8
|
+
|
|
9
|
+
## Pre-Implementation: Codebase Scan (required for every task)
|
|
10
|
+
Before writing any code:
|
|
11
|
+
1. Check what files, classes, and functions already exist in relevant directories
|
|
12
|
+
2. Identify existing code that can be directly reused or extended
|
|
13
|
+
3. Confirm the project's naming conventions, error handling patterns, and logging style
|
|
14
|
+
4. If the task involves a new module, confirm placement aligns with existing directory structure
|
|
15
|
+
|
|
16
|
+
## Implementation Principles
|
|
17
|
+
|
|
18
|
+
<HARD-GATE>
|
|
19
|
+
### Minimal Change Principle
|
|
20
|
+
- Prefer using existing utilities, helpers, and base classes from the codebase
|
|
21
|
+
- If similar functionality exists, extend it rather than creating new
|
|
22
|
+
- Don't introduce packages the codebase doesn't currently use, unless the task explicitly requires it
|
|
23
|
+
- Don't refactor outside the task spec scope, even if improvements are visible (note them but don't change)
|
|
24
|
+
- New code must be consistent with surrounding code style (naming, structure, error handling)
|
|
25
|
+
|
|
26
|
+
### Architecture Consistency
|
|
27
|
+
- Use design patterns already present in the codebase; don't introduce new ones
|
|
28
|
+
- If the codebase uses Repository Pattern, new features should also use Repository Pattern
|
|
29
|
+
- If the codebase uses a specific error handling approach, stay consistent
|
|
30
|
+
- If the codebase has shared types/interfaces, prefer using them
|
|
31
|
+
|
|
32
|
+
### Record but Don't Execute
|
|
33
|
+
- If you discover an architectural adjustment needed but outside task scope, record in commit message or review notes
|
|
34
|
+
- Format: "Discovery: [describe issue], recommend addressing in a subsequent task"
|
|
35
|
+
</HARD-GATE>
|
|
36
|
+
|
|
37
|
+
## Git Commit Convention
|
|
38
|
+
- Follow the project's git commit convention (refer to CLAUDE.md / AGENTS.md)
|
|
39
|
+
- If no custom convention is defined, use conventional commits:
|
|
40
|
+
feat: new feature | fix: bug fix | docs: documentation | style: formatting
|
|
41
|
+
refactor: refactoring | test: tests | chore: maintenance
|
|
42
|
+
- Commit messages MUST be fully in English (including scope and description)
|
|
43
|
+
- Do NOT add Co-Authored-By trailers
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
You are a senior developer with architect-level vision. Refine the spec based on confirmed requirements and codebase analysis.
|
|
2
|
+
|
|
3
|
+
## Spec Content
|
|
4
|
+
{spec_content}
|
|
5
|
+
|
|
6
|
+
## Step 1: Codebase Architecture Inventory
|
|
7
|
+
Before refining the spec, analyze the existing codebase:
|
|
8
|
+
1. Scan directory structure, understand layering and module organization
|
|
9
|
+
2. Identify reusable modules (shared utils, middleware, base classes, interfaces)
|
|
10
|
+
3. Identify design patterns already in use (Repository, Strategy, Event-Driven, etc.)
|
|
11
|
+
4. Inventory existing infrastructure (caching, message queues, schedulers, notification services, etc.)
|
|
12
|
+
5. Review CLAUDE.md / AGENTS.md / README for project conventions and architecture decision records
|
|
13
|
+
|
|
14
|
+
## Step 2: Technical Solution Design
|
|
15
|
+
Based on codebase analysis, design the implementation approach:
|
|
16
|
+
|
|
17
|
+
### Architecture Decisions (each must include these three points)
|
|
18
|
+
- **Decision**: What to do (e.g., use existing NotificationService instead of creating new one)
|
|
19
|
+
- **Rationale**: Why (e.g., codebase already has complete Telegram notification implementation)
|
|
20
|
+
- **Alternatives**: What other options exist (e.g., could call Telegram API directly, but would duplicate code)
|
|
21
|
+
|
|
22
|
+
### Reuse Analysis
|
|
23
|
+
- List existing modules that can be directly reused
|
|
24
|
+
- List existing modules that need minor extensions (explain what changes and why)
|
|
25
|
+
- List modules that must be newly created (explain why existing ones are insufficient)
|
|
26
|
+
|
|
27
|
+
### Architecture Adjustment Suggestions (only when necessary)
|
|
28
|
+
If requirements genuinely need new patterns or infrastructure:
|
|
29
|
+
- Explain why existing architecture cannot satisfy the need
|
|
30
|
+
- Impact assessment (how many files change, which modules are affected)
|
|
31
|
+
- Minimum viable approach (don't introduce a complete solution at once, satisfy current requirements first)
|
|
32
|
+
|
|
33
|
+
<HARD-GATE>
|
|
34
|
+
- Minimal change principle: if 3 lines can solve it, don't write 30
|
|
35
|
+
- Reuse first: use what the codebase has, don't reinvent
|
|
36
|
+
- Don't over-design for future requirements: only solve what the spec explicitly asks for
|
|
37
|
+
- Every new dependency (package, service, design pattern) must have clear justification
|
|
38
|
+
- If codebase already uses a pattern (e.g., Repository Pattern), new features must stay consistent
|
|
39
|
+
</HARD-GATE>
|
|
40
|
+
|
|
41
|
+
## Output Format
|
|
42
|
+
# Feature: <name>
|
|
43
|
+
## Context
|
|
44
|
+
## Codebase Analysis (existing architecture inventory, reusable modules)
|
|
45
|
+
## Requirements (numbered, each with acceptance criteria)
|
|
46
|
+
## Technical Design
|
|
47
|
+
### Architecture Decisions (each with rationale and alternatives)
|
|
48
|
+
### Reuse Plan (which existing modules to reuse, extend, or create new)
|
|
49
|
+
### New Dependencies (if any, with justification)
|
|
50
|
+
## Files (explicit paths with change descriptions, labeled as new/modified/extended)
|
|
51
|
+
## Constraints
|
|
52
|
+
## Acceptance Criteria
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
You are a senior code reviewer. Review the following git diff.
|
|
2
|
+
|
|
3
|
+
## Diff
|
|
4
|
+
```
|
|
5
|
+
{git_diff}
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Original Task Spec
|
|
9
|
+
{task_content}
|
|
10
|
+
|
|
11
|
+
## Review Items
|
|
12
|
+
1. **Correctness**: Does the code correctly implement the task spec
|
|
13
|
+
2. **Minimal Change**: Were changes minimal in scope; are there unnecessary modifications
|
|
14
|
+
3. **Reusability**: Were existing reusable modules missed; is there unnecessary code duplication
|
|
15
|
+
4. **Architecture Consistency**: Is new code consistent with existing codebase patterns (design patterns, naming, layering)
|
|
16
|
+
5. **Over-engineering**: Was anything implemented outside the spec scope; was unnecessary complexity introduced
|
|
17
|
+
6. **Error Handling**: Are there missing error scenarios
|
|
18
|
+
7. **Security**: Are there security concerns
|
|
19
|
+
8. **Performance**: Are there obvious performance issues
|
|
20
|
+
9. **Code Quality**: Readability, naming, structure
|
|
21
|
+
|
|
22
|
+
## Output Format
|
|
23
|
+
Label each issue with severity:
|
|
24
|
+
- Critical: must fix to pass
|
|
25
|
+
- Warning: recommended fix
|
|
26
|
+
- Info: for reference only
|
|
27
|
+
|
|
28
|
+
Final verdict: PASS / NEEDS_CHANGES
|
|
29
|
+
|
|
30
|
+
## IMPORTANT: Review Depth
|
|
31
|
+
You MUST read and analyze the actual code — not just summarize file names or diff stats.
|
|
32
|
+
For each changed file, review the implementation logic, not just the surface.
|
|
33
|
+
If @agents or /skills are specified above, use them. Otherwise, perform the review yourself with full rigor.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
You are a test engineer. Write {test_type} tests based on the following completed implementation.
|
|
2
|
+
|
|
3
|
+
## Implementation Diff
|
|
4
|
+
```
|
|
5
|
+
{git_diff}
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Task Spec
|
|
9
|
+
{task_content}
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
- Tests should cover: happy path, edge cases, error scenarios
|
|
13
|
+
- Use the project's existing test framework and style
|
|
14
|
+
- Don't over-mock; integration tests should use real dependencies where possible
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Feature: <name>
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
<!-- 2-3 sentences of project background -->
|
|
5
|
+
|
|
6
|
+
## Requirements
|
|
7
|
+
<!-- Numbered list with acceptance criteria -->
|
|
8
|
+
|
|
9
|
+
## Constraints
|
|
10
|
+
<!-- Technical limitations, compatibility requirements -->
|
|
11
|
+
|
|
12
|
+
## Notes
|
|
13
|
+
<!-- Additional notes -->
|