INNER CODE UNIT · Python

lint

uvwt/agentdock · core-skills/skill-authoring/run.py:263

def lint(source_value: object) -> dict[str, object]:
    if not isinstance(source_value, str) or not source_value.strip():
        fail("INVALID_INPUT", "source is required for lint")
    source = Path(source_value).expanduser().resolve()
    if not source.is_dir():
        fail("SOURCE_NOT_FOUND", "source must be an existing Skill directory", {"source": str(source)})
    skill_md_path = source / "SKILL.md"
    if not skill_md_path.is_file():
        fail("SKILL_DOCUMENT_MISSING", "source does not contain SKILL.md", {"source": str(source)})

    files = text_files(source)
    issues: list[dict[str, object]] = []
    for path in files:
        issues.extend(scan_file(source, path))
    try:
        skill_md = skill_md_path.read_text(encoding="utf-8")
    except (OSError, UnicodeDecodeError) as exc:
        fail("READ_FAILED", "Unable to read SKILL.md", {"reason": str(exc)})

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…