@sylphx/flow 2.26.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 +6 -0
- package/assets/rules/core.md +1 -0
- package/package.json +1 -1
- package/src/core/flow-executor.ts +27 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
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
|
+
|
|
3
9
|
## 2.26.0 (2025-12-18)
|
|
4
10
|
|
|
5
11
|
### ✨ Features
|
package/assets/rules/core.md
CHANGED
|
@@ -124,6 +124,7 @@ Before accepting any approach:
|
|
|
124
124
|
- **Before significant work**, read:
|
|
125
125
|
- `PRODUCT.md` — Vision, goals, features, target users, success metrics
|
|
126
126
|
- `ARCHITECTURE.md` — Tech stack, patterns, decisions, system design
|
|
127
|
+
- **If files don't exist**, create them with appropriate structure for the project
|
|
127
128
|
- **Update immediately** when relevant changes happen
|
|
128
129
|
- Product doc = WHAT and WHY. Architecture doc = HOW.
|
|
129
130
|
- These docs are SSOT. Code is implementation detail.
|
package/package.json
CHANGED
|
@@ -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
|
*/
|