Skip to content

feat: create Claude Code plugin for sharing commands across repos - #1352

Merged
atxtechbro merged 1 commit into
mainfrom
feat/dotfiles-plugin-for-shared-commands
Oct 9, 2025
Merged

feat: create Claude Code plugin for sharing commands across repos#1352
atxtechbro merged 1 commit into
mainfrom
feat/dotfiles-plugin-for-shared-commands

Conversation

@atxtechbro

Copy link
Copy Markdown
Owner

Git Statistics

.claude-plugin/commands/close-issue.md        |  1 +
.claude-plugin/commands/create-issue.md       |  1 +
.claude-plugin/commands/extract-best-frame.md |  1 +
.claude-plugin/commands/retro.md              |  1 +
.claude-plugin/marketplace.json               | 13 +++++++++++++
.claude-plugin/plugin.json                    |  8 ++++++++
6 files changed, 25 insertions(+)

Summary

Transforms dotfiles into a Claude Code plugin that can be installed in any repo, solving the problem of sharing slash commands across multiple repositories.

The Problem: PR #1344 added /close-issue via symlink in dotfiles, but other repos (like lifehacking) can't access it. The old command generation system that synced to ~/.claude/commands/ was removed in #1320 for provider-agnostic reasons.

The Solution: Use Claude Code's official plugin system introduced in their recent plugins announcement. Dotfiles becomes a shareable plugin that other repos can install.

What Changed

Created plugin structure:

.claude-plugin/
├── plugin.json              # Plugin metadata
├── marketplace.json         # Distribution manifest  
└── commands/                # Symlinked to knowledge base
    ├── close-issue.md      → ../../knowledge/procedures/close-issue-procedure.md
    ├── create-issue.md     → ../../knowledge/procedures/issue-creation-procedure.md
    ├── extract-best-frame.md → ../../knowledge/procedures/extract-best-frame-procedure.md
    └── retro.md           → ../../knowledge/procedures/retro-procedure.md

Benefits

🎯 Modern Approach:

  • Official Claude Code extension system (vs custom generation scripts)
  • Commands shareable across all repos via plugin install
  • Per-repo control (install only where needed)

🔧 Technical:

  • Single source of truth (knowledge base remains authoritative)
  • Symlinks ensure zero duplication
  • Expandable with agents, hooks, MCP servers later
  • Works with both local paths and GitHub distribution

Installation in Other Repos

Local (for testing):

/plugin marketplace add ~/ppv/pillars/dotfiles
/plugin install dotfiles-commands

GitHub (after merge):

/plugin marketplace add atxtechbro/dotfiles
/plugin install dotfiles-commands@atxtechbro

Implementation Notes

This "dotfiles-as-plugin" approach:

  • Leverages official Claude Code plugin system vs maintaining custom sync scripts
  • Enables sharing of dotfiles setup with other users
  • Follows systems-stewardship principle (single source of truth in knowledge base)
  • Can be expanded to include custom agents and hooks in the future

Test Plan

  • Create .claude-plugin/ structure with manifests
  • Symlink commands to knowledge base procedures
  • Test local installation in lifehacking repo
  • Verify /close-issue autocomplete works after plugin install
  • Test GitHub-based installation after merge

Related: Continues the work from #1344 (symlink approach) by making it shareable across repos

Transforms dotfiles into a Claude Code plugin that can be installed in any repo.

**The Problem**: PR #1344 added /close-issue via symlink in dotfiles, but other repos
(like lifehacking) can't access it. The old command generation system was removed in #1320.

**The Solution**: Use Claude Code's official plugin system to share commands:
```
.claude-plugin/
├── plugin.json              # Plugin metadata
├── marketplace.json         # Distribution manifest
└── commands/                # Symlinked to knowledge base
    ├── close-issue.md
    ├── create-issue.md
    ├── extract-best-frame.md
    └── retro.md
```

## Installation in Other Repos

**Local (for testing):**
```bash
/plugin marketplace add ~/ppv/pillars/dotfiles
/plugin install dotfiles-commands
```

