speccrew 0.1.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/.speccrew/agents/speccrew-feature-designer.md +142 -0
- package/.speccrew/agents/speccrew-product-manager.md +61 -0
- package/.speccrew/agents/speccrew-system-designer.md +200 -0
- package/.speccrew/agents/speccrew-system-developer.md +238 -0
- package/.speccrew/agents/speccrew-task-worker.md +80 -0
- package/.speccrew/agents/speccrew-team-leader.md +92 -0
- package/.speccrew/agents/speccrew-test-manager.md +313 -0
- package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
- package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
- package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
- package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
- package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
- package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
- package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
- package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
- package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
- package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
- package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
- package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
- package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
- package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
- package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
- package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
- package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
- package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
- package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
- package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
- package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
- package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
- package/LICENSE +21 -0
- package/README.ar.md +318 -0
- package/README.en.md +318 -0
- package/README.es.md +318 -0
- package/README.md +340 -0
- package/bin/cli.js +62 -0
- package/lib/commands/doctor.js +138 -0
- package/lib/commands/init.js +231 -0
- package/lib/commands/list.js +114 -0
- package/lib/commands/uninstall.js +117 -0
- package/lib/commands/update.js +351 -0
- package/lib/ide-adapters.js +73 -0
- package/lib/utils.js +104 -0
- package/package.json +28 -0
- package/workspace-template/docs/configs/document-templates.json +667 -0
- package/workspace-template/docs/configs/platform-mapping.json +194 -0
- package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
- package/workspace-template/docs/configs/validation-rules.json +87 -0
- package/workspace-template/docs/rules/mermaid-rule.md +114 -0
- package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
- package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
- package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
- package/workspace-template/docs/solutions/harness.md +410 -0
- package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
- package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
- package/workspace-template/docs/solutions/workspace-structure.md +318 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
# Frontend System Design - {ModuleName}
|
|
2
|
+
|
|
3
|
+
> Feature Spec Reference: {FeatureSpecPath}
|
|
4
|
+
> API Contract Reference: {ApiContractPath}
|
|
5
|
+
> Platform: {PlatformId} | Framework: {Framework} | Language: {Language}
|
|
6
|
+
|
|
7
|
+
## 1. Design Goal
|
|
8
|
+
|
|
9
|
+
{Brief description of what this module implements, referencing Feature Spec function}
|
|
10
|
+
|
|
11
|
+
## 2. Component Architecture
|
|
12
|
+
|
|
13
|
+
### 2.1 Component Tree
|
|
14
|
+
|
|
15
|
+
<!-- AI-NOTE: ASCII component tree showing parent-child relationships. Adjust depth based on complexity. -->
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
PageContainer
|
|
19
|
+
├── HeaderSection
|
|
20
|
+
│ ├── SearchBar
|
|
21
|
+
│ └── ActionButtons
|
|
22
|
+
├── ContentArea
|
|
23
|
+
│ ├── DataTable
|
|
24
|
+
│ │ ├── TableHeader
|
|
25
|
+
│ │ └── TableRow
|
|
26
|
+
│ └── Pagination
|
|
27
|
+
└── DetailDrawer
|
|
28
|
+
├── FormSection
|
|
29
|
+
└── FooterActions
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2.2 Component Summary
|
|
33
|
+
|
|
34
|
+
| Component | Path | Type | Status | Description |
|
|
35
|
+
|-----------|------|------|--------|-------------|
|
|
36
|
+
| {Name} | `{directory}/{FileName}` | Page | [NEW]/[MODIFIED]/[EXISTING] | {Purpose} |
|
|
37
|
+
| {Name} | `{directory}/{FileName}` | Component | [NEW]/[MODIFIED]/[EXISTING] | {Purpose} |
|
|
38
|
+
|
|
39
|
+
## 3. Component Detail Design
|
|
40
|
+
|
|
41
|
+
<!-- AI-NOTE: Repeat Section 3.N for each component. Focus on components with [NEW] or [MODIFIED] status. -->
|
|
42
|
+
|
|
43
|
+
### 3.1 {ComponentName}
|
|
44
|
+
|
|
45
|
+
**Purpose**: {What this component does}
|
|
46
|
+
|
|
47
|
+
**Props**:
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Required | Default | Description |
|
|
50
|
+
|------|------|----------|---------|-------------|
|
|
51
|
+
| {prop} | {TypeScript type} | Yes/No | {value} | {description} |
|
|
52
|
+
|
|
53
|
+
**Emits**:
|
|
54
|
+
|
|
55
|
+
| Event | Payload Type | Description |
|
|
56
|
+
|-------|-------------|-------------|
|
|
57
|
+
| {event} | {TypeScript type} | {description} |
|
|
58
|
+
|
|
59
|
+
**Internal State**:
|
|
60
|
+
|
|
61
|
+
| State | Type | Initial Value | Description |
|
|
62
|
+
|-------|------|--------------|-------------|
|
|
63
|
+
| {state} | {type} | {value} | {description} |
|
|
64
|
+
|
|
65
|
+
**Lifecycle & Watchers**:
|
|
66
|
+
|
|
67
|
+
<!-- AI-NOTE: Describe key lifecycle hooks and watchers needed. Reference actual framework API. -->
|
|
68
|
+
|
|
69
|
+
- `onMounted`: {description of initialization logic}
|
|
70
|
+
- `watch({state})`: {description of reactive behavior}
|
|
71
|
+
|
|
72
|
+
**Pseudo-code**:
|
|
73
|
+
|
|
74
|
+
<!-- AI-NOTE: Use actual framework API syntax from techs knowledge. NOT generic code. -->
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
// AI-NOTE: Example for Vue 3 Composition API
|
|
78
|
+
// Adjust imports and syntax based on actual framework from techs knowledge
|
|
79
|
+
import { ref, computed, onMounted, watch } from 'vue'
|
|
80
|
+
import type { PropType } from 'vue'
|
|
81
|
+
import { useRouter } from 'vue-router'
|
|
82
|
+
import { use{StoreName}Store } from '@/stores/{store-name}'
|
|
83
|
+
|
|
84
|
+
// Props definition
|
|
85
|
+
const props = defineProps<{
|
|
86
|
+
{propName}: {Type}
|
|
87
|
+
}>()
|
|
88
|
+
|
|
89
|
+
// Emits definition
|
|
90
|
+
const emit = defineEmits<{
|
|
91
|
+
{eventName}: [{payload}: {Type}]
|
|
92
|
+
}>()
|
|
93
|
+
|
|
94
|
+
// State
|
|
95
|
+
const {stateName} = ref<{Type}>({initialValue})
|
|
96
|
+
|
|
97
|
+
// Computed
|
|
98
|
+
const {computedName} = computed(() => {
|
|
99
|
+
// {description}
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
// Store
|
|
103
|
+
const {storeName} = use{StoreName}Store()
|
|
104
|
+
|
|
105
|
+
// Methods
|
|
106
|
+
const handle{Action} = async () => {
|
|
107
|
+
// {implementation logic}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Lifecycle
|
|
111
|
+
onMounted(() => {
|
|
112
|
+
// {initialization}
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
// Watchers
|
|
116
|
+
watch({stateName}, (newVal, oldVal) => {
|
|
117
|
+
// {reactive behavior}
|
|
118
|
+
})
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Advanced Pseudo-code Patterns
|
|
122
|
+
|
|
123
|
+
<!-- AI-NOTE: Common patterns for conditional rendering, form validation, and pagination -->
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
// Conditional rendering and list iteration
|
|
127
|
+
const filteredItems = computed(() =>
|
|
128
|
+
items.value.filter(item => item.status === 'active')
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
// Form validation
|
|
132
|
+
const validateForm = (): boolean => {
|
|
133
|
+
const errors: Record<string, string> = {}
|
|
134
|
+
if (!formData.value.name?.trim()) {
|
|
135
|
+
errors.name = 'Name is required'
|
|
136
|
+
}
|
|
137
|
+
if (formData.value.price < 0) {
|
|
138
|
+
errors.price = 'Price must be non-negative'
|
|
139
|
+
}
|
|
140
|
+
formErrors.value = errors
|
|
141
|
+
return Object.keys(errors).length === 0
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Pagination boundary handling
|
|
145
|
+
const loadMore = async () => {
|
|
146
|
+
if (isLoading.value || !hasMore.value) return
|
|
147
|
+
isLoading.value = true
|
|
148
|
+
try {
|
|
149
|
+
const result = await fetchPage(currentPage.value + 1)
|
|
150
|
+
if (result.items.length === 0) {
|
|
151
|
+
hasMore.value = false
|
|
152
|
+
return
|
|
153
|
+
}
|
|
154
|
+
items.value.push(...result.items)
|
|
155
|
+
currentPage.value++
|
|
156
|
+
} finally {
|
|
157
|
+
isLoading.value = false
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Referenced APIs**:
|
|
163
|
+
|
|
164
|
+
| API Name | Method | Path | Usage Context |
|
|
165
|
+
|----------|--------|------|--------------|
|
|
166
|
+
| {api} | GET/POST/PUT/DELETE | {path} | {when and why called} |
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### 3.2 {ComponentName}
|
|
171
|
+
|
|
172
|
+
<!-- AI-NOTE: Repeat the same structure as 3.1 for each additional component -->
|
|
173
|
+
|
|
174
|
+
**Purpose**: {What this component does}
|
|
175
|
+
|
|
176
|
+
**Props**:
|
|
177
|
+
|
|
178
|
+
| Prop | Type | Required | Default | Description |
|
|
179
|
+
|------|------|----------|---------|-------------|
|
|
180
|
+
| {prop} | {TypeScript type} | Yes/No | {value} | {description} |
|
|
181
|
+
|
|
182
|
+
**Emits**:
|
|
183
|
+
|
|
184
|
+
| Event | Payload Type | Description |
|
|
185
|
+
|-------|-------------|-------------|
|
|
186
|
+
| {event} | {TypeScript type} | {description} |
|
|
187
|
+
|
|
188
|
+
**Pseudo-code**:
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
// AI-NOTE: Use actual framework API syntax from techs knowledge
|
|
192
|
+
{implementation pseudo-code}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 4. State Management
|
|
198
|
+
|
|
199
|
+
### 4.1 Store Design
|
|
200
|
+
|
|
201
|
+
**Store Module**: `{store-path}/{store-name}`
|
|
202
|
+
**Status**: [NEW]/[MODIFIED]/[EXISTING]
|
|
203
|
+
|
|
204
|
+
**State Definition**:
|
|
205
|
+
|
|
206
|
+
<!-- AI-NOTE: Use actual store pattern from techs knowledge (Pinia/Vuex/Redux/Zustand). -->
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
// AI-NOTE: Example for Pinia store
|
|
210
|
+
// File: src/stores/{store-name}.ts
|
|
211
|
+
import { defineStore } from 'pinia'
|
|
212
|
+
import type { {TypeName} } from '@/types/{module}'
|
|
213
|
+
|
|
214
|
+
interface {StoreName}State {
|
|
215
|
+
{stateField}: {Type}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export const use{StoreName}Store = defineStore('{storeName}', {
|
|
219
|
+
state: (): {StoreName}State => ({
|
|
220
|
+
{stateField}: {initialValue}
|
|
221
|
+
}),
|
|
222
|
+
|
|
223
|
+
getters: {
|
|
224
|
+
{getterName}: (state) => state.{field}
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
actions: {
|
|
228
|
+
async {actionName}(params: {Type}) {
|
|
229
|
+
// {implementation}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Actions**:
|
|
236
|
+
|
|
237
|
+
| Action | Parameters | Description | API Calls |
|
|
238
|
+
|--------|-----------|-------------|-----------|
|
|
239
|
+
| {action} | {params} | {description} | {api references} |
|
|
240
|
+
|
|
241
|
+
**Getters/Selectors**:
|
|
242
|
+
|
|
243
|
+
| Getter | Return Type | Description |
|
|
244
|
+
|--------|-------------|-------------|
|
|
245
|
+
| {getter} | {type} | {description} |
|
|
246
|
+
|
|
247
|
+
### 4.2 State Synchronization Patterns
|
|
248
|
+
|
|
249
|
+
<!-- AI-NOTE: Patterns for cross-component state sync and optimistic updates with rollback -->
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
// Cross-component state synchronization
|
|
253
|
+
watch(() => userStore.currentUser, (newUser, oldUser) => {
|
|
254
|
+
if (newUser && newUser.id !== oldUser?.id) {
|
|
255
|
+
// User switched - reload dependent data
|
|
256
|
+
orderStore.resetAndReload(newUser.id)
|
|
257
|
+
notificationStore.subscribe(newUser.id)
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
// Optimistic update with rollback
|
|
262
|
+
const updateItem = async (id: string, data: Partial<Item>) => {
|
|
263
|
+
const previousState = { ...items.value.find(i => i.id === id) }
|
|
264
|
+
// Optimistic update
|
|
265
|
+
Object.assign(items.value.find(i => i.id === id)!, data)
|
|
266
|
+
try {
|
|
267
|
+
await api.updateItem(id, data)
|
|
268
|
+
} catch (error) {
|
|
269
|
+
// Rollback on failure
|
|
270
|
+
Object.assign(items.value.find(i => i.id === id)!, previousState)
|
|
271
|
+
throw error
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## 5. API Layer
|
|
277
|
+
|
|
278
|
+
### 5.1 API Functions
|
|
279
|
+
|
|
280
|
+
<!-- AI-NOTE: Follow actual API layer patterns from conventions-dev.md. Include request/response types. -->
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
// AI-NOTE: File path follows conventions from techs knowledge
|
|
284
|
+
// File: src/apis/{module}.ts
|
|
285
|
+
|
|
286
|
+
import request from '@/utils/request'
|
|
287
|
+
import type { {RequestType}, {ResponseType} } from '@/types/{module}'
|
|
288
|
+
|
|
289
|
+
// API function with typed request/response
|
|
290
|
+
export const {apiFunctionName} = (params: {RequestType}): Promise<{ResponseType}> => {
|
|
291
|
+
return request.{method}('{path}', params)
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Additional API functions...
|
|
295
|
+
export const {apiFunctionName2} = (id: string): Promise<{ResponseType}> => {
|
|
296
|
+
return request.{method}(`{path}/${id}`)
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### 5.2 Error Handling
|
|
301
|
+
|
|
302
|
+
| Error Code | HTTP Status | Frontend Handling | User Feedback |
|
|
303
|
+
|-----------|-------------|------------------|---------------|
|
|
304
|
+
| {code} | {status} | {handling logic} | {message/toast/redirect} |
|
|
305
|
+
|
|
306
|
+
### 5.3 API Error Handling & Recovery
|
|
307
|
+
|
|
308
|
+
<!-- AI-NOTE: Unified error handling patterns including retry logic and exponential backoff -->
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
// Unified error handling
|
|
312
|
+
const handleApiError = (error: AxiosError) => {
|
|
313
|
+
if (error.response?.status === 401) {
|
|
314
|
+
// Token expired - trigger refresh
|
|
315
|
+
authStore.refreshToken()
|
|
316
|
+
return
|
|
317
|
+
}
|
|
318
|
+
if (error.response?.status === 403) {
|
|
319
|
+
// Permission denied - redirect
|
|
320
|
+
router.push('/forbidden')
|
|
321
|
+
return
|
|
322
|
+
}
|
|
323
|
+
if (error.response?.status === 422) {
|
|
324
|
+
// Validation error - extract field errors
|
|
325
|
+
return error.response.data.errors
|
|
326
|
+
}
|
|
327
|
+
// Network error or timeout - show retry
|
|
328
|
+
if (!error.response) {
|
|
329
|
+
showRetryNotification(error.config)
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// Request retry with exponential backoff
|
|
334
|
+
const withRetry = async <T>(fn: () => Promise<T>, maxRetries = 3): Promise<T> => {
|
|
335
|
+
for (let i = 0; i < maxRetries; i++) {
|
|
336
|
+
try {
|
|
337
|
+
return await fn()
|
|
338
|
+
} catch (error) {
|
|
339
|
+
if (i === maxRetries - 1) throw error
|
|
340
|
+
await new Promise(r => setTimeout(r, 1000 * Math.pow(2, i)))
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
throw new Error('Unreachable')
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## 6. Routing
|
|
348
|
+
|
|
349
|
+
| Route Path | Route Name | Component | Guard | Lazy Load | Description |
|
|
350
|
+
|-----------|------------|-----------|-------|-----------|-------------|
|
|
351
|
+
| {path} | {name} | {component} | {guard type} | Yes/No | {description} |
|
|
352
|
+
|
|
353
|
+
**Route Configuration**:
|
|
354
|
+
|
|
355
|
+
<!-- AI-NOTE: Use actual router config format from techs knowledge. -->
|
|
356
|
+
|
|
357
|
+
```typescript
|
|
358
|
+
// AI-NOTE: Example for Vue Router
|
|
359
|
+
{
|
|
360
|
+
path: '{path}',
|
|
361
|
+
name: '{RouteName}',
|
|
362
|
+
component: () => import('@/views/{Module}/{Page}.vue'),
|
|
363
|
+
meta: {
|
|
364
|
+
requiresAuth: true,
|
|
365
|
+
title: '{Page Title}'
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## 7. Unit Test Points
|
|
371
|
+
|
|
372
|
+
| Test Target | Test Scenario | Expected Behavior |
|
|
373
|
+
|-------------|--------------|-------------------|
|
|
374
|
+
| {component} | {scenario description} | {expected result} |
|
|
375
|
+
| {store action} | {scenario description} | {expected result} |
|
|
376
|
+
| {api function} | {scenario description} | {expected result} |
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
**Document Status**: Draft / In Review / Published
|
|
381
|
+
**Last Updated**: {Date}
|
|
382
|
+
**Related Feature Spec**: [{Feature Name}]({FeatureSpecPath})
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-sd-mobile
|
|
3
|
+
description: Mobile System Design SOP. Guide System Designer Agent to generate platform-specific mobile detailed design documents by filling technology implementation details into the Feature Spec skeleton. Reads techs knowledge to determine actual framework syntax (Flutter/React Native) and conventions.
|
|
4
|
+
tools: Read, Write, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Trigger Scenarios
|
|
8
|
+
|
|
9
|
+
- System Designer Agent dispatches this skill with platform context (platform_id, techs paths, Feature Spec paths)
|
|
10
|
+
- Feature Spec has been confirmed, user requests mobile system design
|
|
11
|
+
- User asks "Create mobile design for this platform" or "Generate mobile module design"
|
|
12
|
+
|
|
13
|
+
# Workflow
|
|
14
|
+
|
|
15
|
+
## Step 1: Read Inputs
|
|
16
|
+
|
|
17
|
+
Read in order:
|
|
18
|
+
|
|
19
|
+
1. **Feature Spec document(s)**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-feature-spec.md`
|
|
20
|
+
2. **API Contract**: `speccrew-workspace/iterations/{number}-{type}-{name}/02.feature-design/[feature-name]-api-contract.md`
|
|
21
|
+
3. **Mobile techs knowledge** (paths from agent context):
|
|
22
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/tech-stack.md`
|
|
23
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/architecture.md`
|
|
24
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/conventions-design.md`
|
|
25
|
+
- `speccrew-workspace/knowledges/techs/{platform_id}/conventions-dev.md`
|
|
26
|
+
4. **Design template**: `speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md`
|
|
27
|
+
5. **Index template**: `speccrew-sd-mobile/templates/INDEX-TEMPLATE.md`
|
|
28
|
+
|
|
29
|
+
## Step 2: Analyze Existing Code Structure
|
|
30
|
+
|
|
31
|
+
Use Glob/Grep to understand current codebase:
|
|
32
|
+
|
|
33
|
+
| Target | Glob Pattern | Purpose |
|
|
34
|
+
|--------|-------------|---------|
|
|
35
|
+
| Screen/Page directory | `lib/screens/**/*.dart` or `src/screens/**/*.tsx` | Understand screen organization |
|
|
36
|
+
| Widget/Component directory | `lib/widgets/**/*.dart` or `src/components/**/*` | Understand widget organization |
|
|
37
|
+
| State management | `lib/providers/**/*.dart` or `src/stores/**/*` | Understand state pattern |
|
|
38
|
+
| Navigation configuration | `lib/router/**/*.dart` or `src/navigation/**/*` | Understand routing structure |
|
|
39
|
+
| API layer | `lib/api/**/*.dart` or `src/api/**/*` | Understand API encapsulation pattern |
|
|
40
|
+
| Local storage | `lib/storage/**/*.dart` or `src/storage/**/*` | Understand persistence patterns |
|
|
41
|
+
| Naming conventions | Various | Identify actual naming patterns in use |
|
|
42
|
+
|
|
43
|
+
Document findings for reference in later steps.
|
|
44
|
+
|
|
45
|
+
## Step 3: Extract Functions from Feature Spec
|
|
46
|
+
|
|
47
|
+
Parse Feature Spec to identify all functions (Section 2.N pattern).
|
|
48
|
+
|
|
49
|
+
For each function, extract:
|
|
50
|
+
|
|
51
|
+
| Aspect | Content to Extract |
|
|
52
|
+
|--------|-------------------|
|
|
53
|
+
| Mobile prototype | UI flow description from Feature Spec |
|
|
54
|
+
| Interaction flow | User actions and system responses |
|
|
55
|
+
| Backend API calls | Required API endpoints from API Contract |
|
|
56
|
+
| Data requirements | Fields and structures needed |
|
|
57
|
+
| Platform features | Camera, GPS, push notifications, biometrics, etc. |
|
|
58
|
+
|
|
59
|
+
Mark each function's screens/widgets as:
|
|
60
|
+
|
|
61
|
+
| Marker | Meaning | Example |
|
|
62
|
+
|--------|---------|---------|
|
|
63
|
+
| `[EXISTING]` | Reuse current screen/widget | `[EXISTING] UserProfileScreen` |
|
|
64
|
+
| `[MODIFIED]` | Enhance/change existing | `[MODIFIED] OrderList - add pull-to-refresh` |
|
|
65
|
+
| `[NEW]` | Create brand new | `[NEW] ProductDetailPage` |
|
|
66
|
+
|
|
67
|
+
**Checkpoint A: Present function extraction summary to user for confirmation.**
|
|
68
|
+
|
|
69
|
+
## Step 4: Generate Module Design Documents
|
|
70
|
+
|
|
71
|
+
For each function (or logical group of closely related functions = one module):
|
|
72
|
+
|
|
73
|
+
### 4.1 Read Template
|
|
74
|
+
|
|
75
|
+
Read `SD-MOBILE-TEMPLATE.md` for document structure.
|
|
76
|
+
|
|
77
|
+
### 4.2 Fill Technology-Specific Details
|
|
78
|
+
|
|
79
|
+
Fill each section with technology-specific implementation details:
|
|
80
|
+
|
|
81
|
+
| Section | Technology-Specific Content |
|
|
82
|
+
|---------|----------------------------|
|
|
83
|
+
| Screen/widget tree | Use actual framework patterns (Flutter Widgets / React Native Components) |
|
|
84
|
+
| Props/Parameters | Type definitions from conventions-dev.md |
|
|
85
|
+
| State management | Actual pattern (Provider/Bloc/Riverpod for Flutter, Redux/MobX for React Native) |
|
|
86
|
+
| API layer | Actual HTTP client (Dio for Flutter, Axios/fetch for React Native) |
|
|
87
|
+
| Navigation | Actual router config (GoRouter for Flutter, React Navigation for React Native) |
|
|
88
|
+
| Local storage | Actual storage solution (SharedPreferences/Hive/SQLite/MMKV) |
|
|
89
|
+
| Platform features | Actual plugin APIs (camera, geolocator, local_notifications, etc.) |
|
|
90
|
+
| Pseudo-code | MUST use actual framework syntax from techs knowledge |
|
|
91
|
+
|
|
92
|
+
### 4.3 Write Module Design
|
|
93
|
+
|
|
94
|
+
Write to: `speccrew-workspace/iterations/{number}-{type}-{name}/03.system-design/{platform_id}/{module}-design.md`
|
|
95
|
+
|
|
96
|
+
**Key Rules for Pseudo-code**:
|
|
97
|
+
- MUST use actual framework API syntax from techs knowledge
|
|
98
|
+
- NOT generic pseudo-code
|
|
99
|
+
- Include actual import statements
|
|
100
|
+
- Use actual state management/API patterns from conventions
|
|
101
|
+
|
|
102
|
+
## Step 5: Generate Platform INDEX.md
|
|
103
|
+
|
|
104
|
+
After all module designs are complete:
|
|
105
|
+
|
|
106
|
+
### 5.1 Read Template
|
|
107
|
+
|
|
108
|
+
Read `INDEX-TEMPLATE.md` for document structure.
|
|
109
|
+
|
|
110
|
+
### 5.2 Fill Platform-Level Summary
|
|
111
|
+
|
|
112
|
+
| Section | Content Source |
|
|
113
|
+
|---------|---------------|
|
|
114
|
+
| Tech stack summary | tech-stack.md |
|
|
115
|
+
| Target platforms | tech-stack.md (iOS/Android min versions) |
|
|
116
|
+
| Shared design decisions | architecture.md, conventions-design.md |
|
|
117
|
+
| State management strategy | architecture.md state management section |
|
|
118
|
+
| Base widgets/components | conventions-design.md shared components |
|
|
119
|
+
| API client configuration | conventions-dev.md HTTP client section |
|
|
120
|
+
| Authentication pattern | architecture.md authentication section |
|
|
121
|
+
| Third-party SDKs | tech-stack.md dependencies |
|
|
122
|
+
|
|
123
|
+
### 5.3 Build Module List
|
|
124
|
+
|
|
125
|
+
Create table with links to each module design document.
|
|
126
|
+
|
|
127
|
+
### 5.4 Write INDEX
|
|
128
|
+
|
|
129
|
+
Write to: `speccrew-workspace/iterations/{number}-{type}-{name}/03.system-design/{platform_id}/INDEX.md`
|
|
130
|
+
|
|
131
|
+
## Step 6: Present Summary
|
|
132
|
+
|
|
133
|
+
Present to user:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
Mobile System Design Summary for: {feature-name}
|
|
137
|
+
Platform: {platform_id}
|
|
138
|
+
|
|
139
|
+
Module Design Documents: {count}
|
|
140
|
+
├── {module1}-design.md
|
|
141
|
+
├── {module2}-design.md
|
|
142
|
+
└── ...
|
|
143
|
+
|
|
144
|
+
Key Design Decisions:
|
|
145
|
+
- State Management: {approach}
|
|
146
|
+
- Navigation Strategy: {approach}
|
|
147
|
+
- API Layer: {approach}
|
|
148
|
+
- Local Storage: {approach}
|
|
149
|
+
- Platform Features: {list}
|
|
150
|
+
|
|
151
|
+
Concerns/Trade-offs:
|
|
152
|
+
- {list any concerns}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Ask user to confirm:**
|
|
156
|
+
1. Are the screen architectures appropriate?
|
|
157
|
+
2. Is the state management strategy correct?
|
|
158
|
+
3. Do the pseudo-code patterns match project conventions?
|
|
159
|
+
4. Are all API calls from API Contract covered?
|
|
160
|
+
5. Are platform-specific features (permissions, native integration) properly handled?
|
|
161
|
+
|
|
162
|
+
# Key Rules
|
|
163
|
+
|
|
164
|
+
| Rule | Description |
|
|
165
|
+
|------|-------------|
|
|
166
|
+
| **Actual Framework Syntax** | All pseudo-code MUST use actual framework/library syntax from techs knowledge, NOT generic code |
|
|
167
|
+
| **API Contract READ-ONLY** | API Contract is reference only - do not modify |
|
|
168
|
+
| **One Module Per Function Group** | Each module design document maps to one or more related Feature Spec functions |
|
|
169
|
+
| **Status Markers Required** | Use [EXISTING], [MODIFIED], [NEW] markers for all screens, widgets, and store modules |
|
|
170
|
+
| **Follow Techs Conventions** | Naming, directory structure, patterns must follow techs knowledge |
|
|
171
|
+
| **Platform-Specific Handling** | Properly handle iOS/Android differences, permissions, and native integrations |
|
|
172
|
+
| **Offline Support** | Consider offline-first patterns where applicable |
|
|
173
|
+
|
|
174
|
+
# Checklist
|
|
175
|
+
|
|
176
|
+
- [ ] All techs knowledge documents loaded before design
|
|
177
|
+
- [ ] Existing code structure analyzed via Glob/Grep
|
|
178
|
+
- [ ] Every Feature Spec function covered in a module design
|
|
179
|
+
- [ ] All API calls from API Contract referenced correctly
|
|
180
|
+
- [ ] Pseudo-code uses actual framework syntax (not generic)
|
|
181
|
+
- [ ] Screen/widget naming follows conventions-dev.md
|
|
182
|
+
- [ ] State management follows architecture.md patterns
|
|
183
|
+
- [ ] Navigation follows conventions-design.md
|
|
184
|
+
- [ ] Local storage strategy documented
|
|
185
|
+
- [ ] Platform permissions and native integrations documented
|
|
186
|
+
- [ ] App lifecycle handling documented
|
|
187
|
+
- [ ] INDEX.md generated with complete module list
|
|
188
|
+
- [ ] All files written to correct paths under 03.system-design/{platform_id}/
|
|
189
|
+
- [ ] Checkpoint A passed: function extraction confirmed with user
|