@sylphx/flow 1.4.16 → 1.4.17

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,11 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 1.4.17
4
+
5
+ ### Patch Changes
6
+
7
+ - ef8463c: Refactor workspace.md rule to follow Minimal Effective Prompt principles. Reduced from 486 to 244 lines (50% reduction) by removing teaching, applying trigger-based outcomes, condensing templates, and trusting LLM capability.
8
+
3
9
  ## 1.4.16
4
10
 
5
11
  ### Patch Changes
@@ -1,485 +1,243 @@
1
1
  ---
2
2
  name: Workspace Documentation
3
- description: .sylphx/ shared workspace - auto-create, maintain SSOT, verify on every read
3
+ description: .sylphx/ workspace - SSOT for context, architecture, decisions
4
4
  ---
5
5
 
6
6
  # WORKSPACE DOCUMENTATION
7
7
 
8
- ## On First Task
8
+ ## Core Behavior
9
9
 
10
- **Check:** `.sylphx/` exists?
10
+ **First task:** `.sylphx/` missing → create structure. Exists → verify accuracy, update/delete outdated.
11
11
 
12
- **No Create structure:**
13
- ```bash
14
- mkdir -p .sylphx/decisions
15
- ```
12
+ **Every task start:** Read all `.sylphx/` files. Verify `<!-- VERIFY: -->` markers. Fix or delete wrong info immediately.
16
13
 
17
- Create files with templates below. Populate with project-specific content.
14
+ **During work:** New understanding/decision/term update `.sylphx/` immediately.
18
15
 
19
- **Yes Verify:**
20
- - Read all files
21
- - Check accuracy vs actual code
22
- - Update or delete outdated sections
16
+ **Before commit:** `.sylphx/` matches code. No contradictions. All markers valid.
23
17
 
24
18
  ---
25
19
 
26
- ## Structure & Templates
20
+ ## File Structure
21
+
22
+ ```
23
+ .sylphx/
24
+ context.md # What, Why, Who, Constraints
25
+ architecture.md # System overview, patterns (WHY), boundaries
26
+ glossary.md # Project-specific terms only
27
+ decisions/
28
+ README.md # ADR index
29
+ NNN-title.md # Individual ADRs
30
+ ```
31
+
32
+ Missing on first task → create with minimal templates below.
33
+
34
+ ---
27
35
 
28
- ### .sylphx/context.md
36
+ ## Templates
29
37
 
30
- **Create when:** First task, or when missing
31
- **Update when:** Project scope/purpose/constraints change
38
+ ### context.md
32
39
 
33
40
  ```markdown
34
41
  # Project Context
35
42
 
36
43
  ## What
37
- [1-2 sentence description of what this project is]
44
+ [1-2 sentences]
38
45
 
39
46
  ## Why
40
- [Problem being solved, user need addressed]
47
+ [Problem solved]
41
48
 
42
49
  ## Who
43
- [Target users, primary use cases]
50
+ [Users, use cases]
44
51
 
45
52
  ## Status
46
- [Development phase: Alpha/Beta/Stable, current version]
53
+ [Phase, version]
47
54
 
48
55
  ## Key Constraints
49
- - [Non-negotiable requirement 1]
50
- - [Non-negotiable requirement 2]
51
- - [Critical limitation or boundary]
52
-
53
- ## Source of Truth References
54
- <!-- VERIFY: These files exist -->
55
- - Tech stack: `package.json`
56
- - Configuration: [list config files]
57
- - Build/Scripts: `package.json` scripts
56
+ - [Non-negotiable 1]
57
+ - [Non-negotiable 2]
58
+
59
+ ## Source of Truth
60
+ <!-- VERIFY: package.json -->
61
+ - Dependencies: `package.json`
62
+ - [Other SSOT references]
58
63
  ```
59
64
 
60
- **Verify:** Referenced files exist. If not, update or remove reference.
65
+ **Update when:** Scope/purpose/constraints change.
61
66
 
62
67
  ---
63
68
 
64
- ### .sylphx/architecture.md
65
-
66
- **Create when:** First task, or when missing
67
- **Update when:** Architecture changes, patterns adopted, major refactoring
69
+ ### architecture.md
68
70
 
