feat: implement extends resolution, --force update, and parent merge in export#55
Open
tianhaocui wants to merge 2 commits intoopen-gitagent:mainfrom
Open
feat: implement extends resolution, --force update, and parent merge in export#55tianhaocui wants to merge 2 commits intoopen-gitagent:mainfrom
tianhaocui wants to merge 2 commits intoopen-gitagent:mainfrom
Conversation
The `export` and `import` commands each registered the same required option twice (once for gemini, once for codex), causing commander to throw on startup and making the entire CLI unusable. Additionally, `case 'codex'` was placed inside the `default` branch in both switch statements, so it could never be matched correctly. Changes: - Merge duplicate `.requiredOption()` calls into a single call listing all supported formats - Move `case 'codex'` out of `default` as an independent case with its own `break` Fixes open-gitagent#53 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The spec (Section 15) defines inheritance via `extends` with clear merge rules, but the implementation was missing. This commit adds: 1. `install` now resolves `extends` — clones the parent agent repo into `.gitagent/parent/` alongside existing dependency handling. 2. `install --force` — removes existing installations before re-cloning, enabling updates without manual `rm -rf`. 3. `export --format claude-code` now merges parent content per spec: - SOUL.md: child replaces parent entirely - RULES.md: parent + child appended (union) - skills/: union with child shadowing parent on name collision 4. Git source detection now supports Bitbucket and GitLab URLs in addition to GitHub. Closes open-gitagent#53 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implement
extendsresolution ininstall, add--forceflag for updates, and merge parent agent content inexport --format claude-code.Why
The spec (Section 15: Inheritance) defines
extendswith clear merge rules, but the implementation was completely missing:extendsfield is parsed but never acted on —installonly handlesdependenciesinstallskips if target exists — no way to update without manualrm -rfexportonly reads current directory — ignores installed parent agentgithub.com— Bitbucket/GitLab repos failThis means the core cross-project sharing workflow described in the README doesn't work.
Closes #53
How Tested
npm run buildpassesgitagent validatepasses on example agentsTested with:
git@bitbucket.org:org/shared-agent.git)extendsin childagent.yaml→gitagent installclones to.gitagent/parent/gitagent install --forceremoves and re-clonesgitagent export --format claude-code -o CLAUDE.mdmerges parent SOUL.md, RULES.md, and skills/Checklist