@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.
@@ -1,485 +1,264 @@
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, delete outdated.
11
11
 
12
- **NoCreate structure:**
13
- ```bash
14
- mkdir -p .sylphx/decisions
15
- ```
12
+ **Task start:** Read `.sylphx/context.md`. Verify VERIFY markers. Drift fix immediately (see Drift Resolution).
13
+
14
+ **During work:** New understanding/decision/term → update `.sylphx/` immediately.
15
+
16
+ **Before commit:** `.sylphx/` matches code. No contradictions. All markers valid.
17
+
18
+ ---
19
+
20
+ ## File Structure
16
21
 
17
- Create files with templates below. Populate with project-specific content.
22
+ ```
23
+ .sylphx/
24
+ context.md # Internal context, constraints, boundaries
25
+ architecture.md # System overview, patterns (WHY), trade-offs
26
+ glossary.md # Project-specific terms only
27
+ decisions/
28
+ README.md # ADR index
29
+ NNN-title.md # Individual ADRs
30
+ ```
18
31
 
19
- **YesVerify:**
20
- - Read all files
21
- - Check accuracy vs actual code
22
- - Update or delete outdated sections
32
+ Missingcreate with templates below.
23
33
 
24
34
  ---
25
35
 
26
- ## Structure & Templates
36
+ ## Templates
27
37
 
28
- ### .sylphx/context.md
38
+ ### context.md
29
39
 
30
- **Create when:** First task, or when missing
31
- **Update when:** Project scope/purpose/constraints change
40
+ Internal context only. Public info README.md.
32
41
 
33
42
  ```markdown
34
43
  # Project Context
35
44
 
36
- ## What
37
- [1-2 sentence description of what this project is]
45
+ ## What (Internal)
46
+ [Project scope, internal boundaries, target use cases]
38
47
 
39
- ## Why
40
- [Problem being solved, user need addressed]
48
+ ## Why (Business/Internal)
49
+ [Business context, internal motivation, market gap]
41
50
 
42
- ## Who
43
- [Target users, primary use cases]
51
+ ## Key Constraints
52
+ <!-- Non-negotiable constraints affecting code decisions -->
53
+ - Technical: [e.g., "Bundle <5MB (Vercel edge)"]
54
+ - Business: [e.g., "Zero telemetry (enterprise security)"]
55
+ - Legal: [e.g., "GDPR compliant (EU market)"]
44
56
 
45
- ## Status
46
- [Development phase: Alpha/Beta/Stable, current version]
57
+ ## Boundaries
58
+ **In scope:** [What we build]
59
+ **Out of scope:** [What we don't]
47
60
 
48
- ## 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
61
+ ## SSOT References
62
+ <!-- VERIFY: package.json -->
63
+ - Dependencies: `package.json`
58
64
  ```
59
65
 
60
- **Verify:** Referenced files exist. If not, update or remove reference.
66
+ Update when: Scope/constraints/boundaries change.
61
67
 
62
68
  ---
63
69
 
64
- ### .sylphx/architecture.md
65
-
66
- **Create when:** First task, or when missing
67
- **Update when:** Architecture changes, patterns adopted, major refactoring
70
+ ### architecture.md
68
71
 
69
72
  ```markdown
70
73
  # Architecture
71
74
 
72
75
  ## System Overview
73
- [1-2 paragraph high-level description]
76
+ [1-2 paragraphs: structure, data flow, key decisions]
74
77
 
75
78
  ## Key Components
76
- <!-- VERIFY: Paths exist -->
77
- - **Component A** (`src/path/`): [Purpose, responsibility]
78
- - **Component B** (`src/path/`): [Purpose, responsibility]
79
+ <!-- VERIFY: src/path/ -->
80
+ - **Name** (`src/path/`): [Responsibility]
79
81
 
80
82
  ## Design Patterns
81
83
 
82
84
  ### 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.
85
+ **Why:** [Problem solved]
86
+ **Where:** `src/path/`
87
+ **Trade-off:** [Gained vs lost]
90
88
 
91
89
  ## Boundaries
92
- **In scope:** [What this project does]
93
- **Out of scope:** [What it explicitly doesn't do]
90
+ **In scope:** [What it does]
91
+ **Out of scope:** [What it doesn't]
94
92
  ```
95
93
 
96
- **Verify:** All paths exist. Patterns still used. Trade-offs still accurate.
94
+ Update when: Architecture changes, pattern adopted, major refactor.
97
95
 
98
96
  ---
99
97
 