69
71
  ```markdown
70
72
  # Architecture
71
73
 
72
74
  ## System Overview
73
- [1-2 paragraph high-level description]
75
+ [1-2 paragraphs]
74
76
 
75
77
  ## Key Components
76
- <!-- VERIFY: Paths exist -->
77
- - **Component A** (`src/path/`): [Purpose, responsibility]
78
- - **Component B** (`src/path/`): [Purpose, responsibility]
78
+ <!-- VERIFY: src/path/ -->
79
+ - **Name** (`src/path/`): [Responsibility]
79
80
 
80
81
  ## Design Patterns
81
82
 
82
83
  ### Pattern: [Name]
83
- **Why chosen:** [Rationale - problem it solves]
84
- **Where used:** `src/path/to/implementation.ts`
85
- **Trade-off:** [What gained vs what lost]
86
-
87
- ## Data Flow
88
- [Macro-level: input → processing → output]
89
- See `src/[entry-point].ts` for implementation.
84
+ **Why:** [Problem solved]
85
+ **Where:** `src/path/`
86
+ **Trade-off:** [Gained vs lost]
90
87
 
91
88
  ## Boundaries
92
- **In scope:** [What this project does]
93
- **Out of scope:** [What it explicitly doesn't do]
89
+ **In scope:** [What it does]
90
+ **Out of scope:** [What it doesn't]
94
91
  ```
95
92
 
96
- **Verify:** All paths exist. Patterns still used. Trade-offs still accurate.
93
+ **Update when:** Architecture changes, pattern adopted, major refactor.
97
94
 
98
95
  ---
99
96
 
100
- ### .sylphx/glossary.md
101
-
102
- **Create when:** First task, or when missing
103
- **Update when:** New project-specific term introduced
97
+ ### glossary.md
104
98
 
105
99
  ```markdown
106
100
  # Glossary
107
101
 
108
102
  ## [Term]
109
- **Definition:** [Clear, concise definition]
110
- **Usage:** `src/path/where/used.ts`
111
- **Context:** [When/why this term matters]
112
-
113
- ---
114
-
115
- [Only project-specific terms. No general programming concepts.]
103
+ **Definition:** [Concise]
104
+ **Usage:** `src/path/`
105
+ **Context:** [When/why matters]
116
106
  ```
117
107
 
118
- **Verify:** Terms still used. Usage references exist.
108
+ **Update when:** New project-specific term introduced.
109
+ **Skip:** General programming concepts.
119
110
 
120
111
  ---
121
112
 
122
- ### .sylphx/decisions/README.md
123
-
124
- **Create when:** First ADR created
125
- **Update when:** New ADR added
113
+ ### decisions/NNN-title.md
126
114
 
127
115
  ```markdown
128
- # Architecture Decision Records
129
-
130
- ## Active Decisions
131
- - [ADR-001: Title](./001-title.md) ✅ Accepted
132
- - [ADR-002: Title](./002-title.md) ✅ Accepted
133
-
134
- ## Superseded
135
- - [ADR-XXX: Old Title](./xxx-old.md) 🔄 Superseded by ADR-YYY
136
-
137
- ## Status Legend
138
- - ✅ Accepted - Currently in effect
139
- - ⏸️ Proposed - Under consideration
140
- - ❌ Rejected - Not adopted
141
- - 🔄 Superseded - Replaced by newer ADR
142
- ```
143
-
144
- ---
145
-
146
- ### .sylphx/decisions/NNN-title.md
147
-
148
- **Create when:** Making architectural decision
149
- **Update when:** Decision status changes or is superseded
150
-
151
- ```markdown
152
- # NNN. [Title - Verb + Object, e.g., "Use Bun as Package Manager"]
116
+ # NNN. [Verb + Object]
153
117
 
154
118
  **Status:** ✅ Accepted
155
119
  **Date:** YYYY-MM-DD
156
- **Deciders:** [Who made decision, or "Project maintainers"]
157
120
 
158
121
  ## Context
159
- [Situation/problem requiring a decision. 1-2 sentences.]
122
+ [Problem. 1-2 sentences.]
160
123
 
161
124
  ## Decision
162
- [What was decided. 1 sentence.]
125
+ [What decided. 1 sentence.]
163
126
 
164
127
  ## Rationale
165
- [Why this decision over alternatives. Key benefits. 2-3 bullet points.]
128
+ - [Key benefit 1]
129
+ - [Key benefit 2]
166
130
 
167
131
  ## Consequences
168
- **Positive:**
169
- - [Benefit 1]
170
- - [Benefit 2]
171
-
172
- **Negative:**
173
- - [Drawback 1]
174
- - [Drawback 2]
132
+ **Positive:** [Benefits]
133
+ **Negative:** [Drawbacks]
175
134
 
176
135
  ## References
177
- <!-- VERIFY: Links exist -->
178
- - Implementation: `src/path/to/code.ts`
179
- - Related PR: #123 (if applicable)
136
+ <!-- VERIFY: src/path/ -->
137
+ - Implementation: `src/path/`
180
138
  - Supersedes: ADR-XXX (if applicable)
181
139
  ```
