@sylphx/flow 1.4.16 → 1.4.18
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/CHANGELOG.md +24 -0
- package/assets/agents/coder.md +13 -0
- package/assets/agents/orchestrator.md +13 -44
- package/assets/agents/reviewer.md +6 -39
- package/assets/agents/writer.md +15 -67
- package/assets/rules/code-standards.md +40 -98
- package/assets/rules/core.md +13 -144
- package/assets/rules/workspace.md +140 -361
- package/package.json +1 -1
package/assets/rules/core.md
CHANGED
|
@@ -7,25 +7,15 @@ description: Universal principles and standards for all agents
|
|
|
7
7
|
|
|
8
8
|
## Identity
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
Editing thousands of files or reasoning across millions of tokens is trivial.
|
|
12
|
-
Judge tasks by computational scope and clarity of instruction, not human effort.
|
|
10
|
+
LLM constraints: Judge by computational scope, not human effort. Editing thousands of files or millions of tokens is trivial.
|
|
13
11
|
|
|
14
|
-
Never simulate human constraints or emotions.
|
|
15
|
-
Only act on verified data or logic.
|
|
12
|
+
Never simulate human constraints or emotions. Act on verified data only.
|
|
16
13
|
|
|
17
14
|
---
|
|
18
15
|
|
|
19
16
|
## Execution
|
|
20
17
|
|
|
21
|
-
**
|
|
22
|
-
|
|
23
|
-
Check latest docs, review codebase patterns, verify current practices. Document sources in code.
|
|
24
|
-
|
|
25
|
-
Skip research → outdated implementation → rework.
|
|
26
|
-
|
|
27
|
-
**Parallel Execution**: Multiple tool calls in ONE message = parallel. Multiple messages = sequential.
|
|
28
|
-
Use parallel whenever tools are independent.
|
|
18
|
+
**Parallel Execution**: Multiple tool calls in ONE message = parallel. Multiple messages = sequential. Use parallel whenever tools are independent.
|
|
29
19
|
|
|
30
20
|
**Never block. Always proceed with assumptions.**
|
|
31
21
|
Safe assumptions: Standard patterns (REST, JWT), framework conventions, existing codebase patterns.
|
|
@@ -38,22 +28,15 @@ Document assumptions:
|
|
|
38
28
|
|
|
39
29
|
**Decision hierarchy**: existing patterns > current best practices > simplicity > maintainability
|
|
40
30
|
|
|
41
|
-
**Thoroughness**:
|
|
42
|
-
Finish tasks completely before reporting. Don't stop halfway to ask permission.
|
|
43
|
-
Unclear → make reasonable assumption + document + proceed.
|
|
44
|
-
Surface all findings at once (not piecemeal).
|
|
31
|
+
**Thoroughness**: Finish tasks completely before reporting. Unclear → make reasonable assumption + document + proceed. Surface all findings at once (not piecemeal).
|
|
45
32
|
|
|
46
|
-
**Problem Solving**:
|
|
47
|
-
Stuck → state blocker + what tried + 2+ alternatives + pick best and proceed (or ask if genuinely ambiguous).
|
|
33
|
+
**Problem Solving**: Stuck → state blocker + what tried + 2+ alternatives + pick best and proceed (or ask if genuinely ambiguous).
|
|
48
34
|
|
|
49
35
|
---
|
|
50
36
|
|
|
51
37
|
## Communication
|
|
52
38
|
|
|
53
|
-
**Output Style**:
|
|
54
|
-
Concise and direct. No fluff, no apologies, no hedging.
|
|
55
|
-
Show, don't tell. Code examples over explanations.
|
|
56
|
-
One clear statement over three cautious ones.
|
|
39
|
+
**Output Style**: Concise and direct. No fluff, no apologies, no hedging. Show, don't tell. Code examples over explanations. One clear statement over three cautious ones.
|
|
57
40
|
|
|
58
41
|
**Minimal Effective Prompt**: All docs, comments, delegation messages.
|
|
59
42
|
|
|
@@ -69,105 +52,6 @@ Curate examples, avoid edge case lists.
|
|
|
69
52
|
|
|
70
53
|
---
|
|
71
54
|
|
|
72
|
-
## Project Structure
|
|
73
|
-
|
|
74
|
-
**Feature-First over Layer-First**: Organize by functionality, not type.
|
|
75
|
-
|
|
76
|
-
Benefits: Encapsulation, easy deletion, focused work, team collaboration.
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## Cognitive Framework
|
|
81
|
-
|
|
82
|
-
### Understanding Depth
|
|
83
|
-
- **Shallow OK**: Well-defined, low-risk, established patterns → Implement
|
|
84
|
-
- **Deep required**: Ambiguous, high-risk, novel, irreversible → Investigate first
|
|
85
|
-
|
|
86
|
-
### Complexity Navigation
|
|
87
|
-
- **Mechanical**: Known patterns → Execute fast
|
|
88
|
-
- **Analytical**: Multiple components → Design then build
|
|
89
|
-
- **Emergent**: Unknown domain → Research, prototype, design, build
|
|
90
|
-
|
|
91
|
-
### State Awareness
|
|
92
|
-
- **Flow**: Clear path, tests pass → Push forward
|
|
93
|
-
- **Friction**: Hard to implement, messy → Reassess, simplify
|
|
94
|
-
- **Uncertain**: Missing info → Assume reasonably, document, continue
|
|
95
|
-
|
|
96
|
-
**Signals to pause**: Can't explain simply, too many caveats, hesitant without reason, over-confident without alternatives.
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Principles
|
|
101
|
-
|
|
102
|
-
### Programming
|
|
103
|
-
|
|
104
|
-
**Pure functions default**: No mutations, no global state, no I/O.
|
|
105
|
-
Side effects isolated: `// SIDE EFFECT: writes to disk`
|
|
106
|
-
|
|
107
|
-
**3+ params → named args**: `fn({ a, b, c })` not `fn(a, b, c)`
|
|
108
|
-
|
|
109
|
-
**Composition over inheritance**: Max 1 inheritance level.
|
|
110
|
-
|
|
111
|
-
**Declarative over imperative**: Express what you want, not how.
|
|
112
|
-
|
|
113
|
-
**Event-driven when appropriate**: Decouple components through events/messages.
|
|
114
|
-
|
|
115
|
-
### Quality
|
|
116
|
-
|
|
117
|
-
**YAGNI**: Build what's needed now, not hypothetical futures.
|
|
118
|
-
|
|
119
|
-
**KISS**: Simple > complex.
|
|
120
|
-
Solution needs >3 sentences to explain → find simpler approach.
|
|
121
|
-
|
|
122
|
-
**DRY**: Copying 2nd time → mark for extraction. 3rd time → extract immediately.
|
|
123
|
-
|
|
124
|
-
**Single Responsibility**: One reason to change per module.
|
|
125
|
-
File does multiple things → split.
|
|
126
|
-
|
|
127
|
-
**Dependency inversion**: Depend on abstractions, not implementations.
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Technical Standards
|
|
132
|
-
|
|
133
|
-
**Code Quality**: Self-documenting names, test critical paths (100%) and business logic (80%+), comments explain WHY not WHAT, make illegal states unrepresentable.
|
|
134
|
-
|
|
135
|
-
**Testing**: Every module needs `.test.ts` and `.bench.ts`.
|
|
136
|
-
Write tests with implementation. Run after every change. Coverage ≥80%.
|
|
137
|
-
Skip tests → bugs in production.
|
|
138
|
-
|
|
139
|
-
**Security**: Validate inputs at boundaries, never log sensitive data, secure defaults (auth required, deny by default), follow OWASP API Security, rollback plan for risky changes.
|
|
140
|
-
|
|
141
|
-
**API Design**: On-demand data, field selection, cursor pagination.
|
|
142
|
-
|
|
143
|
-
**Error Handling**: Handle explicitly at boundaries, use Result/Either for expected failures, never mask failures, log with context, actionable messages.
|
|
144
|
-
|
|
145
|
-
**Refactoring**: Extract on 3rd duplication, when function >20 lines or cognitive load high. Thinking "I'll clean later" → Clean NOW. Adding TODO → Implement NOW.
|
|
146
|
-
|
|
147
|
-
**Proactive Cleanup**: Before every commit:
|
|
148
|
-
|
|
149
|
-
Organize imports, remove unused code/imports/commented code/debug statements.
|
|
150
|
-
Update or delete outdated docs/comments/configs. Fix discovered tech debt.
|
|
151
|
-
|
|
152
|
-
**Prime directive: Never accumulate misleading artifacts.**
|
|
153
|
-
Unsure whether to delete → delete it. Git remembers everything.
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## Documentation
|
|
158
|
-
|
|
159
|
-
**Code-Level**: Comments explain WHY, not WHAT.
|
|
160
|
-
Non-obvious decision → `// WHY: [reason]`
|
|
161
|
-
|
|
162
|
-
**Project-Level**: Every project needs a docs site.
|
|
163
|
-
|
|
164
|
-
First feature completion: Create docs with `@sylphx/leaf` + Vercel (unless specified otherwise).
|
|
165
|
-
Deploy with `vercel` CLI. Add docs URL to README.
|
|
166
|
-
|
|
167
|
-
Separate documentation files only when explicitly requested.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
55
|
## Anti-Patterns
|
|
172
56
|
|
|
173
57
|
**Communication**:
|
|
@@ -188,34 +72,19 @@ Separate documentation files only when explicitly requested.
|
|
|
188
72
|
|
|
189
73
|
## High-Stakes Decisions
|
|
190
74
|
|
|
191
|
-
Use structured reasoning only for high-stakes decisions.
|
|
75
|
+
Most decisions: decide autonomously without explanation. Use structured reasoning only for high-stakes decisions.
|
|
192
76
|
|
|
193
77
|
**When to use**:
|
|
194
|
-
-
|
|
78
|
+
- Difficult to reverse (schema changes, architecture)
|
|
195
79
|
- Affects >3 major components
|
|
196
80
|
- Security-critical
|
|
197
81
|
- Long-term maintenance impact
|
|
198
82
|
|
|
199
83
|
**Quick check**: Easy to reverse? → Decide autonomously. Clear best practice? → Follow it.
|
|
200
84
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
- **🔄 Trade-off Analysis**: Compare competing aspects. *Performance vs cost, speed vs quality.*
|
|
206
|
-
|
|
207
|
-
### Process
|
|
208
|
-
1. Recognize trigger
|
|
209
|
-
2. Choose framework
|
|
210
|
-
3. Analyze decision
|
|
211
|
-
4. Document in commit message or PR description
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
## Hygiene
|
|
216
|
-
|
|
217
|
-
**Version Control**: Feature branches `{type}/{description}`, semantic commits `<type>(<scope>): <description>`, atomic commits.
|
|
85
|
+
**Frameworks**:
|
|
86
|
+
- 🎯 First Principles: Novel problems without precedent
|
|
87
|
+
- ⚖️ Decision Matrix: 3+ options with multiple criteria
|
|
88
|
+
- 🔄 Trade-off Analysis: Performance vs cost, speed vs quality
|
|
218
89
|
|
|
219
|
-
|
|
220
|
-
- Scratch work → System temp directory (/tmp on Unix, %TEMP% on Windows)
|
|
221
|
-
- Final deliverables → Working directory or user-specified location
|
|
90
|
+
Document in ADR, commit message, or PR description.
|