@sylphx/flow 2.25.0 → 2.27.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,17 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 2.27.0 (2025-12-18)
4
+
5
+ ### ✨ Features
6
+
7
+ - **flow:** auto-create PRODUCT.md and ARCHITECTURE.md if missing ([3ae7db8](https://github.com/SylphxAI/flow/commit/3ae7db8770920422597ab073ba69b48248fd1f8b))
8
+
9
+ ## 2.26.0 (2025-12-18)
10
+
11
+ ### ✨ Features
12
+
13
+ - **rules:** add Project Context - PRODUCT.md and ARCHITECTURE.md ([cf7383f](https://github.com/SylphxAI/flow/commit/cf7383f1d8d4176dc605bc01e9ac3da6d3750af4))
14
+
3
15
  ## 2.25.0 (2025-12-18)
4
16
 
5
17
  ### ✨ Features
@@ -120,6 +120,15 @@ Before accepting any approach:
120
120
 
121
121
  **These actions are AUTOMATIC. Do without being asked.**
122
122
 
123
+ ### Project Context
124
+ - **Before significant work**, read:
125
+ - `PRODUCT.md` — Vision, goals, features, target users, success metrics
126
+ - `ARCHITECTURE.md` — Tech stack, patterns, decisions, system design
127
+ - **If files don't exist**, create them with appropriate structure for the project
128
+ - **Update immediately** when relevant changes happen
129
+ - Product doc = WHAT and WHY. Architecture doc = HOW.
130
+ - These docs are SSOT. Code is implementation detail.
131
+
123
132
  ### Task Management
124
133
  - Complex task (3+ steps) → Write todos immediately, update as you progress
125
134
  - Long conversation → Check git log + todos before continuing
@@ -0,0 +1,59 @@
1
+ # ARCHITECTURE
2
+
3
+ ## Tech Stack
4
+
5
+ | Layer | Technology | Why |
6
+ |-------|------------|-----|
7
+ | Frontend | ... | ... |
8
+ | Backend | ... | ... |
9
+ | Database | ... | ... |
10
+ | Auth | ... | ... |
11
+ | Payments | ... | ... |
12
+ | Hosting | ... | ... |
13
+
14
+ ## System Design
15
+
16
+ High-level architecture overview.
17
+
18
+ ```
19
+ [Diagram or description]
20
+ ```
21
+
22
+ ## Key Patterns
23
+
24
+ What patterns and conventions do we follow?
25
+
26
+ - **State management**: ...
27
+ - **API design**: ...
28
+ - **Error handling**: ...
29
+ - **Testing**: ...
30
+
31
+ ## Data Models
32
+
33
+ Core entities and relationships.
34
+
35
+ ## Integrations
36
+
37
+ External services and APIs.
38
+
39
+ | Service | Purpose | Notes |
40
+ |---------|---------|-------|
41
+ | ... | ... | ... |
42
+
43
+ ## Technical Decisions
44
+
45
+ Key decisions and rationale (ADRs).
46
+
47
+ ### Decision: [Title]
48
+ - **Context**: ...
49
+ - **Decision**: ...
50
+ - **Rationale**: ...
51
+ - **Consequences**: ...
52
+
53
+ ## Known Limitations
54
+
55
+ Technical debt, constraints, areas for improvement.
56
+
57
+ ---
58
+
59
+ *Last updated: YYYY-MM-DD*
@@ -0,0 +1,51 @@
1
+ # PRODUCT
2
+
3
+ ## Vision
4
+
5
+ What is this product? Why does it exist? What problem does it solve?
6
+
7
+ ## Success Metrics
8
+
9
+ How do we know we're winning?
10
+
11
+ - Revenue target?
12
+ - User growth?
13
+ - Engagement?
14
+ - Market position?
15
+
16
+ ## Target Users
17
+
18
+ Who are we building for? What are their pain points?
19
+
20
+ ## Value Propositions
21
+
22
+ Why would users choose this over alternatives?
23
+
24
+ ## Key Features
25
+
26
+ What are the core capabilities?
27
+
28
+ | Feature | Status | Priority |
29
+ |---------|--------|----------|
30
+ | ... | ... | ... |
31
+
32
+ ## Competitive Landscape
33
+
34
+ Who are the competitors? What's our differentiation?
35
+
36
+ ## Roadmap
37
+
38
+ What's next? What's the priority order?
39
+
40
+ ### Now
41
+ - ...
42
+
43
+ ### Next
44
+ - ...
45
+
46
+ ### Later
47
+ - ...
48
+
49
+ ---
50
+
51
+ *Last updated: YYYY-MM-DD*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "2.25.0",
3
+ "version": "2.27.0",
4
4
  "description": "One CLI to rule them all. Unified orchestration layer for AI coding assistants. Auto-detection, auto-installation, auto-upgrade.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -5,6 +5,9 @@
5
5
  */
6
6
 
7
7
  import chalk from 'chalk';
8
+ import { existsSync } from 'node:fs';
9
+ import fs from 'node:fs/promises';
10
+ import path from 'node:path';
8
11
  import type { Target } from '../types/target.types.js';
9
12
  import { AttachManager } from './attach-manager.js';
10
13
  import { BackupManager } from './backup-manager.js';
@@ -93,7 +96,8 @@ export class FlowExecutor {
93
96
  return { joined: true };
94
97
  }
95
98
 
96
- // First session - stash, backup, attach (all silent)
99
+ // First session - ensure project docs, stash, backup, attach (all silent)
100
+ await this.ensureProjectDocs(projectPath);
97
101
  await this.gitStashManager.stashSettingsChanges(projectPath);
98
102
  const backup = await this.backupManager.createBackup(projectPath, projectHash, target);
99
103
 
@@ -259,6 +263,28 @@ export class FlowExecutor {
259
263
  }
260
264
  }
261
265
 
266
+ /**
267
+ * Ensure PRODUCT.md and ARCHITECTURE.md exist in project root
268
+ * Creates from templates if missing
269
+ */
270
+ private async ensureProjectDocs(projectPath: string): Promise<void> {
271
+ const templatesDir = this.templateLoader.getAssetsDir();
272
+ const templates = [
273
+ { name: 'PRODUCT.md', template: path.join(templatesDir, 'templates', 'PRODUCT.md') },
274
+ { name: 'ARCHITECTURE.md', template: path.join(templatesDir, 'templates', 'ARCHITECTURE.md') },
275
+ ];
276
+
277
+ for (const { name, template } of templates) {
278
+ const targetPath = path.join(projectPath, name);
279
+
280
+ // Only create if file doesn't exist and template exists
281
+ if (!existsSync(targetPath) && existsSync(template)) {
282
+ const content = await fs.readFile(template, 'utf-8');
283
+ await fs.writeFile(targetPath, content, 'utf-8');
284
+ }
285
+ }
286
+ }
287
+
262
288
  /**
263
289
  * Cleanup after execution (silent)
264
290
  */