@harness-engineering/cli 1.25.7 → 1.26.1
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/dist/agents/skills/README.md +1 -0
- package/dist/agents/skills/claude-code/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/claude-code/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/claude-code/harness-knowledge-pipeline/SKILL.md +277 -0
- package/dist/agents/skills/claude-code/harness-knowledge-pipeline/skill.yaml +60 -0
- package/dist/agents/skills/claude-code/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/claude-code/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/claude-code/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/claude-code/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/claude-code/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/codex/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/codex/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/codex/harness-knowledge-pipeline/SKILL.md +277 -0
- package/dist/agents/skills/codex/harness-knowledge-pipeline/skill.yaml +60 -0
- package/dist/agents/skills/codex/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/codex/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/codex/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/codex/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/codex/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/cursor/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/cursor/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/cursor/harness-knowledge-pipeline/SKILL.md +277 -0
- package/dist/agents/skills/cursor/harness-knowledge-pipeline/skill.yaml +60 -0
- package/dist/agents/skills/cursor/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/cursor/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/cursor/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/cursor/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/cursor/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/gemini-cli/harness-brainstorming/SKILL.md +33 -5
- package/dist/agents/skills/gemini-cli/harness-execution/SKILL.md +6 -0
- package/dist/agents/skills/gemini-cli/harness-knowledge-pipeline/SKILL.md +277 -0
- package/dist/agents/skills/gemini-cli/harness-knowledge-pipeline/skill.yaml +60 -0
- package/dist/agents/skills/gemini-cli/harness-planning/SKILL.md +25 -1
- package/dist/agents/skills/gemini-cli/initialize-harness-project/SKILL.md +22 -6
- package/dist/agents/skills/gemini-cli/initialize-harness-project/skill.yaml +2 -1
- package/dist/agents/skills/gemini-cli/initialize-test-suite-project/SKILL.md +415 -0
- package/dist/agents/skills/gemini-cli/initialize-test-suite-project/skill.yaml +35 -0
- package/dist/agents/skills/package.json +2 -2
- package/dist/agents/skills/tests/initialize-test-suite-project.test.ts +152 -0
- package/dist/{agents-md-QPO3H5HX.js → agents-md-VI3HLR7E.js} +3 -3
- package/dist/{architecture-IJLXRHZA.js → architecture-ZDDKEVID.js} +4 -4
- package/dist/{assess-project-QU6XIVJK.js → assess-project-Y6W7YDUA.js} +1 -1
- package/dist/bin/harness-mcp.js +16 -15
- package/dist/bin/harness.js +27 -27
- package/dist/{check-phase-gate-TNY64AOS.js → check-phase-gate-CXR3VM22.js} +4 -4
- package/dist/{chunk-JJQ3TW2E.js → chunk-2BPPS6YQ.js} +804 -93
- package/dist/{chunk-NKQEMWGT.js → chunk-2FPUPRCY.js} +3419 -126
- package/dist/{chunk-MLOGYWLY.js → chunk-3AMQYWGT.js} +2 -2
- package/dist/{chunk-AS5DQT4S.js → chunk-56A6OXVA.js} +9 -9
- package/dist/{chunk-G5SNXUIK.js → chunk-7GY6WNEI.js} +1 -1
- package/dist/{chunk-SZ3Q4XEO.js → chunk-AMRC4FU2.js} +441 -288
- package/dist/{chunk-K533WNZG.js → chunk-B66LRB5M.js} +1 -1
- package/dist/{chunk-YRBNAHH4.js → chunk-BK4DJIIY.js} +4 -4
- package/dist/{chunk-2DF6OZLG.js → chunk-DBIX3X4H.js} +2 -2
- package/dist/{chunk-LXPRO2FH.js → chunk-FUND5WJR.js} +2 -2
- package/dist/{chunk-FRDS4XGD.js → chunk-JV4Y2U5F.js} +1 -1
- package/dist/{chunk-XVJRFP7W.js → chunk-K56DTX7G.js} +6 -6
- package/dist/{chunk-K35D7HF3.js → chunk-N6B6RKQQ.js} +1 -1
- package/dist/{chunk-LTCEV7VF.js → chunk-NY7DTZ6K.js} +3 -3
- package/dist/{chunk-JPZY7ZQX.js → chunk-OLW7BJ5N.js} +1 -1
- package/dist/{chunk-KVJZQ2MV.js → chunk-ORNEK65Y.js} +1 -1
- package/dist/{chunk-D3XL2FLX.js → chunk-PNNFCVW4.js} +5 -5
- package/dist/{chunk-E5Z6NTTQ.js → chunk-Q3ZLVMQM.js} +1 -1
- package/dist/{chunk-PCOU2UXU.js → chunk-RAVD7QLY.js} +8 -8
- package/dist/{chunk-IQO7IINR.js → chunk-TSVYBDDE.js} +1 -1
- package/dist/{chunk-MCDCZMKN.js → chunk-TY2ESLVL.js} +1 -1
- package/dist/{chunk-TQRCODRJ.js → chunk-VKS3F46M.js} +1 -1
- package/dist/{chunk-GVNT2YC7.js → chunk-WZ7UHPT3.js} +9 -9
- package/dist/{chunk-ZIYLIYN4.js → chunk-YC4EYIER.js} +8 -2
- package/dist/{chunk-IT2KORSK.js → chunk-ZN6ROTYP.js} +1 -1
- package/dist/{ci-workflow-FJYRFZYQ.js → ci-workflow-EW37KVPS.js} +3 -3
- package/dist/{create-skill-6QWJHQYS.js → create-skill-4T5CBSJ2.js} +2 -2
- package/dist/{dist-ZV6GO6FA.js → dist-CJDGASPP.js} +2 -2
- package/dist/{dist-HPWNWCT6.js → dist-NCNAXUFD.js} +41 -1
- package/dist/{docs-7DW3DI4Z.js → docs-4XI2FQW2.js} +4 -4
- package/dist/{engine-P7EE2IWO.js → engine-4L4CDTHU.js} +3 -3
- package/dist/{entropy-HCXRTDFU.js → entropy-PBYSIQYS.js} +3 -3
- package/dist/{feedback-Y4FYN3NR.js → feedback-OTIFW5MK.js} +1 -1
- package/dist/{generate-agent-definitions-3EHPIWBO.js → generate-agent-definitions-CZGUXIIN.js} +4 -4
- package/dist/{graph-loader-KXVS3YK3.js → graph-loader-RDXSEBD7.js} +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +27 -27
- package/dist/{loader-SKHF3JVV.js → loader-UZOXCWFC.js} +3 -3
- package/dist/{mcp-MWYIPDQU.js → mcp-GWVVV6LH.js} +16 -15
- package/dist/{performance-ADWH5NJY.js → performance-5UQPP3XX.js} +4 -4
- package/dist/{review-pipeline-TLKE5OQD.js → review-pipeline-65V4EO6O.js} +3 -3
- package/dist/{runtime-7LYAW7GU.js → runtime-PXX7HNB3.js} +3 -3
- package/dist/{scan-BGJ7TLLV.js → scan-WM7XDUF7.js} +1 -1
- package/dist/{security-5XWINYVB.js → security-CAYDRZIZ.js} +1 -1
- package/dist/{validate-BFFHYHY7.js → validate-CWGXR7QM.js} +4 -4
- package/dist/{validate-cross-check-GQX7OVCR.js → validate-cross-check-BKCNLZYG.js} +3 -3
- package/package.json +10 -10
- package/dist/agents/commands/claude-code/harness/harness.md +0 -36
- package/dist/agents/commands/codex/AGENTS.md +0 -39
- package/dist/agents/commands/codex/harness/add-harness-component/SKILL.md +0 -204
- package/dist/agents/commands/codex/harness/add-harness-component/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/cleanup-dead-code/SKILL.md +0 -257
- package/dist/agents/commands/codex/harness/cleanup-dead-code/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/detect-doc-drift/SKILL.md +0 -191
- package/dist/agents/commands/codex/harness/detect-doc-drift/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/enforce-architecture/SKILL.md +0 -289
- package/dist/agents/commands/codex/harness/enforce-architecture/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-architecture-advisor/SKILL.md +0 -442
- package/dist/agents/commands/codex/harness/harness-architecture-advisor/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-autopilot/SKILL.md +0 -929
- package/dist/agents/commands/codex/harness/harness-autopilot/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-brainstorming/SKILL.md +0 -418
- package/dist/agents/commands/codex/harness/harness-brainstorming/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-code-review/SKILL.md +0 -850
- package/dist/agents/commands/codex/harness/harness-code-review/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-codebase-cleanup/SKILL.md +0 -236
- package/dist/agents/commands/codex/harness/harness-codebase-cleanup/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-debugging/SKILL.md +0 -378
- package/dist/agents/commands/codex/harness/harness-debugging/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-dependency-health/SKILL.md +0 -190
- package/dist/agents/commands/codex/harness/harness-dependency-health/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-docs-pipeline/SKILL.md +0 -472
- package/dist/agents/commands/codex/harness/harness-docs-pipeline/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-execution/SKILL.md +0 -522
- package/dist/agents/commands/codex/harness/harness-execution/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-hotspot-detector/SKILL.md +0 -172
- package/dist/agents/commands/codex/harness/harness-hotspot-detector/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-impact-analysis/SKILL.md +0 -195
- package/dist/agents/commands/codex/harness/harness-impact-analysis/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-integrity/SKILL.md +0 -178
- package/dist/agents/commands/codex/harness/harness-integrity/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-onboarding/SKILL.md +0 -299
- package/dist/agents/commands/codex/harness/harness-onboarding/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-perf/SKILL.md +0 -272
- package/dist/agents/commands/codex/harness/harness-perf/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-planning/SKILL.md +0 -592
- package/dist/agents/commands/codex/harness/harness-planning/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-refactoring/SKILL.md +0 -181
- package/dist/agents/commands/codex/harness/harness-refactoring/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-release-readiness/SKILL.md +0 -701
- package/dist/agents/commands/codex/harness/harness-release-readiness/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-roadmap/SKILL.md +0 -607
- package/dist/agents/commands/codex/harness/harness-roadmap/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-security-scan/SKILL.md +0 -147
- package/dist/agents/commands/codex/harness/harness-security-scan/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-skill-authoring/SKILL.md +0 -314
- package/dist/agents/commands/codex/harness/harness-skill-authoring/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-soundness-review/SKILL.md +0 -1280
- package/dist/agents/commands/codex/harness/harness-soundness-review/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-supply-chain-audit/SKILL.md +0 -255
- package/dist/agents/commands/codex/harness/harness-supply-chain-audit/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-tdd/SKILL.md +0 -189
- package/dist/agents/commands/codex/harness/harness-tdd/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-test-advisor/SKILL.md +0 -171
- package/dist/agents/commands/codex/harness/harness-test-advisor/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-verification/SKILL.md +0 -433
- package/dist/agents/commands/codex/harness/harness-verification/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/harness-verify/SKILL.md +0 -170
- package/dist/agents/commands/codex/harness/harness-verify/agents/openai.yaml +0 -3
- package/dist/agents/commands/codex/harness/initialize-harness-project/SKILL.md +0 -244
- package/dist/agents/commands/codex/harness/initialize-harness-project/agents/openai.yaml +0 -3
- package/dist/agents/commands/cursor/harness/add-harness-component.mdc +0 -200
- package/dist/agents/commands/cursor/harness/cleanup-dead-code.mdc +0 -253
- package/dist/agents/commands/cursor/harness/detect-doc-drift.mdc +0 -187
- package/dist/agents/commands/cursor/harness/enforce-architecture.mdc +0 -304
- package/dist/agents/commands/cursor/harness/harness-architecture-advisor.mdc +0 -457
- package/dist/agents/commands/cursor/harness/harness-autopilot.mdc +0 -924
- package/dist/agents/commands/cursor/harness/harness-brainstorming.mdc +0 -414
- package/dist/agents/commands/cursor/harness/harness-code-review.mdc +0 -865
- package/dist/agents/commands/cursor/harness/harness-codebase-cleanup.mdc +0 -232
- package/dist/agents/commands/cursor/harness/harness-debugging.mdc +0 -374
- package/dist/agents/commands/cursor/harness/harness-dependency-health.mdc +0 -187
- package/dist/agents/commands/cursor/harness/harness-docs-pipeline.mdc +0 -468
- package/dist/agents/commands/cursor/harness/harness-execution.mdc +0 -518
- package/dist/agents/commands/cursor/harness/harness-hotspot-detector.mdc +0 -169
- package/dist/agents/commands/cursor/harness/harness-impact-analysis.mdc +0 -192
- package/dist/agents/commands/cursor/harness/harness-integrity.mdc +0 -175
- package/dist/agents/commands/cursor/harness/harness-onboarding.mdc +0 -296
- package/dist/agents/commands/cursor/harness/harness-perf.mdc +0 -268
- package/dist/agents/commands/cursor/harness/harness-planning.mdc +0 -587
- package/dist/agents/commands/cursor/harness/harness-refactoring.mdc +0 -177
- package/dist/agents/commands/cursor/harness/harness-release-readiness.mdc +0 -697
- package/dist/agents/commands/cursor/harness/harness-roadmap.mdc +0 -603
- package/dist/agents/commands/cursor/harness/harness-security-scan.mdc +0 -162
- package/dist/agents/commands/cursor/harness/harness-skill-authoring.mdc +0 -300
- package/dist/agents/commands/cursor/harness/harness-soundness-review.mdc +0 -1275
- package/dist/agents/commands/cursor/harness/harness-supply-chain-audit.mdc +0 -252
- package/dist/agents/commands/cursor/harness/harness-tdd.mdc +0 -185
- package/dist/agents/commands/cursor/harness/harness-test-advisor.mdc +0 -168
- package/dist/agents/commands/cursor/harness/harness-verification.mdc +0 -429
- package/dist/agents/commands/cursor/harness/harness-verify.mdc +0 -167
- package/dist/agents/commands/cursor/harness/initialize-harness-project.mdc +0 -240
- package/dist/agents/commands/gemini-cli/harness/harness.toml +0 -277
- package/dist/{chunk-RRHUCDRD.js → chunk-ZP5E7YET.js} +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assessProjectDefinition,
|
|
3
3
|
handleAssessProject
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-K56DTX7G.js";
|
|
5
5
|
import {
|
|
6
6
|
getBusinessKnowledgeResource
|
|
7
7
|
} from "./chunk-RC5ZY3EV.js";
|
|
@@ -12,37 +12,37 @@ import {
|
|
|
12
12
|
handleCreateSelfReview,
|
|
13
13
|
handleRequestPeerReview,
|
|
14
14
|
requestPeerReviewDefinition
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WZ7UHPT3.js";
|
|
16
16
|
import {
|
|
17
17
|
getSecurityTrendsDefinition,
|
|
18
18
|
handleGetSecurityTrends,
|
|
19
19
|
handleRunSecurityScan,
|
|
20
20
|
runSecurityScanDefinition
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-3AMQYWGT.js";
|
|
22
22
|
import {
|
|
23
23
|
handleRunCodeReview,
|
|
24
24
|
runCodeReviewDefinition,
|
|
25
25
|
sortFindingsBySeverity
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DBIX3X4H.js";
|
|
27
27
|
import {
|
|
28
28
|
handleValidateProject,
|
|
29
29
|
validateToolDefinition
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NY7DTZ6K.js";
|
|
31
31
|
import {
|
|
32
32
|
checkDependenciesDefinition,
|
|
33
33
|
handleCheckDependencies
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-BK4DJIIY.js";
|
|
35
35
|
import {
|
|
36
36
|
resolveProjectConfig
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-TSVYBDDE.js";
|
|
38
38
|
import {
|
|
39
39
|
checkDocsDefinition,
|
|
40
40
|
handleCheckDocs
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-56A6OXVA.js";
|
|
42
42
|
import {
|
|
43
43
|
detectEntropyDefinition,
|
|
44
44
|
handleDetectEntropy
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-PNNFCVW4.js";
|
|
46
46
|
import {
|
|
47
47
|
checkPerformanceDefinition,
|
|
48
48
|
getCriticalPathsDefinition,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
handleGetPerfBaselines,
|
|
53
53
|
handleUpdatePerfBaselines,
|
|
54
54
|
updatePerfBaselinesDefinition
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-RAVD7QLY.js";
|
|
56
56
|
import {
|
|
57
57
|
resultToMcpResponse
|
|
58
58
|
} from "./chunk-EPUKTTJZ.js";
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
} from "./chunk-W6Y7ZW3Y.js";
|
|
62
62
|
import {
|
|
63
63
|
resolveConfig
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-VKS3F46M.js";
|
|
65
65
|
import {
|
|
66
66
|
GENERATED_HEADER_CLAUDE,
|
|
67
67
|
GENERATED_HEADER_CODEX,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
} from "./chunk-6B6UN6SG.js";
|
|
84
84
|
import {
|
|
85
85
|
loadGraphStore
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-OLW7BJ5N.js";
|
|
87
87
|
import {
|
|
88
88
|
CompactionPipeline,
|
|
89
89
|
DEFAULT_TOKEN_BUDGET,
|
|
@@ -101,7 +101,7 @@ import {
|
|
|
101
101
|
scanForInjection,
|
|
102
102
|
serializeEnvelope,
|
|
103
103
|
writeTaint
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-YC4EYIER.js";
|
|
105
105
|
import {
|
|
106
106
|
Err,
|
|
107
107
|
Ok
|
|
@@ -109,6 +109,9 @@ import {
|
|
|
109
109
|
import {
|
|
110
110
|
SkillMetadataSchema
|
|
111
111
|
} from "./chunk-HIK6OEUF.js";
|
|
112
|
+
import {
|
|
113
|
+
logger
|
|
114
|
+
} from "./chunk-EBJQ6N4M.js";
|
|
112
115
|
import {
|
|
113
116
|
CLIError,
|
|
114
117
|
ExitCode,
|
|
@@ -701,7 +704,7 @@ ${skippedMsg}`
|
|
|
701
704
|
async function handleInitProject(input) {
|
|
702
705
|
const i = input;
|
|
703
706
|
try {
|
|
704
|
-
const { TemplateEngine } = await import("./engine-
|
|
707
|
+
const { TemplateEngine } = await import("./engine-4L4CDTHU.js");
|
|
705
708
|
const engine = new TemplateEngine(resolveTemplatesDir());
|
|
706
709
|
const safePath = sanitizePath(i.path);
|
|
707
710
|
const detected = tryDetectFramework(engine, safePath, i);
|
|
@@ -723,7 +726,7 @@ var listPersonasDefinition = {
|
|
|
723
726
|
inputSchema: { type: "object", properties: {} }
|
|
724
727
|
};
|
|
725
728
|
async function handleListPersonas() {
|
|
726
|
-
const { listPersonas } = await import("./loader-
|
|
729
|
+
const { listPersonas } = await import("./loader-UZOXCWFC.js");
|
|
727
730
|
const result = listPersonas(resolvePersonasDir());
|
|
728
731
|
return resultToMcpResponse(result);
|
|
729
732
|
}
|
|
@@ -747,10 +750,10 @@ async function handleGeneratePersonaArtifacts(input) {
|
|
|
747
750
|
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(input.name)) {
|
|
748
751
|
return resultToMcpResponse(Err(new Error(`Invalid persona name: ${input.name}`)));
|
|
749
752
|
}
|
|
750
|
-
const { loadPersona } = await import("./loader-
|
|
751
|
-
const { generateRuntime } = await import("./runtime-
|
|
752
|
-
const { generateAgentsMd } = await import("./agents-md-
|
|
753
|
-
const { generateCIWorkflow } = await import("./ci-workflow-
|
|
753
|
+
const { loadPersona } = await import("./loader-UZOXCWFC.js");
|
|
754
|
+
const { generateRuntime } = await import("./runtime-PXX7HNB3.js");
|
|
755
|
+
const { generateAgentsMd } = await import("./agents-md-VI3HLR7E.js");
|
|
756
|
+
const { generateCIWorkflow } = await import("./ci-workflow-EW37KVPS.js");
|
|
754
757
|
const personasDir = resolvePersonasDir();
|
|
755
758
|
const filePath = path3.join(personasDir, `${input.name}.yaml`);
|
|
756
759
|
if (!filePath.startsWith(personasDir)) {
|
|
@@ -805,7 +808,7 @@ async function handleRunPersona(input) {
|
|
|
805
808
|
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(input.persona)) {
|
|
806
809
|
return resultToMcpResponse(Err(new Error(`Invalid persona name: ${input.persona}`)));
|
|
807
810
|
}
|
|
808
|
-
const { loadPersona } = await import("./loader-
|
|
811
|
+
const { loadPersona } = await import("./loader-UZOXCWFC.js");
|
|
809
812
|
const { runPersona } = await import("./runner-AAEF2TXY.js");
|
|
810
813
|
const { executeSkill } = await import("./skill-executor-MOCUIAYS.js");
|
|
811
814
|
const personasDir = resolvePersonasDir();
|
|
@@ -1344,7 +1347,7 @@ function loadOrGenerateProfile(projectRoot) {
|
|
|
1344
1347
|
// src/mcp/tools/event-emitter.ts
|
|
1345
1348
|
async function emitSkillEvent(projectPath, event) {
|
|
1346
1349
|
try {
|
|
1347
|
-
const { emitEvent } = await import("./dist-
|
|
1350
|
+
const { emitEvent } = await import("./dist-CJDGASPP.js");
|
|
1348
1351
|
await emitEvent(projectPath, event);
|
|
1349
1352
|
} catch {
|
|
1350
1353
|
}
|
|
@@ -1494,7 +1497,7 @@ var createSkillDefinition = {
|
|
|
1494
1497
|
};
|
|
1495
1498
|
async function handleCreateSkill(input) {
|
|
1496
1499
|
try {
|
|
1497
|
-
const { generateSkillFiles } = await import("./create-skill-
|
|
1500
|
+
const { generateSkillFiles } = await import("./create-skill-4T5CBSJ2.js");
|
|
1498
1501
|
const result = generateSkillFiles({
|
|
1499
1502
|
name: input.name,
|
|
1500
1503
|
description: input.description,
|
|
@@ -1616,7 +1619,7 @@ async function autoSyncRoadmap(projectPath) {
|
|
|
1616
1619
|
try {
|
|
1617
1620
|
const roadmapFile = path11.join(projectPath, "docs", "roadmap.md");
|
|
1618
1621
|
if (!fs10.existsSync(roadmapFile)) return;
|
|
1619
|
-
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-
|
|
1622
|
+
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges } = await import("./dist-CJDGASPP.js");
|
|
1620
1623
|
const raw = fs10.readFileSync(roadmapFile, "utf-8");
|
|
1621
1624
|
const parseResult = parseRoadmap(raw);
|
|
1622
1625
|
if (!parseResult.ok) return;
|
|
@@ -1646,7 +1649,7 @@ async function triggerExternalSync(projectPath, roadmapFile) {
|
|
|
1646
1649
|
console.warn("[roadmap-sync] GITHUB_TOKEN not found \u2014 external sync skipped");
|
|
1647
1650
|
return;
|
|
1648
1651
|
}
|
|
1649
|
-
const { fullSync, GitHubIssuesSyncAdapter } = await import("./dist-
|
|
1652
|
+
const { fullSync, GitHubIssuesSyncAdapter } = await import("./dist-CJDGASPP.js");
|
|
1650
1653
|
const adapter = new GitHubIssuesSyncAdapter({
|
|
1651
1654
|
token,
|
|
1652
1655
|
config: trackerConfig
|
|
@@ -1743,12 +1746,12 @@ var manageStateDefinition = {
|
|
|
1743
1746
|
}
|
|
1744
1747
|
};
|
|
1745
1748
|
async function handleShow(projectPath, input) {
|
|
1746
|
-
const { loadState } = await import("./dist-
|
|
1749
|
+
const { loadState } = await import("./dist-CJDGASPP.js");
|
|
1747
1750
|
return resultToMcpResponse(await loadState(projectPath, input.stream, input.session));
|
|
1748
1751
|
}
|
|
1749
1752
|
async function handleLearn(projectPath, input) {
|
|
1750
1753
|
if (!input.learning) return mcpError("Error: learning is required for learn action");
|
|
1751
|
-
const { appendLearning } = await import("./dist-
|
|
1754
|
+
const { appendLearning } = await import("./dist-CJDGASPP.js");
|
|
1752
1755
|
const result = await appendLearning(
|
|
1753
1756
|
projectPath,
|
|
1754
1757
|
input.learning,
|
|
@@ -1763,7 +1766,7 @@ async function handleLearn(projectPath, input) {
|
|
|
1763
1766
|
async function handleFailure(projectPath, input) {
|
|
1764
1767
|
if (!input.description) return mcpError("Error: description is required for failure action");
|
|
1765
1768
|
if (!input.failureType) return mcpError("Error: failureType is required for failure action");
|
|
1766
|
-
const { appendFailure } = await import("./dist-
|
|
1769
|
+
const { appendFailure } = await import("./dist-CJDGASPP.js");
|
|
1767
1770
|
const result = await appendFailure(
|
|
1768
1771
|
projectPath,
|
|
1769
1772
|
input.description,
|
|
@@ -1782,19 +1785,19 @@ async function handleFailure(projectPath, input) {
|
|
|
1782
1785
|
return resultToMcpResponse(Ok({ recorded: true }));
|
|
1783
1786
|
}
|
|
1784
1787
|
async function handleArchive(projectPath, input) {
|
|
1785
|
-
const { archiveFailures } = await import("./dist-
|
|
1788
|
+
const { archiveFailures } = await import("./dist-CJDGASPP.js");
|
|
1786
1789
|
const result = await archiveFailures(projectPath, input.stream, input.session);
|
|
1787
1790
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1788
1791
|
return resultToMcpResponse(Ok({ archived: true }));
|
|
1789
1792
|
}
|
|
1790
1793
|
async function handleReset(projectPath, input) {
|
|
1791
|
-
const { saveState, DEFAULT_STATE } = await import("./dist-
|
|
1794
|
+
const { saveState, DEFAULT_STATE } = await import("./dist-CJDGASPP.js");
|
|
1792
1795
|
const result = await saveState(projectPath, { ...DEFAULT_STATE }, input.stream, input.session);
|
|
1793
1796
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1794
1797
|
return resultToMcpResponse(Ok({ reset: true }));
|
|
1795
1798
|
}
|
|
1796
1799
|
async function handleGate(projectPath, input) {
|
|
1797
|
-
const { runMechanicalGate } = await import("./dist-
|
|
1800
|
+
const { runMechanicalGate } = await import("./dist-CJDGASPP.js");
|
|
1798
1801
|
const result = await runMechanicalGate(projectPath);
|
|
1799
1802
|
if (result.ok) {
|
|
1800
1803
|
await emitSkillEvent(projectPath, {
|
|
@@ -1814,7 +1817,7 @@ async function handleGate(projectPath, input) {
|
|
|
1814
1817
|
}
|
|
1815
1818
|
async function handleSaveHandoff(projectPath, input) {
|
|
1816
1819
|
if (!input.handoff) return mcpError("Error: handoff is required for save-handoff action");
|
|
1817
|
-
const { saveHandoff } = await import("./dist-
|
|
1820
|
+
const { saveHandoff } = await import("./dist-CJDGASPP.js");
|
|
1818
1821
|
const result = await saveHandoff(
|
|
1819
1822
|
projectPath,
|
|
1820
1823
|
input.handoff,
|
|
@@ -1836,7 +1839,7 @@ async function handleSaveHandoff(projectPath, input) {
|
|
|
1836
1839
|
return resultToMcpResponse(Ok({ saved: true }));
|
|
1837
1840
|
}
|
|
1838
1841
|
async function handleLoadHandoff(projectPath, input) {
|
|
1839
|
-
const { loadHandoff } = await import("./dist-
|
|
1842
|
+
const { loadHandoff } = await import("./dist-CJDGASPP.js");
|
|
1840
1843
|
return resultToMcpResponse(await loadHandoff(projectPath, input.stream, input.session));
|
|
1841
1844
|
}
|
|
1842
1845
|
async function handleAppendEntry(projectPath, input) {
|
|
@@ -1844,7 +1847,7 @@ async function handleAppendEntry(projectPath, input) {
|
|
|
1844
1847
|
if (!input.authorSkill) return mcpError("Error: authorSkill is required for append_entry action");
|
|
1845
1848
|
if (!input.content) return mcpError("Error: content is required for append_entry action");
|
|
1846
1849
|
if (input.session) {
|
|
1847
|
-
const { appendSessionEntry } = await import("./dist-
|
|
1850
|
+
const { appendSessionEntry } = await import("./dist-CJDGASPP.js");
|
|
1848
1851
|
const result = await appendSessionEntry(
|
|
1849
1852
|
projectPath,
|
|
1850
1853
|
input.session,
|
|
@@ -1857,7 +1860,7 @@ async function handleAppendEntry(projectPath, input) {
|
|
|
1857
1860
|
if (input.section !== "decisions") {
|
|
1858
1861
|
return mcpError("Error: session is required for non-decisions sections");
|
|
1859
1862
|
}
|
|
1860
|
-
const { loadState, saveState } = await import("./dist-
|
|
1863
|
+
const { loadState, saveState } = await import("./dist-CJDGASPP.js");
|
|
1861
1864
|
const lr = await loadState(projectPath, input.stream);
|
|
1862
1865
|
if (!lr.ok) return resultToMcpResponse(lr);
|
|
1863
1866
|
lr.value.decisions.push({
|
|
@@ -1875,7 +1878,7 @@ async function handleUpdateEntryStatus(projectPath, input) {
|
|
|
1875
1878
|
if (!input.entryId) return mcpError("Error: entryId is required for update_entry_status action");
|
|
1876
1879
|
if (!input.newStatus)
|
|
1877
1880
|
return mcpError("Error: newStatus is required for update_entry_status action");
|
|
1878
|
-
const { updateSessionEntryStatus } = await import("./dist-
|
|
1881
|
+
const { updateSessionEntryStatus } = await import("./dist-CJDGASPP.js");
|
|
1879
1882
|
const result = await updateSessionEntryStatus(
|
|
1880
1883
|
projectPath,
|
|
1881
1884
|
input.session,
|
|
@@ -1888,7 +1891,7 @@ async function handleUpdateEntryStatus(projectPath, input) {
|
|
|
1888
1891
|
async function handleReadSection(projectPath, input) {
|
|
1889
1892
|
if (!input.session) return mcpError("Error: session is required for read_section action");
|
|
1890
1893
|
if (!input.section) return mcpError("Error: section is required for read_section action");
|
|
1891
|
-
const { readSessionSection } = await import("./dist-
|
|
1894
|
+
const { readSessionSection } = await import("./dist-CJDGASPP.js");
|
|
1892
1895
|
const result = await readSessionSection(
|
|
1893
1896
|
projectPath,
|
|
1894
1897
|
input.session,
|
|
@@ -1898,13 +1901,13 @@ async function handleReadSection(projectPath, input) {
|
|
|
1898
1901
|
}
|
|
1899
1902
|
async function handleReadSections(projectPath, input) {
|
|
1900
1903
|
if (!input.session) return mcpError("Error: session is required for read_sections action");
|
|
1901
|
-
const { readSessionSections } = await import("./dist-
|
|
1904
|
+
const { readSessionSections } = await import("./dist-CJDGASPP.js");
|
|
1902
1905
|
const result = await readSessionSections(projectPath, input.session);
|
|
1903
1906
|
return resultToMcpResponse(result);
|
|
1904
1907
|
}
|
|
1905
1908
|
async function handleArchiveSession(projectPath, input) {
|
|
1906
1909
|
if (!input.session) return mcpError("Error: session is required for archive_session action");
|
|
1907
|
-
const { archiveSession } = await import("./dist-
|
|
1910
|
+
const { archiveSession } = await import("./dist-CJDGASPP.js");
|
|
1908
1911
|
const result = await archiveSession(projectPath, input.session);
|
|
1909
1912
|
if (!result.ok) return resultToMcpResponse(result);
|
|
1910
1913
|
await autoSyncRoadmap(projectPath);
|
|
@@ -1984,7 +1987,7 @@ var listStreamsDefinition = {
|
|
|
1984
1987
|
};
|
|
1985
1988
|
async function handleListStreams(input) {
|
|
1986
1989
|
try {
|
|
1987
|
-
const { listStreams, loadStreamIndex } = await import("./dist-
|
|
1990
|
+
const { listStreams, loadStreamIndex } = await import("./dist-CJDGASPP.js");
|
|
1988
1991
|
const projectPath = sanitizePath(input.path);
|
|
1989
1992
|
const indexResult = await loadStreamIndex(projectPath);
|
|
1990
1993
|
const streamsResult = await listStreams(projectPath);
|
|
@@ -2022,7 +2025,7 @@ var checkPhaseGateDefinition = {
|
|
|
2022
2025
|
};
|
|
2023
2026
|
async function handleCheckPhaseGate(input) {
|
|
2024
2027
|
try {
|
|
2025
|
-
const { runCheckPhaseGate } = await import("./check-phase-gate-
|
|
2028
|
+
const { runCheckPhaseGate } = await import("./check-phase-gate-CXR3VM22.js");
|
|
2026
2029
|
const result = await runCheckPhaseGate({ cwd: sanitizePath(input.path) });
|
|
2027
2030
|
if (result.ok) {
|
|
2028
2031
|
return { content: [{ type: "text", text: JSON.stringify(result.value) }] };
|
|
@@ -2078,7 +2081,7 @@ async function handleValidateCrossCheck(input) {
|
|
|
2078
2081
|
};
|
|
2079
2082
|
}
|
|
2080
2083
|
try {
|
|
2081
|
-
const { runCrossCheck } = await import("./validate-cross-check-
|
|
2084
|
+
const { runCrossCheck } = await import("./validate-cross-check-BKCNLZYG.js");
|
|
2082
2085
|
const specsDir = path12.resolve(projectPath, input.specsDir ?? "docs/specs");
|
|
2083
2086
|
if (!specsDir.startsWith(projectPath)) {
|
|
2084
2087
|
return {
|
|
@@ -2801,7 +2804,7 @@ async function handleGenerateSlashCommands(input) {
|
|
|
2801
2804
|
// src/mcp/resources/state.ts
|
|
2802
2805
|
async function getStateResource(projectRoot) {
|
|
2803
2806
|
try {
|
|
2804
|
-
const { loadState, migrateToStreams } = await import("./dist-
|
|
2807
|
+
const { loadState, migrateToStreams } = await import("./dist-CJDGASPP.js");
|
|
2805
2808
|
await migrateToStreams(projectRoot);
|
|
2806
2809
|
const result = await loadState(projectRoot);
|
|
2807
2810
|
if (result.ok) {
|
|
@@ -2919,7 +2922,7 @@ async function handleQueryGraph(input) {
|
|
|
2919
2922
|
const projectPath = sanitizePath(input.path);
|
|
2920
2923
|
const store = await loadGraphStore(projectPath);
|
|
2921
2924
|
if (!store) return graphNotFoundError();
|
|
2922
|
-
const { ContextQL } = await import("./dist-
|
|
2925
|
+
const { ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
2923
2926
|
const cql = new ContextQL(store);
|
|
2924
2927
|
const result = cql.execute({
|
|
2925
2928
|
rootNodeIds: input.rootNodeIds,
|
|
@@ -3001,7 +3004,7 @@ async function handleSearchSimilar(input) {
|
|
|
3001
3004
|
const projectPath = sanitizePath(input.path);
|
|
3002
3005
|
const store = await loadGraphStore(projectPath);
|
|
3003
3006
|
if (!store) return graphNotFoundError();
|
|
3004
|
-
const { FusionLayer } = await import("./dist-
|
|
3007
|
+
const { FusionLayer } = await import("./dist-NCNAXUFD.js");
|
|
3005
3008
|
const fusion = new FusionLayer(store);
|
|
3006
3009
|
const results = fusion.search(input.query, input.topK ?? 10);
|
|
3007
3010
|
if (input.mode === "summary") {
|
|
@@ -3056,7 +3059,7 @@ async function handleFindContextFor(input) {
|
|
|
3056
3059
|
const projectPath = sanitizePath(input.path);
|
|
3057
3060
|
const store = await loadGraphStore(projectPath);
|
|
3058
3061
|
if (!store) return graphNotFoundError();
|
|
3059
|
-
const { FusionLayer, ContextQL } = await import("./dist-
|
|
3062
|
+
const { FusionLayer, ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
3060
3063
|
const fusion = new FusionLayer(store);
|
|
3061
3064
|
const cql = new ContextQL(store);
|
|
3062
3065
|
const tokenBudget = input.tokenBudget ?? 4e3;
|
|
@@ -3161,7 +3164,7 @@ async function handleGetRelationships(input) {
|
|
|
3161
3164
|
const projectPath = sanitizePath(input.path);
|
|
3162
3165
|
const store = await loadGraphStore(projectPath);
|
|
3163
3166
|
if (!store) return graphNotFoundError();
|
|
3164
|
-
const { ContextQL } = await import("./dist-
|
|
3167
|
+
const { ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
3165
3168
|
const cql = new ContextQL(store);
|
|
3166
3169
|
const direction = input.direction ?? "both";
|
|
3167
3170
|
const bidirectional = direction === "both" || direction === "inbound";
|
|
@@ -3279,7 +3282,7 @@ async function handleGetImpact(input) {
|
|
|
3279
3282
|
const projectPath = sanitizePath(input.path);
|
|
3280
3283
|
const store = await loadGraphStore(projectPath);
|
|
3281
3284
|
if (!store) return graphNotFoundError();
|
|
3282
|
-
const { ContextQL } = await import("./dist-
|
|
3285
|
+
const { ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
3283
3286
|
let targetNodeId = input.nodeId;
|
|
3284
3287
|
if (!targetNodeId && input.filePath) {
|
|
3285
3288
|
const fileNodes = store.findNodes({ type: "file" });
|
|
@@ -3400,7 +3403,7 @@ var ingestSourceDefinition = {
|
|
|
3400
3403
|
path: { type: "string", description: "Path to project root" },
|
|
3401
3404
|
source: {
|
|
3402
3405
|
type: "string",
|
|
3403
|
-
enum: ["code", "knowledge", "git", "all"],
|
|
3406
|
+
enum: ["code", "knowledge", "git", "business-signals", "diagrams", "all"],
|
|
3404
3407
|
description: "Type of source to ingest"
|
|
3405
3408
|
}
|
|
3406
3409
|
},
|
|
@@ -3411,9 +3414,9 @@ async function handleIngestSource(input) {
|
|
|
3411
3414
|
try {
|
|
3412
3415
|
const projectPath = sanitizePath(input.path);
|
|
3413
3416
|
const graphDir = path16.join(projectPath, ".harness", "graph");
|
|
3414
|
-
const { GraphStore, CodeIngestor, TopologicalLinker, KnowledgeIngestor, GitIngestor } = await import("./dist-
|
|
3415
|
-
const
|
|
3416
|
-
await
|
|
3417
|
+
const { GraphStore, CodeIngestor, TopologicalLinker, KnowledgeIngestor, GitIngestor } = await import("./dist-NCNAXUFD.js");
|
|
3418
|
+
const fs18 = await import("fs/promises");
|
|
3419
|
+
await fs18.mkdir(graphDir, { recursive: true });
|
|
3417
3420
|
const store = new GraphStore();
|
|
3418
3421
|
await store.load(graphDir);
|
|
3419
3422
|
const results = [];
|
|
@@ -3434,6 +3437,18 @@ async function handleIngestSource(input) {
|
|
|
3434
3437
|
const gitResult = await gitIngestor.ingest(projectPath);
|
|
3435
3438
|
results.push(gitResult);
|
|
3436
3439
|
}
|
|
3440
|
+
if (input.source === "business-signals" || input.source === "all") {
|
|
3441
|
+
const { createExtractionRunner } = await import("./dist-NCNAXUFD.js");
|
|
3442
|
+
const extractedDir = path16.join(projectPath, ".harness", "knowledge", "extracted");
|
|
3443
|
+
const signalsResult = await createExtractionRunner().run(projectPath, store, extractedDir);
|
|
3444
|
+
results.push(signalsResult);
|
|
3445
|
+
}
|
|
3446
|
+
if (input.source === "diagrams" || input.source === "all") {
|
|
3447
|
+
const { DiagramParser } = await import("./dist-NCNAXUFD.js");
|
|
3448
|
+
const diagramParser = new DiagramParser(store);
|
|
3449
|
+
const diagramResult = await diagramParser.ingest(projectPath);
|
|
3450
|
+
results.push(diagramResult);
|
|
3451
|
+
}
|
|
3437
3452
|
await store.save(graphDir);
|
|
3438
3453
|
const combined = {
|
|
3439
3454
|
nodesAdded: results.reduce((s, r) => s + r.nodesAdded, 0),
|
|
@@ -3495,7 +3510,7 @@ async function handleDetectAnomalies(input) {
|
|
|
3495
3510
|
const projectPath = sanitizePath(input.path);
|
|
3496
3511
|
const store = await loadGraphStore(projectPath);
|
|
3497
3512
|
if (!store) return graphNotFoundError();
|
|
3498
|
-
const { GraphAnomalyAdapter } = await import("./dist-
|
|
3513
|
+
const { GraphAnomalyAdapter } = await import("./dist-NCNAXUFD.js");
|
|
3499
3514
|
const adapter = new GraphAnomalyAdapter(store);
|
|
3500
3515
|
const report = adapter.detect({
|
|
3501
3516
|
...input.threshold !== void 0 && { threshold: input.threshold },
|
|
@@ -3544,7 +3559,7 @@ async function handleAskGraph(input) {
|
|
|
3544
3559
|
const projectPath = sanitizePath(input.path);
|
|
3545
3560
|
const store = await loadGraphStore(projectPath);
|
|
3546
3561
|
if (!store) return graphNotFoundError();
|
|
3547
|
-
const { askGraph } = await import("./dist-
|
|
3562
|
+
const { askGraph } = await import("./dist-NCNAXUFD.js");
|
|
3548
3563
|
const result = await askGraph(store, input.question);
|
|
3549
3564
|
return {
|
|
3550
3565
|
content: [{ type: "text", text: JSON.stringify(result) }]
|
|
@@ -3608,7 +3623,7 @@ async function handleComputeBlastRadius(input) {
|
|
|
3608
3623
|
const projectPath = sanitizePath(input.path);
|
|
3609
3624
|
const store = await loadGraphStore(projectPath);
|
|
3610
3625
|
if (!store) return graphNotFoundError();
|
|
3611
|
-
const { CascadeSimulator } = await import("./dist-
|
|
3626
|
+
const { CascadeSimulator } = await import("./dist-NCNAXUFD.js");
|
|
3612
3627
|
let targetNodeId = input.nodeId;
|
|
3613
3628
|
if (!targetNodeId && input.file) {
|
|
3614
3629
|
const fileNodes = store.findNodes({ type: "file" });
|
|
@@ -3809,7 +3824,7 @@ var generateAgentDefinitionsDefinition = {
|
|
|
3809
3824
|
}
|
|
3810
3825
|
};
|
|
3811
3826
|
async function handleGenerateAgentDefinitions(input) {
|
|
3812
|
-
const { generateAgentDefinitions } = await import("./generate-agent-definitions-
|
|
3827
|
+
const { generateAgentDefinitions } = await import("./generate-agent-definitions-CZGUXIIN.js");
|
|
3813
3828
|
const platforms = input.platform === "all" || !input.platform ? ["claude-code", "gemini-cli"] : [input.platform];
|
|
3814
3829
|
const results = generateAgentDefinitions({
|
|
3815
3830
|
platforms: [...platforms],
|
|
@@ -4137,7 +4152,7 @@ function shouldTriggerExternalSync(input, response) {
|
|
|
4137
4152
|
}
|
|
4138
4153
|
async function handleManageRoadmap(input) {
|
|
4139
4154
|
try {
|
|
4140
|
-
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges, assignFeature } = await import("./dist-
|
|
4155
|
+
const { parseRoadmap, serializeRoadmap, syncRoadmap, applySyncChanges, assignFeature } = await import("./dist-CJDGASPP.js");
|
|
4141
4156
|
const { Ok: Ok2 } = await import("./dist-3EWNRFFQ.js");
|
|
4142
4157
|
const projectPath = sanitizePath(input.path);
|
|
4143
4158
|
const deps = {
|
|
@@ -4576,7 +4591,7 @@ async function handleTransition(validInput, projectPath, id) {
|
|
|
4576
4591
|
const transition = transitionResult.data;
|
|
4577
4592
|
const prompt = renderTransition(transition);
|
|
4578
4593
|
try {
|
|
4579
|
-
const { saveHandoff } = await import("./dist-
|
|
4594
|
+
const { saveHandoff } = await import("./dist-CJDGASPP.js");
|
|
4580
4595
|
await saveHandoff(
|
|
4581
4596
|
projectPath,
|
|
4582
4597
|
{
|
|
@@ -4657,7 +4672,7 @@ async function handleEmitInteraction(input) {
|
|
|
4657
4672
|
}
|
|
4658
4673
|
async function recordInteraction(projectPath, id, type, decision, stream) {
|
|
4659
4674
|
try {
|
|
4660
|
-
const { loadState, saveState } = await import("./dist-
|
|
4675
|
+
const { loadState, saveState } = await import("./dist-CJDGASPP.js");
|
|
4661
4676
|
const stateResult = await loadState(projectPath, stream);
|
|
4662
4677
|
if (stateResult.ok) {
|
|
4663
4678
|
const state = stateResult.value;
|
|
@@ -4818,10 +4833,10 @@ async function handleGatherContext(input) {
|
|
|
4818
4833
|
input.include ?? ["state", "learnings", "handoff", "graph", "validation"]
|
|
4819
4834
|
);
|
|
4820
4835
|
const errors = [];
|
|
4821
|
-
const statePromise = includeSet.has("state") ? import("./dist-
|
|
4836
|
+
const statePromise = includeSet.has("state") ? import("./dist-CJDGASPP.js").then(
|
|
4822
4837
|
(core) => core.loadState(projectPath, void 0, input.session)
|
|
4823
4838
|
) : Promise.resolve(null);
|
|
4824
|
-
const learningsPromise = includeSet.has("learnings") ? import("./dist-
|
|
4839
|
+
const learningsPromise = includeSet.has("learnings") ? import("./dist-CJDGASPP.js").then(
|
|
4825
4840
|
(core) => core.loadBudgetedLearnings(projectPath, {
|
|
4826
4841
|
intent: input.intent,
|
|
4827
4842
|
tokenBudget: input.learningsBudget ?? 1e3,
|
|
@@ -4830,14 +4845,14 @@ async function handleGatherContext(input) {
|
|
|
4830
4845
|
...input.depth !== void 0 && { depth: input.depth }
|
|
4831
4846
|
})
|
|
4832
4847
|
) : Promise.resolve(null);
|
|
4833
|
-
const handoffPromise = includeSet.has("handoff") ? import("./dist-
|
|
4848
|
+
const handoffPromise = includeSet.has("handoff") ? import("./dist-CJDGASPP.js").then(
|
|
4834
4849
|
(core) => core.loadHandoff(projectPath, void 0, input.session)
|
|
4835
4850
|
) : Promise.resolve(null);
|
|
4836
4851
|
const graphPromise = includeSet.has("graph") ? (async () => {
|
|
4837
|
-
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-
|
|
4852
|
+
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-RDXSEBD7.js");
|
|
4838
4853
|
const store = await loadGraphStore2(projectPath);
|
|
4839
4854
|
if (!store) return null;
|
|
4840
|
-
const { FusionLayer, ContextQL } = await import("./dist-
|
|
4855
|
+
const { FusionLayer, ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
4841
4856
|
const fusion = new FusionLayer(store);
|
|
4842
4857
|
const cql = new ContextQL(store);
|
|
4843
4858
|
const tokenBudget = input.tokenBudget ?? 4e3;
|
|
@@ -4874,11 +4889,11 @@ async function handleGatherContext(input) {
|
|
|
4874
4889
|
context: contextBlocks
|
|
4875
4890
|
};
|
|
4876
4891
|
})() : Promise.resolve(null);
|
|
4877
|
-
const sessionsPromise = includeSet.has("sessions") && input.session ? import("./dist-
|
|
4892
|
+
const sessionsPromise = includeSet.has("sessions") && input.session ? import("./dist-CJDGASPP.js").then(
|
|
4878
4893
|
(core) => core.readSessionSections(projectPath, input.session)
|
|
4879
4894
|
) : Promise.resolve(null);
|
|
4880
4895
|
const shouldIncludeEvents = input.includeEvents !== void 0 ? input.includeEvents : includeSet.has("events") || !!input.session && !input.include;
|
|
4881
|
-
const eventsPromise = shouldIncludeEvents ? import("./dist-
|
|
4896
|
+
const eventsPromise = shouldIncludeEvents ? import("./dist-CJDGASPP.js").then(async (core) => {
|
|
4882
4897
|
const result = await core.loadEvents(projectPath, {
|
|
4883
4898
|
session: input.session
|
|
4884
4899
|
});
|
|
@@ -4886,7 +4901,7 @@ async function handleGatherContext(input) {
|
|
|
4886
4901
|
return core.formatEventTimeline(result.value);
|
|
4887
4902
|
}) : Promise.resolve(null);
|
|
4888
4903
|
const validationPromise = includeSet.has("validation") ? (async () => {
|
|
4889
|
-
const { handleValidateProject: handleValidateProject2 } = await import("./validate-
|
|
4904
|
+
const { handleValidateProject: handleValidateProject2 } = await import("./validate-CWGXR7QM.js");
|
|
4890
4905
|
const result = await handleValidateProject2({ path: projectPath });
|
|
4891
4906
|
const first = result.content[0];
|
|
4892
4907
|
return first ? JSON.parse(first.text) : null;
|
|
@@ -4989,7 +5004,7 @@ async function handleGatherContext(input) {
|
|
|
4989
5004
|
};
|
|
4990
5005
|
if (input.session) {
|
|
4991
5006
|
try {
|
|
4992
|
-
const core = await import("./dist-
|
|
5007
|
+
const core = await import("./dist-CJDGASPP.js");
|
|
4993
5008
|
core.updateSessionIndex(
|
|
4994
5009
|
projectPath,
|
|
4995
5010
|
input.session,
|
|
@@ -5141,7 +5156,7 @@ async function handleReviewChanges(input) {
|
|
|
5141
5156
|
}
|
|
5142
5157
|
}
|
|
5143
5158
|
async function runQuickReview(projectPath, diff, diffLines, downgraded, offset, limit) {
|
|
5144
|
-
const { handleAnalyzeDiff: handleAnalyzeDiff2 } = await import("./feedback-
|
|
5159
|
+
const { handleAnalyzeDiff: handleAnalyzeDiff2 } = await import("./feedback-OTIFW5MK.js");
|
|
5145
5160
|
const result = await handleAnalyzeDiff2({ diff, path: projectPath });
|
|
5146
5161
|
const firstContent = result.content[0];
|
|
5147
5162
|
if (!firstContent) throw new Error("Empty analyze_diff response");
|
|
@@ -5176,7 +5191,7 @@ function extractFileCount(diffParsed) {
|
|
|
5176
5191
|
return files?.length ?? 0;
|
|
5177
5192
|
}
|
|
5178
5193
|
async function runStandardReview(projectPath, diff, diffLines, downgraded, offset, limit) {
|
|
5179
|
-
const { handleAnalyzeDiff: handleAnalyzeDiff2, handleCreateSelfReview: handleCreateSelfReview2 } = await import("./feedback-
|
|
5194
|
+
const { handleAnalyzeDiff: handleAnalyzeDiff2, handleCreateSelfReview: handleCreateSelfReview2 } = await import("./feedback-OTIFW5MK.js");
|
|
5180
5195
|
const [diffResult, reviewResult] = await Promise.all([
|
|
5181
5196
|
handleAnalyzeDiff2({ diff, path: projectPath }),
|
|
5182
5197
|
handleCreateSelfReview2({ path: projectPath, diff })
|
|
@@ -5211,7 +5226,7 @@ async function runStandardReview(projectPath, diff, diffLines, downgraded, offse
|
|
|
5211
5226
|
};
|
|
5212
5227
|
}
|
|
5213
5228
|
async function runDeepReview(projectPath, diff, diffLines, _downgraded, offset, limit) {
|
|
5214
|
-
const { handleRunCodeReview: handleRunCodeReview2 } = await import("./review-pipeline-
|
|
5229
|
+
const { handleRunCodeReview: handleRunCodeReview2 } = await import("./review-pipeline-65V4EO6O.js");
|
|
5215
5230
|
const result = await handleRunCodeReview2({
|
|
5216
5231
|
path: projectPath,
|
|
5217
5232
|
diff,
|
|
@@ -5290,7 +5305,7 @@ async function handleCheckTaskIndependence(input) {
|
|
|
5290
5305
|
try {
|
|
5291
5306
|
const projectPath = sanitizePath(input.path);
|
|
5292
5307
|
const store = await loadGraphStore(projectPath);
|
|
5293
|
-
const { TaskIndependenceAnalyzer } = await import("./dist-
|
|
5308
|
+
const { TaskIndependenceAnalyzer } = await import("./dist-NCNAXUFD.js");
|
|
5294
5309
|
const analyzer = new TaskIndependenceAnalyzer(store ?? void 0);
|
|
5295
5310
|
const result = analyzer.analyze({
|
|
5296
5311
|
tasks: input.tasks,
|
|
@@ -5378,7 +5393,7 @@ async function handlePredictConflicts(input) {
|
|
|
5378
5393
|
try {
|
|
5379
5394
|
const projectPath = sanitizePath(input.path);
|
|
5380
5395
|
const store = await loadGraphStore(projectPath);
|
|
5381
|
-
const { ConflictPredictor } = await import("./dist-
|
|
5396
|
+
const { ConflictPredictor } = await import("./dist-NCNAXUFD.js");
|
|
5382
5397
|
const predictor = new ConflictPredictor(store ?? void 0);
|
|
5383
5398
|
const result = predictor.predict({
|
|
5384
5399
|
tasks: input.tasks,
|
|
@@ -5484,7 +5499,7 @@ async function handleDetectStaleConstraints(input) {
|
|
|
5484
5499
|
isError: true
|
|
5485
5500
|
};
|
|
5486
5501
|
}
|
|
5487
|
-
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-
|
|
5502
|
+
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-RDXSEBD7.js");
|
|
5488
5503
|
const store = await loadGraphStore2(projectPath);
|
|
5489
5504
|
if (!store) {
|
|
5490
5505
|
return {
|
|
@@ -5505,7 +5520,7 @@ async function handleDetectStaleConstraints(input) {
|
|
|
5505
5520
|
]
|
|
5506
5521
|
};
|
|
5507
5522
|
}
|
|
5508
|
-
const { detectStaleConstraints } = await import("./dist-
|
|
5523
|
+
const { detectStaleConstraints } = await import("./dist-CJDGASPP.js");
|
|
5509
5524
|
const result = detectStaleConstraints(
|
|
5510
5525
|
store,
|
|
5511
5526
|
windowDays,
|
|
@@ -5625,10 +5640,10 @@ function countCriticalFindings(securityData) {
|
|
|
5625
5640
|
return findings.filter((f) => f.severity === "error").length;
|
|
5626
5641
|
}
|
|
5627
5642
|
async function runHealthChecks(projectPath) {
|
|
5628
|
-
const { handleAssessProject: handleAssessProject2 } = await import("./assess-project-
|
|
5629
|
-
const { handleCheckDependencies: handleCheckDependencies2 } = await import("./architecture-
|
|
5630
|
-
const { handleDetectEntropy: handleDetectEntropy2 } = await import("./entropy-
|
|
5631
|
-
const { handleRunSecurityScan: handleRunSecurityScan2 } = await import("./security-
|
|
5643
|
+
const { handleAssessProject: handleAssessProject2 } = await import("./assess-project-Y6W7YDUA.js");
|
|
5644
|
+
const { handleCheckDependencies: handleCheckDependencies2 } = await import("./architecture-ZDDKEVID.js");
|
|
5645
|
+
const { handleDetectEntropy: handleDetectEntropy2 } = await import("./entropy-PBYSIQYS.js");
|
|
5646
|
+
const { handleRunSecurityScan: handleRunSecurityScan2 } = await import("./security-CAYDRZIZ.js");
|
|
5632
5647
|
const [assessResult, depsResult, entropyResult, securityResult] = await Promise.all([
|
|
5633
5648
|
handleAssessProject2({
|
|
5634
5649
|
path: projectPath,
|
|
@@ -5683,10 +5698,10 @@ function avg(values) {
|
|
|
5683
5698
|
}
|
|
5684
5699
|
async function runGraphMetrics(projectPath) {
|
|
5685
5700
|
try {
|
|
5686
|
-
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-
|
|
5701
|
+
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-RDXSEBD7.js");
|
|
5687
5702
|
const store = await loadGraphStore2(projectPath);
|
|
5688
5703
|
if (!store) return ZERO_METRICS;
|
|
5689
|
-
const { GraphCouplingAdapter, GraphComplexityAdapter, GraphAnomalyAdapter } = await import("./dist-
|
|
5704
|
+
const { GraphCouplingAdapter, GraphComplexityAdapter, GraphAnomalyAdapter } = await import("./dist-NCNAXUFD.js");
|
|
5690
5705
|
const couplingAdapter = new GraphCouplingAdapter(store);
|
|
5691
5706
|
const couplingData = couplingAdapter.computeCouplingData();
|
|
5692
5707
|
const files = couplingData.files;
|
|
@@ -6425,7 +6440,7 @@ async function handleGetDecayTrends(input) {
|
|
|
6425
6440
|
};
|
|
6426
6441
|
}
|
|
6427
6442
|
try {
|
|
6428
|
-
const core = await import("./dist-
|
|
6443
|
+
const core = await import("./dist-CJDGASPP.js");
|
|
6429
6444
|
const { TimelineManager } = core;
|
|
6430
6445
|
const manager = new TimelineManager(projectPath);
|
|
6431
6446
|
const timeline = manager.load();
|
|
@@ -6560,7 +6575,7 @@ async function handleCodeOutline(input) {
|
|
|
6560
6575
|
};
|
|
6561
6576
|
}
|
|
6562
6577
|
try {
|
|
6563
|
-
const { getOutline, formatOutline, EXTENSION_MAP } = await import("./dist-
|
|
6578
|
+
const { getOutline, formatOutline, EXTENSION_MAP } = await import("./dist-CJDGASPP.js");
|
|
6564
6579
|
const { stat } = await import("fs/promises");
|
|
6565
6580
|
const stats = await stat(targetPath).catch(() => null);
|
|
6566
6581
|
if (stats?.isFile()) {
|
|
@@ -6579,7 +6594,7 @@ async function handleCodeOutline(input) {
|
|
|
6579
6594
|
})
|
|
6580
6595
|
);
|
|
6581
6596
|
fileStats.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
6582
|
-
const { paginate: paginate2 } = await import("./dist-
|
|
6597
|
+
const { paginate: paginate2 } = await import("./dist-CJDGASPP.js");
|
|
6583
6598
|
const paged = paginate2(fileStats, input.offset ?? 0, input.limit ?? 30);
|
|
6584
6599
|
const results = [];
|
|
6585
6600
|
for (const entry of paged.items) {
|
|
@@ -6652,7 +6667,7 @@ async function handleCodeSearch(input) {
|
|
|
6652
6667
|
};
|
|
6653
6668
|
}
|
|
6654
6669
|
try {
|
|
6655
|
-
const { searchSymbols } = await import("./dist-
|
|
6670
|
+
const { searchSymbols } = await import("./dist-CJDGASPP.js");
|
|
6656
6671
|
const result = await searchSymbols(input.query, directory, input.glob);
|
|
6657
6672
|
const lines = [`Search: "${result.query}" \u2014 ${result.matches.length} matches`];
|
|
6658
6673
|
for (const match of result.matches) {
|
|
@@ -6721,7 +6736,7 @@ async function handleCodeUnfold(input) {
|
|
|
6721
6736
|
}
|
|
6722
6737
|
try {
|
|
6723
6738
|
if (input.symbol) {
|
|
6724
|
-
const { unfoldSymbol } = await import("./dist-
|
|
6739
|
+
const { unfoldSymbol } = await import("./dist-CJDGASPP.js");
|
|
6725
6740
|
const result = await unfoldSymbol(filePath, input.symbol);
|
|
6726
6741
|
const header = result.warning ? `${result.file}:${result.startLine}-${result.endLine} ${result.warning}
|
|
6727
6742
|
` : `${result.file}:${result.startLine}-${result.endLine}
|
|
@@ -6729,7 +6744,7 @@ async function handleCodeUnfold(input) {
|
|
|
6729
6744
|
return { content: [{ type: "text", text: header + result.content }] };
|
|
6730
6745
|
}
|
|
6731
6746
|
if (input.startLine != null && input.endLine != null) {
|
|
6732
|
-
const { unfoldRange } = await import("./dist-
|
|
6747
|
+
const { unfoldRange } = await import("./dist-CJDGASPP.js");
|
|
6733
6748
|
const result = await unfoldRange(filePath, input.startLine, input.endLine);
|
|
6734
6749
|
const header = `${result.file}:${result.startLine}-${result.endLine}
|
|
6735
6750
|
`;
|
|
@@ -6791,7 +6806,7 @@ async function handleCheckTraceability(input) {
|
|
|
6791
6806
|
isError: true
|
|
6792
6807
|
};
|
|
6793
6808
|
}
|
|
6794
|
-
const { queryTraceability } = await import("./dist-
|
|
6809
|
+
const { queryTraceability } = await import("./dist-NCNAXUFD.js");
|
|
6795
6810
|
const options = {};
|
|
6796
6811
|
if (input.spec) options.specPath = input.spec;
|
|
6797
6812
|
if (input.feature) options.featureName = input.feature;
|
|
@@ -6914,7 +6929,7 @@ async function handlePredictFailures(input) {
|
|
|
6914
6929
|
};
|
|
6915
6930
|
}
|
|
6916
6931
|
try {
|
|
6917
|
-
const core = await import("./dist-
|
|
6932
|
+
const core = await import("./dist-CJDGASPP.js");
|
|
6918
6933
|
const { TimelineManager, PredictionEngine, SpecImpactEstimator } = core;
|
|
6919
6934
|
const manager = new TimelineManager(projectPath);
|
|
6920
6935
|
const includeRoadmap = input.includeRoadmap !== false;
|
|
@@ -7016,6 +7031,699 @@ async function handleRecommendSkills(input) {
|
|
|
7016
7031
|
};
|
|
7017
7032
|
}
|
|
7018
7033
|
|
|
7034
|
+
// src/mcp/tools/advise-skills.ts
|
|
7035
|
+
import path21 from "path";
|
|
7036
|
+
|
|
7037
|
+
// src/commands/advise-skills.ts
|
|
7038
|
+
import { Command as Command2 } from "commander";
|
|
7039
|
+
import fs17 from "fs";
|
|
7040
|
+
import path20 from "path";
|
|
7041
|
+
import chalk from "chalk";
|
|
7042
|
+
|
|
7043
|
+
// src/skill/content-matcher-types.ts
|
|
7044
|
+
var TIER_THRESHOLDS = {
|
|
7045
|
+
apply: 0.6,
|
|
7046
|
+
reference: 0.35,
|
|
7047
|
+
consider: 0.15
|
|
7048
|
+
};
|
|
7049
|
+
var SCORING_WEIGHTS = {
|
|
7050
|
+
keyword: 0.35,
|
|
7051
|
+
stack: 0.25,
|
|
7052
|
+
termOverlap: 0.25,
|
|
7053
|
+
domain: 0.15
|
|
7054
|
+
};
|
|
7055
|
+
var DOMAIN_KEYWORD_MAP = {
|
|
7056
|
+
design: [
|
|
7057
|
+
"layout",
|
|
7058
|
+
"responsive",
|
|
7059
|
+
"typography",
|
|
7060
|
+
"color",
|
|
7061
|
+
"theme",
|
|
7062
|
+
"dark mode",
|
|
7063
|
+
"ui",
|
|
7064
|
+
"ux",
|
|
7065
|
+
"component",
|
|
7066
|
+
"palette",
|
|
7067
|
+
"breakpoint",
|
|
7068
|
+
"grid",
|
|
7069
|
+
"elevation",
|
|
7070
|
+
"shadow",
|
|
7071
|
+
"motion",
|
|
7072
|
+
"animation",
|
|
7073
|
+
"css"
|
|
7074
|
+
],
|
|
7075
|
+
auth: [
|
|
7076
|
+
"authentication",
|
|
7077
|
+
"authorization",
|
|
7078
|
+
"oauth",
|
|
7079
|
+
"session",
|
|
7080
|
+
"token",
|
|
7081
|
+
"jwt",
|
|
7082
|
+
"login",
|
|
7083
|
+
"signup",
|
|
7084
|
+
"password",
|
|
7085
|
+
"credential",
|
|
7086
|
+
"rbac",
|
|
7087
|
+
"permission",
|
|
7088
|
+
"identity"
|
|
7089
|
+
],
|
|
7090
|
+
data: [
|
|
7091
|
+
"database",
|
|
7092
|
+
"schema",
|
|
7093
|
+
"migration",
|
|
7094
|
+
"query",
|
|
7095
|
+
"sql",
|
|
7096
|
+
"nosql",
|
|
7097
|
+
"orm",
|
|
7098
|
+
"model",
|
|
7099
|
+
"table",
|
|
7100
|
+
"transaction",
|
|
7101
|
+
"prisma",
|
|
7102
|
+
"drizzle"
|
|
7103
|
+
],
|
|
7104
|
+
security: [
|
|
7105
|
+
"security",
|
|
7106
|
+
"vulnerability",
|
|
7107
|
+
"xss",
|
|
7108
|
+
"csrf",
|
|
7109
|
+
"injection",
|
|
7110
|
+
"sanitiz",
|
|
7111
|
+
"encrypt",
|
|
7112
|
+
"hash",
|
|
7113
|
+
"owasp",
|
|
7114
|
+
"cve",
|
|
7115
|
+
"audit"
|
|
7116
|
+
],
|
|
7117
|
+
a11y: [
|
|
7118
|
+
"accessibility",
|
|
7119
|
+
"a11y",
|
|
7120
|
+
"aria",
|
|
7121
|
+
"screen reader",
|
|
7122
|
+
"screen-reader",
|
|
7123
|
+
"wcag",
|
|
7124
|
+
"contrast",
|
|
7125
|
+
"keyboard navigation",
|
|
7126
|
+
"focus management"
|
|
7127
|
+
],
|
|
7128
|
+
perf: [
|
|
7129
|
+
"performance",
|
|
7130
|
+
"latency",
|
|
7131
|
+
"throughput",
|
|
7132
|
+
"cache",
|
|
7133
|
+
"lazy load",
|
|
7134
|
+
"bundle size",
|
|
7135
|
+
"tree shaking",
|
|
7136
|
+
"code splitting",
|
|
7137
|
+
"lighthouse",
|
|
7138
|
+
"optimization",
|
|
7139
|
+
"bundle"
|
|
7140
|
+
],
|
|
7141
|
+
testing: [
|
|
7142
|
+
"test",
|
|
7143
|
+
"coverage",
|
|
7144
|
+
"mock",
|
|
7145
|
+
"stub",
|
|
7146
|
+
"fixture",
|
|
7147
|
+
"assertion",
|
|
7148
|
+
"snapshot",
|
|
7149
|
+
"e2e",
|
|
7150
|
+
"integration test",
|
|
7151
|
+
"unit test",
|
|
7152
|
+
"tdd"
|
|
7153
|
+
],
|
|
7154
|
+
api: [
|
|
7155
|
+
"api",
|
|
7156
|
+
"endpoint",
|
|
7157
|
+
"rest",
|
|
7158
|
+
"graphql",
|
|
7159
|
+
"openapi",
|
|
7160
|
+
"swagger",
|
|
7161
|
+
"route",
|
|
7162
|
+
"middleware",
|
|
7163
|
+
"webhook",
|
|
7164
|
+
"grpc"
|
|
7165
|
+
],
|
|
7166
|
+
infra: [
|
|
7167
|
+
"docker",
|
|
7168
|
+
"kubernetes",
|
|
7169
|
+
"ci/cd",
|
|
7170
|
+
"ci",
|
|
7171
|
+
"cd",
|
|
7172
|
+
"deploy",
|
|
7173
|
+
"terraform",
|
|
7174
|
+
"aws",
|
|
7175
|
+
"gcp",
|
|
7176
|
+
"azure",
|
|
7177
|
+
"cloud",
|
|
7178
|
+
"container",
|
|
7179
|
+
"helm"
|
|
7180
|
+
],
|
|
7181
|
+
mobile: [
|
|
7182
|
+
"mobile",
|
|
7183
|
+
"ios",
|
|
7184
|
+
"android",
|
|
7185
|
+
"react native",
|
|
7186
|
+
"react-native",
|
|
7187
|
+
"flutter",
|
|
7188
|
+
"app store",
|
|
7189
|
+
"push notification"
|
|
7190
|
+
]
|
|
7191
|
+
};
|
|
7192
|
+
|
|
7193
|
+
// src/skill/signal-extractor.ts
|
|
7194
|
+
var STEM_SUFFIXES = [
|
|
7195
|
+
"ation",
|
|
7196
|
+
"tion",
|
|
7197
|
+
"sion",
|
|
7198
|
+
"ment",
|
|
7199
|
+
"ness",
|
|
7200
|
+
"ible",
|
|
7201
|
+
"able",
|
|
7202
|
+
"ive",
|
|
7203
|
+
"ous",
|
|
7204
|
+
"ful",
|
|
7205
|
+
"ing",
|
|
7206
|
+
"ity",
|
|
7207
|
+
"ly",
|
|
7208
|
+
"ed",
|
|
7209
|
+
"er",
|
|
7210
|
+
"es",
|
|
7211
|
+
"s"
|
|
7212
|
+
];
|
|
7213
|
+
function simpleStem(word) {
|
|
7214
|
+
const w = word.toLowerCase();
|
|
7215
|
+
if (w.length <= 4) return w;
|
|
7216
|
+
for (const suffix of STEM_SUFFIXES) {
|
|
7217
|
+
if (w.endsWith(suffix) && w.length - suffix.length >= 3) {
|
|
7218
|
+
return w.slice(0, -suffix.length);
|
|
7219
|
+
}
|
|
7220
|
+
}
|
|
7221
|
+
return w;
|
|
7222
|
+
}
|
|
7223
|
+
function extractSpecKeywords(specText) {
|
|
7224
|
+
const match = specText.match(/\*\*Keywords?:\*\*\s*(.+)/i);
|
|
7225
|
+
if (!match?.[1]) return [];
|
|
7226
|
+
return match[1].split(",").map((k) => k.trim()).filter((k) => k.length > 0);
|
|
7227
|
+
}
|
|
7228
|
+
var STACK_SIGNAL_MAP = {
|
|
7229
|
+
react: "react",
|
|
7230
|
+
"react-dom": "react",
|
|
7231
|
+
"react-native": "react-native",
|
|
7232
|
+
next: "next",
|
|
7233
|
+
vue: "vue",
|
|
7234
|
+
nuxt: "nuxt",
|
|
7235
|
+
angular: "angular",
|
|
7236
|
+
svelte: "svelte",
|
|
7237
|
+
express: "express",
|
|
7238
|
+
fastify: "fastify",
|
|
7239
|
+
nestjs: "nest",
|
|
7240
|
+
"@nestjs/core": "nest",
|
|
7241
|
+
typescript: "typescript",
|
|
7242
|
+
tailwindcss: "tailwind",
|
|
7243
|
+
prisma: "prisma",
|
|
7244
|
+
"@prisma/client": "prisma",
|
|
7245
|
+
"drizzle-orm": "drizzle",
|
|
7246
|
+
graphql: "graphql",
|
|
7247
|
+
"@trpc/server": "trpc",
|
|
7248
|
+
trpc: "trpc",
|
|
7249
|
+
vitest: "vitest",
|
|
7250
|
+
jest: "jest",
|
|
7251
|
+
playwright: "playwright",
|
|
7252
|
+
cypress: "cypress",
|
|
7253
|
+
vite: "vite",
|
|
7254
|
+
webpack: "webpack",
|
|
7255
|
+
zod: "zod",
|
|
7256
|
+
mongoose: "mongoose",
|
|
7257
|
+
redis: "redis",
|
|
7258
|
+
ioredis: "redis",
|
|
7259
|
+
"socket.io": "websocket",
|
|
7260
|
+
ws: "websocket"
|
|
7261
|
+
};
|
|
7262
|
+
function detectStackFromDeps(dependencies, devDependencies) {
|
|
7263
|
+
const signals = /* @__PURE__ */ new Set();
|
|
7264
|
+
const allDeps = { ...dependencies, ...devDependencies };
|
|
7265
|
+
for (const pkgName of Object.keys(allDeps)) {
|
|
7266
|
+
const signal = STACK_SIGNAL_MAP[pkgName];
|
|
7267
|
+
if (signal) {
|
|
7268
|
+
signals.add(signal);
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7271
|
+
return [...signals].sort();
|
|
7272
|
+
}
|
|
7273
|
+
function inferDomain(specText) {
|
|
7274
|
+
const lower = specText.toLowerCase();
|
|
7275
|
+
const domains = [];
|
|
7276
|
+
for (const [domain, markers] of Object.entries(DOMAIN_KEYWORD_MAP)) {
|
|
7277
|
+
const hits = markers.filter((m) => lower.includes(m)).length;
|
|
7278
|
+
if (hits >= 2) {
|
|
7279
|
+
domains.push(domain);
|
|
7280
|
+
}
|
|
7281
|
+
}
|
|
7282
|
+
return domains.sort();
|
|
7283
|
+
}
|
|
7284
|
+
function extractSignals(specText, dependencies, devDependencies, contextKeywords, taskText) {
|
|
7285
|
+
const specKeywords = extractSpecKeywords(specText);
|
|
7286
|
+
if (contextKeywords) {
|
|
7287
|
+
const existing = new Set(specKeywords);
|
|
7288
|
+
for (const kw of contextKeywords) {
|
|
7289
|
+
if (!existing.has(kw)) {
|
|
7290
|
+
specKeywords.push(kw);
|
|
7291
|
+
existing.add(kw);
|
|
7292
|
+
}
|
|
7293
|
+
}
|
|
7294
|
+
}
|
|
7295
|
+
const stackSignals = detectStackFromDeps(dependencies, devDependencies);
|
|
7296
|
+
const featureDomain = inferDomain(specText);
|
|
7297
|
+
return {
|
|
7298
|
+
specKeywords,
|
|
7299
|
+
specText,
|
|
7300
|
+
stackSignals,
|
|
7301
|
+
featureDomain,
|
|
7302
|
+
...taskText !== void 0 && { taskText }
|
|
7303
|
+
};
|
|
7304
|
+
}
|
|
7305
|
+
|
|
7306
|
+
// src/skill/content-matcher.ts
|
|
7307
|
+
function computeKeywordOverlap(skillKeywords, specKeywords) {
|
|
7308
|
+
if (skillKeywords.length === 0 || specKeywords.length === 0) return 0;
|
|
7309
|
+
const stemTokens = (keywords) => {
|
|
7310
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
7311
|
+
for (const kw of keywords) {
|
|
7312
|
+
const parts = kw.toLowerCase().split(/[-_\s]+/);
|
|
7313
|
+
for (const part of parts) {
|
|
7314
|
+
if (part.length > 0) {
|
|
7315
|
+
tokens.add(simpleStem(part));
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
}
|
|
7319
|
+
return tokens;
|
|
7320
|
+
};
|
|
7321
|
+
const skillStems = stemTokens(skillKeywords);
|
|
7322
|
+
const specStems = stemTokens(specKeywords);
|
|
7323
|
+
let intersectionCount = 0;
|
|
7324
|
+
for (const stem of skillStems) {
|
|
7325
|
+
if (specStems.has(stem)) intersectionCount++;
|
|
7326
|
+
}
|
|
7327
|
+
const unionSize = (/* @__PURE__ */ new Set([...skillStems, ...specStems])).size;
|
|
7328
|
+
return unionSize > 0 ? intersectionCount / unionSize : 0;
|
|
7329
|
+
}
|
|
7330
|
+
function computeStackMatch(skillSignals, projectSignals) {
|
|
7331
|
+
if (skillSignals.length === 0) return 0;
|
|
7332
|
+
const projectSet = new Set(projectSignals.map((s) => s.toLowerCase()));
|
|
7333
|
+
const matched = skillSignals.filter((s) => projectSet.has(s.toLowerCase())).length;
|
|
7334
|
+
return matched / skillSignals.length;
|
|
7335
|
+
}
|
|
7336
|
+
function computeTermOverlap(skillDescription, specText) {
|
|
7337
|
+
if (!skillDescription || !specText) return 0;
|
|
7338
|
+
const tokenize = (text) => text.toLowerCase().split(/[\s\-_,.;:!?()[\]{}"'`]+/).filter((t) => t.length > 3).map(simpleStem);
|
|
7339
|
+
const descTokens = tokenize(skillDescription);
|
|
7340
|
+
if (descTokens.length === 0) return 0;
|
|
7341
|
+
const specTokenSet = new Set(tokenize(specText));
|
|
7342
|
+
const matched = descTokens.filter((t) => specTokenSet.has(t)).length;
|
|
7343
|
+
return matched / descTokens.length;
|
|
7344
|
+
}
|
|
7345
|
+
function computeDomainMatch(entry, featureDomains) {
|
|
7346
|
+
if (featureDomains.length === 0 || entry.keywords.length === 0) return 0;
|
|
7347
|
+
const skillKeywordsLower = entry.keywords.map((k) => k.toLowerCase());
|
|
7348
|
+
for (const domain of featureDomains) {
|
|
7349
|
+
const domainKeywords = DOMAIN_KEYWORD_MAP[domain];
|
|
7350
|
+
if (!domainKeywords) continue;
|
|
7351
|
+
const hasMatch = skillKeywordsLower.some(
|
|
7352
|
+
(kw) => domainKeywords.some((dk) => kw.includes(dk) || dk.includes(kw))
|
|
7353
|
+
);
|
|
7354
|
+
if (hasMatch) return 1;
|
|
7355
|
+
}
|
|
7356
|
+
return 0;
|
|
7357
|
+
}
|
|
7358
|
+
function classifyTier(score) {
|
|
7359
|
+
if (score >= TIER_THRESHOLDS.apply) return "apply";
|
|
7360
|
+
if (score >= TIER_THRESHOLDS.reference) return "reference";
|
|
7361
|
+
if (score >= TIER_THRESHOLDS.consider) return "consider";
|
|
7362
|
+
return null;
|
|
7363
|
+
}
|
|
7364
|
+
var WHEN_RULES = [
|
|
7365
|
+
{ name: /scan|audit|i18n|lint/, when: "End of phase" },
|
|
7366
|
+
{ name: /test/, keywords: /test|tdd|coverage|mock|e2e|snapshot/, when: "Testing" },
|
|
7367
|
+
{
|
|
7368
|
+
name: /a11y|contrast|wcag|color.accessib/,
|
|
7369
|
+
keywords: /contrast|wcag/,
|
|
7370
|
+
when: "After styling"
|
|
7371
|
+
},
|
|
7372
|
+
{ keywords: /css|tailwind|typography|font|color|palette/, when: "During styling" },
|
|
7373
|
+
{ keywords: /alignment|whitespace|spacing|grid/, when: "Layout review" },
|
|
7374
|
+
{ keywords: /motion|animation|transition|parallax/, when: "During polish" },
|
|
7375
|
+
{ keywords: /architect|pattern|api|schema|data.model/, when: "Architecture decisions" },
|
|
7376
|
+
{ name: /^(gof-|js-)/, when: "Architecture decisions" }
|
|
7377
|
+
];
|
|
7378
|
+
function matchesWhenRule(rule, nameLower, keywordsLower) {
|
|
7379
|
+
const nameHit = rule.name ? rule.name.test(nameLower) : false;
|
|
7380
|
+
const kwHit = rule.keywords ? rule.keywords.test(keywordsLower) : false;
|
|
7381
|
+
if (rule.name && rule.keywords) return nameHit || kwHit;
|
|
7382
|
+
return nameHit || kwHit;
|
|
7383
|
+
}
|
|
7384
|
+
function inferWhen(name, entry) {
|
|
7385
|
+
const nameLower = name.toLowerCase();
|
|
7386
|
+
const keywordsLower = entry.keywords.map((k) => k.toLowerCase()).join(" ");
|
|
7387
|
+
for (const rule of WHEN_RULES) {
|
|
7388
|
+
if (matchesWhenRule(rule, nameLower, keywordsLower)) return rule.when;
|
|
7389
|
+
}
|
|
7390
|
+
return "During implementation";
|
|
7391
|
+
}
|
|
7392
|
+
function scoreSkillByContent(entry, signals) {
|
|
7393
|
+
const keywordScore = computeKeywordOverlap(entry.keywords, signals.specKeywords);
|
|
7394
|
+
const stackScore = computeStackMatch(entry.stackSignals, signals.stackSignals);
|
|
7395
|
+
const textToMatch = signals.taskText ?? signals.specText;
|
|
7396
|
+
const descScore = computeTermOverlap(entry.description, textToMatch);
|
|
7397
|
+
const domainScore = computeDomainMatch(entry, signals.featureDomain);
|
|
7398
|
+
return SCORING_WEIGHTS.keyword * keywordScore + SCORING_WEIGHTS.stack * stackScore + SCORING_WEIGHTS.termOverlap * descScore + SCORING_WEIGHTS.domain * domainScore;
|
|
7399
|
+
}
|
|
7400
|
+
function buildMatchReasons(entry, signals) {
|
|
7401
|
+
const reasons = [];
|
|
7402
|
+
const matchedKeywords = entry.keywords.filter(
|
|
7403
|
+
(kw) => signals.specKeywords.some(
|
|
7404
|
+
(sk) => kw.toLowerCase().includes(sk.toLowerCase()) || sk.toLowerCase().includes(kw.toLowerCase())
|
|
7405
|
+
)
|
|
7406
|
+
);
|
|
7407
|
+
if (matchedKeywords.length > 0) {
|
|
7408
|
+
reasons.push(`Keywords: ${matchedKeywords.join(", ")}`);
|
|
7409
|
+
}
|
|
7410
|
+
const projectSignalSet = new Set(signals.stackSignals.map((s) => s.toLowerCase()));
|
|
7411
|
+
const matchedStack = entry.stackSignals.filter((s) => projectSignalSet.has(s.toLowerCase()));
|
|
7412
|
+
if (matchedStack.length > 0) {
|
|
7413
|
+
reasons.push(`Stack: ${matchedStack.join(", ")}`);
|
|
7414
|
+
}
|
|
7415
|
+
if (signals.featureDomain.length > 0) {
|
|
7416
|
+
reasons.push(`Domain: ${signals.featureDomain.join(", ")}`);
|
|
7417
|
+
}
|
|
7418
|
+
return reasons;
|
|
7419
|
+
}
|
|
7420
|
+
function inferCategory(entry) {
|
|
7421
|
+
const keywordsLower = entry.keywords.map((k) => k.toLowerCase()).join(" ");
|
|
7422
|
+
if (/design|layout|responsive|css|ui|ux|theme|color/.test(keywordsLower)) return "design";
|
|
7423
|
+
if (/auth|oauth|session|token|jwt|login/.test(keywordsLower)) return "security";
|
|
7424
|
+
if (/a11y|accessibility|aria|wcag/.test(keywordsLower)) return "a11y";
|
|
7425
|
+
if (/perf|performance|cache|optimization|lighthouse/.test(keywordsLower)) return "perf";
|
|
7426
|
+
if (/test|tdd|coverage|mock|e2e/.test(keywordsLower)) return "testing";
|
|
7427
|
+
if (/database|sql|orm|migration|schema/.test(keywordsLower)) return "data";
|
|
7428
|
+
if (/api|rest|graphql|endpoint/.test(keywordsLower)) return "api";
|
|
7429
|
+
if (/docker|kubernetes|deploy|ci|terraform/.test(keywordsLower)) return "infra";
|
|
7430
|
+
if (/react|vue|angular|svelte|next/.test(keywordsLower)) return "framework";
|
|
7431
|
+
return "patterns";
|
|
7432
|
+
}
|
|
7433
|
+
function scoreAllSkills(index, signals) {
|
|
7434
|
+
const scored = [];
|
|
7435
|
+
for (const [name, entry] of Object.entries(index.skills)) {
|
|
7436
|
+
const score = scoreSkillByContent(entry, signals);
|
|
7437
|
+
if (score >= TIER_THRESHOLDS.consider) {
|
|
7438
|
+
scored.push({ name, entry, score });
|
|
7439
|
+
}
|
|
7440
|
+
}
|
|
7441
|
+
return scored;
|
|
7442
|
+
}
|
|
7443
|
+
function expandRelatedSkills(scored, index) {
|
|
7444
|
+
const matchedNames = new Set(scored.map((s) => s.name));
|
|
7445
|
+
const expansions = [];
|
|
7446
|
+
for (const match of scored) {
|
|
7447
|
+
if (match.score < TIER_THRESHOLDS.reference) continue;
|
|
7448
|
+
for (const relatedName of match.entry.relatedSkills) {
|
|
7449
|
+
if (matchedNames.has(relatedName)) continue;
|
|
7450
|
+
const relatedEntry = index.skills[relatedName];
|
|
7451
|
+
if (!relatedEntry) continue;
|
|
7452
|
+
const boostedScore = match.score * 0.6;
|
|
7453
|
+
if (boostedScore >= TIER_THRESHOLDS.consider) {
|
|
7454
|
+
matchedNames.add(relatedName);
|
|
7455
|
+
expansions.push({
|
|
7456
|
+
name: relatedName,
|
|
7457
|
+
entry: relatedEntry,
|
|
7458
|
+
score: boostedScore,
|
|
7459
|
+
parentName: match.name
|
|
7460
|
+
});
|
|
7461
|
+
}
|
|
7462
|
+
}
|
|
7463
|
+
}
|
|
7464
|
+
return expansions;
|
|
7465
|
+
}
|
|
7466
|
+
function buildMatchList(scored, expansions, signals) {
|
|
7467
|
+
const matches = [];
|
|
7468
|
+
for (const { name, entry, score } of scored) {
|
|
7469
|
+
const tier = classifyTier(score);
|
|
7470
|
+
if (!tier) continue;
|
|
7471
|
+
matches.push({
|
|
7472
|
+
skillName: name,
|
|
7473
|
+
score: Math.round(score * 100) / 100,
|
|
7474
|
+
tier,
|
|
7475
|
+
matchReasons: buildMatchReasons(entry, signals),
|
|
7476
|
+
category: inferCategory(entry),
|
|
7477
|
+
when: inferWhen(name, entry)
|
|
7478
|
+
});
|
|
7479
|
+
}
|
|
7480
|
+
for (const { name, entry, score, parentName } of expansions) {
|
|
7481
|
+
const tier = classifyTier(score);
|
|
7482
|
+
if (!tier) continue;
|
|
7483
|
+
matches.push({
|
|
7484
|
+
skillName: name,
|
|
7485
|
+
score: Math.round(score * 100) / 100,
|
|
7486
|
+
tier,
|
|
7487
|
+
matchReasons: [`Related to: ${parentName}`, ...buildMatchReasons(entry, signals)],
|
|
7488
|
+
category: inferCategory(entry),
|
|
7489
|
+
when: inferWhen(name, entry)
|
|
7490
|
+
});
|
|
7491
|
+
}
|
|
7492
|
+
matches.sort((a, b) => b.score - a.score);
|
|
7493
|
+
return matches;
|
|
7494
|
+
}
|
|
7495
|
+
function matchContent(index, signals) {
|
|
7496
|
+
const startTime = performance.now();
|
|
7497
|
+
const scored = scoreAllSkills(index, signals);
|
|
7498
|
+
const expansions = expandRelatedSkills(scored, index);
|
|
7499
|
+
const matches = buildMatchList(scored, expansions, signals);
|
|
7500
|
+
return {
|
|
7501
|
+
matches,
|
|
7502
|
+
signalsUsed: signals,
|
|
7503
|
+
scanDuration: Math.round(performance.now() - startTime)
|
|
7504
|
+
};
|
|
7505
|
+
}
|
|
7506
|
+
|
|
7507
|
+
// src/skill/skills-md-writer.ts
|
|
7508
|
+
function generateSkillsMd(featureName, result, totalSkillCount) {
|
|
7509
|
+
const lines = [];
|
|
7510
|
+
lines.push(`# Recommended Skills: ${featureName}`);
|
|
7511
|
+
lines.push("");
|
|
7512
|
+
lines.push("> Auto-generated by Pipeline Skill Advisor. Review and adjust as needed.");
|
|
7513
|
+
const apply = result.matches.filter((m) => m.tier === "apply");
|
|
7514
|
+
const reference = result.matches.filter((m) => m.tier === "reference");
|
|
7515
|
+
const consider = result.matches.filter((m) => m.tier === "consider");
|
|
7516
|
+
if (apply.length > 0) {
|
|
7517
|
+
lines.push("");
|
|
7518
|
+
lines.push("## Apply (invoke during execution)");
|
|
7519
|
+
lines.push("");
|
|
7520
|
+
lines.push(...renderTable(apply));
|
|
7521
|
+
}
|
|
7522
|
+
if (reference.length > 0) {
|
|
7523
|
+
lines.push("");
|
|
7524
|
+
lines.push("## Reference (load as context)");
|
|
7525
|
+
lines.push("");
|
|
7526
|
+
lines.push(...renderTable(reference));
|
|
7527
|
+
}
|
|
7528
|
+
if (consider.length > 0) {
|
|
7529
|
+
lines.push("");
|
|
7530
|
+
lines.push("## Consider");
|
|
7531
|
+
lines.push("");
|
|
7532
|
+
lines.push(...renderTable(consider));
|
|
7533
|
+
}
|
|
7534
|
+
lines.push("");
|
|
7535
|
+
lines.push("---");
|
|
7536
|
+
const skillsScanned = totalSkillCount ?? result.matches.length;
|
|
7537
|
+
const keywords = result.signalsUsed.specKeywords.length;
|
|
7538
|
+
const stack = result.signalsUsed.stackSignals.length;
|
|
7539
|
+
const domains = result.signalsUsed.featureDomain.length;
|
|
7540
|
+
lines.push(
|
|
7541
|
+
`*Scanned ${skillsScanned} skills in ${result.scanDuration}ms. Signals: ${keywords} keywords, ${stack} stack markers, ${domains} domains.*`
|
|
7542
|
+
);
|
|
7543
|
+
lines.push("");
|
|
7544
|
+
return lines.join("\n");
|
|
7545
|
+
}
|
|
7546
|
+
function renderTable(matches) {
|
|
7547
|
+
const lines = [];
|
|
7548
|
+
lines.push("| Skill | Purpose | When | Relevance |");
|
|
7549
|
+
lines.push("|-------|---------|------|-----------|");
|
|
7550
|
+
for (const match of matches) {
|
|
7551
|
+
const purpose = match.matchReasons.join("; ");
|
|
7552
|
+
lines.push(`| \`${match.skillName}\` | ${purpose} | ${match.when} | ${match.score} |`);
|
|
7553
|
+
}
|
|
7554
|
+
return lines;
|
|
7555
|
+
}
|
|
7556
|
+
|
|
7557
|
+
// src/commands/advise-skills.ts
|
|
7558
|
+
function readPackageDeps(cwd) {
|
|
7559
|
+
const pkgPath = path20.join(cwd, "package.json");
|
|
7560
|
+
if (!fs17.existsSync(pkgPath)) return { deps: {}, devDeps: {} };
|
|
7561
|
+
try {
|
|
7562
|
+
const pkg = JSON.parse(fs17.readFileSync(pkgPath, "utf-8"));
|
|
7563
|
+
const deps = typeof pkg.dependencies === "object" && pkg.dependencies !== null ? pkg.dependencies : {};
|
|
7564
|
+
const devDeps = typeof pkg.devDependencies === "object" && pkg.devDependencies !== null ? pkg.devDependencies : {};
|
|
7565
|
+
return { deps, devDeps };
|
|
7566
|
+
} catch {
|
|
7567
|
+
return { deps: {}, devDeps: {} };
|
|
7568
|
+
}
|
|
7569
|
+
}
|
|
7570
|
+
function readSpecText(specPath) {
|
|
7571
|
+
if (!fs17.existsSync(specPath)) {
|
|
7572
|
+
throw new Error(`Spec not found: ${specPath}`);
|
|
7573
|
+
}
|
|
7574
|
+
return fs17.readFileSync(specPath, "utf-8");
|
|
7575
|
+
}
|
|
7576
|
+
function filterMatchesByTier(result, top, thorough) {
|
|
7577
|
+
const applySkills = result.matches.filter((m) => m.tier === "apply").slice(0, top);
|
|
7578
|
+
const refSkills = result.matches.filter((m) => m.tier === "reference").slice(0, top * 2);
|
|
7579
|
+
const considerSkills = thorough ? result.matches.filter((m) => m.tier === "consider").slice(0, top) : [];
|
|
7580
|
+
return { ...result, matches: [...applySkills, ...refSkills, ...considerSkills] };
|
|
7581
|
+
}
|
|
7582
|
+
function extractFeatureName(specText, specPath) {
|
|
7583
|
+
const titleMatch = specText.match(/^#\s+(.+)/m);
|
|
7584
|
+
return titleMatch?.[1] ?? path20.basename(path20.dirname(specPath));
|
|
7585
|
+
}
|
|
7586
|
+
async function runAdviseSkills(options) {
|
|
7587
|
+
const cwd = options.cwd ?? process.cwd();
|
|
7588
|
+
const specPath = path20.resolve(cwd, options.specPath);
|
|
7589
|
+
const specText = readSpecText(specPath);
|
|
7590
|
+
const { deps, devDeps } = readPackageDeps(cwd);
|
|
7591
|
+
const signals = extractSignals(specText, deps, devDeps);
|
|
7592
|
+
const configResult = resolveConfig();
|
|
7593
|
+
const tierOverrides = configResult.ok ? configResult.value.skills?.tierOverrides : void 0;
|
|
7594
|
+
const index = loadOrRebuildIndex("claude-code", cwd, tierOverrides);
|
|
7595
|
+
const totalSkills = Object.keys(index.skills).length;
|
|
7596
|
+
const result = matchContent(index, signals);
|
|
7597
|
+
const filteredResult = filterMatchesByTier(result, options.top ?? 5, !!options.thorough);
|
|
7598
|
+
const featureName = extractFeatureName(specText, specPath);
|
|
7599
|
+
const skillsMdPath = path20.join(path20.dirname(specPath), "SKILLS.md");
|
|
7600
|
+
const md = generateSkillsMd(featureName, filteredResult, totalSkills);
|
|
7601
|
+
fs17.writeFileSync(skillsMdPath, md, "utf-8");
|
|
7602
|
+
return { result: filteredResult, skillsMdPath, featureName, totalSkills };
|
|
7603
|
+
}
|
|
7604
|
+
function formatOutput(featureName, result, skillsMdPath, totalSkills) {
|
|
7605
|
+
const apply = result.matches.filter((m) => m.tier === "apply");
|
|
7606
|
+
const ref = result.matches.filter((m) => m.tier === "reference");
|
|
7607
|
+
const consider = result.matches.filter((m) => m.tier === "consider");
|
|
7608
|
+
const lines = [];
|
|
7609
|
+
lines.push(`Skill Advisor: Found ${result.matches.length} relevant skills for "${featureName}"`);
|
|
7610
|
+
lines.push("");
|
|
7611
|
+
if (apply.length > 0) {
|
|
7612
|
+
lines.push(chalk.green(` Apply (${apply.length}):`));
|
|
7613
|
+
for (const m of apply) {
|
|
7614
|
+
lines.push(` ${m.skillName} (${m.score}) \u2014 ${m.when}`);
|
|
7615
|
+
}
|
|
7616
|
+
}
|
|
7617
|
+
if (ref.length > 0) {
|
|
7618
|
+
lines.push(chalk.blue(` Reference (${ref.length}):`));
|
|
7619
|
+
for (const m of ref) {
|
|
7620
|
+
lines.push(` ${m.skillName} (${m.score}) \u2014 ${m.when}`);
|
|
7621
|
+
}
|
|
7622
|
+
}
|
|
7623
|
+
if (consider.length > 0) {
|
|
7624
|
+
lines.push(chalk.dim(` Consider (${consider.length}):`));
|
|
7625
|
+
for (const m of consider) {
|
|
7626
|
+
lines.push(` ${m.skillName} (${m.score}) \u2014 ${m.when}`);
|
|
7627
|
+
}
|
|
7628
|
+
}
|
|
7629
|
+
lines.push("");
|
|
7630
|
+
lines.push(`Scanned ${totalSkills} skills in ${result.scanDuration}ms`);
|
|
7631
|
+
lines.push(`Written to ${skillsMdPath}`);
|
|
7632
|
+
return lines.join("\n");
|
|
7633
|
+
}
|
|
7634
|
+
function createAdviseSkillsCommand() {
|
|
7635
|
+
return new Command2("advise-skills").description("Content-based skill recommendations for a spec").requiredOption("--spec-path <path>", "Path to the spec (proposal.md)").option("--thorough", "Include Consider tier in output").option("--top <n>", "Max skills per tier (default 5)", parseInt).option("--json", "Output as JSON").action(async (opts) => {
|
|
7636
|
+
try {
|
|
7637
|
+
const { result, skillsMdPath, featureName, totalSkills } = await runAdviseSkills({
|
|
7638
|
+
specPath: opts.specPath,
|
|
7639
|
+
thorough: opts.thorough,
|
|
7640
|
+
top: opts.top
|
|
7641
|
+
});
|
|
7642
|
+
if (opts.json) {
|
|
7643
|
+
logger.info(JSON.stringify(result, null, 2));
|
|
7644
|
+
} else {
|
|
7645
|
+
logger.info(formatOutput(featureName, result, skillsMdPath, totalSkills));
|
|
7646
|
+
}
|
|
7647
|
+
} catch (err) {
|
|
7648
|
+
logger.error(err.message);
|
|
7649
|
+
process.exit(1);
|
|
7650
|
+
}
|
|
7651
|
+
});
|
|
7652
|
+
}
|
|
7653
|
+
|
|
7654
|
+
// src/mcp/tools/advise-skills.ts
|
|
7655
|
+
var adviseSkillsDefinition = {
|
|
7656
|
+
name: "advise_skills",
|
|
7657
|
+
description: "Content-based skill recommendations for a spec or feature description. Returns tiered matches with purpose and timing guidance.",
|
|
7658
|
+
inputSchema: {
|
|
7659
|
+
type: "object",
|
|
7660
|
+
properties: {
|
|
7661
|
+
path: {
|
|
7662
|
+
type: "string",
|
|
7663
|
+
description: "Project root path (defaults to cwd)"
|
|
7664
|
+
},
|
|
7665
|
+
specPath: {
|
|
7666
|
+
type: "string",
|
|
7667
|
+
description: "Path to the spec file (proposal.md), relative to project root"
|
|
7668
|
+
},
|
|
7669
|
+
thorough: {
|
|
7670
|
+
type: "boolean",
|
|
7671
|
+
description: "Include Consider tier in output"
|
|
7672
|
+
},
|
|
7673
|
+
top: {
|
|
7674
|
+
type: "number",
|
|
7675
|
+
description: "Max skills per tier (default 5 apply, 10 reference)"
|
|
7676
|
+
}
|
|
7677
|
+
},
|
|
7678
|
+
required: ["specPath"]
|
|
7679
|
+
}
|
|
7680
|
+
};
|
|
7681
|
+
async function handleAdviseSkills(input) {
|
|
7682
|
+
const projectRoot = input.path || process.cwd();
|
|
7683
|
+
const specRelPath = input.specPath;
|
|
7684
|
+
const thorough = input.thorough || false;
|
|
7685
|
+
const top = input.top || 5;
|
|
7686
|
+
try {
|
|
7687
|
+
const { result, skillsMdPath, featureName, totalSkills } = await runAdviseSkills({
|
|
7688
|
+
specPath: specRelPath,
|
|
7689
|
+
cwd: projectRoot,
|
|
7690
|
+
thorough,
|
|
7691
|
+
top
|
|
7692
|
+
});
|
|
7693
|
+
const response = {
|
|
7694
|
+
featureName,
|
|
7695
|
+
skillsPath: path21.relative(projectRoot, skillsMdPath).replaceAll("\\", "/"),
|
|
7696
|
+
totalScanned: totalSkills,
|
|
7697
|
+
scanDuration: result.scanDuration,
|
|
7698
|
+
apply: result.matches.filter((m) => m.tier === "apply").map((m) => ({
|
|
7699
|
+
skill: m.skillName,
|
|
7700
|
+
score: m.score,
|
|
7701
|
+
when: m.when,
|
|
7702
|
+
reasons: m.matchReasons
|
|
7703
|
+
})),
|
|
7704
|
+
reference: result.matches.filter((m) => m.tier === "reference").map((m) => ({
|
|
7705
|
+
skill: m.skillName,
|
|
7706
|
+
score: m.score,
|
|
7707
|
+
when: m.when,
|
|
7708
|
+
reasons: m.matchReasons
|
|
7709
|
+
})),
|
|
7710
|
+
consider: result.matches.filter((m) => m.tier === "consider").map((m) => ({
|
|
7711
|
+
skill: m.skillName,
|
|
7712
|
+
score: m.score,
|
|
7713
|
+
when: m.when,
|
|
7714
|
+
reasons: m.matchReasons
|
|
7715
|
+
}))
|
|
7716
|
+
};
|
|
7717
|
+
return {
|
|
7718
|
+
content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
|
|
7719
|
+
};
|
|
7720
|
+
} catch (err) {
|
|
7721
|
+
return {
|
|
7722
|
+
content: [{ type: "text", text: JSON.stringify({ error: err.message }) }]
|
|
7723
|
+
};
|
|
7724
|
+
}
|
|
7725
|
+
}
|
|
7726
|
+
|
|
7019
7727
|
// src/mcp/tools/compact.ts
|
|
7020
7728
|
init_dist();
|
|
7021
7729
|
var COMPACT_TOOL_DEFAULT_BUDGET = 2e3;
|
|
@@ -7104,7 +7812,7 @@ function handleContentMode(content, pipeline, budget, source) {
|
|
|
7104
7812
|
};
|
|
7105
7813
|
}
|
|
7106
7814
|
async function handleIntentMode(projectPath, intent, pipeline, budget, filterContent) {
|
|
7107
|
-
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-
|
|
7815
|
+
const { loadGraphStore: loadGraphStore2 } = await import("./graph-loader-RDXSEBD7.js");
|
|
7108
7816
|
const store = await loadGraphStore2(projectPath);
|
|
7109
7817
|
if (!store) {
|
|
7110
7818
|
return {
|
|
@@ -7117,7 +7825,7 @@ async function handleIntentMode(projectPath, intent, pipeline, budget, filterCon
|
|
|
7117
7825
|
isError: true
|
|
7118
7826
|
};
|
|
7119
7827
|
}
|
|
7120
|
-
const { PackedSummaryCache, FusionLayer, ContextQL } = await import("./dist-
|
|
7828
|
+
const { PackedSummaryCache, FusionLayer, ContextQL } = await import("./dist-NCNAXUFD.js");
|
|
7121
7829
|
const cache = new PackedSummaryCache(store);
|
|
7122
7830
|
const cachedEnvelope = cache.get(intent);
|
|
7123
7831
|
if (cachedEnvelope) {
|
|
@@ -7330,7 +8038,7 @@ async function handleDetectConstraintEmergence(input) {
|
|
|
7330
8038
|
}
|
|
7331
8039
|
const nodePath = await import("path");
|
|
7332
8040
|
const historyPath = nodePath.resolve(projectPath, ".harness/arch/violation-history.json");
|
|
7333
|
-
const { ViolationHistoryManager, detectEmergentConstraints } = await import("./dist-
|
|
8041
|
+
const { ViolationHistoryManager, detectEmergentConstraints } = await import("./dist-CJDGASPP.js");
|
|
7334
8042
|
const manager = new ViolationHistoryManager(historyPath);
|
|
7335
8043
|
const history = manager.load();
|
|
7336
8044
|
const options = { windowWeeks, minOccurrences };
|
|
@@ -7415,6 +8123,7 @@ var TOOL_DEFINITIONS = [
|
|
|
7415
8123
|
checkTraceabilityDefinition,
|
|
7416
8124
|
predictFailuresDefinition,
|
|
7417
8125
|
recommendSkillsDefinition,
|
|
8126
|
+
adviseSkillsDefinition,
|
|
7418
8127
|
computeBlastRadiusDefinition,
|
|
7419
8128
|
dispatchSkillsDefinition,
|
|
7420
8129
|
compactToolDefinition,
|
|
@@ -7475,6 +8184,7 @@ var TOOL_HANDLERS = {
|
|
|
7475
8184
|
check_traceability: handleCheckTraceability,
|
|
7476
8185
|
predict_failures: handlePredictFailures,
|
|
7477
8186
|
recommend_skills: handleRecommendSkills,
|
|
8187
|
+
advise_skills: handleAdviseSkills,
|
|
7478
8188
|
compute_blast_radius: handleComputeBlastRadius,
|
|
7479
8189
|
dispatch_skills: handleDispatchSkills,
|
|
7480
8190
|
compact: handleCompact,
|
|
@@ -7580,7 +8290,7 @@ async function appendUpdateNotification(result, resolvedRoot) {
|
|
|
7580
8290
|
shouldRunCheck,
|
|
7581
8291
|
readCheckState,
|
|
7582
8292
|
spawnBackgroundCheck
|
|
7583
|
-
} = await import("./dist-
|
|
8293
|
+
} = await import("./dist-CJDGASPP.js");
|
|
7584
8294
|
const { CLI_VERSION } = await import("./version-CUI434OP.js");
|
|
7585
8295
|
const configInterval = readConfigInterval(resolvedRoot);
|
|
7586
8296
|
const DEFAULT_INTERVAL = 864e5;
|
|
@@ -7674,6 +8384,8 @@ async function startServer(toolFilter) {
|
|
|
7674
8384
|
}
|
|
7675
8385
|
|
|
7676
8386
|
export {
|
|
8387
|
+
loadOrRebuildIndex,
|
|
8388
|
+
createAdviseSkillsCommand,
|
|
7677
8389
|
generateSlashCommands,
|
|
7678
8390
|
handleOrphanDeletion,
|
|
7679
8391
|
createGenerateSlashCommandsCommand,
|
|
@@ -7681,7 +8393,6 @@ export {
|
|
|
7681
8393
|
persistToolingConfig,
|
|
7682
8394
|
ensureHarnessGitignore,
|
|
7683
8395
|
appendFrameworkAgents,
|
|
7684
|
-
loadOrRebuildIndex,
|
|
7685
8396
|
isSnapshotFresh,
|
|
7686
8397
|
loadCachedSnapshot,
|
|
7687
8398
|
captureHealthSnapshot,
|