Skip to content

Commit ccdd323

Browse files
shobmanclaude
andcommitted
Fix scale folders: epic/, feature/, story/ are transparent groupings
Folders named exactly epic, feature, or story no longer create a Confluence page. Their contents are promoted to the parent level with the folder name applied as the scale label. Fixes: epic/ creating an unwanted parent page, missing epic/feature labels, and refs/ not publishing due to disrupted recursion flow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 04ec402 commit ccdd323

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/connectors/confluence/publish.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,17 +368,30 @@ async function publishDirectory(ctx, parentId, dirPath, depth, skipFile, fileSca
368368
await publishPage(ctx, parentId, childPages, title, body, labels);
369369
}
370370

371-
// Process subdirectories — each becomes a parent page
371+
// Process subdirectories
372+
const SCALE_FOLDERS = new Set(["epic", "feature", "story"]);
373+
372374
for (const subdir of subdirs) {
373-
const title = titleFromName(subdir);
374375
const subdirPath = join(dirPath, subdir);
375376

377+
// Scale-named folders (epic/, feature/, story/) are transparent groupings.
378+
// Contents promoted to parent level with the folder name as scale label.
379+
if (SCALE_FOLDERS.has(subdir)) {
380+
if (dryRun) {
381+
console.log("%s[%s/] promoting contents to parent", indent, subdir);
382+
}
383+
await publishDirectory(ctx, parentId, subdirPath, depth, null, subdir);
384+
continue;
385+
}
386+
387+
const title = titleFromName(subdir);
388+
376389
// Check for a matching .md body file INSIDE the subdirectory
377390
const bodyFileName = `${subdir}.md`;
378391
const subdirEntries = await readdir(subdirPath);
379392
const hasBody = subdirEntries.includes(bodyFileName);
380393

381-
// Folders with body files at root level are features
394+
// Folders with body files under epic scale are features
382395
const isFeature = fileScale === "epic" && hasBody;
383396

384397
let body;
@@ -402,7 +415,6 @@ async function publishDirectory(ctx, parentId, dirPath, depth, skipFile, fileSca
402415
// No matching .md — auto-generated page with Children Display macro
403416
labels = [subdir, "aidos"];
404417
body = `<h1>${title}</h1>${CHILDREN_MACRO}`;
405-
childScale = null;
406418
}
407419

408420
if (dryRun) {

0 commit comments

Comments
 (0)