@nextsparkjs/ai-workflow 0.1.0-beta.86
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 +86 -0
- package/claude/_docs/workflows-optimizations.md +359 -0
- package/claude/agents/api-tester.md +636 -0
- package/claude/agents/architecture-supervisor.md +1381 -0
- package/claude/agents/backend-developer.md +1021 -0
- package/claude/agents/backend-validator.md +417 -0
- package/claude/agents/bdd-docs-writer.md +737 -0
- package/claude/agents/block-developer.md +677 -0
- package/claude/agents/code-reviewer.md +1460 -0
- package/claude/agents/db-developer.md +721 -0
- package/claude/agents/db-validator.md +407 -0
- package/claude/agents/demo-video-generator.md +493 -0
- package/claude/agents/documentation-writer.md +1291 -0
- package/claude/agents/frontend-developer.md +1259 -0
- package/claude/agents/frontend-validator.md +777 -0
- package/claude/agents/functional-validator.md +630 -0
- package/claude/agents/mock-analyst.md +387 -0
- package/claude/agents/product-manager.md +971 -0
- package/claude/agents/qa-automation.md +1762 -0
- package/claude/agents/release-manager.md +634 -0
- package/claude/agents/selectors-translator.md +262 -0
- package/claude/agents/unit-test-writer.md +785 -0
- package/claude/agents/visual-comparator.md +329 -0
- package/claude/agents/workflow-maintainer.md +373 -0
- package/claude/commands/do/README.md +88 -0
- package/claude/commands/do/create-api.md +64 -0
- package/claude/commands/do/create-entity.md +66 -0
- package/claude/commands/do/create-migration.md +64 -0
- package/claude/commands/do/create-plugin.md +56 -0
- package/claude/commands/do/create-theme.md +70 -0
- package/claude/commands/do/mock-data.md +67 -0
- package/claude/commands/do/reset-db.md +71 -0
- package/claude/commands/do/setup-scheduled-action.md +75 -0
- package/claude/commands/do/sync-code-review.md +117 -0
- package/claude/commands/do/update-selectors.md +112 -0
- package/claude/commands/do/use-skills.md +90 -0
- package/claude/commands/do/validate-blocks.md +69 -0
- package/claude/commands/how-to/README.md +261 -0
- package/claude/commands/how-to/add-metadata.md +692 -0
- package/claude/commands/how-to/add-taxonomies.md +806 -0
- package/claude/commands/how-to/add-translations.md +571 -0
- package/claude/commands/how-to/create-api.md +577 -0
- package/claude/commands/how-to/create-block.md +575 -0
- package/claude/commands/how-to/create-child-entities.md +771 -0
- package/claude/commands/how-to/create-entity.md +597 -0
- package/claude/commands/how-to/create-migrations.md +605 -0
- package/claude/commands/how-to/create-plugin.md +654 -0
- package/claude/commands/how-to/customize-app.md +481 -0
- package/claude/commands/how-to/customize-dashboard.md +553 -0
- package/claude/commands/how-to/customize-theme.md +438 -0
- package/claude/commands/how-to/define-features-flows.md +632 -0
- package/claude/commands/how-to/deploy.md +507 -0
- package/claude/commands/how-to/handle-file-uploads.md +681 -0
- package/claude/commands/how-to/implement-search.md +1001 -0
- package/claude/commands/how-to/install-plugins.md +352 -0
- package/claude/commands/how-to/manage-test-coverage.md +984 -0
- package/claude/commands/how-to/run-tests.md +400 -0
- package/claude/commands/how-to/set-app-languages.md +601 -0
- package/claude/commands/how-to/set-plans-and-permissions.md +575 -0
- package/claude/commands/how-to/set-scheduled-actions.md +527 -0
- package/claude/commands/how-to/set-user-roles-and-permissions.md +550 -0
- package/claude/commands/how-to/setup-authentication.md +388 -0
- package/claude/commands/how-to/setup-claude-code.md +512 -0
- package/claude/commands/how-to/setup-database.md +274 -0
- package/claude/commands/how-to/setup-email-providers.md +598 -0
- package/claude/commands/how-to/setup-mobile-dev.md +627 -0
- package/claude/commands/how-to/start.md +455 -0
- package/claude/commands/how-to/use-devtools.md +639 -0
- package/claude/commands/how-to/use-superadmin.md +622 -0
- package/claude/commands/session/README.md +193 -0
- package/claude/commands/session/block-create.md +190 -0
- package/claude/commands/session/block-list.md +203 -0
- package/claude/commands/session/block-update.md +192 -0
- package/claude/commands/session/block-validate.md +218 -0
- package/claude/commands/session/close.md +146 -0
- package/claude/commands/session/commit.md +174 -0
- package/claude/commands/session/db-entity.md +206 -0
- package/claude/commands/session/db-fix.md +212 -0
- package/claude/commands/session/db-sample.md +206 -0
- package/claude/commands/session/demo.md +178 -0
- package/claude/commands/session/doc-bdd.md +207 -0
- package/claude/commands/session/doc-feature.md +218 -0
- package/claude/commands/session/doc-read.md +225 -0
- package/claude/commands/session/execute.md +204 -0
- package/claude/commands/session/explain.md +202 -0
- package/claude/commands/session/fix-bug.md +210 -0
- package/claude/commands/session/fix-build.md +182 -0
- package/claude/commands/session/fix-test.md +189 -0
- package/claude/commands/session/pending.md +232 -0
- package/claude/commands/session/refine.md +188 -0
- package/claude/commands/session/resume.md +192 -0
- package/claude/commands/session/review.md +192 -0
- package/claude/commands/session/scope-change.md +181 -0
- package/claude/commands/session/start-blocks.md +347 -0
- package/claude/commands/session/start.md +476 -0
- package/claude/commands/session/status.md +169 -0
- package/claude/commands/session/test-fix.md +221 -0
- package/claude/commands/session/test-run.md +203 -0
- package/claude/commands/session/test-write.md +242 -0
- package/claude/commands/session/validate.md +162 -0
- package/claude/config/context.json +54 -0
- package/claude/config/github.json +69 -0
- package/claude/config/github.schema.json +106 -0
- package/claude/config/team.json +46 -0
- package/claude/config/team.schema.json +106 -0
- package/claude/config/workspace.json +49 -0
- package/claude/config/workspace.schema.json +64 -0
- package/claude/scripts/.gitkeep +0 -0
- package/claude/sessions/.gitkeep +0 -0
- package/claude/skills/README.md +228 -0
- package/claude/skills/accessibility/SKILL.md +573 -0
- package/claude/skills/api-bypass-layers/SKILL.md +550 -0
- package/claude/skills/asana-integration/SKILL.md +499 -0
- package/claude/skills/better-auth/SKILL.md +666 -0
- package/claude/skills/billing-subscriptions/SKILL.md +660 -0
- package/claude/skills/block-decision-matrix/SKILL.md +359 -0
- package/claude/skills/clickup-integration/SKILL.md +434 -0
- package/claude/skills/core-theme-responsibilities/SKILL.md +485 -0
- package/claude/skills/create-plugin/SKILL.md +425 -0
- package/claude/skills/create-theme/SKILL.md +331 -0
- package/claude/skills/cypress-api/SKILL.md +511 -0
- package/claude/skills/cypress-api/scripts/generate-api-controller.py +329 -0
- package/claude/skills/cypress-api/scripts/generate-api-test.py +930 -0
- package/claude/skills/cypress-e2e/SKILL.md +526 -0
- package/claude/skills/cypress-e2e/scripts/extract-selectors.py +383 -0
- package/claude/skills/cypress-e2e/scripts/generate-uat-test.py +788 -0
- package/claude/skills/cypress-selectors/SKILL.md +309 -0
- package/claude/skills/cypress-selectors/scripts/extract-missing.py +243 -0
- package/claude/skills/cypress-selectors/scripts/generate-block-selectors.py +283 -0
- package/claude/skills/cypress-selectors/scripts/validate-selectors.py +145 -0
- package/claude/skills/database-migrations/SKILL.md +335 -0
- package/claude/skills/database-migrations/scripts/generate-sample-data.py +284 -0
- package/claude/skills/database-migrations/scripts/validate-migration.py +323 -0
- package/claude/skills/design-system/SKILL.md +682 -0
- package/claude/skills/documentation/SKILL.md +540 -0
- package/claude/skills/entity-api/SKILL.md +482 -0
- package/claude/skills/entity-system/SKILL.md +635 -0
- package/claude/skills/entity-system/scripts/generate-child-migration.py +298 -0
- package/claude/skills/entity-system/scripts/generate-metas-migration.py +233 -0
- package/claude/skills/entity-system/scripts/generate-migration.py +382 -0
- package/claude/skills/entity-system/scripts/generate-sample-data.py +418 -0
- package/claude/skills/entity-system/scripts/scaffold-entity.py +661 -0
- package/claude/skills/github/SKILL.md +467 -0
- package/claude/skills/i18n-nextintl/SKILL.md +302 -0
- package/claude/skills/i18n-nextintl/scripts/add-translation.py +243 -0
- package/claude/skills/i18n-nextintl/scripts/extract-hardcoded.py +246 -0
- package/claude/skills/i18n-nextintl/scripts/validate-translations.py +260 -0
- package/claude/skills/impact-analysis/SKILL.md +203 -0
- package/claude/skills/jest-unit/SKILL.md +306 -0
- package/claude/skills/jest-unit/references/component-testing.md +371 -0
- package/claude/skills/jest-unit/references/mocking-patterns.md +380 -0
- package/claude/skills/jest-unit/references/service-hook-testing.md +454 -0
- package/claude/skills/jira-integration/SKILL.md +539 -0
- package/claude/skills/mock-analysis/SKILL.md +276 -0
- package/claude/skills/monorepo-architecture/SKILL.md +162 -0
- package/claude/skills/nextjs-api-development/SKILL.md +364 -0
- package/claude/skills/nextjs-api-development/scripts/generate-crud-tests.py +456 -0
- package/claude/skills/nextjs-api-development/scripts/scaffold-endpoint.py +481 -0
- package/claude/skills/nextjs-api-development/scripts/validate-api.py +283 -0
- package/claude/skills/notion-integration/SKILL.md +641 -0
- package/claude/skills/npm-development-workflow/SKILL.md +480 -0
- package/claude/skills/page-builder-blocks/SKILL.md +483 -0
- package/claude/skills/page-builder-blocks/scripts/scaffold-block.py +444 -0
- package/claude/skills/permissions-system/SKILL.md +619 -0
- package/claude/skills/plugins/SKILL.md +340 -0
- package/claude/skills/plugins/references/plugin-templates.md +414 -0
- package/claude/skills/plugins/references/plugin-testing.md +353 -0
- package/claude/skills/plugins/references/plugin-types.md +198 -0
- package/claude/skills/plugins/scripts/scaffold-plugin.py +443 -0
- package/claude/skills/pom-patterns/SKILL.md +452 -0
- package/claude/skills/pom-patterns/scripts/generate-pom.py +392 -0
- package/claude/skills/rate-limiting/SKILL.md +342 -0
- package/claude/skills/react-best-practices/AGENTS.md +2410 -0
- package/claude/skills/react-best-practices/README.md +123 -0
- package/claude/skills/react-best-practices/SKILL.md +125 -0
- package/claude/skills/react-best-practices/metadata.json +15 -0
- package/claude/skills/react-best-practices/rules/_sections.md +46 -0
- package/claude/skills/react-best-practices/rules/_template.md +28 -0
- package/claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/claude/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/claude/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/claude/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/claude/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/claude/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/claude/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/claude/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/claude/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/claude/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/claude/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/claude/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/claude/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/claude/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/claude/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/claude/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/claude/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/claude/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/claude/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/claude/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/claude/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/claude/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/claude/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/claude/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/claude/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/claude/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/claude/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/claude/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/claude/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/claude/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/claude/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/claude/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/claude/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/claude/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/claude/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/claude/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/claude/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/claude/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/claude/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/claude/skills/react-best-practices/rules/server-cache-react.md +76 -0
- package/claude/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/claude/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/claude/skills/react-patterns/SKILL.md +677 -0
- package/claude/skills/registry-system/SKILL.md +331 -0
- package/claude/skills/scheduled-actions/SKILL.md +431 -0
- package/claude/skills/scope-enforcement/SKILL.md +542 -0
- package/claude/skills/scope-enforcement/scripts/validate-scope.py +357 -0
- package/claude/skills/server-actions/SKILL.md +493 -0
- package/claude/skills/service-layer/SKILL.md +587 -0
- package/claude/skills/session-management/SKILL.md +266 -0
- package/claude/skills/session-management/scripts/create-session.py +166 -0
- package/claude/skills/session-management/scripts/iteration-close.sh +105 -0
- package/claude/skills/session-management/scripts/iteration-init.sh +180 -0
- package/claude/skills/session-management/scripts/session-archive.sh +87 -0
- package/claude/skills/session-management/scripts/session-close.sh +133 -0
- package/claude/skills/session-management/scripts/session-init.sh +225 -0
- package/claude/skills/session-management/scripts/session-list.sh +163 -0
- package/claude/skills/session-management/scripts/split-plan.sh +116 -0
- package/claude/skills/shadcn-components/SKILL.md +586 -0
- package/claude/skills/shadcn-theming/SKILL.md +446 -0
- package/claude/skills/suspense-loading/SKILL.md +280 -0
- package/claude/skills/tailwind-theming/SKILL.md +479 -0
- package/claude/skills/tanstack-query/SKILL.md +608 -0
- package/claude/skills/test-coverage/SKILL.md +239 -0
- package/claude/skills/web-design-guidelines/SKILL.md +39 -0
- package/claude/skills/zod-validation/SKILL.md +537 -0
- package/claude/templates/blocks/progress.md +86 -0
- package/claude/templates/iteration/changes.md +61 -0
- package/claude/templates/iteration/progress.md +55 -0
- package/claude/templates/log.md +31 -0
- package/claude/templates/story/context.md +77 -0
- package/claude/templates/story/pendings.md +37 -0
- package/claude/templates/story/plan.md +299 -0
- package/claude/templates/story/requirements.md +109 -0
- package/claude/templates/story/scope.json +10 -0
- package/claude/templates/story/tests.md +91 -0
- package/claude/templates/task/progress.md +58 -0
- package/claude/templates/task/requirements.md +54 -0
- package/claude/workflows/README.md +154 -0
- package/claude/workflows/blocks.md +614 -0
- package/claude/workflows/story.md +1207 -0
- package/claude/workflows/task.md +927 -0
- package/claude/workflows/tweak.md +527 -0
- package/cursor/.gitkeep +0 -0
- package/package.json +34 -0
- package/scripts/setup.mjs +282 -0
- package/scripts/sync.mjs +209 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# /session:explain
|
|
2
|
+
|
|
3
|
+
Provide an interactive walkthrough of the implemented code.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
/session:explain [--file <path>] [--concept <name>]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Behavior
|
|
16
|
+
|
|
17
|
+
Explains the implementation details of the current session, walking through key files and decisions.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Flow
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
25
|
+
│ /session:explain │
|
|
26
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
27
|
+
│ │
|
|
28
|
+
│ 1. Load session context │
|
|
29
|
+
│ - Read scope.json (modified files) │
|
|
30
|
+
│ - Read plan.md (decisions) │
|
|
31
|
+
│ ↓ │
|
|
32
|
+
│ 2. Organize explanation │
|
|
33
|
+
│ - Group by layer (DB/API/UI) │
|
|
34
|
+
│ - Order by importance │
|
|
35
|
+
│ ↓ │
|
|
36
|
+
│ 3. Walk through implementation │
|
|
37
|
+
│ - Show key code sections │
|
|
38
|
+
│ - Explain patterns used │
|
|
39
|
+
│ - Highlight decisions │
|
|
40
|
+
│ ↓ │
|
|
41
|
+
│ 4. Answer questions (interactive) │
|
|
42
|
+
│ │
|
|
43
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Example Output
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
📚 CODE WALKTHROUGH
|
|
52
|
+
|
|
53
|
+
Session: stories/2026-01-11-new-products-entity
|
|
54
|
+
Files modified: 12
|
|
55
|
+
|
|
56
|
+
─────────────────────────────────────────
|
|
57
|
+
|
|
58
|
+
## 1. DATABASE LAYER
|
|
59
|
+
|
|
60
|
+
### Migration: 008_products.sql
|
|
61
|
+
|
|
62
|
+
```sql
|
|
63
|
+
CREATE TABLE products (
|
|
64
|
+
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
65
|
+
name VARCHAR(255) NOT NULL,
|
|
66
|
+
price DECIMAL(10,2) NOT NULL,
|
|
67
|
+
-- Using camelCase per project conventions
|
|
68
|
+
categoryId UUID REFERENCES categories(id),
|
|
69
|
+
createdAt TIMESTAMPTZ DEFAULT NOW()
|
|
70
|
+
);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Why these choices:**
|
|
74
|
+
- UUID for distributed ID generation
|
|
75
|
+
- DECIMAL for precise currency handling
|
|
76
|
+
- TIMESTAMPTZ for timezone awareness
|
|
77
|
+
|
|
78
|
+
─────────────────────────────────────────
|
|
79
|
+
|
|
80
|
+
## 2. BACKEND LAYER
|
|
81
|
+
|
|
82
|
+
### Entity Config: products.ts
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
export const productsEntity: EntityConfig = {
|
|
86
|
+
name: 'products',
|
|
87
|
+
table: 'products',
|
|
88
|
+
fields: {
|
|
89
|
+
name: { type: 'string', required: true },
|
|
90
|
+
price: { type: 'number', required: true },
|
|
91
|
+
// ...
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Pattern:** Using the entity config system for automatic:
|
|
97
|
+
- CRUD API generation
|
|
98
|
+
- Form schema generation
|
|
99
|
+
- Type inference
|
|
100
|
+
|
|
101
|
+
─────────────────────────────────────────
|
|
102
|
+
|
|
103
|
+
## 3. FRONTEND LAYER
|
|
104
|
+
|
|
105
|
+
### ProductForm.tsx
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
export function ProductForm({ product }: Props) {
|
|
109
|
+
const { mutate, isPending } = useEntityMutation('products');
|
|
110
|
+
// Using TanStack Query pattern from project
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Pattern:** Standard form component following:
|
|
115
|
+
- Controlled inputs with react-hook-form
|
|
116
|
+
- Zod validation from entity schema
|
|
117
|
+
- Optimistic updates
|
|
118
|
+
|
|
119
|
+
─────────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
Questions? Type your question or press Enter to continue.
|
|
122
|
+
> Why did you use DECIMAL instead of FLOAT for price?
|
|
123
|
+
|
|
124
|
+
DECIMAL provides exact precision for financial calculations.
|
|
125
|
+
FLOAT can have rounding errors (e.g., 0.1 + 0.2 = 0.30000000000000004).
|
|
126
|
+
For money, we need exact values, so DECIMAL(10,2) ensures
|
|
127
|
+
exactly 2 decimal places with no rounding issues.
|
|
128
|
+
|
|
129
|
+
More questions? [Type question or Enter to finish]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Explain Specific File
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
/session:explain --file core/services/ProductsService.ts
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Output:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
📚 FILE EXPLANATION
|
|
144
|
+
|
|
145
|
+
File: core/services/ProductsService.ts
|
|
146
|
+
Lines: 45
|
|
147
|
+
Purpose: Custom business logic for products
|
|
148
|
+
|
|
149
|
+
─────────────────────────────────────────
|
|
150
|
+
|
|
151
|
+
## Overview
|
|
152
|
+
|
|
153
|
+
This service extends BaseEntityService to add
|
|
154
|
+
custom price calculation logic.
|
|
155
|
+
|
|
156
|
+
## Key Sections
|
|
157
|
+
|
|
158
|
+
### Lines 12-25: Price Calculation
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
calculateFinalPrice(product: Product, discount: number): number {
|
|
162
|
+
const basePrice = product.price;
|
|
163
|
+
const discountAmount = basePrice * (discount / 100);
|
|
164
|
+
return Math.round((basePrice - discountAmount) * 100) / 100;
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Why:** Centralizes pricing logic for consistency.
|
|
169
|
+
The rounding ensures no floating point issues.
|
|
170
|
+
|
|
171
|
+
### Lines 30-40: Validation
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
async validateProduct(data: ProductInput): Promise<void> {
|
|
175
|
+
if (data.price <= 0) {
|
|
176
|
+
throw new ValidationError('Price must be positive');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Why:** Business rule enforcement at service layer,
|
|
182
|
+
not just form validation.
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Options
|
|
188
|
+
|
|
189
|
+
| Option | Description |
|
|
190
|
+
|--------|-------------|
|
|
191
|
+
| `--file <path>` | Explain specific file |
|
|
192
|
+
| `--concept <name>` | Explain specific concept/pattern |
|
|
193
|
+
| `--detailed` | Include all files, not just key ones |
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Related Commands
|
|
198
|
+
|
|
199
|
+
| Command | Action |
|
|
200
|
+
|---------|--------|
|
|
201
|
+
| `/session:demo` | Visual demonstration |
|
|
202
|
+
| `/session:review` | Code review |
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# /session:fix:bug
|
|
2
|
+
|
|
3
|
+
Fix a bug with a simplified workflow.
|
|
4
|
+
|
|
5
|
+
**Aliases:** `/fix`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Workflow Detection
|
|
10
|
+
|
|
11
|
+
**[MANDATORY]** This command determines workflow based on complexity:
|
|
12
|
+
|
|
13
|
+
| Evaluation | Workflow | Session |
|
|
14
|
+
|------------|----------|---------|
|
|
15
|
+
| XS-S (1-3 files, low risk) | TWEAK | tweaks/ |
|
|
16
|
+
| M+ (4+ files or high risk) | TASK | tasks/ |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Syntax
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
/session:fix:bug <description>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Behavior
|
|
29
|
+
|
|
30
|
+
Optimized workflow for bug fixes:
|
|
31
|
+
1. **Analyze** the bug
|
|
32
|
+
2. **Determine** T-Shirt size
|
|
33
|
+
3. **Implement** fix
|
|
34
|
+
4. **Validate** no regressions
|
|
35
|
+
5. **Create** test to prevent recurrence
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Flow
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
43
|
+
│ /session:fix:bug │
|
|
44
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
45
|
+
│ │
|
|
46
|
+
│ 1. Analyze bug description │
|
|
47
|
+
│ - Where does it occur? │
|
|
48
|
+
│ - How to reproduce? │
|
|
49
|
+
│ - What is the expected behavior? │
|
|
50
|
+
│ ↓ │
|
|
51
|
+
│ 2. Search related code │
|
|
52
|
+
│ - Grep for relevant terms │
|
|
53
|
+
│ - Identify affected files │
|
|
54
|
+
│ ↓ │
|
|
55
|
+
│ 3. Evaluate complexity │
|
|
56
|
+
│ │ │
|
|
57
|
+
│ ├─► XS-S (1-3 files): TWEAK workflow │
|
|
58
|
+
│ │ - Direct fix │
|
|
59
|
+
│ │ - Validate build/tests │
|
|
60
|
+
│ │ │
|
|
61
|
+
│ └─► M+ (4+ files or risk): TASK workflow │
|
|
62
|
+
│ - Create task session │
|
|
63
|
+
│ - Document analysis │
|
|
64
|
+
│ - Fix with tests │
|
|
65
|
+
│ ↓ │
|
|
66
|
+
│ 4. Implement fix │
|
|
67
|
+
│ ↓ │
|
|
68
|
+
│ 5. Validate │
|
|
69
|
+
│ - Build passes │
|
|
70
|
+
│ - Existing tests pass │
|
|
71
|
+
│ - Bug reproduced → fixed │
|
|
72
|
+
│ ↓ │
|
|
73
|
+
│ 6. Create regression test (if doesn't exist) │
|
|
74
|
+
│ ↓ │
|
|
75
|
+
│ 7. Ready for commit │
|
|
76
|
+
│ │
|
|
77
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Example
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
/session:fix:bug The submit button doesn't disable during submission
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Output:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
🐛 ANALYZING BUG
|
|
92
|
+
|
|
93
|
+
Description: The submit button doesn't disable during submission
|
|
94
|
+
|
|
95
|
+
─────────────────────────────────────────
|
|
96
|
+
|
|
97
|
+
🔍 ANALYSIS
|
|
98
|
+
|
|
99
|
+
Searching related code...
|
|
100
|
+
├─ "submit" in components... 5 files
|
|
101
|
+
├─ "disabled" in forms... 3 files
|
|
102
|
+
└─ "loading" state... 2 files
|
|
103
|
+
|
|
104
|
+
Probable file:
|
|
105
|
+
core/components/forms/SubmitButton.tsx
|
|
106
|
+
|
|
107
|
+
─────────────────────────────────────────
|
|
108
|
+
|
|
109
|
+
📐 EVALUATION
|
|
110
|
+
|
|
111
|
+
Affected files: ~2
|
|
112
|
+
Risk: Low (UI only)
|
|
113
|
+
T-Shirt: XS
|
|
114
|
+
|
|
115
|
+
Workflow: TWEAK
|
|
116
|
+
|
|
117
|
+
─────────────────────────────────────────
|
|
118
|
+
|
|
119
|
+
🔧 IMPLEMENTING FIX
|
|
120
|
+
|
|
121
|
+
[Reading SubmitButton.tsx]
|
|
122
|
+
[Identifying problem: missing isLoading prop]
|
|
123
|
+
[Applying fix...]
|
|
124
|
+
|
|
125
|
+
─────────────────────────────────────────
|
|
126
|
+
|
|
127
|
+
✅ VALIDATION
|
|
128
|
+
|
|
129
|
+
- Build: ✓ Passes
|
|
130
|
+
- Tests: ✓ 45/45 pass
|
|
131
|
+
- Visual: Button now disables
|
|
132
|
+
|
|
133
|
+
─────────────────────────────────────────
|
|
134
|
+
|
|
135
|
+
📝 REGRESSION TEST
|
|
136
|
+
|
|
137
|
+
Create test to prevent recurrence? [Yes/No]
|
|
138
|
+
|
|
139
|
+
> Yes
|
|
140
|
+
|
|
141
|
+
Creating test in __tests__/components/SubmitButton.test.tsx
|
|
142
|
+
✓ Test created
|
|
143
|
+
|
|
144
|
+
─────────────────────────────────────────
|
|
145
|
+
|
|
146
|
+
✓ Bug fixed. Ready for commit.
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## With Complex Bug
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
🐛 ANALYZING BUG
|
|
155
|
+
|
|
156
|
+
Description: Orders are not being calculated correctly
|
|
157
|
+
|
|
158
|
+
─────────────────────────────────────────
|
|
159
|
+
|
|
160
|
+
🔍 ANALYSIS
|
|
161
|
+
|
|
162
|
+
Searching related code...
|
|
163
|
+
├─ "order" in services... 8 files
|
|
164
|
+
├─ "calculate" in orders... 3 files
|
|
165
|
+
└─ "total" in cart... 4 files
|
|
166
|
+
|
|
167
|
+
Probable files:
|
|
168
|
+
- core/services/orders.ts
|
|
169
|
+
- core/services/cart.ts
|
|
170
|
+
- core/api/orders/route.ts
|
|
171
|
+
|
|
172
|
+
─────────────────────────────────────────
|
|
173
|
+
|
|
174
|
+
📐 EVALUATION
|
|
175
|
+
|
|
176
|
+
Affected files: ~6
|
|
177
|
+
Risk: HIGH (affects revenue)
|
|
178
|
+
T-Shirt: M
|
|
179
|
+
|
|
180
|
+
⚠️ ALERT: This bug affects critical flow (Orders)
|
|
181
|
+
|
|
182
|
+
Recommended workflow: TASK
|
|
183
|
+
|
|
184
|
+
─────────────────────────────────────────
|
|
185
|
+
|
|
186
|
+
Proceed with TASK workflow? [Yes/Use TWEAK]
|
|
187
|
+
|
|
188
|
+
> Yes
|
|
189
|
+
|
|
190
|
+
Creating task session: tasks/2026-01-11-fix-order-calculation
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Options
|
|
196
|
+
|
|
197
|
+
| Option | Description |
|
|
198
|
+
|--------|-------------|
|
|
199
|
+
| `--quick` | Force TWEAK workflow |
|
|
200
|
+
| `--with-test` | Always create regression test |
|
|
201
|
+
| `--no-test` | Don't create test (not recommended) |
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Related Commands
|
|
206
|
+
|
|
207
|
+
| Command | Action |
|
|
208
|
+
|---------|--------|
|
|
209
|
+
| `/session:fix:build` | Fix build errors |
|
|
210
|
+
| `/session:fix:test` | Fix failing tests |
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# /session:fix:build
|
|
2
|
+
|
|
3
|
+
Fix build errors automatically.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Syntax
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
/session:fix:build [--max-iterations <n>]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Behavior
|
|
16
|
+
|
|
17
|
+
Automatically diagnoses and fixes build errors in a loop until the build passes.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Flow
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
25
|
+
│ /session:fix:build │
|
|
26
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
27
|
+
│ │
|
|
28
|
+
│ 1. Run build │
|
|
29
|
+
│ ↓ │
|
|
30
|
+
│ 2. Parse errors │
|
|
31
|
+
│ - TypeScript errors │
|
|
32
|
+
│ - Import errors │
|
|
33
|
+
│ - Config errors │
|
|
34
|
+
│ ↓ │
|
|
35
|
+
│ 3. Categorize by type │
|
|
36
|
+
│ - Type mismatch │
|
|
37
|
+
│ - Missing import │
|
|
38
|
+
│ - Missing dependency │
|
|
39
|
+
│ - Syntax error │
|
|
40
|
+
│ ↓ │
|
|
41
|
+
│ 4. Fix each error │
|
|
42
|
+
│ - Apply targeted fix │
|
|
43
|
+
│ ↓ │
|
|
44
|
+
│ 5. Re-run build │
|
|
45
|
+
│ │ │
|
|
46
|
+
│ ├─► Errors remain: Go to step 2 │
|
|
47
|
+
│ │ │
|
|
48
|
+
│ └─► Build passes: Done │
|
|
49
|
+
│ ↓ │
|
|
50
|
+
│ 6. Show summary │
|
|
51
|
+
│ │
|
|
52
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Example Output
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
🔧 FIX BUILD ERRORS
|
|
61
|
+
|
|
62
|
+
─────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
📋 ITERATION 1
|
|
65
|
+
|
|
66
|
+
Running build...
|
|
67
|
+
❌ Build failed with 5 errors
|
|
68
|
+
|
|
69
|
+
Errors:
|
|
70
|
+
1. TS2345: products.ts:23 - Type mismatch
|
|
71
|
+
2. TS2307: ProductForm.tsx:5 - Missing import
|
|
72
|
+
3. TS2307: ProductForm.tsx:8 - Missing import
|
|
73
|
+
4. TS2339: ProductList.tsx:45 - Property does not exist
|
|
74
|
+
5. TS2345: ProductService.ts:12 - Type mismatch
|
|
75
|
+
|
|
76
|
+
─────────────────────────────────────────
|
|
77
|
+
|
|
78
|
+
🔧 FIXING ERRORS
|
|
79
|
+
|
|
80
|
+
[1/5] products.ts:23 - Type mismatch
|
|
81
|
+
Fix: Cast to correct type
|
|
82
|
+
✓ Fixed
|
|
83
|
+
|
|
84
|
+
[2/5] ProductForm.tsx:5 - Missing import
|
|
85
|
+
Fix: Add import for 'useForm'
|
|
86
|
+
✓ Fixed
|
|
87
|
+
|
|
88
|
+
[3/5] ProductForm.tsx:8 - Missing import
|
|
89
|
+
Fix: Add import for 'zodResolver'
|
|
90
|
+
✓ Fixed
|
|
91
|
+
|
|
92
|
+
[4/5] ProductList.tsx:45 - Property does not exist
|
|
93
|
+
Fix: Update property name
|
|
94
|
+
✓ Fixed
|
|
95
|
+
|
|
96
|
+
[5/5] ProductService.ts:12 - Type mismatch
|
|
97
|
+
Fix: Update function signature
|
|
98
|
+
✓ Fixed
|
|
99
|
+
|
|
100
|
+
─────────────────────────────────────────
|
|
101
|
+
|
|
102
|
+
📋 ITERATION 2
|
|
103
|
+
|
|
104
|
+
Running build...
|
|
105
|
+
✓ Build successful
|
|
106
|
+
|
|
107
|
+
─────────────────────────────────────────
|
|
108
|
+
|
|
109
|
+
📊 SUMMARY
|
|
110
|
+
|
|
111
|
+
Iterations: 2
|
|
112
|
+
Errors fixed: 5
|
|
113
|
+
Files modified: 4
|
|
114
|
+
|
|
115
|
+
Build is now passing.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## With Max Iterations
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
/session:fix:build --max-iterations 3
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Output when limit reached:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
🔧 FIX BUILD ERRORS
|
|
130
|
+
|
|
131
|
+
─────────────────────────────────────────
|
|
132
|
+
|
|
133
|
+
📋 ITERATION 3
|
|
134
|
+
|
|
135
|
+
Running build...
|
|
136
|
+
❌ Build failed with 2 errors
|
|
137
|
+
|
|
138
|
+
⚠️ MAX ITERATIONS REACHED
|
|
139
|
+
|
|
140
|
+
Remaining errors:
|
|
141
|
+
1. TS2322: complex-type.ts:45 - Complex type error
|
|
142
|
+
2. TS2339: api-handler.ts:23 - Missing property
|
|
143
|
+
|
|
144
|
+
These errors may require manual intervention.
|
|
145
|
+
|
|
146
|
+
Options:
|
|
147
|
+
[1] Continue fixing (increase limit)
|
|
148
|
+
[2] Show detailed error analysis
|
|
149
|
+
[3] Stop and fix manually
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Error Categories
|
|
155
|
+
|
|
156
|
+
| Category | Auto-Fix | Example |
|
|
157
|
+
|----------|----------|---------|
|
|
158
|
+
| Missing import | Yes | `import { X } from 'y'` |
|
|
159
|
+
| Type mismatch | Usually | Cast or update type |
|
|
160
|
+
| Syntax error | Usually | Missing bracket, etc. |
|
|
161
|
+
| Missing property | Sometimes | Add property to interface |
|
|
162
|
+
| Complex type | Manual | Generic constraints |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Options
|
|
167
|
+
|
|
168
|
+
| Option | Description |
|
|
169
|
+
|--------|-------------|
|
|
170
|
+
| `--max-iterations <n>` | Max fix attempts (default: 5) |
|
|
171
|
+
| `--dry-run` | Show fixes without applying |
|
|
172
|
+
| `--verbose` | Show detailed fix reasoning |
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Related Commands
|
|
177
|
+
|
|
178
|
+
| Command | Action |
|
|
179
|
+
|---------|--------|
|
|
180
|
+
| `/session:fix:test` | Fix failing tests |
|
|
181
|
+
| `/session:fix:bug` | Fix reported bug |
|
|
182
|
+
| `/session:validate` | Full validation |
|