**GitHub (after merge):**
```bash
/plugin marketplace add atxtechbro/dotfiles
/plugin install dotfiles-commands@atxtechbro
```

## Benefits

- ✅ Official Claude Code extension system (modern approach)
- ✅ Commands shareable across all repos via plugin install
- ✅ Single source of truth (knowledge base remains authoritative)
- ✅ Expandable with agents, hooks, MCP servers later
- ✅ Per-repo control (install only where needed)

Principles: systems-stewardship (single source of truth), dotfiles-as-plugin (shareable setup)
@amazon-q-developer

Copy link
Copy Markdown
Contributor

Code review in progress. Analyzing for code quality issues and best practices. Detailed findings will be posted upon completion.

Using Amazon Q Developer for GitHub

Amazon Q Developer1 is an AI-powered assistant that integrates directly into your GitHub workflow, enhancing your development process with intelligent features for code development, review, and transformation.

Slash Commands

Command Description
/q <message> Chat with the agent to ask questions or request revisions
/q review Requests an Amazon Q powered code review
/q help Displays usage information

Features

Agentic Chat
Enables interactive conversation with Amazon Q to ask questions about the pull request or request specific revisions. Use /q <message> in comment threads or the review body to engage with the agent directly.

Code Review
Analyzes pull requests for code quality, potential issues, and security concerns. Provides feedback and suggested fixes. Automatically triggered on new or reopened PRs (can be disabled for AWS registered installations), or manually with /q review slash command in a comment.

Customization

You can create project-specific rules for Amazon Q Developer to follow:

  1. Create a .amazonq/rules folder in your project root.
  2. Add Markdown files in this folder to define rules (e.g., cdk-rules.md).
  3. Write detailed prompts in these files, such as coding standards or best practices.
  4. Amazon Q Developer will automatically use these rules when generating code or providing assistance.

Example rule:

All Amazon S3 buckets must have encryption enabled, enforce SSL, and block public access.
All Amazon DynamoDB Streams tables must have encryption enabled.
All Amazon SNS topics must have encryption enabled and enforce SSL.
All Amazon SNS queues must enforce SSL.

Feedback

To provide feedback on Amazon Q Developer, create an issue in the Amazon Q Developer public repository.

For more detailed information, visit the Amazon Q for GitHub documentation.

Footnotes

  1. Amazon Q Developer uses generative AI. You may need to verify generated code before using it in your environment. See the AWS Responsible AI Policy.

@atxtechbro
atxtechbro merged commit 5291bd3 into main Oct 9, 2025

@amazon-q-developer amazon-q-developer Bot 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.

Overall Assessment

This PR introduces an innovative approach to sharing Claude Code commands across repositories using the official plugin system. The concept is solid and addresses a real need for command portability, but there are several implementation issues that need to be addressed before this will function correctly.

Critical Issues

Symlink Implementation: The most critical issue is that the command files contain path strings rather than actual symbolic links. Claude Code will read the file content (the path string) instead of following symlinks to the target procedures. This needs to be fixed for the plugin to work.

Plugin Metadata: The plugin.json is missing essential fields like command definitions, entry points, and engine compatibility requirements that Claude Code plugins typically need.

Recommendations

  1. Fix symlinks: Use actual ln -s commands to create proper symbolic links instead of files containing path strings
  2. Enhance plugin.json: Add command definitions, main entry point, and engine compatibility fields
  3. Add version tracking: Include version information in marketplace.json for better release management
  4. Fix file formatting: Ensure all files have proper trailing newlines

Strengths

  • Excellent architectural approach using official Claude Code plugin system
  • Clear documentation and rationale in the PR description
  • Good separation of concerns with knowledge base as single source of truth
  • Well-thought-out installation instructions for both local and GitHub scenarios

The core idea is excellent and will provide significant value once the implementation details are corrected.

@@ -0,0 +1 @@
../../knowledge/procedures/close-issue-procedure.md No newline at end of file

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.

The symlink files contain only relative paths as text content rather than actual symbolic links. This approach won't work as intended because Claude Code will read the file content (the path string) instead of following a symlink to the target file. Consider using actual symbolic links or copying the content directly.

