Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions .claude-plugin/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
# Claude Code Plugin Guidelines

## Skills Directory Location
## Plugin Structure

**Working solution**: Using `source: "./.claude-plugin"` in `marketplace.json` allows skills to remain in `.claude-plugin/skills/` ✅
This plugin uses `source: "./"` in `marketplace.json`, which means:
- `marketplace.json` and `plugin.json` live in `.claude-plugin/`
- `hooks/` and `skills/` directories are at the repository root

Configuration in `marketplace.json`:
Configuration in `.claude-plugin/marketplace.json`:
```json
{
"source": "./.claude-plugin",
"source": "./",
"skills": ["./skills/worktrunk"]
}
```

Configuration in `plugin.json`:
Configuration in `.claude-plugin/plugin.json`:
```json
{
"hooks": "./hooks/hooks.json",
"skills": ["./skills/worktrunk"]
}
```

**Path resolution**:
- Source base: `./.claude-plugin`
- Skills: `./.claude-plugin + ./skills/worktrunk = ./.claude-plugin/skills/worktrunk` ✅
- Hooks: `./.claude-plugin + ./hooks/hooks.json = ./.claude-plugin/hooks/hooks.json` ✅

This approach keeps all Claude Code components organized together in `.claude-plugin/` and avoids root directory clutter.

**Note**: The official Claude Code documentation states "All other directories (commands/, agents/, skills/, hooks/) must be at the plugin root" but using the `source` field to point to `./.claude-plugin` makes paths relative to that directory, allowing this organizational structure.

**Why this works**: The `source` field in `marketplace.json` changes the base directory for path resolution. When `source: "./"` (the default), skills paths are resolved from the plugin root. When `source: "./.claude-plugin"`, skills paths are resolved from `.claude-plugin/`, allowing the entire plugin to be self-contained in one directory.
**Why this structure**: Using `source: "./.claude-plugin"` caused EXDEV (cross-device link) errors on Linux systems where `/tmp` is on a separate filesystem (Ubuntu 21.04+, Fedora, Arch). See https://github.com/anthropics/claude-code/issues/14799 for details. Once that upstream bug is fixed, we could consolidate back to `.claude-plugin/` if desired.

## Known Limitations

Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{
"name": "worktrunk",
"description": "Worktrunk is a git worktree management CLI that streamlines multi-branch development. This plugin provides Claude Code integration with two features: (1) A configuration skill guiding you through LLM-powered commit message generation, project automation hooks (post-create, pre-merge), and worktree path customization. (2) Automatic activity tracking that displays 🤖 (working) and 💬 (waiting) indicators in `wt list`, showing which branches have active Claude sessions. Use when setting up Worktrunk configuration, automating project workflows, or monitoring AI activity across branches.",
"source": "./.claude-plugin",
"source": "./",
"strict": false,
"skills": [
"./skills/worktrunk"
Expand Down
1 change: 0 additions & 1 deletion .claude-plugin/skills/worktrunk/reference/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ allow-branch = ["*"]
consolidate-commits = true
pre-release-replacements = [
# Update skill version marker
{ file = ".claude-plugin/skills/worktrunk/SKILL.md", search = "worktrunk-skill-version: [0-9.]+", replace = "worktrunk-skill-version: {{version}}" },
{ file = "skills/worktrunk/SKILL.md", search = "worktrunk-skill-version: [0-9.]+", replace = "worktrunk-skill-version: {{version}}" },
]

[package.metadata.cargo-udeps.ignore]
Expand Down
File renamed without changes.
File renamed without changes.
38 changes: 13 additions & 25 deletions tests/integration_tests/readme_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1479,57 +1479,45 @@ fn remove_section(content: &str, heading: &str) -> String {
/// Format: (docs_path, skill_path)
/// Files are synced with content transformed for skill consumption
const SKILL_SYNC_FILES: &[(&str, &str)] = &[
(
"docs/content/hook.md",
".claude-plugin/skills/worktrunk/reference/hook.md",
),
("docs/content/hook.md", "skills/worktrunk/reference/hook.md"),
(
"docs/content/config.md",
".claude-plugin/skills/worktrunk/reference/config.md",
"skills/worktrunk/reference/config.md",
),
(
"docs/content/switch.md",
".claude-plugin/skills/worktrunk/reference/switch.md",
"skills/worktrunk/reference/switch.md",
),
(
"docs/content/merge.md",
".claude-plugin/skills/worktrunk/reference/merge.md",
),
(
"docs/content/list.md",
".claude-plugin/skills/worktrunk/reference/list.md",
"skills/worktrunk/reference/merge.md",
),
("docs/content/list.md", "skills/worktrunk/reference/list.md"),
(
"docs/content/select.md",
".claude-plugin/skills/worktrunk/reference/select.md",
),
(
"docs/content/step.md",
".claude-plugin/skills/worktrunk/reference/step.md",
"skills/worktrunk/reference/select.md",
),
("docs/content/step.md", "skills/worktrunk/reference/step.md"),
(
"docs/content/remove.md",
".claude-plugin/skills/worktrunk/reference/remove.md",
"skills/worktrunk/reference/remove.md",
),
(
"docs/content/llm-commits.md",
".claude-plugin/skills/worktrunk/reference/llm-commits.md",
"skills/worktrunk/reference/llm-commits.md",
),
(
"docs/content/tips-patterns.md",
".claude-plugin/skills/worktrunk/reference/tips-patterns.md",
"skills/worktrunk/reference/tips-patterns.md",
),
(
"docs/content/worktrunk.md",
".claude-plugin/skills/worktrunk/reference/worktrunk.md",
),
(
"docs/content/faq.md",
".claude-plugin/skills/worktrunk/reference/faq.md",
"skills/worktrunk/reference/worktrunk.md",
),
("docs/content/faq.md", "skills/worktrunk/reference/faq.md"),
(
"docs/content/claude-code.md",
".claude-plugin/skills/worktrunk/reference/claude-code.md",
"skills/worktrunk/reference/claude-code.md",
),
];

Expand Down