shiftblame 0.1.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/.claude/agents/audit-reviewer.md +152 -0
- package/.claude/agents/feature-developer.md +83 -0
- package/.claude/agents/operations-engineer.md +128 -0
- package/.claude/agents/product-planner.md +65 -0
- package/.claude/agents/project-manager.md +67 -0
- package/.claude/agents/quality-assurance.md +73 -0
- package/.claude/agents/quality-control.md +89 -0
- package/.claude/agents/system-architect.md +69 -0
- package/.claude/commands/shiftblame-link.md +34 -0
- package/.claude/skills/secretary/SKILL.md +317 -0
- package/LICENSE +23 -0
- package/README.md +221 -0
- package/package.json +13 -0
- package/scripts/postinstall.js +51 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const { execSync } = require("child_process");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
|
|
5
|
+
const src = path.join(__dirname, "..", ".claude");
|
|
6
|
+
const isGlobal = Boolean(
|
|
7
|
+
process.env.npm_config_global === "true" ||
|
|
8
|
+
process.env.npm_config_prefix ===
|
|
9
|
+
execSync("npm config get prefix -g", { encoding: "utf8" }).trim()
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
if (isGlobal) {
|
|
13
|
+
const dest = path.join(require("os").homedir(), ".claude");
|
|
14
|
+
copyRecursive(src, dest);
|
|
15
|
+
console.log("shiftblame: user 級別安裝完成 → ~/.claude/");
|
|
16
|
+
} else {
|
|
17
|
+
const projectDir = findProjectRoot(process.cwd());
|
|
18
|
+
const dest = path.join(projectDir, ".claude");
|
|
19
|
+
copyRecursive(src, dest);
|
|
20
|
+
console.log(`shiftblame: repo 級別安裝完成 → ${dest}/`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
console.log("shiftblame: 請在目標 repo 中執行 /shiftblame-link 初始化鍋目錄");
|
|
24
|
+
|
|
25
|
+
function findProjectRoot(dir) {
|
|
26
|
+
let current = dir;
|
|
27
|
+
while (current !== path.dirname(current)) {
|
|
28
|
+
if (
|
|
29
|
+
fs.existsSync(path.join(current, "package.json")) &&
|
|
30
|
+
current !== path.join(__dirname, "..")
|
|
31
|
+
) {
|
|
32
|
+
return current;
|
|
33
|
+
}
|
|
34
|
+
current = path.dirname(current);
|
|
35
|
+
}
|
|
36
|
+
return process.env.INIT_CWD || process.cwd();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function copyRecursive(src, dest) {
|
|
40
|
+
if (!fs.existsSync(src)) return;
|
|
41
|
+
const stat = fs.statSync(src);
|
|
42
|
+
if (stat.isDirectory()) {
|
|
43
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
44
|
+
for (const entry of fs.readdirSync(src)) {
|
|
45
|
+
copyRecursive(path.join(src, entry), path.join(dest, entry));
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
49
|
+
fs.copyFileSync(src, dest);
|
|
50
|
+
}
|
|
51
|
+
}
|