claude-orchestration 1.0.5 → 1.0.6
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/package.json +1 -1
- package/templates/claude/orchestration.md +11 -60
- package/templates/claude/workflows/react/bugfix.md +20 -38
- package/templates/claude/workflows/react/feature.md +23 -41
- package/templates/claude/workflows/react/pr.md +8 -13
- package/templates/claude/workflows/react/refactor.md +18 -29
- package/templates/claude/workflows/react/review.md +32 -40
package/package.json
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
# Orchestration Protocol
|
|
2
2
|
|
|
3
|
-
**MANDATORY: Process
|
|
4
|
-
|
|
5
|
-
---
|
|
3
|
+
**MANDATORY: Process BEFORE any tool usage.**
|
|
6
4
|
|
|
7
5
|
## 1. CLASSIFY TASK
|
|
8
6
|
|
|
9
|
-
### ⛔ STOP CHECKPOINT #1
|
|
10
|
-
|
|
11
7
|
| Signal Words | Workflow |
|
|
12
8
|
|--------------|----------|
|
|
13
9
|
| build, create, add, implement, new | `feature.md` |
|
|
@@ -19,83 +15,38 @@
|
|
|
19
15
|
| document, README, explain | `docs.md` |
|
|
20
16
|
| complex, multi-step, plan | `todo.md` |
|
|
21
17
|
|
|
22
|
-
**Complexity:** 1-2 ops
|
|
23
|
-
|
|
24
|
-
**Technology:** React (`.jsx`/`.tsx`, react imports, hooks) → `workflows/react/` | Other → `workflows/`
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## 2. DECLARE BINDING
|
|
18
|
+
**Complexity:** 1-2 ops = simple | 3+ ops = complex (add `todo.md`)
|
|
19
|
+
**Technology:** React (`.jsx`/`.tsx`, hooks) → `workflows/react/` | Other → `workflows/`
|
|
29
20
|
|
|
30
|
-
###
|
|
21
|
+
### Selection
|
|
22
|
+
- **Clear match:** Proceed to binding
|
|
23
|
+
- **Ambiguous:** Use `AskUserQuestion` (header: "Workflow", options: relevant workflows)
|
|
24
|
+
- **No match:** Ask user to clarify
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
## 2. BINDING (required before ANY tool use)
|
|
33
27
|
|
|
34
28
|
```
|
|
35
29
|
ORCHESTRATION_BINDING:
|
|
36
30
|
- Task: [description]
|
|
37
|
-
- Classification: [workflow]
|
|
38
31
|
- Workflow: [path]
|
|
39
|
-
- Complexity: [
|
|
40
|
-
- Technology: [React / Other / N/A]
|
|
32
|
+
- Complexity: [simple/complex]
|
|
41
33
|
```
|
|
42
34
|
|
|
43
|
-
---
|
|
44
|
-
|
|
45
35
|
## 3. EXEMPT TASKS
|
|
46
36
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
**NOT exempt:** "quick bug fix" (needs investigation), "small feature" (needs context), "make it faster" (needs measurement).
|
|
37
|
+
Requires ALL: single file, 1-2 ops, zero architecture impact, obvious correctness.
|
|
50
38
|
|
|
51
|
-
Exempt binding:
|
|
52
39
|
```
|
|
53
40
|
ORCHESTRATION_BINDING:
|
|
54
41
|
- Task: [description]
|
|
55
42
|
- Classification: EXEMPT
|
|
56
|
-
- Justification: [criteria met]
|
|
57
43
|
```
|
|
58
44
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## 4. VIOLATIONS
|
|
62
|
-
|
|
63
|
-
| Type | Indicator |
|
|
64
|
-
|------|-----------|
|
|
65
|
-
| Missing Binding | Tool use without declaration |
|
|
66
|
-
| Premature Tool Use | Edit before workflow read |
|
|
67
|
-
| Scope Creep | Unplanned files modified |
|
|
68
|
-
| False Exemption | Exempt claim for complex task |
|
|
45
|
+
## 4. COMPLETION
|
|
69
46
|
|
|
70
|
-
**Self-correct:** STOP → DECLARE violation → RETURN to checkpoint → REBIND → CONTINUE
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 5. EXECUTION
|
|
75
|
-
|
|
76
|
-
**Pre-Work:** Binding declared, workflow read, "Before Coding" answered
|
|
77
|
-
|
|
78
|
-
**Mid-Work:** Within scope, no unplanned files, todo tracking if 3+ ops
|
|
79
|
-
|
|
80
|
-
**Completion:** Validation done, then declare:
|
|
81
47
|
```
|
|
82
48
|
ORCHESTRATION_COMPLETE:
|
|
83
49
|
- Task: [description]
|
|
84
50
|
- Workflow: [used]
|
|
85
51
|
- Files: [modified]
|
|
86
52
|
```
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## 6. WORKFLOW REFERENCE
|
|
91
|
-
|
|
92
|
-
| Workflow | React | Other |
|
|
93
|
-
|----------|-------|-------|
|
|
94
|
-
| feature | `workflows/react/feature.md` | `workflows/feature.md` |
|
|
95
|
-
| bugfix | `workflows/react/bugfix.md` | `workflows/bugfix.md` |
|
|
96
|
-
| refactor | `workflows/react/refactor.md` | `workflows/refactor.md` |
|
|
97
|
-
| performance | `workflows/react/performance.md` | `workflows/performance.md` |
|
|
98
|
-
| review | `workflows/react/review.md` | `workflows/review.md` |
|
|
99
|
-
| pr | `workflows/react/pr.md` | `workflows/pr.md` |
|
|
100
|
-
| docs | `workflows/react/docs.md` | `workflows/docs.md` |
|
|
101
|
-
| todo | `workflows/react/todo.md` | `workflows/todo.md` |
|
|
@@ -1,50 +1,32 @@
|
|
|
1
1
|
# React Bugfix Workflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1. Reproduce
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Confirm bug exists | find minimal repro
|
|
6
|
+
- Check Strict Mode behavior
|
|
7
|
+
- Answer: Expected vs actual? React 18 concurrent issue?
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- Can I reproduce the bug?
|
|
9
|
-
- What is expected vs actual behavior?
|
|
10
|
-
- Is this related to React 18 concurrent features?
|
|
9
|
+
## 2. Locate Root Cause
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
| Common React 18 Issues |
|
|
12
|
+
|------------------------|
|
|
13
|
+
| Effects missing cleanup |
|
|
14
|
+
| Stale closures in effects |
|
|
15
|
+
| Concurrent rendering race conditions |
|
|
16
|
+
| Automatic batching changes |
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
- Confirm the bug exists
|
|
16
|
-
- Check if it only occurs in Strict Mode
|
|
17
|
-
- Find minimal reproduction case
|
|
18
|
+
## 3. Fix
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
- Keep changes within affected feature folder
|
|
21
|
+
- Add cleanup: `return () => controller.abort()`
|
|
22
|
+
- Fix stale closures with proper deps
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
- Effects missing cleanup functions
|
|
23
|
-
- Effects with stale closures
|
|
24
|
-
- Race conditions from concurrent rendering
|
|
25
|
-
- Automatic batching behavior changes
|
|
24
|
+
## 4. Verify
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
MUST keep changes within affected feature folder.
|
|
30
|
-
|
|
31
|
-
```tsx
|
|
32
|
-
// Example: Add cleanup for effects
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
const controller = new AbortController()
|
|
35
|
-
fetchData(controller.signal)
|
|
36
|
-
return () => controller.abort()
|
|
37
|
-
}, [])
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### 4. Verify
|
|
41
|
-
- Confirm bug is fixed
|
|
42
|
-
- Test with Strict Mode enabled
|
|
43
|
-
- Add test that would have caught this bug
|
|
26
|
+
- Confirm fix | test with Strict Mode
|
|
27
|
+
- Add regression test
|
|
44
28
|
|
|
45
29
|
## Constraints
|
|
46
30
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- NEVER introduce barrel exports
|
|
50
|
-
- Note other issues separately—don't fix them here
|
|
31
|
+
- Smallest fix only | NO refactoring
|
|
32
|
+
- NO barrel exports | note other issues separately
|
|
@@ -1,55 +1,37 @@
|
|
|
1
1
|
# React Feature Workflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1. Architecture
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**IF not specified:** Use `AskUserQuestion` (header: "Architecture")
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
| Architecture | Structure |
|
|
8
|
+
|--------------|-----------|
|
|
9
|
+
| Feature-driven | `features/{name}/components\|hooks\|utils/` |
|
|
10
|
+
| Flat feature-driven | `features/{name}/` flat files |
|
|
11
|
+
| Atomic design | `atoms\|molecules\|organisms\|templates/` |
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**IF project has patterns:** Follow existing, skip question.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- Read related existing code
|
|
17
|
-
- Identify the target feature folder
|
|
18
|
-
- Check for similar implementations
|
|
19
|
-
- Review reusable hooks and utilities
|
|
15
|
+
## 2. Context
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- Identify shared vs feature-specific code
|
|
25
|
-
- Design state approach (local, context, or external)
|
|
17
|
+
- Read related code, identify target folder
|
|
18
|
+
- Check similar implementations, reusable hooks/utils
|
|
19
|
+
- Answer: What problem? Minimal version? Which folder?
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
## 3. Implement
|
|
28
22
|
|
|
29
|
-
**Components:**
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
**Components:** Function only | `useState`/`useReducer` for local state
|
|
24
|
+
**Hooks:** Extract logic | `hooks/{feature}/{name}.ts` | descriptive names
|
|
25
|
+
**State:** Lift only as needed | composition over prop drilling
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
- Extract reusable logic into custom hooks
|
|
35
|
-
- Components handle rendering; hooks handle logic
|
|
36
|
-
- Name descriptively: `useAuthState`, `useFormValidation`
|
|
37
|
-
- Place in `hooks/{feature}/{hookName}.ts`
|
|
27
|
+
## 4. Validate
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
### 4. Validate
|
|
45
|
-
- Run existing tests for regressions
|
|
46
|
-
- Add tests for new components/hooks
|
|
47
|
-
- Test loading and error states
|
|
48
|
-
- Remove debugging code and unused imports
|
|
29
|
+
- Run tests for regressions
|
|
30
|
+
- Add tests for new code
|
|
31
|
+
- Test loading/error states
|
|
32
|
+
- Remove debug code
|
|
49
33
|
|
|
50
34
|
## Constraints
|
|
51
35
|
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
- MUST match surrounding code style
|
|
55
|
-
- NEVER add features beyond what was requested
|
|
36
|
+
- NO `index.ts`/`index.tsx` | import from file directly
|
|
37
|
+
- Match existing style | no extra features
|
|
@@ -2,23 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Process
|
|
4
4
|
|
|
5
|
-
1. Read
|
|
6
|
-
2. Analyze changes
|
|
7
|
-
3. Output
|
|
5
|
+
1. Read diff (current branch vs main/master)
|
|
6
|
+
2. Analyze changes
|
|
7
|
+
3. Output title + description
|
|
8
8
|
|
|
9
|
-
## Output
|
|
9
|
+
## Output
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
PR Title: <
|
|
13
|
-
|
|
14
|
-
Description:
|
|
15
|
-
<2-3 sentences: what changed and why>
|
|
12
|
+
PR Title: <imperative mood>
|
|
13
|
+
Description: <2-3 sentences: what + why>
|
|
16
14
|
```
|
|
17
15
|
|
|
18
16
|
## Constraints
|
|
19
17
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- Keep description focused on "what" and "why"
|
|
23
|
-
- NEVER create branches, push, or create PRs remotely
|
|
24
|
-
- ONLY output the title and description for the user to copy
|
|
18
|
+
- Imperative mood ("Add" not "Added") | mention breaking changes
|
|
19
|
+
- Output only | NO branch/push/remote PR creation
|
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
# React Refactor Workflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1. Safety Net
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Run tests | add if coverage insufficient
|
|
6
|
+
- Answer: What improvement? How verify unchanged behavior?
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
- What specific improvement am I making?
|
|
9
|
-
- Is there adequate test coverage?
|
|
10
|
-
- How will I verify behavior is unchanged?
|
|
8
|
+
## 2. Plan
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### 1. Ensure Safety Net
|
|
15
|
-
- Run tests to confirm they pass
|
|
16
|
-
- Add tests if coverage is insufficient
|
|
17
|
-
|
|
18
|
-
### 2. Plan
|
|
19
|
-
- Map all imports and dependencies
|
|
20
|
-
- Identify all callers of affected code
|
|
10
|
+
- Map imports/dependencies | identify all callers
|
|
21
11
|
- Break into small, safe steps
|
|
22
12
|
|
|
23
|
-
|
|
13
|
+
## 3. Execute
|
|
24
14
|
|
|
25
|
-
|
|
15
|
+
One change type at a time | run tests after each:
|
|
26
16
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
| Change Types |
|
|
18
|
+
|--------------|
|
|
19
|
+
| Rename files to match folders |
|
|
20
|
+
| Barrel → direct imports |
|
|
21
|
+
| Extract logic into hooks |
|
|
22
|
+
| Split large components |
|
|
31
23
|
|
|
32
|
-
|
|
24
|
+
## 4. Validate
|
|
33
25
|
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
- No `index.ts` or `index.tsx` files remain
|
|
37
|
-
- All entry points match folder names
|
|
26
|
+
- All tests pass | no `index.ts`/`index.tsx`
|
|
27
|
+
- Entry points match folder names
|
|
38
28
|
|
|
39
29
|
## Constraints
|
|
40
30
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
- MUST keep scope contained: one change type at a time
|
|
31
|
+
- Structure only, NOT behavior | NO bug fixes
|
|
32
|
+
- One change type at a time | note issues separately
|
|
@@ -1,54 +1,46 @@
|
|
|
1
1
|
# React Code Review Workflow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1. Understand
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Read PR description | review diff scope
|
|
6
|
+
- Answer: What is the goal? What files changed?
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
- What is this change trying to accomplish?
|
|
9
|
-
- What files are modified?
|
|
8
|
+
## 2. Architecture Checklist
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
| Check | Rule |
|
|
11
|
+
|-------|------|
|
|
12
|
+
| Barrels | No `index.ts`/`index.tsx` |
|
|
13
|
+
| Entry files | Match folder names (`Button/Button.tsx`) |
|
|
14
|
+
| Imports | Direct, not barrel |
|
|
15
|
+
| Colocation | Component + hooks + types + tests together |
|
|
16
|
+
| Placement | Correct feature folder |
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
- Read the PR description
|
|
15
|
-
- Review the diff to understand scope
|
|
16
|
-
- Check if the approach makes sense for the goal
|
|
18
|
+
## 3. React Patterns Checklist
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
| Check | Rule |
|
|
21
|
+
|-------|------|
|
|
22
|
+
| Components | Function only, no class |
|
|
23
|
+
| Hooks | No conditionals, proper deps |
|
|
24
|
+
| Effects | Cleanup where needed |
|
|
25
|
+
| Memory | No leaks (subscriptions, timers) |
|
|
26
|
+
| States | Loading + error handled |
|
|
19
27
|
|
|
20
|
-
|
|
21
|
-
- [ ] Entry files match folder names (`Button/Button.tsx`)
|
|
22
|
-
- [ ] Direct imports used, not barrel imports
|
|
23
|
-
- [ ] Files colocated properly (component, hooks, types, tests together)
|
|
24
|
-
- [ ] New code placed in correct feature folder
|
|
28
|
+
## 4. Code Quality Checklist
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
| Check | Rule |
|
|
31
|
+
|-------|------|
|
|
32
|
+
| Debug | No console.log/debugger |
|
|
33
|
+
| Imports | No unused |
|
|
34
|
+
| Types | No unjustified `any` |
|
|
35
|
+
| Tests | Cover new functionality |
|
|
36
|
+
| Scope | No unrelated changes |
|
|
27
37
|
|
|
28
|
-
|
|
29
|
-
- [ ] Hooks follow rules (no conditional hooks, proper dependencies)
|
|
30
|
-
- [ ] Effects have cleanup where needed
|
|
31
|
-
- [ ] No obvious memory leaks (subscriptions, timers)
|
|
32
|
-
- [ ] Loading and error states handled
|
|
38
|
+
## 5. Feedback
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- [ ] No debugging code left in (console.log, debugger)
|
|
37
|
-
- [ ] No unused imports or variables
|
|
38
|
-
- [ ] Types are accurate (no `any` without justification)
|
|
39
|
-
- [ ] Tests cover new functionality
|
|
40
|
-
- [ ] No unrelated changes mixed in
|
|
41
|
-
|
|
42
|
-
### 5. Provide Feedback
|
|
43
|
-
|
|
44
|
-
Categorize comments:
|
|
45
|
-
- **Blocking**: Must fix before merge (bugs, architecture violations)
|
|
46
|
-
- **Suggestion**: Improvements to consider
|
|
47
|
-
- **Question**: Clarification needed
|
|
40
|
+
- **Blocking:** Must fix (bugs, architecture violations)
|
|
41
|
+
- **Suggestion:** Improvements | **Question:** Clarification
|
|
48
42
|
|
|
49
43
|
## Constraints
|
|
50
44
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
- Keep feedback specific and actionable
|
|
54
|
-
- Suggest fixes, not just problems
|
|
45
|
+
- NO approval with violations | must understand code
|
|
46
|
+
- Specific + actionable | suggest fixes, not just problems
|