cursor-kit-cli 1.2.0-beta → 1.2.0-beta.3

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.
Files changed (92) hide show
  1. package/bin/cursor-reinstall-instance.sh +102 -0
  2. package/dist/cli.cjs +366 -69
  3. package/dist/cli.cjs.map +1 -1
  4. package/dist/cli.js +367 -70
  5. package/dist/cli.js.map +1 -1
  6. package/dist/index.cjs +39 -1
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +9 -1
  9. package/dist/index.d.ts +9 -1
  10. package/dist/index.js +33 -2
  11. package/dist/index.js.map +1 -1
  12. package/package.json +1 -1
  13. package/templates/commands/docs.md +5 -3
  14. package/templates/commands/explain.md +5 -3
  15. package/templates/commands/fix.md +5 -3
  16. package/templates/commands/implement.md +5 -3
  17. package/templates/commands/refactor.md +5 -3
  18. package/templates/commands/review.md +5 -3
  19. package/templates/commands/test.md +5 -3
  20. package/templates/manifest.json +11 -8
  21. package/templates/rules/git.mdc +0 -2
  22. package/templates/rules/toc.mdc +17 -9
  23. package/templates/skills/aesthetic/SKILL.md +121 -0
  24. package/templates/skills/aesthetic/assets/design-guideline-template.md +163 -0
  25. package/templates/skills/aesthetic/assets/design-story-template.md +135 -0
  26. package/templates/skills/aesthetic/references/design-principles.md +62 -0
  27. package/templates/skills/aesthetic/references/design-resources.md +75 -0
  28. package/templates/skills/aesthetic/references/micro-interactions.md +53 -0
  29. package/templates/skills/aesthetic/references/storytelling-design.md +50 -0
  30. package/templates/skills/backend-development/SKILL.mdc +95 -0
  31. package/templates/skills/backend-development/references/backend-api-design.md +495 -0
  32. package/templates/skills/backend-development/references/backend-architecture.md +454 -0
  33. package/templates/skills/backend-development/references/backend-authentication.md +338 -0
  34. package/templates/skills/backend-development/references/backend-code-quality.md +659 -0
  35. package/templates/skills/backend-development/references/backend-debugging.md +904 -0
  36. package/templates/skills/backend-development/references/backend-devops.md +494 -0
  37. package/templates/skills/backend-development/references/backend-mindset.md +387 -0
  38. package/templates/skills/backend-development/references/backend-performance.md +397 -0
  39. package/templates/skills/backend-development/references/backend-security.md +290 -0
  40. package/templates/skills/backend-development/references/backend-technologies.md +256 -0
  41. package/templates/skills/backend-development/references/backend-testing.md +429 -0
  42. package/templates/skills/frontend-design/SKILL.mdc +41 -0
  43. package/templates/skills/frontend-design/references/animejs.md +396 -0
  44. package/templates/skills/frontend-development/SKILL.mdc +399 -0
  45. package/templates/skills/frontend-development/resources/common-patterns.md +331 -0
  46. package/templates/skills/frontend-development/resources/complete-examples.md +872 -0
  47. package/templates/skills/frontend-development/resources/component-patterns.md +502 -0
  48. package/templates/skills/frontend-development/resources/data-fetching.md +767 -0
  49. package/templates/skills/frontend-development/resources/file-organization.md +502 -0
  50. package/templates/skills/frontend-development/resources/loading-and-error-states.md +501 -0
  51. package/templates/skills/frontend-development/resources/performance.md +406 -0
  52. package/templates/skills/frontend-development/resources/routing-guide.md +364 -0
  53. package/templates/skills/frontend-development/resources/styling-guide.md +428 -0
  54. package/templates/skills/frontend-development/resources/typescript-standards.md +418 -0
  55. package/templates/skills/problem-solving/SKILL.mdc +96 -0
  56. package/templates/skills/problem-solving/references/attribution.md +69 -0
  57. package/templates/skills/problem-solving/references/collision-zone-thinking.md +79 -0
  58. package/templates/skills/problem-solving/references/inversion-exercise.md +91 -0
  59. package/templates/skills/problem-solving/references/meta-pattern-recognition.md +87 -0
  60. package/templates/skills/problem-solving/references/scale-game.md +95 -0
  61. package/templates/skills/problem-solving/references/simplification-cascades.md +80 -0
  62. package/templates/skills/problem-solving/references/when-stuck.md +72 -0
  63. package/templates/skills/research/SKILL.mdc +168 -0
  64. package/templates/skills/sequential-thinking/.env.example +8 -0
  65. package/templates/skills/sequential-thinking/README.md +183 -0
  66. package/templates/skills/sequential-thinking/SKILL.mdc +94 -0
  67. package/templates/skills/sequential-thinking/package.json +31 -0
  68. package/templates/skills/sequential-thinking/references/advanced-strategies.md +79 -0
  69. package/templates/skills/sequential-thinking/references/advanced-techniques.md +76 -0
  70. package/templates/skills/sequential-thinking/references/core-patterns.md +95 -0
  71. package/templates/skills/sequential-thinking/references/examples-api.md +88 -0
  72. package/templates/skills/sequential-thinking/references/examples-architecture.md +94 -0
  73. package/templates/skills/sequential-thinking/references/examples-debug.md +90 -0
  74. package/templates/skills/sequential-thinking/scripts/format-thought.js +159 -0
  75. package/templates/skills/sequential-thinking/scripts/process-thought.js +236 -0
  76. package/templates/skills/sequential-thinking/tests/format-thought.test.js +133 -0
  77. package/templates/skills/sequential-thinking/tests/process-thought.test.js +215 -0
  78. package/templates/skills/ui-styling/LICENSE.txt +202 -0
  79. package/templates/skills/ui-styling/SKILL.mdc +321 -0
  80. package/templates/skills/ui-styling/references/canvas-design-system.md +320 -0
  81. package/templates/skills/ui-styling/references/shadcn-accessibility.md +471 -0
  82. package/templates/skills/ui-styling/references/shadcn-components.md +424 -0
  83. package/templates/skills/ui-styling/references/shadcn-theming.md +373 -0
  84. package/templates/skills/ui-styling/references/tailwind-customization.md +483 -0
  85. package/templates/skills/ui-styling/references/tailwind-responsive.md +382 -0
  86. package/templates/skills/ui-styling/references/tailwind-utilities.md +455 -0
  87. package/templates/rules/frontend-design.mdc +0 -48
  88. package/templates/rules/performance.mdc +0 -54
  89. package/templates/rules/react.mdc +0 -58
  90. package/templates/rules/security.mdc +0 -50
  91. package/templates/rules/testing.mdc +0 -54
  92. package/templates/rules/typescript.mdc +0 -36
