claude-orchestration 1.0.0 → 1.0.1
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/bin/cli.js +18 -13
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -37,7 +37,6 @@ if (process.argv.includes("--version") || process.argv.includes("-v")) {
|
|
|
37
37
|
|
|
38
38
|
const SOURCE_DIR = path.join(__dirname, "..", "templates", "claude");
|
|
39
39
|
const DEST_NAME = ".claude";
|
|
40
|
-
const CLAUDE_MD = "CLAUDE.md";
|
|
41
40
|
|
|
42
41
|
const ORCHESTRATION_INSTRUCTION = `
|
|
43
42
|
|
|
@@ -46,28 +45,34 @@ const ORCHESTRATION_INSTRUCTION = `
|
|
|
46
45
|
For complex tasks, refer to .claude/orchestration.md for available workflows.
|
|
47
46
|
`;
|
|
48
47
|
|
|
49
|
-
async function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
48
|
+
async function findClaudeMdFiles(projectDir) {
|
|
49
|
+
const entries = await fs.readdir(projectDir, { withFileTypes: true });
|
|
50
|
+
return entries
|
|
51
|
+
.filter((entry) => entry.isFile() && entry.name.toLowerCase() === "claude.md")
|
|
52
|
+
.map((entry) => entry.name);
|
|
56
53
|
}
|
|
57
54
|
|
|
58
55
|
async function updateClaudeMd(projectDir) {
|
|
59
|
-
const
|
|
56
|
+
const claudeMdFiles = await findClaudeMdFiles(projectDir);
|
|
57
|
+
|
|
58
|
+
if (claudeMdFiles.length === 0) {
|
|
59
|
+
const newFilePath = path.join(projectDir, "CLAUDE.md");
|
|
60
|
+
await fs.writeFile(newFilePath, `# CLAUDE.md${ORCHESTRATION_INSTRUCTION}`);
|
|
61
|
+
console.log(" Created: CLAUDE.md");
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
60
64
|
|
|
61
|
-
|
|
65
|
+
for (const fileName of claudeMdFiles) {
|
|
66
|
+
const claudeMdPath = path.join(projectDir, fileName);
|
|
62
67
|
const content = await fs.readFile(claudeMdPath, "utf-8");
|
|
63
68
|
|
|
64
69
|
if (content.includes(".claude/orchestration.md")) {
|
|
65
|
-
console.log(` Skipped: ${
|
|
66
|
-
|
|
70
|
+
console.log(` Skipped: ${fileName} already references orchestration.md`);
|
|
71
|
+
continue;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
await fs.appendFile(claudeMdPath, ORCHESTRATION_INSTRUCTION);
|
|
70
|
-
console.log(` Updated: ${
|
|
75
|
+
console.log(` Updated: ${fileName}`);
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
|