182
140
 
183
- **Keep <200 words total.**
141
+ **<200 words total.**
142
+
143
+ **Create when:**
144
+ - 2+ significant alternatives
145
+ - Long-term impact
146
+ - Non-obvious trade-offs
147
+ - "Why did they do this?" question
148
+
149
+ **Don't create for:** Obvious/temporary/trivial choices.
150
+
151
+ **Quick test:** Matters in 6 months? → ADR. Otherwise skip.
184
152
 
185
153
  ---
186
154
 
187
155
  ## SSOT Discipline
188
156
 
189
- **Never duplicate. Always reference.**
190
-
191
- ### ❌ Bad (Duplication - Will Drift)
157
+ Never duplicate. Always reference.
192
158
 
159
+ Reference format:
193
160
  ```markdown
194
- Dependencies:
195
- - react 19.2.0
196
- - zod 4.1.12
197
-
198
- Linting rules:
199
- - no-unused-vars
200
- - prefer-const
161
+ <!-- VERIFY: path/to/file -->
162
+ [Topic]: See `path/to/file`
201
163
  ```
202
164
 
203
- ### ✅ Good (Reference - SSOT Maintained)
204
-
165
+ **Examples:**
205
166
  ```markdown
206
- <!-- VERIFY: package.json exists -->
167
+ <!-- VERIFY: package.json -->
207
168
  Dependencies: See `package.json`
208
169
 
209
- <!-- VERIFY: biome.json exists -->
170
+ <!-- VERIFY: biome.json -->
210
171
  Linting: Biome (config in `biome.json`)
211
-
212
- ## Why Biome
213
- - Decision: ADR-003
214
- - Benefit: Single tool for format + lint
215
- - Trade-off: Smaller ecosystem than ESLint
216
- ```
217
-
218
- **Format for references:**
219
- ```markdown
220
- <!-- VERIFY: path/to/file.ts -->
221
- [Description]. See `path/to/file.ts`.
172
+ Why Biome: Single tool for format+lint. Trade-off: Smaller ecosystem. (ADR-003)
222
173
  ```
223
174
 
224
- Verification marker reminds: when file changes, check if doc needs update.
175
+ Marker `<!-- VERIFY: -->` = reminder to check on file changes.
225
176
 
226
177
  ---
227
178
 
228
- ## Maintenance Triggers
229
-
230
- ### On Every Task Start
231
-
232
- ```
233
- 1. Check .sylphx/ exists
234
- - No → Create with templates
235
- - Yes → Continue to verify
236
-
237
- 2. Read all .sylphx/ files
238
-
239
- 3. Verify accuracy:
240
- - Check <!-- VERIFY: --> markers
241
- - Confirm files exist
242
- - Check if still accurate vs code
243
-
244
- 4. Update or delete:
245
- - Wrong → Fix immediately
246
- - Outdated → Update or delete
247
- - Missing context → Add
248
-
249
- 5. Note gaps for later update
250
- ```
251
-
252
- ### During Task Execution
253
-
254
- **Triggers to update:**
179
+ ## Update Triggers
255
180
 
256
- - **New understanding** → Update context.md or architecture.md
257
- - **Architectural decision made** → Create ADR in decisions/
258
- - **New project-specific term** → Add to glossary.md
259
- - **Pattern adopted** → Document in architecture.md with WHY
260
- - **Constraint discovered** → Add to context.md
261
- - **Found outdated info** → Delete or update immediately
262
-
263
- ### Before Commit
264
-
265
- ```
266
- 1. Updated understanding? → Update .sylphx/
267
- 2. Made architectural change? → Create/update ADR
268
- 3. Deprecated approach? → Mark superseded or delete
269
- 4. Verify: No contradictions between .sylphx/ and code
270
- 5. Verify: All <!-- VERIFY: --> markers still valid
271
- ```
181
+ **New understanding** → Update context.md or architecture.md
182
+ **Architectural decision** → Create ADR
183
+ **Project-specific term** → Add to glossary.md
184
+ **Pattern adopted** → Document in architecture.md (WHY + trade-off)
185
+ **Constraint discovered** → Add to context.md
186
+ **Outdated info found** → Delete or fix immediately
272
187
 
273
188
  ---
274
189
 
275
190
  ## Content Rules
