🧪 Add unit tests for idstack-gen-skills#52
Conversation
Adds test/test-gen-skills.sh to verify generation targets and error paths. Integrates the test suite into the existing smoke-test.sh flow. Co-authored-by: savvides <1580637+savvides@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request integrates unit tests for the idstack-gen-skills tool by adding a new test script test/test-gen-skills.sh and updating test/smoke-test.sh to run it. The review feedback identifies a critical safety risk in test/test-gen-skills.sh where using rm -rf "$WORK"/* could lead to accidental deletion of the root filesystem if $WORK is empty or unset. The reviewer suggests safely deleting and recreating the entire $WORK directory instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| # Clean existing items before seeding to avoid permission issues or stale files | ||
| rm -rf "$WORK"/* "$WORK"/.??* 2>/dev/null || true | ||
| mkdir -p "$WORK/bin" "$WORK/templates/assets" "$WORK/skills/test-skill" |
There was a problem hiding this comment.
⚠️ Safety & Correctness Issue
Using rm -rf "$WORK"/* poses two significant issues:
- Severe Safety Risk: If
$WORKis ever empty or unset, this command expands torm -rf /*, which will attempt to delete the entire root filesystem. - Incomplete Dotfile Cleanup: The pattern
.??*only matches dotfiles with at least two characters after the dot (e.g.,.ab), leaving single-character dotfiles (like.a) untouched.
💡 Recommendation
Simply delete and recreate the entire $WORK directory. This is completely safe from the rm -rf /* expansion risk, automatically cleans up all files (including all dotfiles), and is much simpler.
| # Clean existing items before seeding to avoid permission issues or stale files | |
| rm -rf "$WORK"/* "$WORK"/.??* 2>/dev/null || true | |
| mkdir -p "$WORK/bin" "$WORK/templates/assets" "$WORK/skills/test-skill" | |
| # Clean existing items before seeding to avoid permission issues or stale files | |
| rm -rf "$WORK" | |
| mkdir -p "$WORK/bin" "$WORK/templates/assets" "$WORK/skills/test-skill" |
🎯 What: The testing gap addressed
The
bin/idstack-gen-skillsscript previously lacked dedicated unit tests. This PR adds a comprehensive test suite intest/test-gen-skills.shto fill this gap.📊 Coverage: What scenarios are now tested
claudetarget: Validates proper generation ofskills/<skill>/SKILL.mdwhile substituting PREAMBLE, SCHEMA, retainingallowed-tools, and inserting the generation header.codextarget: Validates proper generation ofdist/codex/skills/idstack-<skill>/SKILL.md, stripping ofallowed-tools, and generation of repo-rootAGENTS.md.alltarget: Ensures both formats generate properly.--dry-runsuccessfully reportsOKon fresh runs, and fails (exits 1) when files are stale/modified.✨ Result: The improvement in test coverage
bin/idstack-gen-skillsnow has an exhaustive and self-contained suite, allowing confident future refactoring. All tests automatically run during CI/pipeline validation via thetest/smoke-test.shintegration.PR created automatically by Jules for task 3265346482908859913 started by @savvides