@@ -0,0 +1,8 @@
{
"name": "dotfiles-commands",

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.

The plugin.json is missing several important fields that are typically required for Claude Code plugins. Consider adding fields like main (entry point), commands (command definitions), and engines (compatibility requirements) to ensure proper plugin functionality.

Comment on lines +7 to +8
{
"name": "dotfiles-commands",

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.

The marketplace.json structure looks correct, but consider adding version information and more detailed metadata. The source field pointing to "." is appropriate for a self-contained plugin, but you may want to add a version field to track plugin releases.

Suggested change
{
"name": "dotfiles-commands",
{
"name": "dotfiles-commands",
"source": ".",
"version": "1.0.0",
"description": "Shared procedures and slash commands from dotfiles knowledge base",
"keywords": ["commands", "procedures", "github", "automation"]
}

@@ -0,0 +1 @@
../../knowledge/procedures/issue-creation-procedure.md No newline at end of file

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.

Same issue as with close-issue.md - this file contains a path string rather than being an actual symlink. All command files in the commands directory have this same problem and will not function as intended.

@@ -0,0 +1 @@
../../knowledge/procedures/close-issue-procedure.md No newline at end of file

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.

🛑 Missing Newline: The file is missing a trailing newline character, which can cause issues with Git and text processing tools. This is indicated by the "No newline at end of file" message in the diff.

@@ -0,0 +1,13 @@
{
"name": "dotfiles-marketplace",

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.

Consider using a more descriptive name for the marketplace. "dotfiles-marketplace" might be confusing since this is specifically for command sharing. Something like "dotfiles-commands-marketplace" would be clearer about the purpose.

atxtechbro added a commit that referenced this pull request Oct 9, 2025
Adds required YAML front matter with description field to all procedure files
so Claude Code can discover and display them as slash commands in autocomplete.

**Root Cause**: Claude Code requires YAML front matter for command discovery:
```yaml
---
description: Command description
---
```

Without this, procedures are invisible to `/plugin` system even when installed.

**Changes**:
- close-issue-procedure.md: Add "Close GitHub issue with PR workflow"
- issue-creation-procedure.md: Add "Create GitHub issue with validated labels"
- extract-best-frame-procedure.md: Add "Extract best frame from video using AI"
- retro-procedure.md: Add "Run retrospective to capture learnings"
- README.md: Add note about restarting Claude Code after plugin install

**After this PR merges**:
1. Uninstall/reinstall plugin to get updated procedures
2. Restart Claude Code
3. Commands will appear in autocomplete

Fixes command discovery from PR #1352
atxtechbro added a commit that referenced this pull request Oct 9, 2025
…#1354)

Adds required YAML front matter with description field to all procedure files
so Claude Code can discover and display them as slash commands in autocomplete.

**Root Cause**: Claude Code requires YAML front matter for command discovery:
```yaml
---
description: Command description
---
```

Without this, procedures are invisible to `/plugin` system even when installed.

**Changes**:
- close-issue-procedure.md: Add "Close GitHub issue with PR workflow"
- issue-creation-procedure.md: Add "Create GitHub issue with validated labels"
- extract-best-frame-procedure.md: Add "Extract best frame from video using AI"
- retro-procedure.md: Add "Run retrospective to capture learnings"
- README.md: Add note about restarting Claude Code after plugin install

**After this PR merges**:
1. Uninstall/reinstall plugin to get updated procedures
2. Restart Claude Code
3. Commands will appear in autocomplete

Fixes command discovery from PR #1352
atxtechbro added a commit that referenced this pull request Oct 9, 2025
Removes the deprecated command generation architecture that was replaced
by Claude Code's native plugin system (PR #1352).

**What Was Removed:**
- `utils/generate-claude-commands.sh` - Template processor
- `utils/generate-commands.sh` - Multi-provider command generation
- `utils/sync-claude-commands.sh` - Command sync tool
- `utils/prompt_orchestrator.py` - Template engine
- CI/CD validation for command sync
- All references from README, setup.sh, and settings.json

**Why:**
- PR #1320 moved to "provider-agnostic, slash-free invocation"
- PR #1352 introduced plugin system as replacement
- Template generation no longer used or maintained
- Symlinks in `.claude-plugin/` handle distribution now

**What Remains:**
- `.claude-plugin/` - Plugin distribution (current architecture)
- `.claude/commands/` - Local commands for dotfiles repo
- `knowledge/procedures/` - Single source of truth

**Cleanup Also:**
- Removed 16 old worktrees (leftover branches)
- Pruned git worktree references

Closes #1319 follow-up
atxtechbro added a commit that referenced this pull request Oct 9, 2025
Removes the deprecated command generation architecture that was replaced
by Claude Code's native plugin system (PR #1352).

**What Was Removed:**
- `utils/generate-claude-commands.sh` - Template processor
- `utils/generate-commands.sh` - Multi-provider command generation
- `utils/sync-claude-commands.sh` - Command sync tool
- `utils/prompt_orchestrator.py` - Template engine
- CI/CD validation for command sync
- All references from README, setup.sh, and settings.json

**Why:**
- PR #1320 moved to "provider-agnostic, slash-free invocation"
- PR #1352 introduced plugin system as replacement
- Template generation no longer used or maintained
- Symlinks in `.claude-plugin/` handle distribution now

**What Remains:**
- `.claude-plugin/` - Plugin distribution (current architecture)
- `.claude/commands/` - Local commands for dotfiles repo
- `knowledge/procedures/` - Single source of truth

**Cleanup Also:**
- Removed 16 old worktrees (leftover branches)
- Pruned git worktree references

Closes #1319 follow-up
atxtechbro added a commit that referenced this pull request Oct 10, 2025
Remove all documentation and procedures for the prompt orchestrator system
that was deleted in PR #1355 (Oct 9, 2025). The entire template generation
architecture was replaced by Claude Code's native plugin system.

## Files Removed

**Documentation (obsolete):**
- `docs/prompt-orchestration.md` - Described template syntax for deleted orchestrator
- `docs/prompt-orchestrator-security.md` - Security docs for deleted code

**Procedure (obsolete):**
- `knowledge/procedures/command-lifecycle-management.md` - Referenced deleted tools:
  - utils/sync-claude-commands.sh (removed PR #1355)
  - utils/generate-commands.sh (removed PR #1355)
  - .claude/command-templates/ (never existed)

**Artifacts (untracked):**
- `utils/__pycache__/prompt_orchestrator.cpython-312.pyc` - Not in git, removed manually

## Updated

**knowledge/principles/systems-stewardship.md:26** - Updated gitignore example:
- Old: Referenced deleted `.claude/command-templates`
- New: References current `mlruns/` (MLflow tracking data)

## Context

The prompt orchestrator (utils/prompt_orchestrator.py) was removed in
commit 688fe9d along with 1,131 lines of template generation tooling.
These docs were orphaned but not removed at the time.

## Impact

- 3 docs files removed (~150 lines)
- 1 procedure removed (42 lines)
- 1 principle example updated
- Zero functional loss - all referenced deleted systems

Related to #1355 (orchestrator removal)
Related to #1352 (plugin system replacement)

Principle: subtraction-creates-value
atxtechbro added a commit that referenced this pull request Oct 10, 2025
Remove all documentation, procedures, and vestigial syntax for the prompt
orchestrator system deleted in PR #1355 (Oct 9, 2025). The entire template
generation architecture was replaced by Claude Code's native plugin system.

## Files Removed

**Documentation (obsolete):**
- `docs/prompt-orchestration.md` - Described template syntax for deleted orchestrator
- `docs/prompt-orchestrator-security.md` - Security docs for deleted code

**Procedure (obsolete):**
- `knowledge/procedures/command-lifecycle-management.md` - Referenced deleted tools:
  - utils/sync-claude-commands.sh (removed PR #1355)
  - utils/generate-commands.sh (removed PR #1355)
  - .claude/command-templates/ (never existed)

**Artifacts (untracked):**
- `utils/__pycache__/prompt_orchestrator.cpython-312.pyc` - Not in git, removed manually

## Vestigial Syntax Removed

**commands/close-issue.md** - Removed 2 non-functional markers:
- Line 52: `{{ INJECT:principles/tracer-bullets.md }}`
- Line 69: `{{ INJECT:principles/eager-evolution.md }}`

**commands/extract-best-frame.md** - Removed 1 non-functional marker:
- Line 211: `{{ INJECT:principles/tracer-bullets.md }}`

These `{{ INJECT: }}` markers were remnants of the deleted orchestrator's
template processing. They're not processed by any current system - GitHub
Actions only processes `{{ KNOWLEDGE_BASE }}` and local commands don't
process them at all. The principles are already available in context,
making these markers vestigial documentation cruft.

## Updated

**knowledge/principles/systems-stewardship.md:26** - Updated gitignore example:
- Old: Referenced deleted `.claude/command-templates`
- New: References current `mlruns/` (MLflow tracking data)

## Context

The prompt orchestrator (utils/prompt_orchestrator.py) was removed in
commit 688fe9d along with 1,131 lines of template generation tooling.
These docs and syntax markers were orphaned but not removed at the time.

## Impact

- 3 docs files removed (~150 lines)
- 1 procedure removed (42 lines)
- 3 vestigial syntax markers removed
- 1 principle example updated
- Zero functional loss - all referenced deleted systems or non-functional syntax

Related to #1355 (orchestrator removal)
Related to #1352 (plugin system replacement)

Principle: subtraction-creates-value
atxtechbro added a commit that referenced this pull request Oct 10, 2025
#1377)

Remove all documentation, procedures, and vestigial syntax for the prompt
orchestrator system deleted in PR #1355 (Oct 9, 2025). The entire template
generation architecture was replaced by Claude Code's native plugin system.

## Files Removed

**Documentation (obsolete):**
- `docs/prompt-orchestration.md` - Described template syntax for deleted orchestrator
- `docs/prompt-orchestrator-security.md` - Security docs for deleted code

**Procedure (obsolete):**
- `knowledge/procedures/command-lifecycle-management.md` - Referenced deleted tools:
  - utils/sync-claude-commands.sh (removed PR #1355)
  - utils/generate-commands.sh (removed PR #1355)
  - .claude/command-templates/ (never existed)

**Artifacts (untracked):**
- `utils/__pycache__/prompt_orchestrator.cpython-312.pyc` - Not in git, removed manually

## Vestigial Syntax Removed

**commands/close-issue.md** - Removed 2 non-functional markers:
- Line 52: `{{ INJECT:principles/tracer-bullets.md }}`
- Line 69: `{{ INJECT:principles/eager-evolution.md }}`

**commands/extract-best-frame.md** - Removed 1 non-functional marker:
- Line 211: `{{ INJECT:principles/tracer-bullets.md }}`

These `{{ INJECT: }}` markers were remnants of the deleted orchestrator's
template processing. They're not processed by any current system - GitHub
Actions only processes `{{ KNOWLEDGE_BASE }}` and local commands don't
process them at all. The principles are already available in context,
making these markers vestigial documentation cruft.

## Updated

**knowledge/principles/systems-stewardship.md:26** - Updated gitignore example:
- Old: Referenced deleted `.claude/command-templates`
- New: References current `mlruns/` (MLflow tracking data)

## Context

The prompt orchestrator (utils/prompt_orchestrator.py) was removed in
commit 688fe9d along with 1,131 lines of template generation tooling.
These docs and syntax markers were orphaned but not removed at the time.

## Impact

- 3 docs files removed (~150 lines)
- 1 procedure removed (42 lines)
- 3 vestigial syntax markers removed
- 1 principle example updated
- Zero functional loss - all referenced deleted systems or non-functional syntax

Related to #1355 (orchestrator removal)
Related to #1352 (plugin system replacement)

Principle: subtraction-creates-value
@atxtechbro
atxtechbro deleted the feat/dotfiles-plugin-for-shared-commands branch October 10, 2025 08:30
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