276
191
 
277
- ### ✅ Include (Macro-Level WHY)
278
-
279
- - Project purpose and context
192
+ ### ✅ Include (WHY)
193
+ - Project purpose, context
280
194
  - Architectural decisions (WHY chosen)
281
- - System boundaries (in/out of scope)
282
- - Key patterns (WHY used, trade-offs)
283
- - Project-specific terminology
195
+ - System boundaries
196
+ - Key patterns (WHY, trade-offs)
197
+ - Project-specific terms
284
198
  - Non-obvious constraints
285
199
 
286
- ### ❌ Exclude (Belongs Elsewhere)
287
-
288
- - API documentation JSDoc in code
289
- - Implementation detailsCode comments
290
- - Configuration values Config files
291
- - Dependency versions package.json
292
- - Code examples Actual code or tests
293
- - How-to guides → Code comments
294
- - Step-by-step processes → Code itself
200
+ ### ❌ Exclude (Elsewhere)
201
+ - API docs → JSDoc
202
+ - ImplementationCode comments
203
+ - Config valuesConfig files
204
+ - Versionspackage.json
205
+ - How-toCode
206
+ - Step-by-stepCode
295
207
 
296
- **Principle:** If it's in code or config, don't duplicate it here.
208
+ **If in code/config, don't duplicate.**
297
209
 
298
210
  ---
299
211
 
300
- ## Red Flags (Delete Immediately)
212
+ ## Red Flags
301
213
 
302
- Scan for these on every read:
214
+ Scan every read. Delete immediately:
303
215
 
304
216
  - ❌ "We plan to..." / "In the future..." (speculation)
305
- - ❌ "Currently using..." (implies might change - use present tense or delete)
306
- - ❌ Contradicts actual code
217
+ - ❌ "Currently using..." (implies change)
218
+ - ❌ Contradicts code
307
219
  - ❌ References non-existent files
308
- - ❌ Duplicates package.json / config
309
- - ❌ Explains HOW instead of WHY
310
- - ❌ Generic advice (not project-specific)
311
-
312
- **When found:** Delete entire section immediately.
313
-
314
- ---
315
-
316
- ## Cleanup Protocol
317
-
318
- **Monthly or after major changes:**
319
-
320
- ```bash
321
- # 1. Check all referenced files exist
322
- cd .sylphx
323
- grep -r "src/" . | grep -o 'src/[^`)]*' | sort -u > /tmp/refs.txt
324
- # Verify each file in refs.txt exists
325
-
326
- # 2. Check package.json references
327
- grep -r "package.json" .
328
- # Verify info isn't duplicated
329
-
330
- # 3. Check verification markers
331
- grep -r "<!-- VERIFY:" .
332
- # Check each marked file exists and content accurate
333
-
334
- # 4. Read all files
335
- # Delete outdated sections
336
- # Update inaccurate content
337
- # Remove speculation
338
- ```
339
-
340
- ---
341
-
342
- ## Decision Flow: Create ADR?
343
-
344
- **Create ADR when:**
345
- - Choosing between 2+ significant alternatives
346
- - Decision has long-term impact
347
- - Future developers will ask "why did they do this?"
348
- - Non-obvious trade-offs involved
349
-
350
- **Don't create ADR for:**
351
- - Obvious choices (use standard tool)
352
- - Temporary decisions (will change soon)
353
- - Implementation details (belongs in code comments)
354
- - Trivial choices (naming, formatting)
355
-
356
- **Quick test:** Will this decision matter in 6 months? Yes → ADR. No → Skip.
220
+ - ❌ Duplicates package.json/config
221
+ - ❌ Explains HOW not WHY
222
+ - ❌ Generic advice
357
223
 
358
224
  ---
359
225
 
360
- ## Verification Commands
361
-
362
- **Check links valid:**
363
- ```bash
364
- cd .sylphx
365
- # Extract all file references
366
- grep -roh '`[^`]*\.[a-z]*`' . | tr -d '`' | sort -u | while read f; do
367
- [ -f "../$f" ] || echo "MISSING: $f"
368
- done
369
- ```
370
-
371
- **Check for duplication:**
372
- ```bash
373
- # If package.json mentioned without "See package.json"
374
- grep -r "dependencies" .sylphx/ | grep -v "See \`package.json\`"
375
- # Should be empty or references only
376
- ```
377
-
378
- ---
379
-
380
- ## Examples
381
-
382
- ### Good context.md (Real Project)
383
-
384
- ```markdown
385
- # Project Context
386
-
387
- ## What
388
- AI-powered CLI for autonomous development workflows with agent orchestration.
389
-
390
- ## Why
391
- Enable developers to delegate complex multi-step tasks to AI that can plan, execute, verify autonomously while maintaining quality.
392
-
393
- ## Who
394
- Developers using Claude/AI for coding assistance.
395
-
396
- ## Status
397
- Active development - v1.2.0
398
- Focus: Agent prompt optimization
399
-
400
- ## Key Constraints
401
- - No breaking changes without major version
402
- - Research mandatory before implementation
403
- - All modules need .test.ts and .bench.ts
404
- - Clean commits only (no TODOs, debug code)
405
-
406
- ## Source of Truth
407
- <!-- VERIFY: packages/flow/package.json -->
408
- - Dependencies: `packages/flow/package.json`
409
- - Build: `package.json` scripts (root + packages/flow)
410
- - TypeScript: `packages/flow/tsconfig.json`
411
- ```
412
-
413
- ### Good architecture.md
414
-
415
- ```markdown
416
- # Architecture
417
-
418
- ## System Overview
419
- CLI loads agent prompts from markdown, composes with rules/output-styles, orchestrates multi-agent workflows.
420
-
421
- ## Key Components
422
- <!-- VERIFY: Paths exist -->
423
- - **Agent Loader** (`src/core/agent-loader.ts`): Parses markdown prompts
424
- - **Agent Manager** (`src/core/agent-manager.ts`): Orchestration
425
-
426
- ## Design Patterns
427
-
428
- ### Pattern: Markdown-as-Config
429
- **Why:** Human-readable, version-controlled, easy iteration
430
- **Where:** `assets/**/*.md` with frontmatter
431
- **Trade-off:** Parsing overhead vs flexibility (chose flexibility)
226
+ ## Verification
432
227
 
