Repository navigation
feat(claude): ponytail pluginを追加 - #63
Conversation
marketplace DietrichGebert/ponytail からponytail pluginを有効化する。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe Claude template now enables the ChangesClaude Ponytail Plugin
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@modules/ai/claude/template/settings.json`:
- Around line 168-173: Update the ponytail entry in extraKnownMarketplaces by
adding its reviewed GitHub release tag as the source ref. Keep the existing
repository configuration unchanged otherwise, ensuring marketplace refreshes
remain pinned until this configuration is explicitly updated.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4decc1c7-6725-45d0-9bf2-bf9ca44502ff
📒 Files selected for processing (1)
modules/ai/claude/template/settings.json
| }, | ||
| "ponytail": { | ||
| "source": { | ||
| "source": "github", | ||
| "repo": "DietrichGebert/ponytail" | ||
| } |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== target file excerpt =="
sed -n '150,190p' modules/ai/claude/template/settings.json 2>/dev/null || true
echo
echo "== other marketplace sources in settings =="
python3 - <<'PY'
import json
from pathlib import Path
p=Path('modules/ai/claude/template/settings.json')
if p.exists():
data=json.loads(p.read_text())
for key, value in data.items():
s=value.get('source') if isinstance(value, dict) else None
if s and isinstance(s, dict) and s.get('source') == 'github':
print(key, {k:v for k,v in s.items() if k in {"source","repo","ref"}})
PY
echo
echo "== Ponytail repository hooks files (read-only metadata) =="
tmp="$(mktemp -d)"
cd "$tmp"
git init -q
git remote add origin https://github.com/DietrichGebert/ponytail.git
python3 - <<'PY'
import subprocess, sys, json
from pathlib import Path
try:
subprocess.run(['git','ls-tree','-r','HEAD'], check=True, text=True, capture_output=True, stdout=subprocess.PIPE)
except Exception as e:
sys.exit(0)
PY
if command -v gh >/dev/null 2>&1; then
echo "gh available"
gh api repos/DietrichGebert/ponytail/git/trees/HEAD?recursive=true --jq '.tree[] | select((.type=="blob") and (((.path|starts_with(".github/workflows/")) or (.path|ends_with("hook")) or (.path|contains("hook")))) or (.type=="submodule"))' 2>/dev/null | sed -n '1,120p' || true
else
echo "gh not available"
fi
echo
echo "== Claude docs snippets if available locally =="
rg -n '"ref"|marketplace|Github marketplace|ponytail' -S . --glob '!node_modules' --glob '!dist' --glob '!build' 2>/dev/null | sed -n '1,120p' || trueRepository: hitsan/dotfiles
Length of output: 1066
🌐 Web query:
Claude Code marketplace sources ref github settings.json
💡 Result:
In Claude Code, you can configure additional plugin marketplaces by adding them to the extraKnownMarketplaces field within your .claude/settings.json file [1][2][3]. When using a GitHub-based source for a marketplace, the configuration follows this structure [1][3]: { "extraKnownMarketplaces": { "my-marketplace-name": { "source": { "source": "github", "repo": "owner/repo", "ref": "branch-or-tag-name" } } } } Key details regarding this configuration include: Marketplace Source: The source field defines where Claude Code fetches the marketplace catalog (a marketplace.json file) [1]. GitHub Support: For GitHub-based marketplace sources, you can use the ref field to specify a git branch or tag [1]. If omitted, it defaults to the repository's default branch [1]. Usage: When team members trust the project directory, Claude Code will prompt them to install marketplaces defined in the project's .claude/settings.json [1][2][3]. Distinction: Note that ref is supported for marketplace sources, whereas individual plugins listed inside a marketplace.json file may support ref and sha for version pinning [1]. For security-constrained environments, administrators can use strictKnownMarketplaces in managed settings to restrict which marketplace sources are allowed [4][5].
Citations:
- 1: https://code.claude.com/docs/en/plugin-marketplaces
- 2: https://code.claude.com/docs/en/discover-plugins
- 3: https://claude.yourdocs.dev/docs/claude-code/plugin-marketplaces
- 4: https://code.claude.com/docs/en/settings
- 5: https://code.claude.com/docs/en/configuration
🌐 Web query:
Ponytail GitHub repository hooks files .github hooks installed
💡 Result:
Ponytail is a repository-based project that enhances AI coding assistants (such as Claude Code, GitHub Copilot CLI, and Qoder) by injecting rules, skills, and mode tracking [1][2]. It does not use standard Git hooks (which are stored in.git/hooks) [3][4], nor does it install its own hooks into a.github/hooks directory [5]. Instead, Ponytail uses "lifecycle hooks" defined within its own repository structure, typically located in a hooks/ directory [2][5]. These hooks are JSON configuration files or scripts (e.g., Node.js, PowerShell, or shell scripts) that specific AI agent platforms are instructed to load [2][5][6]. Regarding the.github/ folder: 1. Ponytail may utilize.github/copilot-instructions.md as part of its fallback, instruction-only mode for GitHub Copilot, which allows for always-on guidance without needing to install full plugin hooks [1][7][2]. 2. Standard GitHub Copilot hooks (distinct from Ponytail's internal logic) can be configured via.github/hooks/*.json, but Ponytail's specific implementation relies on being added as a plugin to the host agent (e.g., via codex plugin add or copilot plugin install) [6][8]. To set up Ponytail for full functionality, you generally run the install commands provided by your agent's marketplace (e.g., copilot plugin marketplace add DietrichGebert/ponytail) rather than manually placing files into.github/ [1][7][6]. You can review the repository's hooks/ directory to see the lifecycle events and scripts that the plugin utilizes [2][5].
Citations:
- 1: https://github.com/DietrichGebert/ponytail/
- 2: https://github.com/DietrichGebert/ponytail/blob/main/docs/agent-portability.md
- 3: https://git-scm.com/docs/githooks
- 4: https://git-scm.com/book/ms/v2/Customizing-Git-Git-Hooks
- 5: DietrichGebert/ponytail@7a3475c
- 6: https://github.com/DietrichGebert/ponytail/releases
- 7: https://github.com/DietrichGebert/ponytail/blob/main/README.md
- 8: https://github.com/github/docs/blob/main/content/copilot/reference/hooks-reference.md
🌐 Web query:
site:code.claude.com/reference/extension lifecycle hooks Ponytail Claude Code
💡 Result:
The relevant Claude Code documentation is:
- Hooks reference: lifecycle hooks, event schemas, matchers, input/output, async and HTTP hooks. [1]
- Hooks guide: setup and examples for automating workflows. [2]
- Extension overview: compares hooks with skills, subagents, MCP, and plugins. [3]
I couldn’t find a Claude Code concept or feature named “Ponytail” in the results.
🌐 Web query:
site:github.com/DietrichGebert/ponytail lifecycle hooks README Claude Code
💡 Result:
Claude Code supports a plugin-based architecture that utilizes lifecycle hooks, typically defined in a hooks/hooks.json file [1][2]. These hooks allow developers to trigger Node.js scripts in response to specific lifecycle events [3][4]. Key aspects of Claude Code lifecycle hooks include: - Configuration: Plugins define their hooks in a hooks.json file, which is automatically loaded by Claude Code [1][2]. This file maps lifecycle events to the corresponding executable commands [2][5]. - Supported Events: Common lifecycle events for plugins include SessionStart (triggered when a session begins) and UserPromptSubmit (triggered whenever a user submits a prompt) [2][5]. - Execution Requirements: Claude Code executes these hooks via a non-interactive shell [6][5]. Because these hooks often invoke Node.js scripts (e.g., ponytail-mode-tracker.js or ponytail-activate.js), the node runtime must be available on the non-interactive shell's PATH [3][6]. - Best Practices: - If node is not guaranteed to be on the PATH (such as in Nix or nvm environments), developers are advised to implement guards in their hook commands (e.g., command -v node >/dev/null 2>&1 && node "..." || exit 0) to allow the plugin to degrade gracefully without throwing errors on every prompt [6][5]. - Use ${CLAUDE_PLUGIN_ROOT} in hooks.json to correctly reference plugin files, as this variable is substituted by Claude Code at runtime [2]. - Plugin Integration: When developing or installing plugins like "ponytail," users may need to review and trust these hooks within the Claude Code environment to enable features like session activation, mode tracking, and statusline updates [3][1]. If a hook fails (e.g., due to a missing dependency or an issue parsing the prompt data), it may result in error messages during session startup or on every prompt submission [2][5]. Debugging often involves ensuring the hook script correctly parses the data.prompt object, especially if the command is dispatched as a skill rather than plain text [7][8].
Citations:
- 1: https://github.com/DietrichGebert/ponytail/blob/main/docs/agent-portability.md
- 2: fix: use CLAUDE_PLUGIN_ROOT in hooks.json, drop duplicate manifest hooks DietrichGebert/ponytail#12
- 3: https://github.com/DietrichGebert/ponytail/blob/main/README.md
- 4: https://github.com/DietrichGebert/ponytail
- 5: UserPromptSubmit hook errors on every prompt when node isn't on a global PATH (undeclared dependency) DietrichGebert/ponytail#51
- 6: fix: hooks degrade gracefully when node is not on PATH DietrichGebert/ponytail#57
- 7: fix: parse command-name from skill-dispatch prompt in UserPromptSubmit (#584) DietrichGebert/ponytail#585
- 8: [Bug] /ponytail never sets a mode in Claude Code: the UserPromptSubmit hook receives the SKILL.md body, not the command text DietrichGebert/ponytail#584
Pin the marketplace to a reviewed release.
extraKnownMarketplaces GitHub sources support ref; without it, refreshes will pull the repository default branch. Add a reviewed tag so marketplace code and lifecycle hooks cannot change without an explicit configuration update.
Proposed change
"source": {
"source": "github",
- "repo": "DietrichGebert/ponytail"
+ "repo": "DietrichGebert/ponytail",
+ "ref": "<reviewed-release-tag>"
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@modules/ai/claude/template/settings.json` around lines 168 - 173, Update the
ponytail entry in extraKnownMarketplaces by adding its reviewed GitHub release
tag as the source ref. Keep the existing repository configuration unchanged
otherwise, ensuring marketplace refreshes remain pinned until this configuration
is explicitly updated.
Summary
DietrichGebert/ponytailからponytail pluginを有効化するTest plan
home-manager switch --flake .で settings.json が反映されることを確認🤖 Generated with Claude Code
Summary by CodeRabbit