Skip to content

refactor(scripts): consolidate agent sync scripts into unified tool - #23

Merged
trumpyla merged 5 commits into
mainfrom
refactor/consolidate-agent-sync-scripts
Oct 20, 2025
Merged

refactor(scripts): consolidate agent sync scripts into unified tool#23
trumpyla merged 5 commits into
mainfrom
refactor/consolidate-agent-sync-scripts

Conversation

@trumpyla

Copy link
Copy Markdown
Member

Summary

  • Consolidate gh_sync_claude.sh, gh_sync_codex.sh, and gh_sync_agents.sh into a single unified script
  • Remove deprecated agent-specific sync scripts
  • Add comprehensive repository validation script (repo_validate.sh)
  • Update all git hooks, documentation, and related tooling

Changes

Scripts Consolidated

  • Removed: scripts/gh_sync_claude.sh (97 lines)
  • Removed: scripts/gh_sync_codex.sh (176 lines)
  • Enhanced: scripts/gh_sync_agents.sh with unified functionality (+152 lines)
  • Added: scripts/repo_validate.sh (980 lines) for repository compliance checking

Enhanced Functionality

The unified gh_sync_agents.sh now:

  • Supports multiple agent types via --models flag (default: "claude codex")
  • Copies agent directories from .common/artagon-common submodule
  • Creates root-level symlinks (.agents, .claude, .codex)
  • Generates project.md files with YAML pointers to shared content
  • Creates project-specific overlay files with references to shared preferences
  • Supports both .common/artagon-common (current) and artagon-common (legacy) paths

Git Hooks Updated

All hooks now use the unified gh_sync_agents.sh:

  • git-hooks/pre-commit - Validates agent configuration sync
  • git-hooks/post-checkout - Auto-syncs after branch switches
  • git-hooks/post-merge - Auto-syncs after merges

Documentation Updated

  • README.md - Added comprehensive usage examples and options for unified script
  • scripts/README.md - Updated script listing and replaced deprecated script docs

Other Updates

  • scripts/repo_setup.sh - Now calls unified agent sync script
  • scripts/gh_setup_contributing.sh - Added support for .common/artagon-common path

Test plan

  • Test gh_sync_agents.sh --check on artagon-common (passed)
  • Test gh_sync_agents.sh --ensure functionality
  • Test repo_validate.sh on artagon-parent (0 errors)
  • Test repo_validate.sh on artagon-bom (0 errors)
  • Verify git hooks call correct script
  • Verify all symlinks created correctly (.agents, .claude, .codex)
  • Verify agent directories copied from artagon-common
  • Verify documentation accuracy

Files Changed

11 files: +1,195 insertions, -322 deletions

Related Issues

Closes #22

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings October 20, 2025 16:53
@github-actions github-actions Bot added documentation Improvements or additions to documentation scripts labels Oct 20, 2025
@github-actions

Copy link
Copy Markdown

Thank you for your contribution! 🎉

Your PR has been validated and is ready for review.

What happens next?

  1. Automated checks will run (tests, linting, etc.)
  2. Maintainers will review your changes
  3. You may be asked to make updates based on feedback
  4. Once approved, your PR will be merged

While you wait


🤖 This comment was generated automatically

Copilot AI 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.

Pull Request Overview

This PR consolidates three separate agent sync scripts into a single unified tool, removing deprecated scripts and adding comprehensive repository validation. The consolidation simplifies maintenance by replacing agent-specific scripts with a multi-agent capable tool that handles Claude, Codex, and future agents through a common interface.

Key changes:

  • Unified gh_sync_agents.sh replaces individual agent sync scripts with --models flag support
  • New repo_validate.sh provides comprehensive repository compliance checking with fix capabilities
  • Updated all git hooks, documentation, and setup scripts to use the unified tool

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/repo_validate.sh New comprehensive validation script with check and fix modes for repository compliance
scripts/repo_setup.sh Updated to call unified gh_sync_agents.sh instead of deprecated Codex-specific script
scripts/gh_sync_codex.sh Removed deprecated Codex-specific sync script (176 lines)
scripts/gh_sync_claude.sh Removed deprecated Claude-specific sync script (97 lines)
scripts/gh_sync_agents.sh Enhanced with unified multi-agent support, directory copying, and symlink management
scripts/gh_setup_contributing.sh Added support for .common/artagon-common path alongside legacy path
scripts/README.md Updated documentation to reflect unified script and removed deprecated script references
git-hooks/pre-commit Updated to use gh_sync_agents.sh instead of gh_sync_codex.sh
git-hooks/post-merge Updated to use gh_sync_agents.sh instead of gh_sync_codex.sh
git-hooks/post-checkout Updated to use gh_sync_agents.sh instead of gh_sync_codex.sh
README.md Updated with comprehensive examples and options for unified agent sync script

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread scripts/gh_sync_agents.sh Outdated
trumpyla added a commit that referenced this pull request Oct 20, 2025
Remove deprecated `setup_model_directory_links()` function and its call
from `bootstrap_model()`. Root-level symlinks (.agents, .claude, .codex)
are now created by `create_root_symlinks()` after all models are
bootstrapped, making the per-model symlink function unnecessary.

Addresses review comment on PR #23.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@trumpyla
trumpyla requested a review from Copilot October 20, 2025 17:09

Copilot AI 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.

Pull Request Overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread scripts/repo_validate.sh Outdated
Comment thread scripts/repo_validate.sh Outdated
Consolidate gh_sync_claude.sh, gh_sync_codex.sh, and gh_sync_agents.sh
into a single unified script for managing AI agent configurations (Claude,
Codex, etc.). This simplifies maintenance and ensures consistent behavior
across all agent types.

Changes:
- Remove deprecated gh_sync_claude.sh and gh_sync_codex.sh scripts
- Enhance gh_sync_agents.sh to support multiple agent types via --models flag
- Add directory copying from artagon-common submodule
- Add root-level symlink creation (.agents, .claude, .codex)
- Update all git hooks to use unified gh_sync_agents.sh
- Update repo_setup.sh to call unified script
- Update gh_setup_contributing.sh to support .common/artagon-common path
- Update README.md and scripts/README.md with new usage examples
- Add repo_validate.sh for repository compliance checking
Remove reference to deleted gh_sync_claude.sh script and add
validation for new repo_validate.sh script.
Remove deprecated `setup_model_directory_links()` function and its call
from `bootstrap_model()`. Root-level symlinks (.agents, .claude, .codex)
are now created by `create_root_symlinks()` after all models are
bootstrapped, making the per-model symlink function unnecessary.

Addresses review comment on PR #23.
@trumpyla
trumpyla force-pushed the refactor/consolidate-agent-sync-scripts branch from 117352e to ba6ee41 Compare October 20, 2025 17:18
trumpyla and others added 2 commits October 20, 2025 13:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@trumpyla
trumpyla merged commit 3a4bc3e into main Oct 20, 2025
5 checks passed
@trumpyla
trumpyla deleted the refactor/consolidate-agent-sync-scripts branch October 20, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation scripts testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate gh_sync_* scripts into unified agent sync tool

2 participants