Skip to content

fix: make skills self-contained (closes #140)#141

Open
dmartinol wants to merge 2 commits into
mainfrom
fix/issue-140-skill-self-containment
Open

fix: make skills self-contained (closes #140)#141
dmartinol wants to merge 2 commits into
mainfrom
fix/issue-140-skill-self-containment

Conversation

@dmartinol

Copy link
Copy Markdown
Collaborator

Summary

Fixes #140 — 25 skills across 3 packs referenced files outside their own folder via upward traversal links (../, ../../) or absolute runtime paths, breaking portability when installed via Lola.

Changes by pack

rh-ai-engineer (11 skills)

  • Created references/ symlinks in each skill folder pointing to the 4 shared files (skill-conventions.md, common-issues.md, openshift-fallback-templates.md, live-doc-lookup.md)
  • Updated all ../references/ links to references/ (local)

ocp-admin (7 skills)

  • cluster-creator: fixed broken ../README.md link (wrong depth); removed hyperlink, kept plain text
  • cluster-inventory, cluster-report: removed ../../README.md hyperlinks — replaced with plain text (MCP setup is not the skill's concern)
  • cluster-report: symlinked scripts/cluster-report/*.py into skill's scripts/; updated all markdown links and bash command
  • container-cve-validator, coreos-cve-validator, cve-recon, image-inspect: symlinked scripts/security-validation/*.py into each skill's scripts/; replaced SCRIPTS_DIR="$(git rev-parse --show-toplevel)/..." with SCRIPTS_DIR="scripts" (portable relative path)

rh-sre (7 skills)

  • cve-impact, cve-validation, fleet-inventory, job-template-creator, job-template-remediation-validator, playbook-executor: removed broken #validation-freshness-policy anchor links (anchor never existed; inline text already stated the policy)
  • job-template-remediation-validator, job-template-creator: converted ../sibling/SKILL.md hyperlinks to plain backtick skill names
  • remediation: symlinked cve-validation/references/01-remediation-indicators.md into local references/; updated link

Verification

Evaluated 8 test cases across the 4 highest-risk skills using the skill-creator eval framework. All 13 assertions passed:

  • SCRIPTS_DIR="scripts" resolves correctly; symlinked scripts confirmed executable at runtime (eval 2 actually ran validate_input.py via the symlink)
  • 01-remediation-indicators.md loads correctly via symlink; Remediatable Gate logic intact
  • All validation phases present in job-template-remediation-validator; sibling skill refs as plain text throughout
  • Human Notification Protocol triggers correctly in all prerequisite-failure scenarios

Known limitations (tracked separately)

  • cluster-report script invocation (python3 scripts/assemble.py) uses a relative path with a CWD dependency — pre-existing issue, not introduced by this PR
  • container-cve-validator does not list regctl/cosign/syft as external prerequisites — pre-existing doc gap

…necessary links. Add new references for common issues and live document lookups across various skills. Ensure consistency in documentation for prerequisites and fallback templates.

Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
@dmartinol

Copy link
Copy Markdown
Collaborator Author

Link verification results

Ran a full audit of all local markdown links across all packs (~1,574 links total). Found 86 apparent broken links — none introduced by this PR.

Breakdown

Category Count Description
False positives ~4 Regex patterns parsed as link targets (/.*/, [a-z0-9.-]*) in rh-developer and rh-virt prose
Pre-existing in shared rh-ai-engineer reference files ~24 common-issues.md links to ../../docs/references/known-model-profiles.md which doesn't exist at pack level. Our symlinks propagate this 11× (once per skill) but the underlying link was already broken in the shared file
Pre-existing in rh-sre cve-impact flows ~6 flows/*.md files use ../SKILL.md (should be ../../SKILL.md) and reference a non-existent .py file
Pre-existing in other packs ~52 rh-sre, rh-virt, rh-automation docs with broken cross-directory references

Our changes — all clean

  • rh-ai-engineer symlinks: all 44 symlinks resolve to real files ✓
  • ocp-admin script symlinks: all 36 symlinks resolve to real files ✓
  • rh-sre link removals: removed broken anchor references and sibling hyperlinks ✓
  • rh-sre remediation symlink: resolves correctly ✓

Pre-existing issues (especially in rh-ai-engineer/skills/references/ and rh-sre cve-impact flows) can be tracked as a separate follow-on issue.

@dmartinol

Copy link
Copy Markdown
Collaborator Author

Minor nit in rh-sre/skills/remediation/SKILL.md: the link display text for 01-remediation-indicators.md reads as the old traversal path with the ../ prefix stripped, which looks garbled. Will fix in a follow-up commit:

# current (garbled)
See [cve-validation references/01-remediation-indicators.md](references/01-remediation-indicators.md).

# should be
See [01-remediation-indicators.md](references/01-remediation-indicators.md).

…s document. Ensure clarity in the documentation regarding the remediatable gate process.

Signed-off-by: Daniele Martinoli <dmartino@redhat.com>

@ikrispin ikrispin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! From what I see you've hit all the necessary spots. lgtm

@r2dedios r2dedios left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch with the "SCRIPTS_DIR" fix. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills must be self-contained: 26 skills reference files outside their folder

3 participants