Fix: include docs references in unified skill output (#213)

* Fix: include docs references in unified skill output

* Fix: quality checker counts nested reference files

* fix(unified): pass through llms_txt_url and skip_llms_txt to doc scraper

* configs: add svelte CLI unified preset (llms.txt + categories)

---------

Co-authored-by: Chris Engelhard <chris@chrisengelhard.nl>
This commit is contained in:
Chris Engelhard
2026-01-01 17:40:51 +01:00
committed by GitHub
parent 98d73611ad
commit 9949cdcdca
4 changed files with 113 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ discrepancies transparently.
import os
import json
import shutil
import logging
from pathlib import Path
from typing import Dict, List, Any, Optional
@@ -286,12 +287,42 @@ This skill combines knowledge from multiple sources:
docs_dir = os.path.join(self.skill_dir, 'references', 'documentation')
os.makedirs(docs_dir, exist_ok=True)
# Best-effort: copy docs-only reference files into unified docs references.
# UnifiedScraper runs doc_scraper using name "{name}_docs", which creates
# output/{name}_docs/references/*.md. Those are the most useful documentation
# references for the unified skill.
source_refs_dir = os.path.join('output', f"{self.name}_docs", 'references')
copied_files: List[str] = []
if os.path.isdir(source_refs_dir):
for entry in sorted(os.listdir(source_refs_dir)):
src_path = os.path.join(source_refs_dir, entry)
dst_path = os.path.join(docs_dir, entry)
if not os.path.isfile(src_path):
continue
shutil.copy2(src_path, dst_path)
copied_files.append(entry)
# Create index
index_path = os.path.join(docs_dir, 'index.md')
with open(index_path, 'w') as f:
with open(index_path, 'w', encoding='utf-8') as f:
f.write("# Documentation\n\n")
f.write("Reference from official documentation.\n\n")
if copied_files:
files_no_index = [p for p in copied_files if p.lower() != 'index.md']
files_index = [p for p in copied_files if p.lower() == 'index.md']
f.write("## Files\n\n")
for filename in files_no_index + files_index:
f.write(f"- [{filename}]({filename})\n")
else:
f.write("## Notes\n\n")
f.write(
"No documentation reference files were copied into this unified skill. "
"This usually means the docs-only build did not produce reference files.\n"
)
logger.info("Created documentation references")
def _generate_github_references(self):