@khanhcan148/mk 0.1.16 → 0.1.18
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 +4 -2
- package/package.json +1 -1
- package/src/commands/init.js +13 -7
- package/src/commands/update.js +455 -436
- package/src/lib/auth.js +7 -1
- package/src/lib/checksum.js +21 -6
- package/src/lib/concurrency.js +36 -0
- package/src/lib/constants.js +8 -0
- package/src/lib/copy.js +335 -331
package/README.md
CHANGED
|
@@ -81,6 +81,7 @@ cp -r .claude ~/.claude/
|
|
|
81
81
|
/mk-audit # Code archaeology chain: orientation, testing, heatmap, breaking-change analysis, technical debt, domain extraction
|
|
82
82
|
/mk-selftest # Self-validation checks on kit agents, skills, docs, workflows
|
|
83
83
|
/mk-log-analysis # Datadog + Azure App Insights log analysis with severity triage and Mermaid visual reports
|
|
84
|
+
/mk-wiki # Wiki management: staleness detection, batch refresh, bootstrap, stats, structural validation
|
|
84
85
|
```
|
|
85
86
|
|
|
86
87
|
## Structure
|
|
@@ -88,8 +89,8 @@ cp -r .claude ~/.claude/
|
|
|
88
89
|
```
|
|
89
90
|
├── .claude/
|
|
90
91
|
│ ├── agents/ # 32 agents (5 primary + 27 utility: implementers, quality, docs, specialized, concerns)
|
|
91
|
-
│ ├── skills/ #
|
|
92
|
-
│ │ ├── mk-*/ #
|
|
92
|
+
│ ├── skills/ # 67 skill packages (SKILL.md + scripts/references/assets)
|
|
93
|
+
│ │ ├── mk-*/ # 20 workflow commands (/mk-audit, /mk-brainstorm, /mk-log-analysis, /mk-overview, /mk-wiki, etc.)
|
|
93
94
|
│ │ └── ... # Domain skills (frontend, backend, testing, browser automation, etc.)
|
|
94
95
|
│ └── workflows/ # Development protocols
|
|
95
96
|
├── bin/ # CLI entry point (mk command)
|
|
@@ -139,6 +140,7 @@ User → /mk-* command (skill) → spawns utility agents → agents use knowledg
|
|
|
139
140
|
| `/mk-workflow` | Trace REST endpoint call chains with upstream caller detection, variant branching, side effects/feature flags, Mermaid diagrams |
|
|
140
141
|
| `/mk-log-analysis` | Analyze production logs from Datadog or Azure Application Insights via MCP; progressive severity triage, pattern detection, mandatory stack trace investigation, mk-debug integration |
|
|
141
142
|
| `/mk-selftest` | Run self-validation checks on kit agents, skills, docs, and workflows |
|
|
143
|
+
| `/mk-wiki` | Manage wiki health: staleness detection, batch refresh, bootstrap, stats, structural validation |
|
|
142
144
|
|
|
143
145
|
## Primary Agents
|
|
144
146
|
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -5,6 +5,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
import { copyKitFiles, mergeSettingsJson } from '../lib/copy.js';
|
|
6
6
|
import { writeManifest } from '../lib/manifest.js';
|
|
7
7
|
import { computeChecksum } from '../lib/checksum.js';
|
|
8
|
+
import { pLimit, DEFAULT_CONCURRENCY_CAP } from '../lib/concurrency.js';
|
|
8
9
|
import { resolveSourceDir, resolveTargetDir, resolveManifestPath } from '../lib/paths.js';
|
|
9
10
|
import { MANIFEST_FILENAME } from '../lib/constants.js';
|
|
10
11
|
import { resolveTokenOrLogin } from '../lib/auth.js';
|
|
@@ -59,13 +60,18 @@ export async function runInit(params = {}) {
|
|
|
59
60
|
'utf8'
|
|
60
61
|
));
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
// Compute checksums in bounded parallel — pLimit(cap=16) keeps concurrent
|
|
64
|
+
// file descriptors well under macOS default ulimit 256 so large installs
|
|
65
|
+
// never hit EMFILE. Output order matches input (see pLimit contract).
|
|
66
|
+
const existingEntries = fileList.filter(entry => existsSync(entry.absolutePath));
|
|
67
|
+
const fileChecksumEntries = await pLimit(
|
|
68
|
+
existingEntries.map((entry) => async () => {
|
|
69
|
+
const checksum = await computeChecksum(entry.absolutePath);
|
|
70
|
+
return [entry.relativePath, { checksum, size: entry.size }];
|
|
71
|
+
}),
|
|
72
|
+
DEFAULT_CONCURRENCY_CAP
|
|
73
|
+
);
|
|
74
|
+
const files = Object.fromEntries(fileChecksumEntries);
|
|
69
75
|
|
|
70
76
|
// Write manifest.
|
|
71
77
|
// Use explicitVersion when provided (e.g. release.version from initAction);
|