skill-creator 1.2.2 → 1.3.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/README.md +86 -67
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +84 -64
- package/dist/cli.js.map +1 -1
- package/dist/commands/createSkill.d.ts +6 -0
- package/dist/commands/createSkill.d.ts.map +1 -0
- package/dist/commands/createSkill.js +32 -0
- package/dist/commands/createSkill.js.map +1 -0
- package/dist/commands/downloadContext7.js +1 -1
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +2 -12
- package/dist/commands/shared.js.map +1 -1
- package/dist/core/searchEngineFactory.js +2 -2
- package/dist/core/searchEngineFactory.js.map +1 -1
- package/dist/core/skillCreator.d.ts +0 -1
- package/dist/core/skillCreator.d.ts.map +1 -1
- package/dist/core/skillCreator.js +9 -54
- package/dist/core/skillCreator.js.map +1 -1
- package/dist/types/index.d.ts +5 -15
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +1 -1
- package/dist/utils/config.d.ts +3 -15
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +2 -11
- package/dist/utils/config.js.map +1 -1
- package/package.json +15 -9
- package/templates/SKILL.md +2 -25
- package/templates/SKILL.zh-CN.md +2 -25
- package/templates/skill-creator.md +1 -1
- package/templates/skill-creator.zh-CN.md +6 -6
- package/dist/core/templateManager.d.ts +0 -28
- package/dist/core/templateManager.d.ts.map +0 -1
- package/dist/core/templateManager.js +0 -583
- package/dist/core/templateManager.js.map +0 -1
- package/dist/utils/claudeCodeDetection.d.ts +0 -27
- package/dist/utils/claudeCodeDetection.d.ts.map +0 -1
- package/dist/utils/claudeCodeDetection.js +0 -81
- package/dist/utils/claudeCodeDetection.js.map +0 -1
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions to detect Claude Code environment and bypass-permissions mode
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Detect if running within Claude Code environment
|
|
6
|
-
*/
|
|
7
|
-
export function isClaudeCodeEnvironment() {
|
|
8
|
-
return !!process.env.CLAUDE_CODE_SSE_PORT;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Try to detect if Claude Code is in bypass-permissions mode
|
|
12
|
-
*
|
|
13
|
-
* Since Claude Code may not directly expose this information, we use several heuristics:
|
|
14
|
-
* 1. Check for Claude Code environment variables
|
|
15
|
-
* 2. Check for non-interactive session indicators
|
|
16
|
-
* 3. Check for specific Claude Code bypass mode patterns
|
|
17
|
-
*/
|
|
18
|
-
export function detectClaudeCodeBypassMode() {
|
|
19
|
-
// Method 1: Check if we're in Claude Code environment
|
|
20
|
-
if (!isClaudeCodeEnvironment()) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
// Method 2: Check for specific environment variables that might indicate bypass mode
|
|
24
|
-
// (These are potential variables Claude Code might set in bypass mode)
|
|
25
|
-
const bypassIndicators = [
|
|
26
|
-
'CLAUDE_CODE_BYPASS_PERMISSIONS',
|
|
27
|
-
'CLAUDE_CODE_NON_INTERACTIVE',
|
|
28
|
-
'CLAUDE_CODE_AUTO_MODE',
|
|
29
|
-
'CLAUDE_CODE_BYPASS_MODE'
|
|
30
|
-
];
|
|
31
|
-
for (const indicator of bypassIndicators) {
|
|
32
|
-
if (process.env[indicator]) {
|
|
33
|
-
const value = process.env[indicator].toLowerCase();
|
|
34
|
-
if (value === 'true' || value === '1' || value === 'yes') {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// Method 3: Check for non-interactive session indicators
|
|
40
|
-
const nonInteractiveIndicators = [
|
|
41
|
-
'CI', // Continuous Integration
|
|
42
|
-
'AUTOMATION', // Automation environment
|
|
43
|
-
'NON_INTERACTIVE', // General non-interactive flag
|
|
44
|
-
];
|
|
45
|
-
for (const indicator of nonInteractiveIndicators) {
|
|
46
|
-
if (process.env[indicator]) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// Method 4: Check if stdin is not a TTY (indicating non-interactive)
|
|
51
|
-
try {
|
|
52
|
-
if (!process.stdin.isTTY && isClaudeCodeEnvironment()) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
// Ignore errors checking TTY
|
|
58
|
-
}
|
|
59
|
-
// Method 5: Heuristic based on Claude Code SSE port and lack of TTY
|
|
60
|
-
// If we're in Claude Code but not in an interactive terminal,
|
|
61
|
-
// it might be in bypass mode
|
|
62
|
-
if (isClaudeCodeEnvironment() && !process.stdout.isTTY) {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Get Claude Code environment information
|
|
69
|
-
*/
|
|
70
|
-
export function getClaudeCodeInfo() {
|
|
71
|
-
return {
|
|
72
|
-
isClaudeCode: isClaudeCodeEnvironment(),
|
|
73
|
-
ssePort: process.env.CLAUDE_CODE_SSE_PORT,
|
|
74
|
-
bypassMode: detectClaudeCodeBypassMode(),
|
|
75
|
-
isTTY: !!(process.stdin.isTTY && process.stdout.isTTY),
|
|
76
|
-
environment: Object.fromEntries(Object.entries(process.env).filter(([key]) => key.startsWith('CLAUDE_CODE') ||
|
|
77
|
-
key.includes('BYPASS') ||
|
|
78
|
-
key.includes('PERMISSION')))
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=claudeCodeDetection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claudeCodeDetection.js","sourceRoot":"","sources":["../../src/utils/claudeCodeDetection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAA;AAC3C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