cc-proficiency 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-plugin/plugin.json +11 -0
- package/LICENSE +201 -0
- package/README.md +345 -0
- package/README.zh-CN.md +284 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +543 -0
- package/dist/cli.js.map +1 -0
- package/dist/gist/uploader.d.ts +26 -0
- package/dist/gist/uploader.d.ts.map +1 -0
- package/dist/gist/uploader.js +99 -0
- package/dist/gist/uploader.js.map +1 -0
- package/dist/hooks/session-end.js +64 -0
- package/dist/i18n/locales.d.ts +30 -0
- package/dist/i18n/locales.d.ts.map +1 -0
- package/dist/i18n/locales.js +64 -0
- package/dist/i18n/locales.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/config-parser.d.ts +25 -0
- package/dist/parsers/config-parser.d.ts.map +1 -0
- package/dist/parsers/config-parser.js +262 -0
- package/dist/parsers/config-parser.js.map +1 -0
- package/dist/parsers/history-parser.d.ts +13 -0
- package/dist/parsers/history-parser.d.ts.map +1 -0
- package/dist/parsers/history-parser.js +50 -0
- package/dist/parsers/history-parser.js.map +1 -0
- package/dist/parsers/normalizer.d.ts +8 -0
- package/dist/parsers/normalizer.d.ts.map +1 -0
- package/dist/parsers/normalizer.js +105 -0
- package/dist/parsers/normalizer.js.map +1 -0
- package/dist/parsers/transcript-parser.d.ts +23 -0
- package/dist/parsers/transcript-parser.d.ts.map +1 -0
- package/dist/parsers/transcript-parser.js +112 -0
- package/dist/parsers/transcript-parser.js.map +1 -0
- package/dist/renderer/svg.d.ts +10 -0
- package/dist/renderer/svg.d.ts.map +1 -0
- package/dist/renderer/svg.js +209 -0
- package/dist/renderer/svg.js.map +1 -0
- package/dist/scoring/curves.d.ts +34 -0
- package/dist/scoring/curves.d.ts.map +1 -0
- package/dist/scoring/curves.js +60 -0
- package/dist/scoring/curves.js.map +1 -0
- package/dist/scoring/engine.d.ts +16 -0
- package/dist/scoring/engine.d.ts.map +1 -0
- package/dist/scoring/engine.js +137 -0
- package/dist/scoring/engine.js.map +1 -0
- package/dist/scoring/rule-engine.d.ts +30 -0
- package/dist/scoring/rule-engine.d.ts.map +1 -0
- package/dist/scoring/rule-engine.js +151 -0
- package/dist/scoring/rule-engine.js.map +1 -0
- package/dist/scoring/rules.d.ts +32 -0
- package/dist/scoring/rules.d.ts.map +1 -0
- package/dist/scoring/rules.js +443 -0
- package/dist/scoring/rules.js.map +1 -0
- package/dist/scoring/signals.d.ts +7 -0
- package/dist/scoring/signals.d.ts.map +1 -0
- package/dist/scoring/signals.js +245 -0
- package/dist/scoring/signals.js.map +1 -0
- package/dist/store/local-store.d.ts +12 -0
- package/dist/store/local-store.d.ts.map +1 -0
- package/dist/store/local-store.js +107 -0
- package/dist/store/local-store.js.map +1 -0
- package/dist/store/queue.d.ts +24 -0
- package/dist/store/queue.d.ts.map +1 -0
- package/dist/store/queue.js +105 -0
- package/dist/store/queue.js.map +1 -0
- package/dist/types.d.ts +264 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/ci-detect.d.ts +6 -0
- package/dist/utils/ci-detect.d.ts.map +1 -0
- package/dist/utils/ci-detect.js +19 -0
- package/dist/utils/ci-detect.js.map +1 -0
- package/hooks/hooks.json +15 -0
- package/hooks/session-end.ts +71 -0
- package/hooks/tsconfig.json +13 -0
- package/package.json +43 -0
- package/skills/proficiency/SKILL.md +15 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
export interface RawTranscriptEntry {
|
|
2
|
+
parentUuid: string | null;
|
|
3
|
+
isSidechain: boolean;
|
|
4
|
+
type: string;
|
|
5
|
+
uuid: string;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
cwd: string;
|
|
9
|
+
version: string;
|
|
10
|
+
gitBranch?: string;
|
|
11
|
+
slug?: string;
|
|
12
|
+
userType?: string;
|
|
13
|
+
permissionMode?: string;
|
|
14
|
+
promptId?: string;
|
|
15
|
+
message?: {
|
|
16
|
+
role: string;
|
|
17
|
+
model?: string;
|
|
18
|
+
content: string | ContentBlock[];
|
|
19
|
+
usage?: TokenUsage;
|
|
20
|
+
stop_reason?: string;
|
|
21
|
+
};
|
|
22
|
+
toolUseResult?: ToolUseResult;
|
|
23
|
+
data?: ProgressData;
|
|
24
|
+
subtype?: string;
|
|
25
|
+
hookCount?: number;
|
|
26
|
+
hookInfos?: Array<{
|
|
27
|
+
command: string;
|
|
28
|
+
durationMs: number;
|
|
29
|
+
}>;
|
|
30
|
+
preventedContinuation?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ContentBlock {
|
|
33
|
+
type: string;
|
|
34
|
+
text?: string;
|
|
35
|
+
id?: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
input?: Record<string, unknown>;
|
|
38
|
+
tool_use_id?: string;
|
|
39
|
+
content?: string | ContentBlock[];
|
|
40
|
+
is_error?: boolean;
|
|
41
|
+
caller?: {
|
|
42
|
+
type: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface TokenUsage {
|
|
46
|
+
input_tokens?: number;
|
|
47
|
+
cache_creation_input_tokens?: number;
|
|
48
|
+
cache_read_input_tokens?: number;
|
|
49
|
+
output_tokens?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface ProgressData {
|
|
52
|
+
type: string;
|
|
53
|
+
hookEvent?: string;
|
|
54
|
+
hookName?: string;
|
|
55
|
+
command?: string;
|
|
56
|
+
prompt?: string;
|
|
57
|
+
agentId?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ToolUseResult {
|
|
60
|
+
type?: string;
|
|
61
|
+
filePath?: string;
|
|
62
|
+
oldString?: string;
|
|
63
|
+
newString?: string;
|
|
64
|
+
structuredPatch?: unknown[];
|
|
65
|
+
userModified?: boolean;
|
|
66
|
+
replaceAll?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export type NormalizedEvent = UserPromptEvent | ToolCallEvent | ToolResultEvent | HookProgressEvent | SystemStopEvent | FileSnapshotEvent | UnknownEvent;
|
|
69
|
+
export interface UserPromptEvent {
|
|
70
|
+
kind: "user_prompt";
|
|
71
|
+
sessionId: string;
|
|
72
|
+
timestamp: string;
|
|
73
|
+
content: string;
|
|
74
|
+
permissionMode?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface ToolCallEvent {
|
|
77
|
+
kind: "tool_call";
|
|
78
|
+
sessionId: string;
|
|
79
|
+
timestamp: string;
|
|
80
|
+
toolName: string;
|
|
81
|
+
toolId: string;
|
|
82
|
+
input: Record<string, unknown>;
|
|
83
|
+
callerType?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ToolResultEvent {
|
|
86
|
+
kind: "tool_result";
|
|
87
|
+
sessionId: string;
|
|
88
|
+
timestamp: string;
|
|
89
|
+
toolId: string;
|
|
90
|
+
isError: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface HookProgressEvent {
|
|
93
|
+
kind: "hook_progress";
|
|
94
|
+
sessionId: string;
|
|
95
|
+
timestamp: string;
|
|
96
|
+
hookEvent: string;
|
|
97
|
+
hookName: string;
|
|
98
|
+
command: string;
|
|
99
|
+
}
|
|
100
|
+
export interface SystemStopEvent {
|
|
101
|
+
kind: "system_stop";
|
|
102
|
+
sessionId: string;
|
|
103
|
+
timestamp: string;
|
|
104
|
+
hookCount: number;
|
|
105
|
+
preventedContinuation: boolean;
|
|
106
|
+
}
|
|
107
|
+
export interface FileSnapshotEvent {
|
|
108
|
+
kind: "file_snapshot";
|
|
109
|
+
sessionId: string;
|
|
110
|
+
timestamp: string;
|
|
111
|
+
}
|
|
112
|
+
export interface UnknownEvent {
|
|
113
|
+
kind: "unknown";
|
|
114
|
+
sessionId: string;
|
|
115
|
+
timestamp: string;
|
|
116
|
+
rawType: string;
|
|
117
|
+
}
|
|
118
|
+
export interface ParsedSession {
|
|
119
|
+
sessionId: string;
|
|
120
|
+
startTime: string;
|
|
121
|
+
endTime: string;
|
|
122
|
+
project: string;
|
|
123
|
+
events: NormalizedEvent[];
|
|
124
|
+
version: string;
|
|
125
|
+
}
|
|
126
|
+
export interface ExtractedSignals {
|
|
127
|
+
ccMastery: CCMasterySignals;
|
|
128
|
+
toolMcp: ToolMcpSignals;
|
|
129
|
+
agentic: AgenticSignals;
|
|
130
|
+
promptCraft: PromptCraftSignals;
|
|
131
|
+
contextMgmt: ContextMgmtSignals;
|
|
132
|
+
outcomes: OutcomeSignals;
|
|
133
|
+
}
|
|
134
|
+
export interface CCMasterySignals {
|
|
135
|
+
hasGlobalClaudeMd: boolean;
|
|
136
|
+
globalClaudeMdHasImports: boolean;
|
|
137
|
+
projectClaudeMdCount: number;
|
|
138
|
+
hasCustomHooks: boolean;
|
|
139
|
+
hookWithMatcherCount: number;
|
|
140
|
+
pluginCount: number;
|
|
141
|
+
pluginsUsedInTranscripts: number;
|
|
142
|
+
uniqueSkillsUsed: number;
|
|
143
|
+
usedPlanMode: boolean;
|
|
144
|
+
hasRulesFiles: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface ToolMcpSignals {
|
|
147
|
+
uniqueToolsUsed: number;
|
|
148
|
+
uniqueMcpServersUsed: number;
|
|
149
|
+
lspToolCallCount: number;
|
|
150
|
+
deliberateWorkflowCount: number;
|
|
151
|
+
editSuccessRate: number;
|
|
152
|
+
totalToolCalls: number;
|
|
153
|
+
}
|
|
154
|
+
export interface AgenticSignals {
|
|
155
|
+
uniqueSubagentTypes: number;
|
|
156
|
+
totalSubagentCalls: number;
|
|
157
|
+
parallelToolCallCount: number;
|
|
158
|
+
usedWorktree: boolean;
|
|
159
|
+
multiSessionProjectCount: number;
|
|
160
|
+
usedTaskManagement: boolean;
|
|
161
|
+
}
|
|
162
|
+
export interface PromptCraftSignals {
|
|
163
|
+
structuredPromptRatio: number;
|
|
164
|
+
iterativeRefinementCount: number;
|
|
165
|
+
uniqueCommandsUsed: number;
|
|
166
|
+
contextProvisionCount: number;
|
|
167
|
+
totalPrompts: number;
|
|
168
|
+
}
|
|
169
|
+
export interface ContextMgmtSignals {
|
|
170
|
+
memoryFileCount: number;
|
|
171
|
+
activeMemoryFiles: number;
|
|
172
|
+
projectCount: number;
|
|
173
|
+
sessionCount: number;
|
|
174
|
+
sessionDurations: number[];
|
|
175
|
+
}
|
|
176
|
+
export interface OutcomeSignals {
|
|
177
|
+
editAcceptanceRate: number;
|
|
178
|
+
permissionModeProgression: number;
|
|
179
|
+
errorRecoveryRate: number;
|
|
180
|
+
repeatFailureRate: number;
|
|
181
|
+
}
|
|
182
|
+
export type DomainId = "cc-mastery" | "tool-mcp" | "agentic" | "prompt-craft" | "context-mgmt";
|
|
183
|
+
export type ConfidenceLevel = "low" | "medium" | "high";
|
|
184
|
+
export interface DomainScore {
|
|
185
|
+
id: DomainId;
|
|
186
|
+
label: string;
|
|
187
|
+
score: number;
|
|
188
|
+
weight: number;
|
|
189
|
+
confidence: ConfidenceLevel;
|
|
190
|
+
dataPoints: number;
|
|
191
|
+
}
|
|
192
|
+
export interface FeatureInventory {
|
|
193
|
+
hooks: Array<{
|
|
194
|
+
name: string;
|
|
195
|
+
count: number;
|
|
196
|
+
}>;
|
|
197
|
+
skills: Array<{
|
|
198
|
+
name: string;
|
|
199
|
+
count: number;
|
|
200
|
+
}>;
|
|
201
|
+
mcpServers: string[];
|
|
202
|
+
topTools: Array<{
|
|
203
|
+
name: string;
|
|
204
|
+
count: number;
|
|
205
|
+
}>;
|
|
206
|
+
totalToolCalls: number;
|
|
207
|
+
uniqueToolCount: number;
|
|
208
|
+
usedPlanMode: boolean;
|
|
209
|
+
hasMemory: boolean;
|
|
210
|
+
hasRules: boolean;
|
|
211
|
+
featureScores?: Record<string, number>;
|
|
212
|
+
}
|
|
213
|
+
export interface ProficiencyResult {
|
|
214
|
+
username: string;
|
|
215
|
+
timestamp: string;
|
|
216
|
+
domains: DomainScore[];
|
|
217
|
+
features: FeatureInventory;
|
|
218
|
+
sessionCount: number;
|
|
219
|
+
projectCount: number;
|
|
220
|
+
phase: "calibrating" | "early" | "full";
|
|
221
|
+
setupChecklist: SetupChecklist;
|
|
222
|
+
}
|
|
223
|
+
export interface SetupChecklist {
|
|
224
|
+
hasClaudeMd: boolean;
|
|
225
|
+
hasHooks: boolean;
|
|
226
|
+
hasPlugins: boolean;
|
|
227
|
+
hasMcpServers: boolean;
|
|
228
|
+
hasMemory: boolean;
|
|
229
|
+
hasRules: boolean;
|
|
230
|
+
}
|
|
231
|
+
export interface CCProficiencyConfig {
|
|
232
|
+
username?: string;
|
|
233
|
+
gistId?: string;
|
|
234
|
+
autoUpload: boolean;
|
|
235
|
+
public: boolean;
|
|
236
|
+
locale?: string;
|
|
237
|
+
}
|
|
238
|
+
export interface SessionSnapshot {
|
|
239
|
+
sessionId: string;
|
|
240
|
+
timestamp: string;
|
|
241
|
+
project: string;
|
|
242
|
+
signals: ExtractedSignals;
|
|
243
|
+
scoringVersion: string;
|
|
244
|
+
}
|
|
245
|
+
export interface LocalStore {
|
|
246
|
+
processedSessionIds: string[];
|
|
247
|
+
snapshots: SessionSnapshot[];
|
|
248
|
+
lastResult?: ProficiencyResult;
|
|
249
|
+
lastUpdated?: string;
|
|
250
|
+
}
|
|
251
|
+
export interface QueueEntry {
|
|
252
|
+
sessionId: string;
|
|
253
|
+
transcriptPath: string;
|
|
254
|
+
cwd: string;
|
|
255
|
+
timestamp: string;
|
|
256
|
+
}
|
|
257
|
+
export interface HistoryEntry {
|
|
258
|
+
display: string;
|
|
259
|
+
pastedContents: Record<string, unknown>;
|
|
260
|
+
timestamp: number;
|
|
261
|
+
project: string;
|
|
262
|
+
sessionId: string;
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot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AAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,uDAAuD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-detect.d.ts","sourceRoot":"","sources":["../../src/utils/ci-detect.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAYzC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isCIEnvironment = isCIEnvironment;
|
|
4
|
+
/**
|
|
5
|
+
* Detect if the current environment is CI/CD.
|
|
6
|
+
* CI sessions should be excluded from proficiency scoring.
|
|
7
|
+
*/
|
|
8
|
+
function isCIEnvironment() {
|
|
9
|
+
const env = process.env;
|
|
10
|
+
return !!(env.CI === "true" ||
|
|
11
|
+
env.GITHUB_ACTIONS === "true" ||
|
|
12
|
+
env.GITLAB_CI === "true" ||
|
|
13
|
+
env.JENKINS_URL ||
|
|
14
|
+
env.CODESPACES === "true" ||
|
|
15
|
+
env.BUILDKITE === "true" ||
|
|
16
|
+
env.CIRCLECI === "true" ||
|
|
17
|
+
env.TRAVIS === "true");
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ci-detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-detect.js","sourceRoot":"","sources":["../../src/utils/ci-detect.ts"],"names":[],"mappings":";;AAIA,0CAYC;AAhBD;;;GAGG;AACH,SAAgB,eAAe;IAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB,OAAO,CAAC,CAAC,CACP,GAAG,CAAC,EAAE,KAAK,MAAM;QACjB,GAAG,CAAC,cAAc,KAAK,MAAM;QAC7B,GAAG,CAAC,SAAS,KAAK,MAAM;QACxB,GAAG,CAAC,WAAW;QACf,GAAG,CAAC,UAAU,KAAK,MAAM;QACzB,GAAG,CAAC,SAAS,KAAK,MAAM;QACxB,GAAG,CAAC,QAAQ,KAAK,MAAM;QACvB,GAAG,CAAC,MAAM,KAAK,MAAM,CACtB,CAAC;AACJ,CAAC"}
|
package/hooks/hooks.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stop hook for cc-proficiency.
|
|
5
|
+
* Reads session info from stdin, appends to queue, spawns processor.
|
|
6
|
+
* Must exit 0 in <1 second.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { spawn } from "node:child_process";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { homedir } from "node:os";
|
|
12
|
+
import { appendFileSync, existsSync, mkdirSync } from "node:fs";
|
|
13
|
+
|
|
14
|
+
const STORE_DIR = join(homedir(), ".cc-proficiency");
|
|
15
|
+
const QUEUE_FILE = join(STORE_DIR, "queue.jsonl");
|
|
16
|
+
|
|
17
|
+
// CI/CD detection — skip if non-interactive
|
|
18
|
+
const CI_VARS = ["CI", "GITHUB_ACTIONS", "GITLAB_CI", "CODESPACES", "BUILDKITE", "CIRCLECI", "TRAVIS"];
|
|
19
|
+
if (CI_VARS.some((v) => process.env[v] === "true") || process.env.JENKINS_URL) {
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Read stdin (hook payload)
|
|
24
|
+
let input = "";
|
|
25
|
+
process.stdin.setEncoding("utf-8");
|
|
26
|
+
process.stdin.on("data", (chunk) => { input += chunk; });
|
|
27
|
+
process.stdin.on("end", () => {
|
|
28
|
+
try {
|
|
29
|
+
const payload = JSON.parse(input);
|
|
30
|
+
const entry = {
|
|
31
|
+
sessionId: payload.session_id ?? "",
|
|
32
|
+
transcriptPath: payload.transcript_path ?? "",
|
|
33
|
+
cwd: payload.cwd ?? "",
|
|
34
|
+
timestamp: new Date().toISOString(),
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (!entry.sessionId || !entry.transcriptPath) {
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Ensure store dir
|
|
42
|
+
if (!existsSync(STORE_DIR)) {
|
|
43
|
+
mkdirSync(STORE_DIR, { recursive: true });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Append to queue
|
|
47
|
+
appendFileSync(QUEUE_FILE, JSON.stringify(entry) + "\n", "utf-8");
|
|
48
|
+
|
|
49
|
+
// Spawn processor as detached child (fire-and-forget)
|
|
50
|
+
try {
|
|
51
|
+
// When compiled: dist/hooks/session-end.js → dist/cli.js is at ../cli.js
|
|
52
|
+
const processorPath = join(__dirname, "..", "cli.js");
|
|
53
|
+
if (existsSync(processorPath)) {
|
|
54
|
+
const child = spawn("node", [processorPath, "process"], {
|
|
55
|
+
detached: true,
|
|
56
|
+
stdio: "ignore",
|
|
57
|
+
});
|
|
58
|
+
child.unref();
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
// Processor spawn failed — user can run manually
|
|
62
|
+
}
|
|
63
|
+
} catch {
|
|
64
|
+
// Invalid JSON or other error — exit cleanly
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
process.exit(0);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Timeout safety — exit after 4 seconds regardless
|
|
71
|
+
setTimeout(() => process.exit(0), 4000);
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cc-proficiency",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Claude Code proficiency badge generator — analyze usage patterns across 5 domains aligned with Claude Certified Architect",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"cc-proficiency": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc && tsc -p hooks/tsconfig.json",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:watch": "vitest",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"lint": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18.0.0"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/",
|
|
22
|
+
"hooks/",
|
|
23
|
+
".claude-plugin/",
|
|
24
|
+
"skills/",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"claude-code",
|
|
29
|
+
"proficiency",
|
|
30
|
+
"badge",
|
|
31
|
+
"analytics",
|
|
32
|
+
"certification",
|
|
33
|
+
"architect",
|
|
34
|
+
"svg"
|
|
35
|
+
],
|
|
36
|
+
"license": "Apache-2.0",
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^22.0.0",
|
|
39
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
40
|
+
"typescript": "^5.7.0",
|
|
41
|
+
"vitest": "^3.0.0"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Proficiency Badge
|
|
2
|
+
|
|
3
|
+
Analyze your Claude Code usage and display proficiency scores.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Run `/proficiency` to see your current proficiency scores across 5 domains aligned with the Claude Certified Architect exam.
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
1. Run `cc-proficiency analyze --full` via Bash to compute scores from all sessions
|
|
12
|
+
2. Display the results to the user
|
|
13
|
+
3. Run `cc-proficiency explain` via Bash to show improvement tips
|
|
14
|
+
4. If the user wants to generate/update their badge, run `cc-proficiency badge`
|
|
15
|
+
5. If the user wants to push to GitHub, run `cc-proficiency push`
|