100
- ### .sylphx/glossary.md
101
-
102
- **Create when:** First task, or when missing
103
- **Update when:** New project-specific term introduced
98
+ ### glossary.md
104
99
 
105
100
  ```markdown
106
101
  # Glossary
107
102
 
108
103
  ## [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.]
104
+ **Definition:** [Concise]
105
+ **Usage:** `src/path/`
106
+ **Context:** [When/why matters]
116
107
  ```
117
108
 
118
- **Verify:** Terms still used. Usage references exist.
119
-
120
- ---
121
-
122
- ### .sylphx/decisions/README.md
123
-
124
- **Create when:** First ADR created
125
- **Update when:** New ADR added
126
-
127
- ```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
- ```
109
+ Update when: New project-specific term. Skip: General programming concepts.
143
110
 
144
111
  ---
145
112
 
146
- ### .sylphx/decisions/NNN-title.md
147
-
148
- **Create when:** Making architectural decision
149
- **Update when:** Decision status changes or is superseded
113
+ ### decisions/NNN-title.md
150
114
 
151
115
  ```markdown
152
- # NNN. [Title - Verb + Object, e.g., "Use Bun as Package Manager"]
116
+ # NNN. [Verb + Object]
153
117
 
154
- **Status:** ✅ Accepted
118
+ **Status:** ✅ Accepted | 🚧 Proposed | ❌ Rejected | 📦 Superseded
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.**
184
-
185
- ---
186
-
187
- ## SSOT Discipline
188
-
189
- **Never duplicate. Always reference.**
190
-
191
- ### ❌ Bad (Duplication - Will Drift)
192
-
193
- ```markdown
194
- Dependencies:
195
- - react 19.2.0
196
- - zod 4.1.12
197
-
198
- Linting rules:
199
- - no-unused-vars
200
- - prefer-const
201
- ```
202
-
203
- ### ✅ Good (Reference - SSOT Maintained)
141
+ **<200 words total.**
204
142
 
205
- ```markdown
206
- <!-- VERIFY: package.json exists -->
207
- Dependencies: See `package.json`
143
+ **Create ADR when:**
144
+ - Difficult to reverse (schema, architecture)
145
+ - Affects >3 major components
146
+ - Security/compliance decision
147
+ - 2+ significant alternatives
148
+ - Team will ask "why?"
208
149
 
209
- <!-- VERIFY: biome.json exists -->
210
- Linting: Biome (config in `biome.json`)
150
+ **Don't create for:** Framework patterns, best practices, temporary solutions, single-file changes.
211
151
 
212
- ## Why Biome
213
- - Decision: ADR-003
214
- - Benefit: Single tool for format + lint
215
- - Trade-off: Smaller ecosystem than ESLint
152
+ **Decision tree:**
216
153
  ```
217
-
218
- **Format for references:**
219
- ```markdown
220
- <!-- VERIFY: path/to/file.ts -->
221
- [Description]. See `path/to/file.ts`.
154
+ Can reverse in <1 day? → No ADR
155
+ Clear best practice? → No ADR
156
+ Affects architecture? → ADR
157
+ Trade-offs worth documenting? → ADR
222
158
  ```
223
159
 
224
- Verification marker reminds: when file changes, check if doc needs update.
225
-
226
160
  ---
227
161
 
228
- ## Maintenance Triggers
162
+ ## SSOT Discipline
229
163
 
230
- ### On Every Task Start
164
+ Never duplicate. Always reference.
231
165
 
166
+ ```markdown
167
+ <!-- VERIFY: path/to/file -->
168
+ [Topic]: See `path/to/file`
232
169
  ```
233
- 1. Check .sylphx/ exists
234
- - No → Create with templates
235
- - Yes → Continue to verify
236
170
 
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
171
+ **Example:**
172
+ ```markdown
173
+ <!-- VERIFY: package.json -->
174
+ Dependencies: `package.json`
248
175
 
249
- 5. Note gaps for later update
176
+ <!-- VERIFY: biome.json -->
177
+ Linting: Biome. WHY: Single tool for format+lint. Trade-off: Smaller ecosystem. (ADR-003)
250
178
  ```
251
179
 
252
- ### During Task Execution
253
-
254
- **Triggers to update:**
255
-
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
- ```
180
+ VERIFY marker = check on file changes.
272
181
 
273
182
  ---
274
183
 