@@ -0,0 +1,183 @@
1
+ # Sequential Thinking Agent Skill
2
+
3
+ Structured, reflective problem-solving methodology converted from the sequential-thinking MCP server into a native Agent Skill.
4
+
5
+ ## Overview
6
+
7
+ This skill teaches Claude to apply systematic sequential thinking methodology for complex problem-solving, without relying on external MCP tools. It enables:
8
+ - Breaking down complex problems into manageable thought sequences
9
+ - Dynamic adjustment of thought count as understanding evolves
10
+ - Revision of previous thoughts when new insights emerge
11
+ - Branching into alternative reasoning paths
12
+ - Hypothesis generation and verification
13
+
14
+ ## Skill Structure
15
+
16
+ ```
17
+ sequential-thinking/
18
+ ├── SKILL.md (105 lines)
19
+ │ Core methodology, when to apply, scripts usage
20
+
21
+ ├── package.json
22
+ │ Test dependencies (jest)
23
+
24
+ ├── .env.example
25
+ │ Configuration options
26
+
27
+ ├── scripts/
28
+ │ ├── process-thought.js (executable)
29
+ │ │ Validate and track thoughts deterministically
30
+ │ │
31
+ │ └── format-thought.js (executable)
32
+ │ Format thoughts for display (box/simple/markdown)
33
+
34
+ ├── tests/
35
+ │ ├── process-thought.test.js
36
+ │ │ Validation, tracking, history tests
37
+ │ │
38
+ │ └── format-thought.test.js
39
+ │ Formatting tests (all formats)
40
+
41
+ └── references/
42
+ ├── core-patterns.md (95 lines)
43
+ │ Essential revision & branching patterns
44
+
45
+ ├── examples-api.md (88 lines)
46
+ │ API design example walkthrough
47
+
48
+ ├── examples-debug.md (90 lines)
49
+ │ Performance debugging example
50
+
51
+ ├── examples-architecture.md (94 lines)
52
+ │ Architecture decision example
53
+
54
+ ├── advanced-techniques.md (76 lines)
55
+ │ Spiral refinement, hypothesis testing, convergence
56
+
57
+ └── advanced-strategies.md (79 lines)
58
+ Uncertainty management, revision cascades, meta-thinking
59
+ ```
60
+
61
+ **Documentation**: 627 lines across 7 files (all under 100 lines)
62
+ **Scripts**: 2 executable Node.js scripts with tests
63
+
64
+ ## Key Features
65
+
66
+ ### Progressive Disclosure Design
67
+ Each file focuses on specific aspects, loaded only when needed:
68
+ - **SKILL.md**: Quick reference with core methodology
69
+ - **core-patterns.md**: Common patterns for everyday use
70
+ - **examples-*.md**: Real-world walkthroughs for learning
71
+ - **advanced-*.md**: Sophisticated techniques for complex scenarios
72
+
73
+ ### Token Efficiency
74
+ - Concise explanations sacrifice grammar for brevity
75
+ - Examples demonstrate patterns without verbose explanation
76
+ - Cross-references between files avoid duplication
77
+
78
+ ### Methodology Conversion
79
+ Extracted from MCP server's approach and converted to instructions:
80
+ - MCP tool provided **interface** for sequential thinking
81
+ - Agent skill provides **methodology** to think sequentially
82
+ - No dependency on external tools—pure instructional approach
83
+
84
+ ## Usage Modes
85
+
86
+ **Explicit Mode**: Use visible thought markers
87
+ ```
88
+ Thought 1/5: [Analysis]
89
+ Thought 2/5: [Further analysis]
90
+ ```
91
+
92
+ **Implicit Mode**: Apply methodology internally without cluttering output
93
+
94
+ ## When Claude Should Use This Skill
95
+
96
+ Automatically activated for:
97
+ - Complex problem decomposition
98
+ - Adaptive planning with potential revisions
99
+ - Debugging and root cause analysis
100
+ - Architecture and design decisions
101
+ - Problems with unclear or emerging scope
102
+ - Multi-step solutions requiring context
103
+
104
+ ## Scripts Usage
105
+
106
+ ### Process Thought (Validation & Tracking)
107
+
108
+ ```bash
109
+ # Process a thought
110
+ node scripts/process-thought.js --thought "Initial analysis" --number 1 --total 5 --next true
111
+
112
+ # Process with revision
113
+ node scripts/process-thought.js --thought "Corrected analysis" --number 2 --total 5 --next true --revision 1
114
+
115
+ # Process with branching
116
+ node scripts/process-thought.js --thought "Branch A" --number 2 --total 5 --next true --branch 1 --branchId "branch-a"
117
+
118
+ # View history
119
+ node scripts/process-thought.js --history
120
+
121
+ # Reset history
122
+ node scripts/process-thought.js --reset
123
+ ```
124
+
125
+ ### Format Thought (Display)
126
+
127
+ ```bash
128
+ # Box format (default)
129
+ node scripts/format-thought.js --thought "Analysis" --number 1 --total 5
130
+
131
+ # Simple text format
132
+ node scripts/format-thought.js --thought "Analysis" --number 1 --total 5 --format simple
133
+
134
+ # Markdown format
135
+ node scripts/format-thought.js --thought "Analysis" --number 1 --total 5 --format markdown
136
+
137
+ # With revision
138
+ node scripts/format-thought.js --thought "Revised" --number 2 --total 5 --revision 1
139
+
140
+ # With branch
141
+ node scripts/format-thought.js --thought "Branch" --number 2 --total 5 --branch 1 --branchId "a"
142
+ ```
143
+
144
+ ### Running Tests
145
+
146
+ ```bash
147
+ # Install dependencies (first time only)
148
+ npm install
149
+
150
+ # Run all tests
151
+ npm test
152
+
153
+ # Run tests in watch mode
154
+ npm run test:watch
155
+
156
+ # Run with coverage
157
+ npm run test:coverage
158
+ ```
159
+
160
+ ## When to Use Scripts
161
+
162
+ **Use scripts when**:
163
+ - Need deterministic validation of thought structure
164
+ - Want persistent thought history tracking
165
+ - Require formatted output for documentation
166
+ - Building tools that integrate with sequential thinking
167
+
168
+ **Don't use scripts when**:
169
+ - Applying methodology directly in responses
170
+ - Want lightweight, inline thinking
171
+ - No need for validation or tracking
172
+
173
+ Scripts are **optional tooling** - the methodology can be applied without them.
174
+
175
+ ## Source
176
+
177
+ Converted from: https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking
178
+
179
+ Original MCP server by Anthropic (MIT License).
180
+ Skill conversion:
181
+ - Extracts methodology as instructions
182
+ - Adds executable scripts for deterministic validation
183
+ - Makes tool-independent while preserving functionality
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: sequential-thinking
3
+ description: Apply structured, reflective problem-solving for complex tasks requiring multi-step analysis, revision capability, and hypothesis verification. Use for complex problem decomposition, adaptive planning, analysis needing course correction, problems with unclear scope, multi-step solutions, and hypothesis-driven work.
4
+ version: 1.0.0
5
+ license: MIT
6
+ ---
7
+
8
+ # Sequential Thinking
9
+
10
+ Structured problem-solving via manageable, reflective thought sequences with dynamic adjustment.
11
+
12
+ ## When to Apply
13
+
14
+ - Complex problem decomposition
15
+ - Adaptive planning with revision capability
16
+ - Analysis needing course correction
17
+ - Problems with unclear/emerging scope
18
+ - Multi-step solutions requiring context maintenance
19
+ - Hypothesis-driven investigation/debugging
20
+
21
+ ## Core Process
22
+
23
+ ### 1. Start with Loose Estimate
24
+ ```
25
+ Thought 1/5: [Initial analysis]
26
+ ```
27
+ Adjust dynamically as understanding evolves.
28
+
29
+ ### 2. Structure Each Thought
30
+ - Build on previous context explicitly
31
+ - Address one aspect per thought
32
+ - State assumptions, uncertainties, realizations
33
+ - Signal what next thought should address
34
+
35
+ ### 3. Apply Dynamic Adjustment
36
+ - **Expand**: More complexity discovered → increase total
37
+ - **Contract**: Simpler than expected → decrease total
38
+ - **Revise**: New insight invalidates previous → mark revision
39
+ - **Branch**: Multiple approaches → explore alternatives
40
+
41
+ ### 4. Use Revision When Needed
42
+ ```
43
+ Thought 5/8 [REVISION of Thought 2]: [Corrected understanding]
44
+ - Original: [What was stated]
45
+ - Why revised: [New insight]
46
+ - Impact: [What changes]
47
+ ```
48
+
49
+ ### 5. Branch for Alternatives
50
+ ```
51
+ Thought 4/7 [BRANCH A from Thought 2]: [Approach A]
52
+ Thought 4/7 [BRANCH B from Thought 2]: [Approach B]
53
+ ```
54
+ Compare explicitly, converge with decision rationale.
55
+
56
+ ### 6. Generate & Verify Hypotheses
57
+ ```
58
+ Thought 6/9 [HYPOTHESIS]: [Proposed solution]
59
+ Thought 7/9 [VERIFICATION]: [Test results]
60
+ ```
61
+ Iterate until hypothesis verified.
62
+
63
+ ### 7. Complete Only When Ready
64
+ Mark final: `Thought N/N [FINAL]`
65
+
66
+ Complete when:
67
+ - Solution verified
68
+ - All critical aspects addressed
69
+ - Confidence achieved
70
+ - No outstanding uncertainties
71
+
72
+ ## Application Modes
73
+
74
+ **Explicit**: Use visible thought markers when complexity warrants visible reasoning or user requests breakdown.
75
+
76
+ **Implicit**: Apply methodology internally for routine problem-solving where thinking aids accuracy without cluttering response.
77
+
78
+ ## Scripts (Optional)
79
+
80
+ Optional scripts for deterministic validation/tracking:
81
+ - `scripts/process-thought.js` - Validate & track thoughts with history
82
+ - `scripts/format-thought.js` - Format for display (box/markdown/simple)
83
+
84
+ See README.md for usage examples. Use when validation/persistence needed; otherwise apply methodology directly.
85
+
86
+ ## References
87
+
88
+ Load when deeper understanding needed:
89
+ - `references/core-patterns.md` - Revision & branching patterns
90
+ - `references/examples-api.md` - API design example
91
+ - `references/examples-debug.md` - Debugging example
92
+ - `references/examples-architecture.md` - Architecture decision example
93
+ - `references/advanced-techniques.md` - Spiral refinement, hypothesis testing, convergence
94
+ - `references/advanced-strategies.md` - Uncertainty, revision cascades, meta-thinking
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "sequential-thinking-skill",
3
+ "version": "1.0.0",
4
+ "description": "Sequential thinking methodology with thought processing scripts",
5
+ "main": "scripts/process-thought.js",
6
+ "scripts": {
7
+ "test": "jest",
8
+ "test:watch": "jest --watch",
9
+ "test:coverage": "jest --coverage"
10
+ },
11
+ "keywords": [
12
+ "sequential-thinking",
13
+ "problem-solving",
14
+ "agent-skill"
15
+ ],
16
+ "author": "Converted from Anthropic MCP Server",
17
+ "license": "MIT",
18
+ "devDependencies": {
19
+ "jest": "^29.7.0"
20
+ },
21
+ "jest": {
22
+ "testEnvironment": "node",
23
+ "testMatch": [
24
+ "**/tests/**/*.test.js"
25
+ ],
26
+ "coveragePathIgnorePatterns": [
27
+ "/node_modules/",
28
+ "/tests/"
29
+ ]
30
+ }
31
+ }
@@ -0,0 +1,79 @@
1
+ # Advanced Sequential Thinking Strategies
2
+
3
+ Additional sophisticated patterns for complex scenarios.
4
+
5
+ ## Uncertainty Management
6
+
7
+ Handle incomplete information systematically.
8
+
9
+ ```
10
+ Thought 2/7: Need to decide X
11
+ Thought 3/7: Insufficient data—two scenarios possible
12
+ Thought 4/7 [SCENARIO A if P true]: Analysis for A
13
+ Thought 4/7 [SCENARIO B if P false]: Analysis for B
14
+ Thought 5/7: Decision that works for both scenarios
15
+ Thought 6/7: Or determine critical info needed
16
+ Thought 7/7 [FINAL]: Robust solution or clear info requirement
17
+ ```
18
+
19
+ **Use for**: Decisions under uncertainty, incomplete requirements.
20
+
21
+ **Strategies**:
22
+ - Find solution robust to uncertainty
23
+ - Identify minimal info needed to resolve
24
+ - Make safe assumptions with clear documentation
25
+
26
+ ## Revision Cascade Management
27
+
28
+ Handle revisions that invalidate multiple subsequent thoughts.
29
+
30
+ ```
31
+ Thought 1/8: Foundation assumption
32
+ Thought 2/8: Build on Thought 1
33
+ Thought 3/8: Further build
34
+ Thought 4/8: Discover Thought 1 invalid
35
+ Thought 5/8 [REVISION of Thought 1]: Corrected foundation
36
+ Thought 6/8 [REASSESSMENT]: Which of 2-3 still valid?
37
+ - Thought 2: Partially valid, needs adjustment
38
+ - Thought 3: Completely invalid
39
+ Thought 7/8: Rebuild from corrected Thought 5
40
+ Thought 8/8 [FINAL]: Solution on correct foundation
41
+ ```
42
+
43
+ **Key**: After major revision, explicitly assess downstream impact.
44
+
45
+ ## Meta-Thinking Calibration
46
+
47
+ Monitor and adjust thinking process itself.
48
+
49
+ ```
50
+ Thought 5/9: [Regular thought]
51
+ Thought 6/9 [META]: Past 3 thoughts circling without progress
52
+ Analysis: Missing key information
53
+ Adjustment: Need to research X before continuing
54
+ Thought 7/9: Research findings on X
55
+ Thought 8/9: Now can proceed with informed decision
56
+ Thought 9/9: [Resume productive path]
57
+ ```
58
+
59
+ **Use when**: Stuck, circling, or unproductive pattern noticed.
60
+ **Action**: Pause, identify issue, adjust strategy.
61
+
62
+ ## Parallel Constraint Satisfaction
63
+
64
+ Handle multiple independent constraints simultaneously.
65
+
66
+ ```
67
+ Thought 2/10: Solution must satisfy A, B, C
68
+ Thought 3/10 [CONSTRAINT A]: Solutions satisfying A: {X, Y, Z}
69
+ Thought 4/10 [CONSTRAINT B]: Solutions satisfying B: {Y, Z, W}
70
+ Thought 5/10 [CONSTRAINT C]: Solutions satisfying C: {X, Z}
71
+ Thought 6/10 [INTERSECTION]: Z satisfies all
72
+ Thought 7/10: Verify Z feasible
73
+ Thought 8/10 [BRANCH if infeasible]: Relax which constraint?
74
+ Thought 9/10: Decision on constraint relaxation if needed
75
+ Thought 10/10 [FINAL]: Optimal solution given constraints
76
+ ```
77
+
78
+ **Use for**: Optimization problems, multi-criteria decisions.
79
+ **Pattern**: Analyze independently → Find intersection → Verify feasibility.
@@ -0,0 +1,76 @@
1
+ # Advanced Sequential Thinking Techniques
2
+
3
+ Complex problem-solving patterns.
4
+
5
+ ## Spiral Refinement
6
+
7
+ Return to concepts with progressively deeper understanding.
8
+
9
+ ```
10
+ Thought 1/7: Initial design (surface)
11
+ Thought 2/7: Discover constraint A
12
+ Thought 3/7: Refine for A
13
+ Thought 4/7: Discover constraint B
14
+ Thought 5/7: Refine for both A and B
15
+ Thought 6/7: Integration reveals edge case
16
+ Thought 7/7: Final design addressing all constraints
17
+ ```
18
+
19
+ **Use for**: Complex systems where constraints emerge iteratively.
20
+ **Key**: Each return is refinement, not restart.
21
+
22
+ ## Hypothesis-Driven Investigation
23
+
24
+ Systematic hypothesis generation and testing.
25
+
26
+ ```
27
+ Thought 1/6: Observe symptoms
28
+ Thought 2/6 [HYPOTHESIS]: Explanation X
29
+ Thought 3/6 [VERIFICATION]: Test X—partial match
30
+ Thought 4/6 [REFINED HYPOTHESIS]: Adjusted Y
31
+ Thought 5/6 [VERIFICATION]: Test Y—confirmed
32
+ Thought 6/6 [FINAL]: Solution based on verified Y
33
+ ```
34
+
35
+ **Use for**: Debugging, root cause analysis, diagnostics.
36
+ **Pattern**: Generate → Test → Refine → Re-test loop.
37
+
38
+ ## Multi-Branch Convergence
39
+
40
+ Explore alternatives, then synthesize best approach.
41
+
42
+ ```
43
+ Thought 2/8: Multiple viable approaches
44
+ Thought 3/8 [BRANCH A]: Approach A benefits
45
+ Thought 4/8 [BRANCH A]: Approach A drawbacks
46
+ Thought 5/8 [BRANCH B]: Approach B benefits
47
+ Thought 6/8 [BRANCH B]: Approach B drawbacks
48
+ Thought 7/8 [CONVERGENCE]: Hybrid combining A's X with B's Y
49
+ Thought 8/8 [FINAL]: Hybrid superior to either alone
50
+ ```
51
+
52
+ **Use for**: Complex decisions where neither option clearly best.
53
+ **Key**: Convergence often yields better solution than either branch.
54
+
55
+ ## Progressive Context Deepening
56
+
57
+ Build understanding in layers from abstract to concrete.
58
+
59
+ ```
60
+ Thought 1/9: High-level problem
61
+ Thought 2/9: Identify major components
62
+ Thought 3/9: Zoom into component A (detailed)
63
+ Thought 4/9: Zoom into component B (detailed)
64
+ Thought 5/9: Identify A-B interactions
65
+ Thought 6/9: Discover emergent constraint
66
+ Thought 7/9 [REVISION of 3-4]: Adjust for interaction
67
+ Thought 8/9: Verify complete system
68
+ Thought 9/9 [FINAL]: Integrated solution
69
+ ```
70
+
71
+ **Use for**: System design, architecture, integration problems.
72
+ **Pattern**: Abstract → Components → Details → Interactions → Integration.
73
+
74
+ ## Reference
75
+
76
+ See `advanced-strategies.md` for: Uncertainty Management, Revision Cascade Management, Meta-Thinking Calibration, Parallel Constraint Satisfaction.
@@ -0,0 +1,95 @@
1
+ # Core Sequential Thinking Patterns
2
+
3
+ Essential revision and branching patterns.
4
+
5
+ ## Revision Patterns
6
+
7
+ ### Assumption Challenge
8
+ Early assumption proves invalid with new data.
9
+ ```
10
+ Thought 1/5: Assume X is bottleneck
11
+ Thought 4/5 [REVISION of Thought 1]: X adequate; Y is actual bottleneck
12
+ ```
13
+
14
+ ### Scope Expansion
15
+ Problem larger than initially understood.
16
+ ```
17
+ Thought 1/4: Fix bug
18
+ Thought 4/5 [REVISION of scope]: Architectural redesign needed, not patch
19
+ ```
20
+
21
+ ### Approach Shift
22
+ Initial strategy inadequate for requirements.
23
+ ```
24
+ Thought 2/6: Optimize query
25
+ Thought 5/6 [REVISION of Thought 2]: Optimization + cache layer required
26
+ ```
27
+
28
+ ### Understanding Deepening
29
+ Later insight fundamentally changes interpretation.
30
+ ```
31
+ Thought 1/5: Feature broken
32
+ Thought 4/5 [REVISION of Thought 1]: Not bug—UX confusion issue
33
+ ```
34
+
35
+ ## Branching Patterns
36
+
37
+ ### Trade-off Evaluation
38
+ Compare approaches with different trade-offs.
39
+ ```
40
+ Thought 3/7: Choose between X and Y
41
+ Thought 4/7 [BRANCH A]: X—simpler, less scalable
42
+ Thought 4/7 [BRANCH B]: Y—complex, scales better
43
+ Thought 5/7: Choose Y for long-term needs
44
+ ```
45
+
46
+ ### Risk Mitigation
47
+ Prepare backup for high-risk primary approach.
48
+ ```
49
+ Thought 2/6: Primary: API integration
50
+ Thought 3/6 [BRANCH A]: API details
51
+ Thought 3/6 [BRANCH B]: Fallback: webhook
52
+ Thought 4/6: Implement A with B contingency
53
+ ```
54
+
55
+ ### Parallel Exploration
56
+ Investigate independent concerns separately.
57
+ ```
58
+ Thought 3/8: Two unknowns—DB schema & API design
59
+ Thought 4/8 [BRANCH DB]: DB options
60
+ Thought 4/8 [BRANCH API]: API patterns
61
+ Thought 5/8: Integrate findings
62
+ ```
63
+
64
+ ### Hypothesis Testing
65
+ Test multiple explanations systematically.
66
+ ```
67
+ Thought 2/6: Could be A, B, or C
68
+ Thought 3/6 [BRANCH A]: Test A—not cause
69
+ Thought 3/6 [BRANCH B]: Test B—confirmed
70
+ Thought 4/6: Root cause via Branch B
71
+ ```
72
+
73
+ ## Adjustment Guidelines
74
+
75
+ **Expand when**: Complexity discovered, multiple aspects identified, verification needed, alternatives require exploration.
76
+
77
+ **Contract when**: Key insight solves earlier, problem simpler, steps merge naturally.
78
+
79
+ **Example**:
80
+ ```
81
+ Thought 1/5: Initial
82
+ Thought 3/7: Complexity (5→7)
83
+ Thought 5/8: Another aspect (7→8)
84
+ Thought 8/8 [FINAL]: Complete
85
+ ```
86
+
87
+ ## Anti-Patterns
88
+
89
+ **Premature Completion**: Rushing without verification → Add verification thoughts.
90
+
91
+ **Revision Cascade**: Repeated revisions without understanding why → Identify root cause.
92
+
93
+ **Branching Explosion**: Too many branches → Limit to 2-3, converge before more.
94
+
95
+ **Context Loss**: Ignoring earlier insights → Reference previous thoughts explicitly.
@@ -0,0 +1,88 @@
1
+ # Example: API Design with Sequential Thinking
2
+
3
+ **Problem**: Design authentication API for multi-tenant SaaS.
4
+
5
+ ## Without Sequential Thinking
6
+ "Use JWT with OAuth2. Add tenant ID to claims. Implement refresh tokens."
7
+ (Misses edge cases, scaling, security)
8
+
9
+ ## With Sequential Thinking
10
+
11
+ ```
12
+ Thought 1/5: Requirements
13
+
14
+ Multi-tenant SaaS authentication needs:
15
+ - Tenant isolation (prevent cross-tenant access)
16
+ - Scalability (thousands of tenants)
17
+ - Security (industry standards)
18
+
19
+ Uncertainty: Session vs token? Stateful vs stateless?
20
+ Next: Evaluate approaches
21
+
22
+ Thought 2/6: Approach evaluation (adjusted)
23
+
24
+ Comparing session vs JWT:
25
+ - Session: Server state, easy revocation, harder scaling
26
+ - JWT: Stateless, scales well, complex revocation
27
+
28
+ Multi-tenancy complicates sessions (which DB?).
29
+ JWT better for distributed systems.
30
+ Next: JWT structure
31
+
32
+ Thought 3/6: JWT payload design
33
+
34
+ JWT includes: User ID, Tenant ID, Permissions, Expiration
35
+
36
+ Uncertainty: Where verify tenant? Gateway vs service?
37
+ Next: Token refresh
38
+
39
+ Thought 4/6 [REVISION of Thought 3]: Security fix
40
+
41
+ Original: Tenant ID in JWT claims.
42
+ Issue: Claims visible (base64), could read tenant IDs.
43
+
44
+ Corrected:
45
+ - Keep tenant ID (needed for routing)
46
+ - Add gateway verification
47
+ - Log access attempts
48
+
49
+ Impact: Need gateway security layer
50
+
51
+ Thought 5/7: Refresh strategy (adjusted)
52
+
53
+ Access: 15 min
54
+ Refresh: 7 days, rotate on use
55
+
56
+ Storage:
57
+ - Access: Client memory
58
+ - Refresh: HttpOnly cookie + DB revocation
59
+
60
+ Enables revocation + stateless benefits.
61
+
62
+ Thought 6/7: Gateway flow
63
+
64
+ 1. Verify JWT signature
65
+ 2. Extract tenant ID
66
+ 3. Verify user belongs to tenant (cache + DB)
67
+ 4. Forward with verified context
68
+
69
+ Addresses Thought 4 security concern.
70
+
71
+ Thought 7/7 [FINAL]: Complete solution
72
+
73
+ - JWT with refresh rotation
74
+ - Tenant ID + gateway verification
75
+ - 15-min access, 7-day refresh
76
+ - HttpOnly cookies + revocation DB
77
+ - Gateway enforces isolation
78
+
79
+ Confidence: High
80
+ Assumptions: Distributed, centralized gateway
81
+ Trade-offs: Slight latency vs security
82
+ ```
83
+
84
+ ## Key Outcomes
85
+
86
+ 1. **Revision caught security issue**: Tenant ID visibility
87
+ 2. **Dynamic adjustment**: 5→7 thoughts as complexity emerged
88
+ 3. **Comprehensive**: Authentication, authorization, multi-tenancy, revocation