@phuc1403/musketeer 0.7.0 → 0.9.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 +49 -49
- package/manifest.json +333 -301
- package/package.json +1 -1
- package/template/.claude/agents/code-reviewer.md +182 -166
- package/template/.claude/hooks/git-skill-reminder.cjs +53 -0
- package/template/.claude/hooks/inject-design-docs.cjs +13 -13
- package/template/.claude/hooks/inject-ubiquitous-language.cjs +52 -0
- package/template/.claude/hooks/lib/colors.cjs +180 -122
- package/template/.claude/hooks/lib/transcript-parser.cjs +300 -277
- package/template/.claude/skills/code-review/SKILL.md +201 -54
- package/template/.claude/skills/code-review/references/checklist-workflow.md +96 -0
- package/template/.claude/skills/code-review/references/checklists/api.md +52 -52
- package/template/.claude/skills/code-review/references/checklists/base.md +100 -100
- package/template/.claude/skills/code-review/references/checklists/web-app.md +54 -54
- package/template/.claude/skills/code-review/references/code-review-reception.md +113 -0
- package/template/.claude/skills/code-review/references/codebase-scan-workflow.md +30 -0
- package/template/.claude/skills/code-review/references/edge-case-scouting.md +119 -0
- package/template/.claude/skills/code-review/references/input-mode-resolution.md +135 -0
- package/template/.claude/skills/code-review/references/parallel-review-workflow.md +76 -0
- package/template/.claude/skills/code-review/references/requesting-code-review.md +116 -0
- package/template/.claude/skills/code-review/references/spec-compliance-review.md +43 -0
- package/template/.claude/skills/code-review/references/task-management-reviews.md +140 -0
- package/template/.claude/skills/code-review/references/verification-before-completion.md +139 -0
- package/template/.claude/skills/context-map/SKILL.md +1 -1
- package/template/.claude/skills/git/SKILL.md +131 -115
- package/template/.claude/skills/git/references/branch-management.md +88 -88
- package/template/.claude/skills/git/references/commit-standards.md +46 -46
- package/template/.claude/skills/git/references/context-efficiency.md +54 -0
- package/template/.claude/skills/git/references/gh-cli-guide.md +109 -109
- package/template/.claude/skills/git/references/safety-protocols.md +69 -69
- package/template/.claude/skills/git/references/workflow-commit.md +58 -58
- package/template/.claude/skills/git/references/workflow-merge-pr.md +136 -0
- package/template/.claude/skills/git/references/workflow-merge.md +48 -48
- package/template/.claude/skills/git/references/workflow-pr.md +58 -58
- package/template/.claude/skills/git/references/workflow-push.md +52 -52
- package/template/.claude/skills/knowledge-crunching/SKILL.md +56 -92
- package/template/.claude/skills/knowledge-crunching/assets/ubiquitous-language.template.md +3 -0
- package/template/.claude/skills/skill-creator/LICENSE.txt +201 -201
- package/template/.claude/skills/skill-creator/SKILL.md +154 -149
- package/template/.claude/skills/skill-creator/agents/analyzer.md +274 -274
- package/template/.claude/skills/skill-creator/agents/comparator.md +202 -202
- package/template/.claude/skills/skill-creator/agents/grader.md +223 -223
- package/template/.claude/skills/skill-creator/assets/eval_review.html +146 -146
- package/template/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -471
- package/template/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -1325
- package/template/.claude/skills/skill-creator/references/benchmark-optimization-guide.md +86 -86
- package/template/.claude/skills/skill-creator/references/distribution-guide.md +79 -79
- package/template/.claude/skills/skill-creator/references/eval-infrastructure-guide.md +129 -129
- package/template/.claude/skills/skill-creator/references/eval-schemas.md +121 -121
- package/template/.claude/skills/skill-creator/references/mcp-skills-integration.md +71 -71
- package/template/.claude/skills/skill-creator/references/metadata-quality-criteria.md +94 -94
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-hosting.md +104 -104
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-overview.md +89 -89
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-schema.md +93 -93
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-sources.md +103 -103
- package/template/.claude/skills/skill-creator/references/plugin-marketplace-troubleshooting.md +76 -76
- package/template/.claude/skills/skill-creator/references/script-quality-criteria.md +106 -106
- package/template/.claude/skills/skill-creator/references/skill-anatomy-and-requirements.md +77 -77
- package/template/.claude/skills/skill-creator/references/skill-creation-workflow.md +152 -151
- package/template/.claude/skills/skill-creator/references/skill-design-patterns.md +75 -75
- package/template/.claude/skills/skill-creator/references/skillmark-benchmark-criteria.md +102 -102
- package/template/.claude/skills/skill-creator/references/structure-organization-criteria.md +114 -114
- package/template/.claude/skills/skill-creator/references/testing-and-iteration.md +78 -78
- package/template/.claude/skills/skill-creator/references/token-efficiency-criteria.md +74 -74
- package/template/.claude/skills/skill-creator/references/troubleshooting-guide.md +81 -81
- package/template/.claude/skills/skill-creator/references/validation-checklist.md +83 -83
- package/template/.claude/skills/skill-creator/references/writing-effective-instructions.md +88 -88
- package/template/.claude/skills/skill-creator/references/yaml-frontmatter-reference.md +92 -92
- package/template/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -401
- package/template/.claude/skills/skill-creator/scripts/encoding_utils.py +36 -36
- package/template/.claude/skills/skill-creator/scripts/generate_report.py +326 -326
- package/template/.claude/skills/skill-creator/scripts/improve_description.py +248 -248
- package/template/.claude/skills/skill-creator/scripts/init_skill.py +360 -360
- package/template/.claude/skills/skill-creator/scripts/package_skill.py +143 -143
- package/template/.claude/skills/skill-creator/scripts/quick_validate.py +110 -110
- package/template/.claude/skills/skill-creator/scripts/run_eval.py +310 -310
- package/template/.claude/skills/skill-creator/scripts/run_loop.py +332 -332
- package/template/.claude/skills/skill-creator/scripts/utils.py +47 -47
- package/template/.claude/statusline.cjs +0 -0
- package/template/.claude/hooks/inject-context.cjs +0 -52
- package/template/.claude/skills/code-review/references/adversarial-review.md +0 -223
- package/template/.claude/skills/knowledge-crunching/assets/context.template.md +0 -59
- package/template/.claude/skills/knowledge-crunching/references/crunching-dialogue.md +0 -113
- /package/template/.claude/hooks/{usage-context-awareness.cjs → usage-quota-cache-refresh.cjs} +0 -0
|
@@ -1,122 +1,180 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ANSI Terminal Colors - Cross-platform color support for statusline
|
|
6
|
-
* Supports NO_COLOR, FORCE_COLOR, COLORTERM auto-detection
|
|
7
|
-
* @module colors
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// ANSI escape codes (
|
|
11
|
-
const RESET = '\x1b[0m';
|
|
12
|
-
const DIM = '\x1b[2m';
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @
|
|
64
|
-
*/
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* @
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ANSI Terminal Colors - Cross-platform color support for statusline
|
|
6
|
+
* Supports NO_COLOR, FORCE_COLOR, COLORTERM auto-detection
|
|
7
|
+
* @module colors
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// ANSI escape codes (standard + bright palette)
|
|
11
|
+
const RESET = '\x1b[0m';
|
|
12
|
+
const DIM = '\x1b[2m';
|
|
13
|
+
const CLEAR_INTENSITY = '\x1b[22m';
|
|
14
|
+
const CLEAR_FOREGROUND = '\x1b[39m';
|
|
15
|
+
const RED = '\x1b[31m';
|
|
16
|
+
const GREEN = '\x1b[32m';
|
|
17
|
+
const YELLOW = '\x1b[33m';
|
|
18
|
+
const BLUE = '\x1b[34m';
|
|
19
|
+
const MAGENTA = '\x1b[35m';
|
|
20
|
+
const CYAN = '\x1b[36m';
|
|
21
|
+
const BRIGHT_RED = '\x1b[91m';
|
|
22
|
+
const BRIGHT_GREEN = '\x1b[92m';
|
|
23
|
+
const BRIGHT_YELLOW = '\x1b[93m';
|
|
24
|
+
const BRIGHT_BLUE = '\x1b[94m';
|
|
25
|
+
const BRIGHT_MAGENTA = '\x1b[95m';
|
|
26
|
+
const BRIGHT_CYAN = '\x1b[96m';
|
|
27
|
+
const BRIGHT_WHITE = '\x1b[97m';
|
|
28
|
+
const STABLE_PREFIX = `${CLEAR_INTENSITY}${CLEAR_FOREGROUND}`;
|
|
29
|
+
const STABLE_SUFFIX = `${RESET}${CLEAR_INTENSITY}${CLEAR_FOREGROUND}`;
|
|
30
|
+
const COLOR_CODES = {
|
|
31
|
+
green: GREEN,
|
|
32
|
+
yellow: YELLOW,
|
|
33
|
+
red: RED,
|
|
34
|
+
blue: BLUE,
|
|
35
|
+
cyan: CYAN,
|
|
36
|
+
magenta: MAGENTA,
|
|
37
|
+
dim: DIM,
|
|
38
|
+
brightRed: BRIGHT_RED,
|
|
39
|
+
brightGreen: BRIGHT_GREEN,
|
|
40
|
+
brightYellow: BRIGHT_YELLOW,
|
|
41
|
+
brightBlue: BRIGHT_BLUE,
|
|
42
|
+
brightMagenta: BRIGHT_MAGENTA,
|
|
43
|
+
brightCyan: BRIGHT_CYAN,
|
|
44
|
+
brightWhite: BRIGHT_WHITE,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Detect color support at module load (cached)
|
|
48
|
+
// Claude Code statusline runs via pipe but output displays in TTY - default to true
|
|
49
|
+
const shouldUseColor = (() => {
|
|
50
|
+
if (process.env.NO_COLOR) return false;
|
|
51
|
+
if (process.env.FORCE_COLOR) return true;
|
|
52
|
+
// Default true for statusline context (Claude Code handles TTY display)
|
|
53
|
+
return true;
|
|
54
|
+
})();
|
|
55
|
+
|
|
56
|
+
// Mutable override (set by statusline.cjs from config)
|
|
57
|
+
// null = use env detection, true/false = explicit override
|
|
58
|
+
let _colorOverride = null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Set explicit color enable/disable override (from config)
|
|
62
|
+
* Pass null to revert to env-var detection
|
|
63
|
+
* @param {boolean} enabled
|
|
64
|
+
*/
|
|
65
|
+
function setColorEnabled(enabled) {
|
|
66
|
+
_colorOverride = enabled;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Determine if colors should be rendered, respecting env vars and config override
|
|
71
|
+
* NO_COLOR env var always takes precedence over config override
|
|
72
|
+
* @returns {boolean}
|
|
73
|
+
*/
|
|
74
|
+
function isColorEnabled() {
|
|
75
|
+
// NO_COLOR env var is a hard override that always wins
|
|
76
|
+
if (process.env.NO_COLOR) return false;
|
|
77
|
+
if (_colorOverride !== null) return _colorOverride;
|
|
78
|
+
return shouldUseColor;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Detect 256-color support via COLORTERM
|
|
82
|
+
const has256Color = (() => {
|
|
83
|
+
const ct = process.env.COLORTERM;
|
|
84
|
+
return ct === 'truecolor' || ct === '24bit' || ct === '256color';
|
|
85
|
+
})();
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Wrap text with ANSI color code
|
|
89
|
+
* @param {string} text - Text to colorize
|
|
90
|
+
* @param {string} code - ANSI escape code
|
|
91
|
+
* @returns {string} Colorized text or plain text if colors disabled
|
|
92
|
+
*/
|
|
93
|
+
function colorize(text, code) {
|
|
94
|
+
if (!isColorEnabled() || !code) return String(text);
|
|
95
|
+
return `${STABLE_PREFIX}${code}${text}${STABLE_SUFFIX}`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function green(text) { return colorize(text, GREEN); }
|
|
99
|
+
function yellow(text) { return colorize(text, YELLOW); }
|
|
100
|
+
function red(text) { return colorize(text, RED); }
|
|
101
|
+
function blue(text) { return colorize(text, BLUE); }
|
|
102
|
+
function cyan(text) { return colorize(text, CYAN); }
|
|
103
|
+
function magenta(text) { return colorize(text, MAGENTA); }
|
|
104
|
+
function dim(text) { return colorize(text, DIM); }
|
|
105
|
+
function brightRed(text) { return colorize(text, BRIGHT_RED); }
|
|
106
|
+
function brightGreen(text) { return colorize(text, BRIGHT_GREEN); }
|
|
107
|
+
function brightYellow(text) { return colorize(text, BRIGHT_YELLOW); }
|
|
108
|
+
function brightBlue(text) { return colorize(text, BRIGHT_BLUE); }
|
|
109
|
+
function brightMagenta(text) { return colorize(text, BRIGHT_MAGENTA); }
|
|
110
|
+
function brightCyan(text) { return colorize(text, BRIGHT_CYAN); }
|
|
111
|
+
function brightWhite(text) { return colorize(text, BRIGHT_WHITE); }
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get color code based on context percentage threshold
|
|
115
|
+
* @param {number} percent - Context usage percentage (0-100)
|
|
116
|
+
* @returns {string} ANSI color code
|
|
117
|
+
*/
|
|
118
|
+
function resolveColorCode(colorName) {
|
|
119
|
+
if (colorName === 'white' || colorName === 'none' || colorName === 'default') return '';
|
|
120
|
+
return COLOR_CODES[colorName] || '';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function getContextColor(percent, palette = {}) {
|
|
124
|
+
const high = resolveColorCode(palette.high || 'red') || RED;
|
|
125
|
+
const mid = resolveColorCode(palette.mid || 'yellow') || YELLOW;
|
|
126
|
+
const low = resolveColorCode(palette.low || 'green') || GREEN;
|
|
127
|
+
if (percent >= 85) return high;
|
|
128
|
+
if (percent >= 70) return mid;
|
|
129
|
+
return low;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Generate colored progress bar for context window
|
|
134
|
+
* Uses ▰▱ characters (smooth horizontal rectangles) for consistent rendering
|
|
135
|
+
* @param {number} percent - Usage percentage (0-100)
|
|
136
|
+
* @param {number} width - Bar width in characters (default 12)
|
|
137
|
+
* @returns {string} Unicode progress bar with threshold-based colors
|
|
138
|
+
*/
|
|
139
|
+
function coloredBar(percent, width = 12, palette = {}) {
|
|
140
|
+
const clamped = Math.max(0, Math.min(100, percent));
|
|
141
|
+
const filled = Math.round((clamped / 100) * width);
|
|
142
|
+
const empty = width - filled;
|
|
143
|
+
|
|
144
|
+
if (!isColorEnabled()) {
|
|
145
|
+
return '▰'.repeat(filled) + '▱'.repeat(empty);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const color = getContextColor(percent, palette);
|
|
149
|
+
return `${STABLE_PREFIX}${color}${'▰'.repeat(filled)}${STABLE_PREFIX}${DIM}${'▱'.repeat(empty)}${STABLE_SUFFIX}`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Resolve a color name from theme config to its color function.
|
|
154
|
+
* Used by section renderers to apply theme-configurable colors.
|
|
155
|
+
* Falls back to identity function (no color) for unknown names.
|
|
156
|
+
* @param {string} colorName - Color name (e.g. "green", "yellow", "dim")
|
|
157
|
+
* @returns {Function} Color function (string) => string
|
|
158
|
+
*/
|
|
159
|
+
function resolveColor(colorName) {
|
|
160
|
+
const code = resolveColorCode(colorName);
|
|
161
|
+
return code ? (s) => colorize(s, code) : (s) => String(s);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
module.exports = {
|
|
165
|
+
RESET,
|
|
166
|
+
green,
|
|
167
|
+
yellow,
|
|
168
|
+
red,
|
|
169
|
+
cyan,
|
|
170
|
+
magenta,
|
|
171
|
+
dim,
|
|
172
|
+
getContextColor,
|
|
173
|
+
coloredBar,
|
|
174
|
+
shouldUseColor,
|
|
175
|
+
has256Color,
|
|
176
|
+
setColorEnabled,
|
|
177
|
+
isColorEnabled,
|
|
178
|
+
resolveColorCode,
|
|
179
|
+
resolveColor,
|
|
180
|
+
};
|