@nextsparkjs/ai-workflow 0.1.0-beta.100
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 +115 -0
- package/claude/_docs/workflows-optimizations.md +359 -0
- package/claude/agents/api-tester.md +634 -0
- package/claude/agents/architecture-supervisor.md +1351 -0
- package/claude/agents/backend-developer.md +997 -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 +1432 -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 +1268 -0
- package/claude/agents/frontend-developer.md +1234 -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 +963 -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 +352 -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 +746 -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 +440 -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 +500 -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/changelog.md +115 -0
- package/claude/commands/session/close.md +225 -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 +604 -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 +40 -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 +43 -0
- package/claude/config/workspace.schema.json +75 -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/media-library/SKILL.md +743 -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 +530 -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 +688 -0
- package/claude/skills/registry-system/SKILL.md +331 -0
- package/claude/skills/scheduled-actions/SKILL.md +671 -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 +507 -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 +35 -0
- package/scripts/postinstall.mjs +198 -0
- package/scripts/setup.mjs +282 -0
- package/scripts/sync.mjs +209 -0
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
# TWEAK Workflow v1.0
|
|
2
|
+
|
|
3
|
+
**T-Shirt Size:** XS - S
|
|
4
|
+
**Session:** `tweaks/` (optional)
|
|
5
|
+
**Subagents:** None
|
|
6
|
+
**Duration:** 5-20 minutes
|
|
7
|
+
**Token Estimate:** 10-40k
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
The TWEAK workflow is designed for small adjustments that don't require planning, documentation, or specialized agents. It's the most efficient path for minor fixes, config changes, and small improvements.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Initial Questions (3 Core)
|
|
18
|
+
|
|
19
|
+
Before starting, Claude asks **3 core questions** to gather essential context:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
23
|
+
│ TWEAK DISCOVERY (Claude asks directly) │
|
|
24
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
25
|
+
│ │
|
|
26
|
+
│ 1. TASK MANAGER │
|
|
27
|
+
│ Is there an existing task in a project management system? │
|
|
28
|
+
│ - No │
|
|
29
|
+
│ - Yes, ClickUp (request task_id) │
|
|
30
|
+
│ - Yes, Jira (request task_id) │
|
|
31
|
+
│ - Yes, Linear (request task_id) │
|
|
32
|
+
│ - Yes, Asana (request task_id) │
|
|
33
|
+
│ │
|
|
34
|
+
│ 2. TESTING │
|
|
35
|
+
│ Does this change need tests? │
|
|
36
|
+
│ - No tests needed (existing tests cover it) │
|
|
37
|
+
│ - Run existing tests only │
|
|
38
|
+
│ - Modify existing tests │
|
|
39
|
+
│ │
|
|
40
|
+
│ 3. DOCUMENTATION │
|
|
41
|
+
│ Does this need documentation updates? │
|
|
42
|
+
│ - No documentation needed │
|
|
43
|
+
│ - Update existing docs │
|
|
44
|
+
│ │
|
|
45
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Note:** If answers suggest more complexity (new tests, new docs, etc.), Claude should recommend escalating to TASK workflow.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## When to Use
|
|
53
|
+
|
|
54
|
+
### Criteria (ALL must apply)
|
|
55
|
+
|
|
56
|
+
| Criterion | Requirement |
|
|
57
|
+
|-----------|-------------|
|
|
58
|
+
| **Files affected** | 1-3 files maximum |
|
|
59
|
+
| **Business risk** | None or negligible |
|
|
60
|
+
| **Technical risk** | Low (isolated changes) |
|
|
61
|
+
| **Planning needed** | No |
|
|
62
|
+
| **New tests needed** | No (only run existing) |
|
|
63
|
+
| **Documentation** | Not required |
|
|
64
|
+
|
|
65
|
+
### Examples
|
|
66
|
+
|
|
67
|
+
| Task | T-Shirt | Why TWEAK |
|
|
68
|
+
|------|---------|-----------|
|
|
69
|
+
| Fix typo in translation | XS | 1 file, zero risk |
|
|
70
|
+
| Update version in package.json | XS | 1 file, routine change |
|
|
71
|
+
| Add optional field with default | S | 2-3 files, low risk |
|
|
72
|
+
| Fix simple validation bug | S | 1-2 files, existing tests cover it |
|
|
73
|
+
| Update config constant | XS | 1 file, no side effects |
|
|
74
|
+
| Correct CSS styling issue | S | 1-2 files, visual only |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## When NOT to Use
|
|
79
|
+
|
|
80
|
+
**Escalate to TASK if:**
|
|
81
|
+
- More than 3 files affected
|
|
82
|
+
- New tests need to be written
|
|
83
|
+
- Touches authentication, authorization, or payments
|
|
84
|
+
- Requires any database changes
|
|
85
|
+
- Needs documentation
|
|
86
|
+
- Business stakeholder should approve
|
|
87
|
+
|
|
88
|
+
**Escalate to STORY if:**
|
|
89
|
+
- New entity or major feature
|
|
90
|
+
- Architecture decisions needed
|
|
91
|
+
- High business risk
|
|
92
|
+
- Multiple layers (DB + API + UI)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Context Awareness
|
|
97
|
+
|
|
98
|
+
**CRITICAL:** Before modifying any files, read `.claude/config/context.json` to understand the environment.
|
|
99
|
+
|
|
100
|
+
### Scope Check (Phase 1: ANALYZE)
|
|
101
|
+
|
|
102
|
+
Before making changes, verify the file path is allowed:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
const context = await Read('.claude/config/context.json')
|
|
106
|
+
const filePath = 'core/utils/helper.ts'
|
|
107
|
+
|
|
108
|
+
// Check if path is allowed
|
|
109
|
+
if (context.context === 'consumer') {
|
|
110
|
+
if (filePath.startsWith('core/')) {
|
|
111
|
+
// STOP - Cannot modify core in consumer context
|
|
112
|
+
return `
|
|
113
|
+
❌ Cannot modify ${filePath} in consumer context.
|
|
114
|
+
|
|
115
|
+
This file is in core/, which is read-only in your project.
|
|
116
|
+
|
|
117
|
+
Alternatives:
|
|
118
|
+
1. Create theme-specific override in contents/themes/${activeTheme}/
|
|
119
|
+
2. Create utility in contents/plugins/
|
|
120
|
+
3. If core change is truly needed → Document as "Core Enhancement Request"
|
|
121
|
+
`
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Monorepo TWEAK
|
|
127
|
+
|
|
128
|
+
When context is `monorepo`:
|
|
129
|
+
- **CAN** modify any file in allowed paths
|
|
130
|
+
- **CAN** fix issues in `core/` files
|
|
131
|
+
- **CAN** update shared utilities
|
|
132
|
+
- Quick fixes across themes are allowed
|
|
133
|
+
|
|
134
|
+
### Consumer TWEAK
|
|
135
|
+
|
|
136
|
+
When context is `consumer`:
|
|
137
|
+
- **LIMITED** to active theme and plugins only
|
|
138
|
+
- Core files are **READ-ONLY** (in node_modules)
|
|
139
|
+
- If fix requires core change → Suggest workaround
|
|
140
|
+
- Document core issues for upstream maintainers
|
|
141
|
+
|
|
142
|
+
### Path Validation Quick Check
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
const context = await Read('.claude/config/context.json')
|
|
146
|
+
|
|
147
|
+
// TWEAK can only modify paths in allowedPaths
|
|
148
|
+
const isAllowed = context.allowedPaths.some(pattern =>
|
|
149
|
+
matchGlob(filePath, pattern)
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
if (!isAllowed) {
|
|
153
|
+
// Escalate or suggest alternative
|
|
154
|
+
return suggestAlternative(filePath, context)
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Flow
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
164
|
+
│ TWEAK WORKFLOW v1.0 │
|
|
165
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
166
|
+
│ │
|
|
167
|
+
│ Phase 0: DISCOVERY (< 1 minute) │
|
|
168
|
+
│ ─────────────────────────────── │
|
|
169
|
+
│ [MANDATORY] Claude asks 3 core questions │
|
|
170
|
+
│ ├── Task Manager? (link external task) │
|
|
171
|
+
│ ├── Testing? (none / run existing / modify) │
|
|
172
|
+
│ └── Documentation? (none / update existing) │
|
|
173
|
+
│ ↓ │
|
|
174
|
+
│ Phase 1: ANALYZE (< 1 minute) │
|
|
175
|
+
│ ───────────────────────────── │
|
|
176
|
+
│ [MANDATORY] Understand the task │
|
|
177
|
+
│ ├── What needs to change? │
|
|
178
|
+
│ ├── Which files are affected? │
|
|
179
|
+
│ ├── Are there existing tests that cover this? │
|
|
180
|
+
│ └── Confirm T-Shirt size is XS or S │
|
|
181
|
+
│ ↓ │
|
|
182
|
+
│ Phase 2: IMPLEMENT │
|
|
183
|
+
│ ───────────────────── │
|
|
184
|
+
│ [MANDATORY] Make the change │
|
|
185
|
+
│ ├── Read affected files │
|
|
186
|
+
│ ├── Apply minimal, focused changes │
|
|
187
|
+
│ └── Follow existing code patterns │
|
|
188
|
+
│ ↓ │
|
|
189
|
+
│ Phase 3: VALIDATE │
|
|
190
|
+
│ ──────────────────── │
|
|
191
|
+
│ [MANDATORY] Verify the change works │
|
|
192
|
+
│ ├── TypeScript compiles (tsc --noEmit) │
|
|
193
|
+
│ ├── Build passes (pnpm build) │
|
|
194
|
+
│ ├── Existing tests pass (affected only) │
|
|
195
|
+
│ └── Visual verification (if UI change) │
|
|
196
|
+
│ ↓ │
|
|
197
|
+
│ Phase 4: LOG (Optional) │
|
|
198
|
+
│ ──────────────────────── │
|
|
199
|
+
│ [OPTIONAL] Create session log │
|
|
200
|
+
│ └── Only if tracking is needed │
|
|
201
|
+
│ ↓ │
|
|
202
|
+
│ DONE: Ready for commit │
|
|
203
|
+
│ │
|
|
204
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Detailed Phase Descriptions
|
|
210
|
+
|
|
211
|
+
### Phase 1: ANALYZE
|
|
212
|
+
|
|
213
|
+
**Duration:** < 1 minute
|
|
214
|
+
**Goal:** Confirm this is truly a TWEAK task
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
[MANDATORY] Quick Analysis Steps:
|
|
218
|
+
|
|
219
|
+
1. Parse the task description
|
|
220
|
+
- What is the user asking for?
|
|
221
|
+
- Is it a fix, update, or minor addition?
|
|
222
|
+
|
|
223
|
+
2. Identify affected files
|
|
224
|
+
- Use Grep/Glob to find relevant code
|
|
225
|
+
- If > 3 files → Escalate to TASK
|
|
226
|
+
|
|
227
|
+
3. Check existing coverage
|
|
228
|
+
- Are there tests for this code path?
|
|
229
|
+
- If no tests and tests needed → Escalate to TASK
|
|
230
|
+
|
|
231
|
+
4. Assess risk
|
|
232
|
+
- Does this touch critical flows? → Escalate
|
|
233
|
+
- Could this break other features? → Escalate
|
|
234
|
+
- Is this isolated and safe? → Continue
|
|
235
|
+
|
|
236
|
+
5. Confirm T-Shirt size
|
|
237
|
+
- XS: 1 file, trivial change
|
|
238
|
+
- S: 2-3 files, simple change
|
|
239
|
+
- Anything else → Escalate
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
**Red Flags (escalate immediately):**
|
|
243
|
+
- File path contains `auth`, `payment`, `checkout`, `billing`
|
|
244
|
+
- Change requires modifying database schema
|
|
245
|
+
- User mentions "new feature" or "new entity"
|
|
246
|
+
- Multiple teams/areas affected
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### Phase 2: IMPLEMENT
|
|
251
|
+
|
|
252
|
+
**Duration:** 2-10 minutes
|
|
253
|
+
**Goal:** Make the change with minimal footprint
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
[MANDATORY] Implementation Rules:
|
|
257
|
+
|
|
258
|
+
1. Read before writing
|
|
259
|
+
- Always read the file first
|
|
260
|
+
- Understand the existing pattern
|
|
261
|
+
|
|
262
|
+
2. Minimal changes
|
|
263
|
+
- Only change what's necessary
|
|
264
|
+
- Don't refactor "while you're there"
|
|
265
|
+
- Don't add comments to unchanged code
|
|
266
|
+
|
|
267
|
+
3. Follow patterns
|
|
268
|
+
- Match existing code style
|
|
269
|
+
- Use same patterns as surrounding code
|
|
270
|
+
- Don't introduce new dependencies
|
|
271
|
+
|
|
272
|
+
4. No scope creep
|
|
273
|
+
- Stick to the original request
|
|
274
|
+
- If you find other issues, note them but don't fix
|
|
275
|
+
- One change at a time
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**What NOT to do:**
|
|
279
|
+
- Add new npm packages
|
|
280
|
+
- Create new files (unless absolutely necessary)
|
|
281
|
+
- Change unrelated code
|
|
282
|
+
- Add "improvements" not requested
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
### Phase 3: VALIDATE
|
|
287
|
+
|
|
288
|
+
**Duration:** 1-5 minutes
|
|
289
|
+
**Goal:** Ensure the change doesn't break anything
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
[MANDATORY] Validation Checklist:
|
|
293
|
+
|
|
294
|
+
□ TypeScript compiles
|
|
295
|
+
Command: pnpm tsc --noEmit
|
|
296
|
+
If errors: Fix before proceeding
|
|
297
|
+
|
|
298
|
+
□ Build passes
|
|
299
|
+
Command: pnpm build
|
|
300
|
+
If errors: Fix before proceeding
|
|
301
|
+
|
|
302
|
+
□ Lint passes (for changed files)
|
|
303
|
+
Command: pnpm lint --fix
|
|
304
|
+
If warnings: Review and fix if significant
|
|
305
|
+
|
|
306
|
+
□ Tests pass (if applicable)
|
|
307
|
+
Command: pnpm test -- --testPathPattern="<pattern>"
|
|
308
|
+
Only run tests related to changed files
|
|
309
|
+
|
|
310
|
+
□ Visual verification (for UI changes)
|
|
311
|
+
- Open in browser
|
|
312
|
+
- Check the change works as expected
|
|
313
|
+
- Check no visual regressions
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**If validation fails:**
|
|
317
|
+
1. Fix the issue
|
|
318
|
+
2. Re-validate
|
|
319
|
+
3. If multiple fixes needed → Consider escalating to TASK
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
### Phase 4: LOG (Optional)
|
|
324
|
+
|
|
325
|
+
**When to create a log:**
|
|
326
|
+
- User explicitly requests documentation
|
|
327
|
+
- Change might need to be referenced later
|
|
328
|
+
- Part of a series of related quick fixes
|
|
329
|
+
|
|
330
|
+
**Log location:**
|
|
331
|
+
```
|
|
332
|
+
.claude/sessions/tweaks/YYYY-MM-DD-short-name.md
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**Log format:**
|
|
336
|
+
```markdown
|
|
337
|
+
# Quick Fix: [Short Name]
|
|
338
|
+
|
|
339
|
+
**Date:** YYYY-MM-DD HH:MM
|
|
340
|
+
**Type:** quick-fix
|
|
341
|
+
**T-Shirt:** XS/S
|
|
342
|
+
|
|
343
|
+
## Summary
|
|
344
|
+
[One sentence describing what was done]
|
|
345
|
+
|
|
346
|
+
## Files Changed
|
|
347
|
+
- `path/to/file.ts` - [What changed]
|
|
348
|
+
|
|
349
|
+
## Verification
|
|
350
|
+
- [x] TypeScript compiles
|
|
351
|
+
- [x] Build passes
|
|
352
|
+
- [x] Tests pass
|
|
353
|
+
- [x] Visual check (if applicable)
|
|
354
|
+
|
|
355
|
+
## Notes
|
|
356
|
+
[Any important context for future reference]
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## Commands
|
|
362
|
+
|
|
363
|
+
### Start TWEAK workflow
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Explicit TWEAK
|
|
367
|
+
/session:start:tweak Fix typo in login button
|
|
368
|
+
|
|
369
|
+
# Automatic detection (Claude evaluates)
|
|
370
|
+
/start Fix typo in login button
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Related commands
|
|
374
|
+
|
|
375
|
+
| Command | When to use |
|
|
376
|
+
|---------|-------------|
|
|
377
|
+
| `/session:fix:bug` | Quick bug fixes (auto-evaluates workflow) |
|
|
378
|
+
| `/session:fix:build` | Fix build errors |
|
|
379
|
+
| `/session:commit` | Prepare commit after changes |
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Characteristics Summary
|
|
384
|
+
|
|
385
|
+
| Aspect | TWEAK Workflow |
|
|
386
|
+
|--------|----------------|
|
|
387
|
+
| **Session files** | None (or optional log) |
|
|
388
|
+
| **Subagents** | Not used |
|
|
389
|
+
| **Planning** | Not needed |
|
|
390
|
+
| **Requirements doc** | Not created |
|
|
391
|
+
| **Tests** | Run existing only |
|
|
392
|
+
| **Code review** | Not formal (self-check) |
|
|
393
|
+
| **Documentation** | Not required |
|
|
394
|
+
| **Typical duration** | 5-20 minutes |
|
|
395
|
+
| **Token estimate** | 10-40k |
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
## Decision Matrix: TWEAK vs TASK
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
Files Affected
|
|
403
|
+
1-3 4-10 11+
|
|
404
|
+
┌───────────┬───────────┬───────────┐
|
|
405
|
+
None/Low │ TWEAK │ TASK │ STORY │
|
|
406
|
+
├───────────┼───────────┼───────────┤
|
|
407
|
+
Risk Medium │ TASK │ TASK │ STORY │
|
|
408
|
+
├───────────┼───────────┼───────────┤
|
|
409
|
+
High │ TASK │ STORY │ STORY │
|
|
410
|
+
└───────────┴───────────┴───────────┘
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Examples
|
|
416
|
+
|
|
417
|
+
### Example 1: Fix Translation Typo (XS)
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
User: Fix typo "Submti" → "Submit" in Spanish translation
|
|
421
|
+
|
|
422
|
+
Claude's process:
|
|
423
|
+
1. ANALYZE
|
|
424
|
+
- Task: Fix typo
|
|
425
|
+
- Files: 1 (es.json)
|
|
426
|
+
- Risk: None
|
|
427
|
+
- T-Shirt: XS → TWEAK
|
|
428
|
+
|
|
429
|
+
2. IMPLEMENT
|
|
430
|
+
- Read contents/themes/default/messages/es.json
|
|
431
|
+
- Change "Submti" to "Enviar" (correct Spanish)
|
|
432
|
+
- Save file
|
|
433
|
+
|
|
434
|
+
3. VALIDATE
|
|
435
|
+
- pnpm build ✓
|
|
436
|
+
- No tests for translations (OK)
|
|
437
|
+
|
|
438
|
+
4. LOG: Not needed
|
|
439
|
+
|
|
440
|
+
Result: Ready for commit in ~3 minutes
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### Example 2: Add Default Value to Field (S)
|
|
444
|
+
|
|
445
|
+
```
|
|
446
|
+
User: Add default value "active" to status field in user config
|
|
447
|
+
|
|
448
|
+
Claude's process:
|
|
449
|
+
1. ANALYZE
|
|
450
|
+
- Task: Add default value
|
|
451
|
+
- Files: 2 (config + types)
|
|
452
|
+
- Risk: Low (default value is safe)
|
|
453
|
+
- T-Shirt: S → TWEAK
|
|
454
|
+
|
|
455
|
+
2. IMPLEMENT
|
|
456
|
+
- Read user.config.ts
|
|
457
|
+
- Add default: "active" to status field
|
|
458
|
+
- Update types if needed
|
|
459
|
+
|
|
460
|
+
3. VALIDATE
|
|
461
|
+
- pnpm tsc --noEmit ✓
|
|
462
|
+
- pnpm build ✓
|
|
463
|
+
- Run user tests ✓
|
|
464
|
+
|
|
465
|
+
4. LOG: Not needed
|
|
466
|
+
|
|
467
|
+
Result: Ready for commit in ~5 minutes
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
### Example 3: Escalation to TASK
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
User: Fix the search not returning correct results
|
|
474
|
+
|
|
475
|
+
Claude's process:
|
|
476
|
+
1. ANALYZE
|
|
477
|
+
- Task: Fix search functionality
|
|
478
|
+
- Files: Need to investigate...
|
|
479
|
+
- Found: 6 files in search module
|
|
480
|
+
- Risk: Medium (affects user experience)
|
|
481
|
+
|
|
482
|
+
⚠️ ESCALATION TRIGGERED
|
|
483
|
+
- More than 3 files
|
|
484
|
+
- Medium risk
|
|
485
|
+
|
|
486
|
+
Claude: "This appears to affect 6 files and has medium risk.
|
|
487
|
+
I recommend using TASK workflow. Proceed with TASK?"
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
## Anti-Patterns
|
|
493
|
+
|
|
494
|
+
### What TWEAK is NOT for
|
|
495
|
+
|
|
496
|
+
| Anti-Pattern | Why It's Wrong |
|
|
497
|
+
|--------------|----------------|
|
|
498
|
+
| "Quick" new feature | Features need planning |
|
|
499
|
+
| "Just add this field to DB" | DB changes need migrations |
|
|
500
|
+
| "Small auth fix" | Auth is never small risk |
|
|
501
|
+
| "Quick refactor" | Refactors need tests |
|
|
502
|
+
| "Add error handling" | Could affect multiple flows |
|
|
503
|
+
|
|
504
|
+
### Signs You're Using TWEAK Wrong
|
|
505
|
+
|
|
506
|
+
1. **You're reading more than 5 files** → Too complex
|
|
507
|
+
2. **You want to "improve" other code** → Scope creep
|
|
508
|
+
3. **You need to add a new dependency** → Not quick
|
|
509
|
+
4. **You're creating new files** → Probably needs TASK
|
|
510
|
+
5. **You're uncertain about the impact** → Needs analysis
|
|
511
|
+
|
|
512
|
+
---
|
|
513
|
+
|
|
514
|
+
## Related Documentation
|
|
515
|
+
|
|
516
|
+
- `workflows/task.md` - For medium complexity
|
|
517
|
+
- `workflows/story.md` - For major features
|
|
518
|
+
- `commands/session-start.md` - Start command details
|
|
519
|
+
- `commands/session-fix-bug.md` - Bug fix workflow
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
## Version History
|
|
524
|
+
|
|
525
|
+
| Version | Changes |
|
|
526
|
+
|---------|---------|
|
|
527
|
+
| v1.0 | Initial English version with comprehensive detail |
|
package/cursor/.gitkeep
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nextsparkjs/ai-workflow",
|
|
3
|
+
"version": "0.1.0-beta.100",
|
|
4
|
+
"description": "AI workflow templates for NextSpark - Claude Code agents, commands, skills, and multi-editor support",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "NextSpark <hello@nextspark.dev>",
|
|
7
|
+
"homepage": "https://nextspark.dev",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/NextSpark-js/nextspark.git",
|
|
11
|
+
"directory": "packages/ai-workflow"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"nextjs",
|
|
15
|
+
"ai",
|
|
16
|
+
"workflow",
|
|
17
|
+
"claude",
|
|
18
|
+
"cursor",
|
|
19
|
+
"agents",
|
|
20
|
+
"developer-tools"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "./scripts/setup.mjs",
|
|
24
|
+
"files": [
|
|
25
|
+
"claude",
|
|
26
|
+
"cursor",
|
|
27
|
+
"scripts",
|
|
28
|
+
"README.md"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"setup": "node scripts/setup.mjs",
|
|
32
|
+
"sync": "node scripts/sync.mjs",
|
|
33
|
+
"postinstall": "node scripts/postinstall.mjs || true"
|
|
34
|
+
}
|
|
35
|
+
}
|