Skip to content

Comments

refactor: add skills/ build system with CI freshness check#4

Merged
runkids merged 3 commits intomainfrom
infra/build-system
Feb 12, 2026
Merged

refactor: add skills/ build system with CI freshness check#4
runkids merged 3 commits intomainfrom
infra/build-system

Conversation

@runkids
Copy link
Owner

@runkids runkids commented Feb 12, 2026

Summary

  • Migrate from manually editing skillshare-hub.json to a structured skills/*.json build system
  • Add scripts/build.sh to generate skillshare-hub.json from skills/*.json (sorted, formatted)
  • CI now rebuilds and verifies skillshare-hub.json is in sync (git diff --quiet)
  • Refactor scripts/audit.sh: group sources by repo to deduplicate clones, Bash 3.x compat (temp dir instead of associative arrays), clean up leftover temp dirs
  • Update CONTRIBUTING.md with new workflow, categories table, and local dev commands
  • Update PR template checklist

Changes

File Change
skills/skill.json New — source of truth for hub meta-skills
scripts/build.sh New — merges skills/*.jsonskillshare-hub.json
scripts/audit.sh Rewritten — repo dedup, Bash 3.x compat, temp dir cleanup
Makefile Add build target, ci now runs build → validate → audit
.github/workflows/validate-pr.yml Add skills/** trigger, build step, freshness check
CONTRIBUTING.md New workflow docs, categories, local dev section
.github/PULL_REQUEST_TEMPLATE.md Updated checklist

Pure refactoringskillshare-hub.json output is unchanged (same 2 skills).

Test plan

  • make build produces identical skillshare-hub.json to main
  • make validate passes
  • CI workflow runs successfully on this PR

Migrate from manually editing skillshare-hub.json to a structured
build system:

- Add skills/ directory as source of truth (skills/core.json)
- Add scripts/build.sh to generate skillshare-hub.json from skills/*.json
- Update Makefile with build target (make build/validate/audit/ci)
- Update CI to build from skills/ and verify hub.json is in sync
- Refactor scripts/audit.sh: group by repo to deduplicate clones,
  Bash 3.x compat (temp dir instead of associative arrays),
  clean up leftover temp dirs before/after clone
- Update CONTRIBUTING.md with new workflow and categories
- Update PR template checklist
@github-actions
Copy link
Contributor

No new or changed skill sources to audit.

@gemini-code-assist
Copy link

Summary of Changes

Hello @runkids, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant refactoring of the skill management system, transitioning from a single, manually edited JSON file to a modular, build-driven approach. This change aims to enhance the maintainability and scalability of skill definitions, streamline the contribution process for new skills, and ensure data consistency through automated CI checks. The update also includes optimizations to the skill auditing script, making the overall system more robust and efficient.

Highlights

  • Modular Skill Definition: Migrated skill definition from a single skillshare-hub.json to a structured skills/*.json build system, allowing for better organization and management of individual skill entries.
  • Automated Build Process: Introduced a new scripts/build.sh script to automatically generate skillshare-hub.json by merging and sorting the individual skills/*.json files.
  • CI Freshness Check: Implemented a CI freshness check to ensure that skillshare-hub.json is always in sync with its source skills/*.json files, preventing out-of-date data.
  • Optimized Skill Auditing: Refactored scripts/audit.sh to improve efficiency by grouping skill sources by repository, reducing redundant cloning, and enhancing compatibility with Bash 3.x environments.
  • Updated Contribution Guidelines: Revised CONTRIBUTING.md to reflect the new skill contribution workflow, including a categories table and local development commands, and updated the PR template checklist.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .github/PULL_REQUEST_TEMPLATE.md
    • Updated PR checklist to include new steps for adding skills via skills/*.json and running make build.
  • .github/workflows/validate-pr.yml
    • Configured the CI workflow to trigger on changes within the skills/ directory.
    • Added a build step to generate skillshare-hub.json during CI runs.
    • Implemented a freshness check to verify that skillshare-hub.json is up-to-date with its source files.
  • CONTRIBUTING.md
    • Revised skill addition instructions to guide users through the new modular workflow.
    • Added a detailed 'Categories' section with a table mapping file paths to skill types.
    • Included a new example for multi-skill repositories using subpaths in the source field.
    • Updated the description for the source field to reflect support for subpaths.
    • Added a 'Local Development' section with common make commands for building, validating, and auditing.
  • Makefile
    • Added a new build target that executes scripts/build.sh to generate skillshare-hub.json.
    • Modified the format target to alias build, as the build process now handles sorting and formatting.
    • Updated the ci target to include the build step before validate and audit.
  • scripts/audit.sh
    • Refactored the script by extracting parse_source and audit_target functions for better modularity.
    • Implemented a new logic to group sources by clone_url using temporary files, improving Bash 3.x compatibility and reducing redundant repository cloning.
    • Added logic to audit multiple subpaths from a single cloned repository, optimizing the audit process.
    • Cleaned up temporary directories created during the audit process.
  • scripts/build.sh
    • Added a new script responsible for reading all *.json files from the skills directory.
    • Implemented logic to merge the contents of these JSON files, sort the skills by name, and wrap them in the hub schema.
    • Outputs the consolidated and formatted data to skillshare-hub.json.
  • skills/skill.json
    • Added a new file to store core meta-skill definitions.
    • Included initial skill definitions for skill-creator and skillshare, complete with descriptions, sources, and tags.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/validate-pr.yml
Activity
  • No human activity (comments, reviews) was detected on this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is a great refactoring that significantly improves the contribution workflow and maintainability of the skill hub. The move to a structured skills/*.json build system is a solid architectural change. The updated audit.sh script is much more efficient by avoiding duplicate clones, and the attention to Bash 3.x compatibility is a nice touch. The documentation updates are clear and will be very helpful for contributors.

I've left a couple of suggestions on the shell scripts to improve their robustness, one regarding a bug in file checking and another on temporary file cleanup. Overall, this is an excellent pull request.

Comment on lines +14 to +17
if [ ${#files[@]} -eq 0 ]; then
echo "ERROR: No .json files found in $SKILLS_DIR"
exit 1
fi

Choose a reason for hiding this comment

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

high

This check for missing .json files is not quite correct for standard bash behavior. Without shopt -s nullglob, if no files match a glob pattern, the pattern itself is returned as a single-element array. This means ${#files[@]} will be 1, not 0, and this check will be bypassed, leading to a less clear error from jq later.

A more reliable way to check is to see if the first element of the array actually exists as a file.

Suggested change
if [ ${#files[@]} -eq 0 ]; then
echo "ERROR: No .json files found in $SKILLS_DIR"
exit 1
fi
if [ ! -e "${files[0]}" ]; then
echo "ERROR: No .json files found in $SKILLS_DIR"
exit 1
fi

Comment on lines +109 to +110
group_dir=$(mktemp -d)
trap 'rm -rf "$group_dir"' EXIT

Choose a reason for hiding this comment

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

medium

This script creates temporary directories in multiple places (group_dir and clone_dir). While group_dir is cleaned up by a trap, the clone_dirs created in /tmp are removed manually. If the script is interrupted (e.g., with Ctrl-C), these clone directories might be left behind.

For more robust cleanup, consider creating a single parent temporary directory for all transient data. A single trap on this parent directory would ensure all temporary files and directories are cleaned up, regardless of how the script terminates.

Example structure:

# Create a single root temp dir at the start
audit_tmp_dir=$(mktemp -d)
trap 'rm -rf "$audit_tmp_dir"' EXIT

# Use subdirectories within it
group_dir="${audit_tmp_dir}/groups"
mkdir "$group_dir"
# ...
clone_dir="${audit_tmp_dir}/clones/${safe_name}"
# ...

This would make the script's cleanup mechanism more resilient.

@github-actions
Copy link
Contributor

No new or changed skill sources to audit.

@runkids runkids merged commit 432ca1c into main Feb 12, 2026
2 checks passed
@runkids runkids deleted the infra/build-system branch February 13, 2026 02:25
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.

1 participant