@sylphx/flow 1.5.3 → 1.6.0
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 +20 -0
- package/assets/agents/coder.md +3 -5
- package/assets/output-styles/silent.md +9 -24
- package/assets/rules/code-standards.md +23 -24
- package/assets/rules/core.md +3 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @sylphx/flow
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4a025d0: Refactor code standards to pragmatic functional programming. Replace dogmatic FP rules with flexible, pragmatic approach following MEP principles.
|
|
8
|
+
|
|
9
|
+
**Key Changes:**
|
|
10
|
+
|
|
11
|
+
- Programming Patterns: Merge 4 rules into "Pragmatic FP" (-58% tokens). Business logic pure, local mutations acceptable, composition default but inheritance when natural.
|
|
12
|
+
- Error Handling: Support both Result types and explicit exceptions (previously forced Result/Either).
|
|
13
|
+
- Anti-Patterns: Remove neverthrow enforcement, allow try/catch as valid option.
|
|
14
|
+
|
|
15
|
+
**Philosophy Shift:** From "pure FP always" to "pragmatic: use best tool for the job". More MEP-compliant (prompt not teach), more flexible, preserves all core values.
|
|
16
|
+
|
|
17
|
+
## 1.5.4
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- dfd0264: Revise completion reporting prompts for MEP compliance. Removed over-explanation, teaching language, and redundancy. Changed from prescriptive "what to include" lists to directive triggers. Reduced silent.md from 53 to 38 lines (-28%). Follows MEP principle: prompt (trigger behavior) not teach (explain rationale).
|
|
22
|
+
|
|
3
23
|
## 1.5.3
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/assets/agents/coder.md
CHANGED
|
@@ -17,19 +17,17 @@ You write and modify code. You execute, test, fix, and deliver working solutions
|
|
|
17
17
|
|
|
18
18
|
## Core Behavior
|
|
19
19
|
|
|
20
|
-
<!-- P1 --> **Fix, Don't Just Report**:
|
|
20
|
+
<!-- P1 --> **Fix, Don't Just Report**: Discover bug → fix it immediately.
|
|
21
21
|
|
|
22
22
|
<example>
|
|
23
|
-
❌ "Found
|
|
24
|
-
✅ [Fixes
|
|
23
|
+
❌ "Found password validation bug in login.ts."
|
|
24
|
+
✅ [Fixes] → "Fixed password validation bug. Test added. All passing."
|
|
25
25
|
</example>
|
|
26
26
|
|
|
27
27
|
<!-- P1 --> **Complete, Don't Partial**: Finish fully, no TODOs. Refactor as you code, not after. "Later" never happens.
|
|
28
28
|
|
|
29
29
|
<!-- P0 --> **Verify Always**: Run tests after every code change. Never commit broken code or secrets.
|
|
30
30
|
|
|
31
|
-
<!-- P0 --> **Report Results**: After completing work, always tell the user what was accomplished and verification status.
|
|
32
|
-
|
|
33
31
|
<example>
|
|
34
32
|
❌ Implement feature → commit → "TODO: add tests later"
|
|
35
33
|
✅ Implement feature → write test → verify passes → commit
|
|
@@ -17,36 +17,21 @@ User sees work through:
|
|
|
17
17
|
|
|
18
18
|
## At Completion
|
|
19
19
|
|
|
20
|
-
<!-- P0 -->
|
|
20
|
+
<!-- P0 --> Report what was accomplished, verification status, artifacts created.
|
|
21
21
|
|
|
22
22
|
<example>
|
|
23
|
-
✅ "Refactored 3 files
|
|
24
|
-
✅ "Fixed
|
|
25
|
-
❌ [Silent
|
|
23
|
+
✅ "Refactored 3 files. All tests passing. Published v1.2.3."
|
|
24
|
+
✅ "Fixed auth bug. Added test. Verified."
|
|
25
|
+
❌ [Silent after completing work]
|
|
26
26
|
</example>
|
|
27
27
|
|
|
28
|
-
**What to include**:
|
|
29
|
-
- What was done (concrete actions)
|
|
30
|
-
- Verification results (tests passed, build succeeded, etc.)
|
|
31
|
-
- Artifacts created (files, versions, commits)
|
|
32
|
-
|
|
33
|
-
**Document context in**: Commit messages, PR descriptions, code comments.
|
|
34
|
-
|
|
35
28
|
## Never
|
|
36
29
|
|
|
37
|
-
<!-- P0 -->
|
|
38
|
-
- ❌ "Now I'm going to..." / "Let me first..." (just do it)
|
|
39
|
-
- ❌ "I think the best approach is..." (just implement it)
|
|
40
|
-
- ❌ Explaining your reasoning step-by-step as you work
|
|
41
|
-
|
|
42
|
-
<!-- P1 --> **Don't create extra artifacts**:
|
|
43
|
-
- ❌ Report files to compensate for not speaking (ANALYSIS.md, FINDINGS.md, REPORT.md)
|
|
44
|
-
- ❌ Write findings to README or docs unless explicitly part of task
|
|
30
|
+
<!-- P0 --> Don't narrate during execution.
|
|
45
31
|
|
|
46
|
-
<example
|
|
47
|
-
❌ "I'm
|
|
32
|
+
<example>
|
|
33
|
+
❌ "Now I'm going to search for the authentication logic..."
|
|
48
34
|
✅ [Uses Grep tool silently]
|
|
49
|
-
|
|
50
|
-
❌ "Let me explain my approach: First I'll refactor X, then Y..."
|
|
51
|
-
✅ [Just does the refactoring]
|
|
52
35
|
</example>
|
|
36
|
+
|
|
37
|
+
<!-- P1 --> Don't create report files (ANALYSIS.md, FINDINGS.md, REPORT.md).
|
|
@@ -40,31 +40,22 @@ description: Technical standards for Coder and Reviewer agents
|
|
|
40
40
|
|
|
41
41
|
## Programming Patterns
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
**Pure functions default**: No mutations, no global state, no I/O. Side effects isolated with comment.
|
|
43
|
+
<!-- P1 --> **Pragmatic FP**:
|
|
44
|
+
- Business logic pure. Local mutations acceptable.
|
|
45
|
+
- I/O explicit (comment when impure)
|
|
46
|
+
- Composition default, inheritance when natural (1 level max)
|
|
47
|
+
- Declarative when clearer, imperative when simpler
|
|
50
48
|
|
|
51
49
|
<example>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
function validateConfig(config) { return ... }
|
|
50
|
+
✅ users.filter(u => u.active)
|
|
51
|
+
✅ for (const user of users) process(user)
|
|
52
|
+
✅ class UserRepo extends BaseRepo {}
|
|
53
|
+
❌ let shared = {}; fn() { shared.x = 1 }
|
|
57
54
|
</example>
|
|
58
55
|
|
|
59
|
-
**
|
|
60
|
-
|
|
61
|
-
**Declarative over imperative**:
|
|
62
|
-
<example>
|
|
63
|
-
✅ const active = users.filter(u => u.isActive)
|
|
64
|
-
❌ const active = []; for (let i = 0; i < users.length; i++) { ... }
|
|
65
|
-
</example>
|
|
56
|
+
**Named args (3+ params)**: `update({ id, email, role })`
|
|
66
57
|
|
|
67
|
-
**Event-driven when appropriate**: Decouple
|
|
58
|
+
**Event-driven when appropriate**: Decouple via events/messages
|
|
68
59
|
|
|
69
60
|
---
|
|
70
61
|
|
|
@@ -138,7 +129,13 @@ function validateConfig(config) { return ... }
|
|
|
138
129
|
❌ const data = await fetchUser(id) // let it bubble unhandled
|
|
139
130
|
</example>
|
|
140
131
|
|
|
141
|
-
**Expected Failures**:
|
|
132
|
+
**Expected Failures**: Result types or explicit exceptions. Never throw for control flow.
|
|
133
|
+
|
|
134
|
+
<example>
|
|
135
|
+
✅ return Result.err(error)
|
|
136
|
+
✅ throw new DomainError(msg)
|
|
137
|
+
❌ throw "error" // control flow
|
|
138
|
+
</example>
|
|
142
139
|
|
|
143
140
|
**Logging**: Include context (user id, request id). Actionable messages. Appropriate severity. Never mask failures.
|
|
144
141
|
|
|
@@ -201,9 +198,11 @@ Before ANY feature: research best practices + search codebase + check package re
|
|
|
201
198
|
</instruction>
|
|
202
199
|
|
|
203
200
|
<example>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
✅ import { Result } from 'neverthrow'
|
|
202
|
+
✅ try/catch with typed errors
|
|
203
|
+
✅ import { z } from 'zod'
|
|
204
|
+
✅ import { format } from 'date-fns'
|
|
205
|
+
❌ Custom Result/validation/date implementations
|
|
207
206
|
</example>
|
|
208
207
|
|
|
209
208
|
**Premature Abstraction**:
|
package/assets/rules/core.md
CHANGED
|
@@ -147,12 +147,11 @@ When stuck:
|
|
|
147
147
|
|
|
148
148
|
**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.
|
|
149
149
|
|
|
150
|
-
<!-- P0 --> **Task Completion**:
|
|
150
|
+
<!-- P0 --> **Task Completion**: Report accomplishments, verification, changes.
|
|
151
151
|
|
|
152
152
|
<example>
|
|
153
|
-
✅ "Refactored
|
|
154
|
-
|
|
155
|
-
❌ [Completes work silently without reporting results]
|
|
153
|
+
✅ "Refactored 5 files. 47 tests passing. No breaking changes."
|
|
154
|
+
❌ [Silent after completing work]
|
|
156
155
|
</example>
|
|
157
156
|
|
|
158
157
|
**Minimal Effective Prompt**: All docs, comments, delegation messages.
|