agileflow 2.96.1 → 2.96.2

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
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.96.2] - 2026-02-06
11
+
12
+ ### Fixed
13
+ - Smart docs folder detection for existing AgileFlow installations
14
+
10
15
  ## [2.96.1] - 2026-02-06
11
16
 
12
17
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agileflow",
3
- "version": "2.96.1",
3
+ "version": "2.96.2",
4
4
  "description": "AI-driven agile development system for Claude Code, Cursor, Windsurf, and more",
5
5
  "keywords": [
6
6
  "agile",
@@ -416,25 +416,45 @@ Document your CI/CD workflows and configuration here.
416
416
  return result;
417
417
  }
418
418
 
419
+ /**
420
+ * Check if a folder is an AgileFlow docs folder
421
+ * @param {string} folderPath - Path to check
422
+ * @returns {boolean} True if it's an AgileFlow docs folder
423
+ */
424
+ function isAgileFlowDocsFolder(folderPath) {
425
+ const metadataPath = path.join(folderPath, '00-meta', 'agileflow-metadata.json');
426
+ return fs.existsSync(metadataPath);
427
+ }
428
+
419
429
  /**
420
430
  * Get the docs folder name from metadata or default
431
+ * Checks both 'docs' and 'agileflow-docs' folders
421
432
  * @param {string} targetDir - Target directory
422
433
  * @returns {Promise<string>} Docs folder name
423
434
  */
424
435
  async function getDocsFolderName(targetDir) {
425
- try {
426
- const metadataPath = path.join(targetDir, 'docs', '00-meta', 'agileflow-metadata.json');
427
- if (fs.existsSync(metadataPath)) {
428
- const metadata = JSON.parse(await fs.readFile(metadataPath, 'utf8'));
429
- return metadata.docsFolder || 'docs';
436
+ // Check in order of preference: existing metadata, then probe folders
437
+ const candidateFolders = ['docs', 'agileflow-docs'];
438
+
439
+ for (const folder of candidateFolders) {
440
+ try {
441
+ const folderPath = path.join(targetDir, folder);
442
+ const metadataPath = path.join(folderPath, '00-meta', 'agileflow-metadata.json');
443
+ if (fs.existsSync(metadataPath)) {
444
+ const metadata = JSON.parse(await fs.readFile(metadataPath, 'utf8'));
445
+ return metadata.docsFolder || folder;
446
+ }
447
+ } catch (_err) {
448
+ // Continue to next candidate
430
449
  }
431
- } catch (err) {
432
- // Ignore errors, return default
433
450
  }
451
+
452
+ // No existing AgileFlow docs found, default to 'docs'
434
453
  return 'docs';
435
454
  }
436
455
 
437
456
  module.exports = {
438
457
  createDocsStructure,
439
458
  getDocsFolderName,
459
+ isAgileFlowDocsFolder,
440
460
  };
@@ -112,9 +112,15 @@ async function promptInstall() {
112
112
  // Always install to current directory
113
113
  const directory = path.resolve('.');
114
114
 
115
- // Check if docs/ folder already exists (conflict detection)
115
+ // Check if docs/ folder already exists and if it's an AgileFlow docs folder
116
116
  const defaultDocsFolder = 'docs';
117
- const docsExists = fs.existsSync(path.join(directory, defaultDocsFolder));
117
+ const docsPath = path.join(directory, defaultDocsFolder);
118
+ const docsExists = fs.existsSync(docsPath);
119
+
120
+ // Check if existing docs/ is an AgileFlow docs folder
121
+ // AgileFlow docs have 00-meta/agileflow-metadata.json
122
+ const isAgileFlowDocs =
123
+ docsExists && fs.existsSync(path.join(docsPath, '00-meta', 'agileflow-metadata.json'));
118
124
 
119
125
  // Build questions dynamically - only ask what's necessary
120
126
  const questions = [
@@ -132,12 +138,13 @@ async function promptInstall() {
132
138
  },
133
139
  ];
134
140
 
135
- // Only ask about docs folder if it already exists (potential conflict)
136
- if (docsExists) {
141
+ // Only ask about docs folder if it exists AND is not an AgileFlow folder
142
+ // If it's already an AgileFlow folder, reuse it silently
143
+ if (docsExists && !isAgileFlowDocs) {
137
144
  questions.push({
138
145
  type: 'input',
139
146
  name: 'docsFolder',
140
- message: `A 'docs/' folder already exists. Use a different name for AgileFlow docs?`,
147
+ message: `A 'docs/' folder already exists (not AgileFlow). Use a different name?`,
141
148
  default: 'agileflow-docs',
142
149
  validate: input => {
143
150
  if (!/^[a-zA-Z0-9._-]+$/.test(input)) {