433
- ### Pattern: Minimal Effective Prompting
434
- **Why:** Trust LLM, reduce tokens 40%, increase clarity
435
- **Where:** All prompts (v1.2.0 refactor)
436
- **Trade-off:** Less explicit teaching vs more effective triggering
437
- **Decision:** ADR-002
438
- ```
439
-
440
- ### Good ADR
441
-
442
- ```markdown
443
- # 002. Minimal Effective Prompt Philosophy
228
+ **On every `.sylphx/` read:**
229
+ - Check `<!-- VERIFY: -->` markers files exist?
230
+ - Content accurate vs code?
231
+ - Wrong fix. Outdated update/delete.
444
232
 
445
- **Status:** Accepted
446
- **Date:** 2024-11-15
447
-
448
- ## Context
449
- Agent prompts were verbose with step-by-step teaching, reducing effectiveness and increasing cost.
450
-
451
- ## Decision
452
- Adopt MEP: Trust LLM, WHAT+WHEN not HOW+WHY, mixed formats, condensed.
453
-
454
- ## Rationale
455
- - 40% token reduction
456
- - Better LLM performance (less noise)
457
- - Easier maintenance
458
-
459
- ## Consequences
460
- **Positive:** Lower cost, better results, cleaner prompts
461
- **Negative:** Less explicit for human readers
462
-
463
- ## References
464
- <!-- VERIFY: commit exists -->
465
- - Implementation: All `assets/**/*.md` files
466
- - Refactor: commit c7795c0f
467
- ```
233
+ **Monthly or after major changes:**
234
+ - Verify all file references exist
235
+ - Check no duplication of package.json/config
236
+ - Verify all markers valid
237
+ - Delete outdated sections
468
238
 
469
239
  ---
470
240
 
471
- ## Summary
472
-
473
- **Agent behavior:**
474
- 1. **First task:** Check .sylphx/ exists → Create if missing → Populate with templates
475
- 2. **Every task start:** Read .sylphx/ → Verify accuracy → Update/delete as needed
476
- 3. **During work:** New understanding → Update immediately
477
- 4. **Before commit:** Verify .sylphx/ matches reality → No contradictions
478
-
479
- **Content:**
480
- - **Include:** WHY (context, decisions, rationale)
481
- - **Exclude:** HOW (implementation → code)
482
- - **Reference:** Link to SSOT, never duplicate
483
- - **Maintain:** Verify on read, update on learn, delete when wrong
241
+ ## Prime Directive
484
242
 
485
- **Prime Directive: Outdated docs worse than no docs. When in doubt, delete.**
243
+ **Outdated docs worse than no docs. When in doubt, delete.**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "1.4.16",
3
+ "version": "1.4.17",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {