Skip to content

Enhance git-worktree-skills with official documentation and advanced patterns#9

Closed
tommy-ca wants to merge 8 commits intoEveryInc:mainfrom
tommy-ca:feature/enhance-worktree-skills
Closed

Enhance git-worktree-skills with official documentation and advanced patterns#9
tommy-ca wants to merge 8 commits intoEveryInc:mainfrom
tommy-ca:feature/enhance-worktree-skills

Conversation

@tommy-ca
Copy link
Copy Markdown

@tommy-ca tommy-ca commented Nov 9, 2025

Summary

Enhanced the three git-worktree-skills with comprehensive references to official Git documentation, community best practices, and advanced workflow patterns. Created a centralized resource hub and organized changes into 5 atomic, logically independent commits for clean code review.

What's Changed

New Files

  • RESOURCES.md (150 lines): Centralized reference hub with official Git docs, community guides, tool integrations, and stack overflow discussions

Enhanced Skills

git-worktree-create

  • Added official Git documentation links and experimental status warning
  • Added "Git Worktree Fundamentals" explaining main vs linked worktrees and isolation
  • Added "Advanced Worktree Options" (detached HEAD, orphan branches, locking, repair, sparse checkout)
  • Added "Limitations and Warnings" with experimental status and best practices

git-worktree-manage

  • Added official documentation links with command-specific references
  • Added "Worktree Status and Metadata" section explaining status indicators
  • Added "Advanced Management Techniques" with porcelain format scripting and bulk operations

git-worktree-best-practices

  • Added "Official Git Guidance" section with key recommendations
  • Added Patterns 6-8: Emergency Hotfix, CI/CD Optimization, Long-Running Review Workflow
  • Added comprehensive "Anti-Patterns to Avoid" section covering common pitfalls
  • Added "Compounding Engineering Philosophy" summary

Documentation Updates

  • skills/README.md: Added "Learning Resources" section
  • plugin/README.md: Added "Learning Resources" section

Atomic Commits

This PR contains 5 logically independent commits:

  1. Add centralized RESOURCES.md (e0dc644)

    • Creates foundation for documentation references
  2. Add documentation, fundamentals, and advanced options to git-worktree-create (d284523)

    • Official docs, Git fundamentals, advanced features, limitations, resources
  3. Add documentation, metadata, and advanced management to git-worktree-manage (c8e1d95)

    • Official docs, status/metadata, advanced techniques, resources
  4. Add official guidance, workflow patterns, and anti-patterns to best-practices (568a1de)

    • Official guidance, 3 new patterns, 4 anti-patterns, philosophy
  5. Add Learning Resources sections to README files (b27bd0d)

    • Discoverability updates for all new documentation

Testing

✓ Verified all code examples execute correctly in test repository
✓ Tested worktree creation, listing, and removal operations
✓ Validated markdown formatting and structure
✓ Confirmed all JSON files valid

Content Stats

  • Files Modified: 6
  • Lines Added: 734
  • New File: 1 (RESOURCES.md)
  • External References: 15+ official and community links
  • Workflow Patterns: 8 total (3 newly added)
  • Anti-Patterns: 4 documented with solutions

Compounding Engineering Impact

Following the compounding engineering philosophy:

  • Each skill makes subsequent skills easier through comprehensive documentation
  • Consistent patterns reduce decision-making and rework
  • Anti-patterns section prevents common mistakes
  • Centralized resources empower self-service learning

Related Issues

This enhancement addresses the need for:

  • Official Git documentation integration
  • Advanced workflow patterns and guidance
  • Clear experimental feature warnings
  • Anti-pattern documentation
  • Centralized learning resources

Review Notes

Each commit is:

  • ✓ Logically independent and reviewable in isolation
  • ✓ Focused on a single, clear purpose
  • ✓ Buildable and testable at each step
  • ✓ Following conventional commit patterns

The structure allows reviewing by logical concern rather than by file.

🤖 Generated with Claude Code

tommy-ca and others added 8 commits November 8, 2025 19:57
Introduce 3 reusable skills that encapsulate git worktree best practices:

- git-worktree-create: Create worktrees with smart defaults
  - Branch naming conventions
  - Directory structure (.worktrees/)
  - .gitignore management
  - Verification steps
  - Includes automation script and examples

- git-worktree-manage: List, remove, and maintain worktrees
  - Worktree lifecycle management
  - Cleanup and pruning
  - Status inspection

- git-worktree-best-practices: Comprehensive workflow guide
  - Common patterns and workflows
  - Team conventions
  - Troubleshooting guidance

These skills extract common patterns from commands (especially /work)
to make them reusable across agents and other commands.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Update the /work command to delegate worktree creation to the
git-worktree-create skill instead of duplicating the logic inline.

Changes:
- Replace inline worktree setup (43 lines) with skill invocation
- Reference skill documentation for details
- Simplify command by ~14 lines
- Maintain same functionality
- Improve maintainability (single source of truth)

The command now invokes the skill which handles:
- Branch naming
- Directory structure
- .gitignore updates
- Worktree creation
- Environment verification

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

Co-Authored-By: Claude <noreply@anthropic.com>
Release version 1.1.0 with new skills functionality.

Changes:
- Bump version: 1.0.0 → 1.1.0 (minor, additive change)
- Update plugin.json:
  - Add components.skills: 3
  - Add skills section with git-worktree skills
  - Update description to mention skills
  - Add git-worktrees keyword
- Update marketplace.json:
  - Update version to 1.1.0
  - Update description to mention skills
  - Add git-worktrees tag
- Add plugin README.md:
  - Document all components (agents, commands, skills)
  - Include usage examples
  - List all agents, commands, and skills
  - Add version history
  - Add installation instructions

This is an additive, non-breaking change that introduces reusable
skills as a new capability of the plugin.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Create a curated reference hub containing:
- Official Git documentation (man pages, book, command references)
- Community guides (DEV.to, Medium, GitHub Gists)
- Tool integrations (CLI tools, IDE support)
- Stack Overflow discussions
- Related Git features (stash, sparse-checkout, bisect, rebase)

This centralized resource makes it easier to find authoritative
documentation and community best practices for git worktree workflows.

Aligns with compounding engineering: create once, reference everywhere.

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

Co-Authored-By: Claude <noreply@anthropic.com>
…-create

Add official Git documentation links to Overview with experimental status warning.

Add "Git Worktree Fundamentals" section explaining:
- Main vs linked worktrees
- Shared vs isolated data (HEAD, index, files, refs)
- Why this isolation matters for development

Add "Advanced Worktree Options" section with:
- Detached HEAD worktrees for experiments
- Orphan branch worktrees for separate histories
- Lock/unlock for portable worktrees
- Repair operations for moved worktrees
- Sparse checkout with no-checkout mode

Add "Limitations and Warnings" section covering:
- Experimental status with submodules
- Branch checkout restrictions
- Performance considerations with many worktrees
- Best practices to avoid issues

Add comprehensive "Official Resources" section with:
- Official Git documentation references
- Community guides and tutorials
- Related skills and commands
- Link to RESOURCES.md hub

All changes reference official Git documentation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
…manage

Add official Git documentation links to Overview with command-specific references:
- List, remove, prune, lock/unlock, repair commands

Add "Worktree Status and Metadata" section explaining:
- Status indicators (active, locked, prunable, detached HEAD)
- Administrative files in .git/worktrees/
- What each metadata file represents

Add "Advanced Management Techniques" section with:
- Scripting with porcelain format output
- Machine-readable output for parsing
- Bulk operation examples
- Repair operations for corrupted worktrees

Add comprehensive "Official Resources" section with:
- Official Git documentation references
- Community guides and tutorials
- Related skills
- Link to RESOURCES.md hub

All changes align with official Git documentation patterns.

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

Co-Authored-By: Claude <noreply@anthropic.com>
…ractices

Add "Official Git Guidance" section with:
- Key recommendations from Git documentation
- Community best practices from GitHub Gist
- Important experimental status warnings
- Guidance on when and why to use worktrees

Add Patterns 6-8 with real-world examples:
- Pattern 6: Emergency Hotfix (canonical Git docs example)
  Shows worktrees as superior alternative to git stash
- Pattern 7: CI/CD Optimization (single clone with worktrees)
  Saves disk space and bandwidth vs multiple clones
- Pattern 8: Long-Running Review Workflow
  Preserves review context across days without branch switching

Add comprehensive "Anti-Patterns to Avoid" section covering:
- Too many worktrees (symptoms and solutions)
- Manual directory deletion (use git worktree remove)
- Shared branch in multiple worktrees (impossible)
- Worktrees with submodules (experimental, use cautiously)

Add "Compounding Engineering Philosophy" summary showing how
worktrees enable: isolation → clean merges → easy cleanup → reduced cognitive load.

All patterns reference official Git documentation and community best practices.

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

Co-Authored-By: Claude <noreply@anthropic.com>
skills/README.md:
- Add "Learning Resources" section with links to:
  - Skill documentation files
  - Examples and usage patterns
  - RESOURCES.md curated reference hub
  - External official and community resources
- Improves discoverability of comprehensive documentation

plugins/compounding-engineering/README.md:
- Add "Learning Resources" section with same structure
- Helps users understand git-worktree-create, manage, and best-practices skills
- Cross-references to skill documentation
- Links to official Git docs and community guides
- Mentions related `/work` and `/review` commands

Makes 750+ lines of new documentation easily discoverable from
top-level navigation points.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +80 to +83
log_info "Updating main branch"
cd "$git_root"
git checkout main 2>/dev/null || true
git pull origin main 2>/dev/null || true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Guard main-branch pull when checkout fails

The script always runs git pull origin main even if git checkout main failed. Because both commands are suffixed with || true, a checkout failure (for example due to uncommitted changes or a repository whose default branch is not main) is silently ignored while the pull still executes. In that scenario the pull merges remote main into whichever branch the user was already on, potentially introducing unrelated changes or conflicts when the intent was only to prepare a clean base before creating a worktree. Consider performing the pull only after a successful checkout or skipping the update when the checkout cannot be performed.

Useful? React with 👍 / 👎.

@tommy-ca
Copy link
Copy Markdown
Author

tommy-ca commented Nov 9, 2025

Closing this PR as it should be submitted to my fork (tommy-ca/every-marketplace) instead of the upstream repository. I will recreate this PR in my fork with the same changes.

@tommy-ca tommy-ca closed this Nov 9, 2025
armstrongl added a commit to nuggylib/compound-engineering-plugin that referenced this pull request Apr 14, 2026
…-plan tracking

Add the implementation plan for idea EveryInc#20 (Carrying Cost Budgeting) which
introduces a `bun run skill:stats` command that ranks all skills and agents
by carrying cost (`file_size x estimated_tool_calls`) instead of raw file size.

The plan was refined through three parallel review passes (coherence,
feasibility, scope) that applied 14 auto-fixes:

- Collapsed two-file architecture to a single self-contained script
- Broadened tool detection from verb+tool patterns (near-zero recall on
  real content) to capitalized tool names at word boundaries
- Replaced loop scope-based multiplication with additive weights
- Added `disable-model-invocation` frontmatter filter for tutorial skills
- Clarified sort key as single `system_cost` metric (not two competing
  metrics)
- Documented `@`-expansion undercount as a known limitation

The meta-plan tracking table is updated: idea EveryInc#20 brainstorm and plan
columns both marked done. Next in the roadmap: S4 (brainstorm ideas
EveryInc#9, EveryInc#6, EveryInc#5, EveryInc#10 in parallel).
armstrongl added a commit to nuggylib/compound-engineering-plugin that referenced this pull request Apr 21, 2026
…-plan tracking

Add the implementation plan for idea EveryInc#20 (Carrying Cost Budgeting) which
introduces a `bun run skill:stats` command that ranks all skills and agents
by carrying cost (`file_size x estimated_tool_calls`) instead of raw file size.

The plan was refined through three parallel review passes (coherence,
feasibility, scope) that applied 14 auto-fixes:

- Collapsed two-file architecture to a single self-contained script
- Broadened tool detection from verb+tool patterns (near-zero recall on
  real content) to capitalized tool names at word boundaries
- Replaced loop scope-based multiplication with additive weights
- Added `disable-model-invocation` frontmatter filter for tutorial skills
- Clarified sort key as single `system_cost` metric (not two competing
  metrics)
- Documented `@`-expansion undercount as a known limitation

The meta-plan tracking table is updated: idea EveryInc#20 brainstorm and plan
columns both marked done. Next in the roadmap: S4 (brainstorm ideas
EveryInc#9, EveryInc#6, EveryInc#5, EveryInc#10 in parallel).
mvanhorn added a commit to mvanhorn/compound-engineering-plugin that referenced this pull request Apr 28, 2026
Add a conditional review persona that delegates to OpenAI's Codex CLI
for an independent second-opinion read on the diff. Codex catches
blind spots same-model reviewers share — different model, different
reasoning patterns, different recall.

Reapplies PR EveryInc#356 onto current main after the v3 restructure
(ce-review -> ce-code-review, agents/<category>/ -> agents/ce-*.agent.md,
ce: -> ce-, new subagent template that passes pre-computed diff).

Addresses both Codex findings still active on the prior commit:

- P1 (line 54): "Stop assuming ce:review passes base branch context."
  The new subagent template passes the pre-computed diff directly;
  ce-codex-reviewer materializes that diff to a tempfile and feeds
  it to codex. No base-branch resolution, no git symbolic-ref or
  rev-parse, no fall-back chain to break on non-default targets.

- P2 (line 123): "Remove cross-persona suppression rule." The agent
  no longer instructs codex to suppress findings already covered by
  other personas. Synthesis dedupes centrally in Stage 5; the parallel
  subagent has no visibility into other reviewers' outputs anyway.

Pieces:

- agents/ce-codex-reviewer.agent.md — new persona, anchored confidence
  rubric (50/75; 100 never emitted because second-opinion is not direct
  verification), two-phase environment guard (CODEX_SANDBOX/SESSION_ID
  recursion check + which codex availability check), pipe-delimited
  output translation into the structured findings schema.
- skills/ce-code-review/references/persona-catalog.md — codex registered
  as conditional persona EveryInc#9. Selected when the diff is non-trivial
  (>=25 changed non-test lines) or correctness-sensitive (auth,
  payments, data, parsing, concurrency, external API contracts) AND
  the user-level codex CLI is on PATH.
- skills/ce-code-review/SKILL.md — codex added to the cross-cutting
  conditional dispatch table; reviewer count bumped 18 -> 19.
- plugins/compound-engineering/README.md — codex listed in the Review
  agents table (insertion in sorted order).
- tests/review-skill-contract.test.ts — codex added to the anchored-
  rubric persona loop, plus four new contract tests guarding (a)
  frontmatter shape, (b) the no-base-branch-resolution rule with
  explicit P1 regression callouts, (c) the no-cross-persona-suppression
  rule with explicit P2 regression callout, (d) catalog/SKILL.md
  registration, and (e) the two environment guards before any codex
  invocation.

Verification:

- bun test tests/review-skill-contract.test.ts: 28 pass (was 24)
- bun test full suite: 992 pass, 9 pre-existing failures in
  detect-project-type.sh unchanged (present on main before this PR)
- bun run release:validate: clean (52 agents, 35 skills, 0 MCP)

No release-owned files touched: plugin.json, marketplace.json, and
CHANGELOG.md remain untouched per AGENTS.md rules.
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