skilld 0.9.3 → 0.9.5

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.
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./chunk.mjs";
2
2
  import { _ as writeSections, b as sanitizeMarkdown, h as readCachedSection, y as repairMarkdown } from "./storage.mjs";
3
- import { l as getFilePatterns, o as mapInsert, t as yamlEscape } from "./yaml.mjs";
3
+ import { d as getPackageRules, o as mapInsert, t as yamlEscape, u as getFilePatterns } from "./yaml.mjs";
4
4
  import { homedir } from "node:os";
5
5
  import { dirname, join, relative } from "pathe";
6
6
  import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
@@ -558,7 +558,7 @@ function budgetScale(sectionCount) {
558
558
  if (sectionCount === 3) return .7;
559
559
  return .6;
560
560
  }
561
- function apiChangesSection({ packageName, version, hasReleases, hasChangelog, hasIssues, hasDiscussions, features, enabledSectionCount }) {
561
+ function apiChangesSection({ packageName, version, hasReleases, hasChangelog, hasDocs, hasIssues, hasDiscussions, features, enabledSectionCount }) {
562
562
  const [, major, minor] = version?.match(/^(\d+)\.(\d+)/) ?? [];
563
563
  const searchHints = [];
564
564
  if (features?.search !== false) {
@@ -587,11 +587,11 @@ function apiChangesSection({ packageName, version, hasReleases, hasChangelog, ha
587
587
  });
588
588
  if (hasChangelog) referenceWeights.push({
589
589
  name: "Changelog",
590
- path: `./.skilld/pkg/${hasChangelog}`,
590
+ path: `./.skilld/${hasChangelog}`,
591
591
  score: 9,
592
592
  useFor: "Features/Breaking Changes sections per version"
593
593
  });
594
- referenceWeights.push({
594
+ if (hasDocs) referenceWeights.push({
595
595
  name: "Docs",
596
596
  path: "./.skilld/docs/",
597
597
  score: 4,
@@ -646,15 +646,16 @@ Each item: ⚠️ (breaking/deprecated) or ✨ (new) + API name + what changed +
646
646
  ].filter(Boolean)
647
647
  };
648
648
  }
649
- function bestPracticesSection({ packageName, hasIssues, hasDiscussions, hasReleases, hasChangelog, features, enabledSectionCount }) {
649
+ function bestPracticesSection({ packageName, hasIssues, hasDiscussions, hasReleases, hasChangelog, hasDocs, features, enabledSectionCount }) {
650
650
  const searchHints = [];
651
651
  if (features?.search !== false) searchHints.push(`\`npx -y skilld search "recommended" -p ${packageName}\``, `\`npx -y skilld search "avoid" -p ${packageName}\``);
652
- const referenceWeights = [{
652
+ const referenceWeights = [];
653
+ if (hasDocs) referenceWeights.push({
653
654
  name: "Docs",
654
655
  path: "./.skilld/docs/",
655
656
  score: 9,
656
657
  useFor: "Primary source — recommended patterns, configuration, idiomatic usage"
657
- }];
658
+ });
658
659
  if (hasDiscussions) referenceWeights.push({
659
660
  name: "Discussions",
660
661
  path: "./.skilld/discussions/_INDEX.md",
@@ -675,7 +676,7 @@ function bestPracticesSection({ packageName, hasIssues, hasDiscussions, hasRelea
675
676
  });
676
677
  if (hasChangelog) referenceWeights.push({
677
678
  name: "Changelog",
678
- path: `./.skilld/pkg/${hasChangelog}`,
679
+ path: `./.skilld/${hasChangelog}`,
679
680
  score: 3,
680
681
  useFor: "Only for new patterns introduced in recent versions"
681
682
  });
@@ -723,13 +724,14 @@ Content addressing the user's instructions above, using concise examples and sou
723
724
  rules: [`- **Custom section "${heading}":** MAX ${maxLines(50, 80, enabledSectionCount)} lines, use \`## ${heading}\` heading`]
724
725
  };
725
726
  }
726
- function apiSection({ hasReleases, hasChangelog, hasIssues, hasDiscussions, enabledSectionCount }) {
727
- const referenceWeights = [{
727
+ function apiSection({ hasReleases, hasChangelog, hasDocs, hasIssues, hasDiscussions, enabledSectionCount }) {
728
+ const referenceWeights = [];
729
+ if (hasDocs) referenceWeights.push({
728
730
  name: "Docs",
729
731
  path: "./.skilld/docs/",
730
732
  score: 10,
731
733
  useFor: "Primary source — scan all doc pages for export names"
732
- }];
734
+ });
733
735
  if (hasReleases) referenceWeights.push({
734
736
  name: "Releases",
735
737
  path: "./.skilld/releases/_INDEX.md",
@@ -738,7 +740,7 @@ function apiSection({ hasReleases, hasChangelog, hasIssues, hasDiscussions, enab
738
740
  });
739
741
  if (hasChangelog) referenceWeights.push({
740
742
  name: "Changelog",
741
- path: `./.skilld/pkg/${hasChangelog}`,
743
+ path: `./.skilld/${hasChangelog}`,
742
744
  score: 5,
743
745
  useFor: "New APIs added in recent versions"
744
746
  });
@@ -815,7 +817,7 @@ function generateImportantBlock({ packageName, hasIssues, hasDiscussions, hasRel
815
817
  const rows = [["Docs", hasShippedDocs ? `\`${skillDir}/.skilld/pkg/docs/\` or \`${skillDir}/.skilld/pkg/README.md\`` : docsType === "llms.txt" ? `\`${skillDir}/.skilld/docs/llms.txt\`` : docsType === "readme" ? `\`${skillDir}/.skilld/pkg/README.md\`` : `\`${skillDir}/.skilld/docs/\``], ["Package", `\`${skillDir}/.skilld/pkg/\``]];
816
818
  if (hasIssues) rows.push(["Issues", `\`${skillDir}/.skilld/issues/\``]);
817
819
  if (hasDiscussions) rows.push(["Discussions", `\`${skillDir}/.skilld/discussions/\``]);
818
- if (hasChangelog) rows.push(["Changelog", `\`${skillDir}/.skilld/pkg/${hasChangelog}\``]);
820
+ if (hasChangelog) rows.push(["Changelog", `\`${skillDir}/.skilld/${hasChangelog}\``]);
819
821
  if (hasReleases) rows.push(["Releases", `\`${skillDir}/.skilld/releases/\``]);
820
822
  const table = [
821
823
  "| Resource | Path |",
@@ -890,15 +892,18 @@ function buildSectionPrompt(opts) {
890
892
  hasDiscussions,
891
893
  hasReleases,
892
894
  hasChangelog,
895
+ hasDocs: !!opts.docFiles?.some((f) => f.includes("/docs/")),
893
896
  features: opts.features,
894
897
  enabledSectionCount: opts.enabledSectionCount
895
898
  }, customPrompt);
896
899
  if (!sectionDef) return "";
897
900
  const outputFile = SECTION_OUTPUT_FILES[section];
901
+ const packageRules = getPackageRules(packageName);
898
902
  const rules = [
899
903
  ...sectionDef.rules ?? [],
900
904
  "- Link to exact source file where you found info",
901
- "- TypeScript only, Vue uses `<script setup lang=\"ts\">`",
905
+ "- TypeScript only",
906
+ ...packageRules.map((r) => `- ${r}`),
902
907
  "- Imperative voice (\"Use X\" not \"You should use X\")",
903
908
  `- **NEVER fetch external URLs.** All information is in the local \`./.skilld/\` directory. Use Read, Glob${opts.features?.search !== false ? ", and `skilld search`" : ""} only.`,
904
909
  "- **Do NOT use Task tool or spawn subagents.** Work directly.",
@@ -1342,7 +1347,7 @@ function buildArgs(model, skillDir, symlinkDirs) {
1342
1347
  "-m",
1343
1348
  model,
1344
1349
  "--allowed-tools",
1345
- "read_file,write_file,glob_tool",
1350
+ "read_file,write_file,glob_tool,list_directory,search_file_content",
1346
1351
  "--include-directories",
1347
1352
  skillDir,
1348
1353
  ...symlinkDirs.flatMap((d) => ["--include-directories", d])
@@ -1382,7 +1387,9 @@ const TOOL_VERBS = {
1382
1387
  Bash: "Running",
1383
1388
  read_file: "Reading",
1384
1389
  glob_tool: "Searching",
1385
- write_file: "Writing"
1390
+ write_file: "Writing",
1391
+ list_directory: "Listing",
1392
+ search_file_content: "Searching"
1386
1393
  };
1387
1394
  function createToolProgress(log) {
1388
1395
  const pending = /* @__PURE__ */ new Map();