skilld 0.14.1 → 0.14.2
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 +2 -0
- package/dist/_chunks/detect-imports.mjs +3 -2
- package/dist/_chunks/detect-imports.mjs.map +1 -1
- package/dist/_chunks/npm.mjs +2 -19
- package/dist/_chunks/npm.mjs.map +1 -1
- package/dist/_chunks/prompts.mjs +28 -19
- package/dist/_chunks/prompts.mjs.map +1 -1
- package/dist/_chunks/{package-registry.mjs → shared.mjs} +34 -2
- package/dist/_chunks/shared.mjs.map +1 -0
- package/dist/_chunks/validate.mjs +1 -1
- package/dist/agent/index.d.mts.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/cli.mjs +13 -7
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/sources/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/_chunks/package-registry.mjs.map +0 -1
package/dist/_chunks/prompts.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as sanitizeMarkdown, t as repairMarkdown } from "./sanitize.mjs";
|
|
2
2
|
import { t as yamlEscape } from "./yaml.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { i as resolveSkilldCommand, l as getFilePatterns, u as getPackageRules } from "./shared.mjs";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { dirname, join, relative } from "pathe";
|
|
6
6
|
import { existsSync, lstatSync, mkdirSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -589,22 +589,23 @@ function checkAbsolutePaths(content) {
|
|
|
589
589
|
function apiChangesSection({ packageName, version, hasReleases, hasChangelog, hasDocs, hasIssues, hasDiscussions, pkgFiles, features, enabledSectionCount, releaseCount }) {
|
|
590
590
|
const [, major, minor] = version?.match(/^(\d+)\.(\d+)/) ?? [];
|
|
591
591
|
const boost = releaseBoost(releaseCount, minor ? Number(minor) : void 0);
|
|
592
|
+
const cmd = resolveSkilldCommand();
|
|
592
593
|
const searchHints = [];
|
|
593
594
|
if (features?.search !== false) {
|
|
594
|
-
searchHints.push(
|
|
595
|
+
searchHints.push(`\`${cmd} search "deprecated" -p ${packageName}\``, `\`${cmd} search "breaking" -p ${packageName}\``);
|
|
595
596
|
if (major && minor) {
|
|
596
597
|
const minorNum = Number(minor);
|
|
597
598
|
const majorNum = Number(major);
|
|
598
599
|
if (minorNum <= 2) {
|
|
599
|
-
searchHints.push(
|
|
600
|
-
if (minorNum > 0) searchHints.push(
|
|
601
|
-
if (majorNum > 0) searchHints.push(
|
|
600
|
+
searchHints.push(`\`${cmd} search "v${majorNum}.${minorNum}" -p ${packageName}\``);
|
|
601
|
+
if (minorNum > 0) searchHints.push(`\`${cmd} search "v${majorNum}.${minorNum - 1}" -p ${packageName}\``);
|
|
602
|
+
if (majorNum > 0) searchHints.push(`\`${cmd} search "v${majorNum - 1}" -p ${packageName}\``);
|
|
602
603
|
} else {
|
|
603
|
-
searchHints.push(
|
|
604
|
-
searchHints.push(
|
|
605
|
-
searchHints.push(
|
|
604
|
+
searchHints.push(`\`${cmd} search "v${majorNum}.${minorNum}" -p ${packageName}\``);
|
|
605
|
+
searchHints.push(`\`${cmd} search "v${majorNum}.${minorNum - 1}" -p ${packageName}\``);
|
|
606
|
+
searchHints.push(`\`${cmd} search "v${majorNum}.${minorNum - 2}" -p ${packageName}\``);
|
|
606
607
|
}
|
|
607
|
-
searchHints.push(
|
|
608
|
+
searchHints.push(`\`${cmd} search "Features" -p ${packageName}\``);
|
|
608
609
|
}
|
|
609
610
|
}
|
|
610
611
|
const referenceWeights = [];
|
|
@@ -710,8 +711,9 @@ Each item: BREAKING/DEPRECATED/NEW label + API name + what changed + source link
|
|
|
710
711
|
function bestPracticesSection({ packageName, hasIssues, hasDiscussions, hasReleases, hasChangelog, hasDocs, pkgFiles, features, enabledSectionCount, releaseCount, version }) {
|
|
711
712
|
const [, , minor] = version?.match(/^(\d+)\.(\d+)/) ?? [];
|
|
712
713
|
const boost = 1 + (releaseBoost(releaseCount, minor ? Number(minor) : void 0) - 1) * .5;
|
|
714
|
+
const cmd = resolveSkilldCommand();
|
|
713
715
|
const searchHints = [];
|
|
714
|
-
if (features?.search !== false) searchHints.push(
|
|
716
|
+
if (features?.search !== false) searchHints.push(`\`${cmd} search "recommended" -p ${packageName}\``, `\`${cmd} search "avoid" -p ${packageName}\``);
|
|
715
717
|
const referenceWeights = [];
|
|
716
718
|
if (hasDocs) referenceWeights.push({
|
|
717
719
|
name: "Docs",
|
|
@@ -851,13 +853,15 @@ function generateImportantBlock({ packageName, hasIssues, hasDiscussions, hasRel
|
|
|
851
853
|
"|----------|------|",
|
|
852
854
|
...rows.map(([desc, cmd]) => `| ${desc} | ${cmd} |`)
|
|
853
855
|
].join("\n");
|
|
856
|
+
const cmd = resolveSkilldCommand();
|
|
857
|
+
const fallbackCmd = cmd === "skilld" ? "npx -y skilld" : "skilld";
|
|
854
858
|
return `**IMPORTANT:** Use these references${features?.search !== false ? `\n\n## Search
|
|
855
859
|
|
|
856
|
-
Use
|
|
860
|
+
Use \`${cmd} search\` as your primary research tool — search before manually reading files. If \`${cmd}\` is unavailable, use \`${fallbackCmd} search\`.
|
|
857
861
|
|
|
858
862
|
\`\`\`bash
|
|
859
|
-
|
|
860
|
-
${hasIssues ?
|
|
863
|
+
${cmd} search "<query>" -p ${packageName}
|
|
864
|
+
${hasIssues ? `${cmd} search "issues:<query>" -p ${packageName}\n` : ""}${hasReleases ? `${cmd} search "releases:<query>" -p ${packageName}\n` : ""}\`\`\`
|
|
861
865
|
|
|
862
866
|
Filters: \`docs:\`, \`issues:\`, \`releases:\` prefix narrows by source type.` : ""}
|
|
863
867
|
|
|
@@ -942,7 +946,10 @@ function buildSectionPrompt(opts) {
|
|
|
942
946
|
"- **Stop exploring once you have enough high-quality items** to fill the budget. Do not read additional files just to be thorough.",
|
|
943
947
|
opts.pkgFiles?.some((f) => f.endsWith(".d.ts")) ? "- **To verify API exports:** Read the `.d.ts` file directly (see Types row in references). Package directories are often gitignored — if you search `pkg/`, pass `no_ignore: true` to avoid silent empty results." : ""
|
|
944
948
|
].filter(Boolean);
|
|
945
|
-
|
|
949
|
+
const weightsTable = sectionDef.referenceWeights?.length ? `\n\n## Reference Priority\n\n| Reference | Path | Score | Use For |\n|-----------|------|:-----:|--------|\n${sectionDef.referenceWeights.map((w) => `| ${w.name} | [\`${w.path.split("/").pop()}\`](${w.path}) | ${w.score}/10 | ${w.useFor} |`).join("\n")}` : "";
|
|
950
|
+
const cmd = resolveSkilldCommand();
|
|
951
|
+
const fallbackCmd = cmd === "skilld" ? "npx -y skilld" : "skilld";
|
|
952
|
+
return `${preamble}${weightsTable}
|
|
946
953
|
|
|
947
954
|
## Task
|
|
948
955
|
|
|
@@ -960,7 +967,7 @@ ${rules.join("\n")}
|
|
|
960
967
|
|
|
961
968
|
Write your final output to the file \`${skillDir}/.skilld/${outputFile}\` using the Write tool. Do NOT write to any other file path.
|
|
962
969
|
|
|
963
|
-
After writing, run
|
|
970
|
+
After writing, run \`${cmd} validate ${skillDir}/.skilld/${outputFile}\` and fix any warnings before finishing. If unavailable, use \`${fallbackCmd} validate ${skillDir}/.skilld/${outputFile}\`.
|
|
964
971
|
`;
|
|
965
972
|
}
|
|
966
973
|
function buildAllSectionPrompts(opts) {
|
|
@@ -1166,12 +1173,14 @@ function generateFrontmatter({ name, version, description: pkgDescription, globs
|
|
|
1166
1173
|
return lines.join("\n");
|
|
1167
1174
|
}
|
|
1168
1175
|
function generateSearchBlock(name, hasIssues, hasReleases) {
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
|
|
1176
|
+
const cmd = resolveSkilldCommand();
|
|
1177
|
+
const fallbackCmd = cmd === "skilld" ? "npx -y skilld" : "skilld";
|
|
1178
|
+
const examples = [`${cmd} search "query" -p ${name}`];
|
|
1179
|
+
if (hasIssues) examples.push(`${cmd} search "issues:error handling" -p ${name}`);
|
|
1180
|
+
if (hasReleases) examples.push(`${cmd} search "releases:deprecated" -p ${name}`);
|
|
1172
1181
|
return `## Search
|
|
1173
1182
|
|
|
1174
|
-
Use
|
|
1183
|
+
Use \`${cmd} search\` instead of grepping \`.skilld/\` directories — hybrid semantic + keyword search across all indexed docs, issues, and releases. If \`${cmd}\` is unavailable, use \`${fallbackCmd} search\`.
|
|
1175
1184
|
|
|
1176
1185
|
\`\`\`bash
|
|
1177
1186
|
${examples.join("\n")}
|