275
- ## Content Rules
276
-
277
- ### ✅ Include (Macro-Level WHY)
278
-
279
- - Project purpose and context
280
- - Architectural decisions (WHY chosen)
281
- - System boundaries (in/out of scope)
282
- - Key patterns (WHY used, trade-offs)
283
- - Project-specific terminology
284
- - Non-obvious constraints
285
-
286
- ### ❌ Exclude (Belongs Elsewhere)
184
+ ## Update Triggers
287
185
 
288
- - API documentationJSDoc in code
289
- - Implementation details → Code 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
295
-
296
- **Principle:** If it's in code or config, don't duplicate it here.
186
+ New understanding → context.md/architecture.md. Architectural decision → ADR. Project term → glossary.md. Pattern adopted → architecture.md (WHY + trade-off). Constraint context.md. Outdated delete/fix immediately.
297
187
 
298
188
  ---
299
189
 
300
- ## Red Flags (Delete Immediately)
190
+ ## Content Rules
301
191
 
302
- Scan for these on every read:
192
+ ### Include (WHY + Internal)
193
+ - context.md: Business context, constraints, scope
194
+ - architecture.md: Design decisions (WHY), patterns, trade-offs
195
+ - glossary.md: Project-specific terms
196
+ - ADRs: Significant decisions with alternatives
303
197
 
304
- -"We plan to..." / "In the future..." (speculation)
305
- - "Currently using..." (implies might change - use present tense or delete)
306
- - Contradicts actual code
307
- - References non-existent files
308
- - Duplicates package.json / config
309
- - Explains HOW instead of WHY
310
- - Generic advice (not project-specific)
198
+ ###Exclude (Elsewhere)
199
+ - Public info README.md
200
+ - API docs JSDoc/TSDoc
201
+ - Implementation Code comments
202
+ - Config Config files
203
+ - Versions/deps package.json
204
+ - How-to Code/docs site
311
205
 
312
- **When found:** Delete entire section immediately.
206
+ Internal context only. No duplication.
313
207
 
314
208
  ---
315
209
 
316
- ## Cleanup Protocol
210
+ ## Red Flags
317
211
 
318
- **Monthly or after major changes:**
212
+ Delete immediately:
319
213
 
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
- ```
214
+ - ❌ "We plan to..." / "In the future..."
215
+ - "Currently using..."
216
+ - ❌ Contradicts code
217
+ - Non-existent file references
218
+ - Duplicates package.json/config
219
+ - ❌ Explains HOW not WHY
220
+ - Generic advice
339
221
 
340
222
  ---
341
223
 
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)
224
+ ## Verification
355
225
 
356
- **Quick test:** Will this decision matter in 6 months? Yes ADR. No → Skip.
226
+ **Every `.sylphx/` read:** VERIFY markers valid. Content matches code. Wrongfix immediately.
357
227
 
358
- ---
359
-
360
- ## Verification Commands
361
-
362
- **Check links valid:**
228
+ **Automated:**
363
229
  ```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
230
+ bun run verify-docs # Check all VERIFY markers
376
231
  ```
377
232
 
378
233
  ---
379
234
 
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.
235
+ ## Drift Resolution
395
236
 
396
- ## Status
397
- Active development - v1.2.0
398
- Focus: Agent prompt optimization
237
+ **Detection triggers:**
238
+ - VERIFY marker → non-existent file
239
+ - Docs describe missing pattern
240
+ - Code has undocumented pattern
241
+ - Contradiction between .sylphx/ and code
399
242
 
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`
243
+ **Resolution hierarchy:**
411
244
  ```
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)
432
-
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
245
+ Code vs Docs:
246
+ ├─ WHAT/HOW → Code wins, update docs
247
+ ├─ WHY → Docs win if valid, else update both
248
+ └─ Both outdated → Research, fix both
438
249
  ```
439
250
 
440
- ### Good ADR
251
+ **Fix immediately:** Code evolved → update docs. Docs outdated → update/delete. File moved → update markers. Who detects = who fixes.
441
252
 
442
- ```markdown
443
- # 002. Minimal Effective Prompt Philosophy
253
+ **Document:** Architectural change → ADR. Pattern change → architecture.md. Constraint change → context.md.
444
254
 
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
- ```
255
+ **Examples:**
256
+ - File moved → update marker path
257
+ - Implementation changed → update docs + ADR
258
+ - Constraint violated → fix code or update constraint
468
259
 
469
260
  ---
470
261
 
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
262
+ ## Prime Directive
484
263
 
485
- **Prime Directive: Outdated docs worse than no docs. When in doubt, delete.**
264
+ **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.18",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {