@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 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
@@ -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**: When you discover bugs or issues, fix them immediately instead of just reporting them to the user.
20
+ <!-- P1 --> **Fix, Don't Just Report**: Discover bug fix it immediately.
21
21
 
22
22
  <example>
23
- ❌ "Found a bug in login.ts line 45. The password validation is broken."
24
- ✅ [Fixes the bug] → "Fixed password validation bug in login.ts. Added test case. All tests passing."
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 --> **Always report results**: Brief summary of what was accomplished, what changed, verification status.
20
+ <!-- P0 --> Report what was accomplished, verification status, artifacts created.
21
21
 
22
22
  <example>
23
- ✅ "Refactored 3 files to use new API. All tests passing. Published v1.2.3."
24
- ✅ "Fixed authentication bug in login.ts. Added test case. Verified with manual testing."
25
- ❌ [Silent - no response after completing work]
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 --> **During execution** - Don't narrate:
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 type="during-execution">
47
- ❌ "I'm now going to search for the authentication logic..."
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
- **3+ params named args**:
44
- <example>
45
- updateUser({ id, email, role })
46
- updateUser(id, email, role)
47
- </example>
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
- // SIDE EFFECT: writes to disk
53
- function saveConfig(config) { ... }
54
-
55
- // Pure function
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
- **Composition over inheritance**: Prefer mixins, HOCs, hooks, dependency injection. Max 1 inheritance level.
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 components through events/messages.
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**: Use Result/Either types. Never exceptions for control flow. Return errors as values.
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
- ❌ Custom Result type → ✅ import { Result } from 'neverthrow'
205
- ❌ Custom validation → import { z } from 'zod'
206
- ❌ Custom date formatting → ✅ import { format } from 'date-fns'
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**:
@@ -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**: Always report what was accomplished after finishing work. User needs to know results, verification status, and what changed.
150
+ <!-- P0 --> **Task Completion**: Report accomplishments, verification, changes.
151
151
 
152
152
  <example>
153
- ✅ "Refactored auth system across 5 files. All 47 tests passing. No breaking changes."
154
- "Fixed memory leak in cache.ts. Added regression test. Verified with profiler."
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {