Skip to content

docs(claude-isolated-test): enhance skill with packnplay best practices - #295

Merged
baleen37 merged 5 commits into
mainfrom
feat/enhance-compact
Jan 31, 2026
Merged

docs(claude-isolated-test): enhance skill with packnplay best practices#295
baleen37 merged 5 commits into
mainfrom
feat/enhance-compact

Conversation

@baleen37

@baleen37 baleen37 commented Jan 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix YAML name to match directory (claude-isolated-test)
  • Add Overview section with core principles
  • Add Core Concepts section (Container Isolation, Worktree Management, Credential Mounting)
  • Add Docker verification commands
  • Add Common Pitfalls table with 7 typical mistakes
  • Add Security Considerations section
  • Expand Quick Reference with attach, configure, env config commands
  • Improve description to focus on triggering conditions

Test plan

  • Skill file validated with subagent testing
  • All 4 test scenarios passed (isolated testing, API switching, concurrent sessions, port conflicts)
  • Writing-skills criteria met (YAML frontmatter, description, overview, examples, troubleshooting)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Renamed context compaction plugin (strategic-compact → auto-compact) with refined automatic suggestion mechanism for long sessions
  • Documentation

    • Added comprehensive documentation for auto-compact plugin with configuration and usage guidance
    • Significantly expanded documentation for isolated testing plugin, including new sections for installation, environment configuration, credential management, and troubleshooting

✏️ Tip: You can customize this high-level summary in your review settings.

baleen37 and others added 4 commits January 31, 2026 18:47
This empty commit triggers a new release to properly include
the auto-updater fix from the previous release.

Co-Authored-By: Claude <noreply@anthropic.com>
- Rename plugin directory: strategic-compact → auto-compact
- Update all internal references:
  - State directory: ~/.claude/strategic-compact → ~/.claude/auto-compact
  - Environment variable: STRATEGIC_COMPACT_SESSION_ID → AUTO_COMPACT_SESSION_ID
  - Message prefix: [StrategicCompact] → [AutoCompact]
- Refine terminology to clarify plugin behavior:
  - "Automatically suggests when to manually compact"
  - Core principle: "Auto Compact suggests; you decide when to compact"
  - Distinguish from forced auto-compaction
- Update marketplace.json and plugin.json descriptions
- All tests passing (32/32)

Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive documentation improvements based on testing:
- Fix YAML name to match directory (claude-isolated-test)
- Add Overview section with core principles
- Add Core Concepts section (Container Isolation, Worktree Management, Credential Mounting)
- Add Docker verification commands
- Add Common Pitfalls table with 7 typical mistakes
- Add Security Considerations section
- Expand Quick Reference with attach, configure, env config commands
- Improve description to focus on triggering conditions

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

coderabbitai Bot commented Jan 31, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR renames the strategic-compact plugin to auto-compact, updating its manifest entry, hooks, session management scripts, tests, and documentation. A new settings.local.json file grants PR creation permissions. State tracking timestamps and iteration counters are updated. The claude-isolated-test SKILL.md documentation is significantly expanded with operational guidance, configuration examples, and troubleshooting details.

Changes

Cohort / File(s) Summary
Plugin Manifest & Marketplace
.claude-plugin/marketplace.json, plugins/auto-compact/.claude-plugin/plugin.json, plugins/strategic-compact/.claude-plugin/plugin.json
Updated marketplace.json to replace strategic-compact entry with auto-compact (name, description, source path). Added new plugin.json metadata for auto-compact; deleted strategic-compact plugin.json contents.
Auto-Compact Hooks & Scripts
plugins/auto-compact/hooks/auto-compact.sh, plugins/auto-compact/hooks/hooks.json, plugins/auto-compact/hooks/session-start-hook.sh
Implemented auto-compact hook scripts with session ID and state directory updated from strategic-compact equivalents. Updated hooks.json to reference auto-compact.sh. Session-start-hook creates ~/.claude/auto-compact directory and exports AUTO_COMPACT_SESSION_ID.
Auto-Compact Documentation & Configuration
plugins/auto-compact/README.md, plugins/auto-compact/skills/auto-compact/SKILL.md
Added comprehensive documentation describing auto-compact feature (threshold-based suggestions, non-intrusive behavior, configuration via COMPACT_THRESHOLD). SKILL.md includes activation criteria, tracking mechanism, user messages, best practices, and integration details.
Auto-Compact Tests
plugins/auto-compact/tests/auto-compact.bats
Test suite updated with consistent renaming: strategic-compact → auto-compact across paths, hook names, environment variables (STRATEGIC_COMPACT_SESSION_ID → AUTO_COMPACT_SESSION_ID), and state directory references.
Claude-Isolated-Test Documentation
plugins/me/skills/claude-isolated-test/SKILL.md
Significantly expanded documentation (317 added lines) transforming from concise setup reference to comprehensive operational manual. Includes packnplay overview, when-to-use diagrams, installation methods, credential management, port mapping, environment configurations, container lifecycle, security considerations, and troubleshooting.
Configuration & State Updates
.claude/settings.local.json, .omc/state/ralph-state.json, .omc/state/subagent-tracking.json
Added new settings file granting Skill(me:create-pr) and Skill(create-pr) permissions. Updated iteration counter from 6 to 9; updated subagent tracking timestamp to 2026-01-31T10:13:50.251Z.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 A plugin once called "strategic" hops away,
Now "auto-compact" takes the stage today!
Sessions renamed, hooks refactored with care,
While isolated-test docs fill the air. 📚✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title focuses on enhancing claude-isolated-test skill documentation with packnplay best practices, but the PR contains significant changes beyond this scope, including plugin renaming (strategic-compact to auto-compact), new plugin files, deleted plugin content, and updates to auto-compact hooks and tests. Update the title to reflect the major plugin refactoring work, such as 'refactor: rename strategic-compact to auto-compact and enhance claude-isolated-test documentation' or break into separate PRs for each concern.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/enhance-compact

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@plugins/auto-compact/skills/auto-compact/SKILL.md`:
- Around line 35-120: The markdown has lint errors (MD022/MD031/MD060): add
blank lines before and after headings like "Messages You'll See", "Best
Practices", "When to Compact", and before/after fenced code blocks (the ```
blocks showing log messages and the bash snippet) and fix table pipe style to
match project rules (use leading and trailing pipes with single-space padding
around cell content) throughout SKILL.md (also apply same fixes to the other
affected section around lines 152-169); after making these spacing and pipe
adjustments, run markdownlint via the repository's pre-commit hook to validate
and commit the fixes.

In `@plugins/me/skills/claude-isolated-test/SKILL.md`:
- Around line 52-59: The file SKILL.md contains duplicate headings "Container
Isolation" and "Worktree Management" which trigger MD024; rename the later
occurrences to unique titles (e.g., "Container Isolation (per-session)" and
"Worktree Management (per-test)" or similar) so anchor links differ, then update
any internal links or references that pointed to the old anchors and run the
markdown linter to confirm MD024 is resolved; look for the headings named
"Container Isolation" and "Worktree Management" in the document and change the
later instances to unique labels.
- Around line 88-90: Fix the Markdown table spacing to satisfy markdownlint
MD060 by ensuring there is a single space on both sides of each pipe in the
tables (e.g., change "| Task | Command |" cells to have spaces around every "|"
so the header and all rows follow the compact style). Update the table block
shown (the header row and its following row entries) and apply the same spacing
fix to the other table blocks in this file that follow the same pattern so every
table has consistent " | " spacing between cells.
- Around line 50-60: Add blank lines before and after the Markdown headings
"Container Isolation" and "Worktree Management" and around the fenced code block
(the ```bash block showing worktree path) to satisfy markdownlint rules
MD022/MD031; ensure there is an empty line above each heading and both an empty
line before the opening ```bash and after the closing ``` (also apply the same
fixes for the similar section referenced later around the other fenced block).
🧹 Nitpick comments (2)
plugins/auto-compact/README.md (1)

40-43: Add language specifier to fenced code block.

The code block showing example messages should have a language specifier to satisfy markdownlint (MD040). Since these are plain text messages, use text or plaintext.

📝 Proposed fix
-```
+```text
 [AutoCompact] 50 tool calls reached - consider /compact if transitioning phases
 [AutoCompact] 75 tool calls - good checkpoint for /compact if context is stale
</details>

</blockquote></details>
<details>
<summary>plugins/auto-compact/hooks/auto-compact.sh (1)</summary><blockquote>

`19-27`: **Consider sourcing shared library instead of duplicating `validate_session_id`.**

This function is duplicated from `lib/state.sh` (noted "local copy for now" in comment). Since `session-start-hook.sh` already sources this library successfully, consider doing the same here for maintainability.



<details>
<summary>♻️ Proposed fix</summary>

```diff
 set -euo pipefail

-# Validate session_id format (local copy for now)
-validate_session_id() {
-  local session_id="$1"
-  if [[ ! "$session_id" =~ ^[a-zA-Z0-9_-]+$ ]]; then
-    echo "Warning: Invalid session_id format: '$session_id'" >&2
-    return 1
-  fi
-  return 0
-}
+# Source state library for validate_session_id
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+source "$SCRIPT_DIR/lib/state.sh"

Comment on lines +35 to +120
### Messages You'll See

At threshold (default: 50):
```
[AutoCompact] 50 tool calls reached - consider /compact if transitioning phases
```

Every 25 calls after threshold:
```
[AutoCompact] 75 tool calls - good checkpoint for /compact if context is stale
```

## Best Practices

### When to Compact

**Good timing:**
- After exploration phase, before implementation
- After completing a milestone (feature, bugfix, refactor)
- Before starting new unrelated task
- When context feels stale or repetitive
- After debugging, before writing fix

**Bad timing:**
- Mid-implementation of current task
- Before understanding the problem
- When actively debugging
- During code review feedback

### Compaction Strategy

**What to keep:**
- Current task context and requirements
- Relevant architectural decisions
- Recent test results
- Current debugging findings

**What to summarize:**
- Completed implementation details
- Historical conversation not relevant to current task
- Explored alternatives not chosen
- Past debugging attempts

### Workflow Integration

1. **Exploration phase**: Read code, understand problem
2. **Compact**: `/compact` - summarize findings, preserve context
3. **Implementation phase**: Write code, test
4. **Compact**: `/compact` - preserve implementation context
5. **Next phase**: Repeat as needed

## Configuration

### Custom Threshold

Set `COMPACT_THRESHOLD` to customize when suggestions appear:

```bash
# In your shell profile or session
export COMPACT_THRESHOLD=100 # Suggest after 100 tool calls
```

Default: 50 tool calls

### State Directory

Session counters stored in:
```
~/.claude/auto-compact/tool-count-{session_id}.txt
```

Session ID extracted from SessionStart hook and stored in:
```
~/.claude/auto-compact/session-env.sh
```

## Why Suggestions Over Forced Auto-Compaction?

**Forced auto-compaction problems:**
- Happens at arbitrary points, often mid-task
- Loses critical context during active work
- Interrupts thought processes
- Difficult to resume after compaction

**Auto Compact benefits:**
- You control when compaction occurs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix markdownlint spacing and table pipe style.

markdownlint reports MD022/MD031/MD060 here; add blank lines around headings and fenced code blocks, and adjust table pipe spacing to match the configured style. As per coding guidelines: Run markdownlint on all Markdown files using pre-commit hooks.

Also applies to: 152-169

🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 52-52: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 58-58: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 59-59: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 77-77: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 89-89: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


[warning] 89-89: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)


[warning] 89-89: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


[warning] 89-89: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)


[warning] 106-106: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 111-111: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 120-120: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
In `@plugins/auto-compact/skills/auto-compact/SKILL.md` around lines 35 - 120, The
markdown has lint errors (MD022/MD031/MD060): add blank lines before and after
headings like "Messages You'll See", "Best Practices", "When to Compact", and
before/after fenced code blocks (the ``` blocks showing log messages and the
bash snippet) and fix table pipe style to match project rules (use leading and
trailing pipes with single-space padding around cell content) throughout
SKILL.md (also apply same fixes to the other affected section around lines
152-169); after making these spacing and pipe adjustments, run markdownlint via
the repository's pre-commit hook to validate and commit the fixes.

Comment on lines +50 to +60
## Core Concepts

### Container Isolation
Each Claude session runs in a separate Docker container with:
- **Independent filesystem** - changes don't affect host
- **Isolated environment** - clean state for each test
- **Host path preservation** - project mounted at same path as host

### Worktree Management
```bash
# Worktrees stored at: ~/.local/share/packnplay/worktrees/<project>/<worktree>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add blank lines around headings and fenced blocks to satisfy markdownlint.

MD022/MD031 are triggered in this area. Add a blank line before/after headings and fenced code blocks.

🔧 Proposed fix (example for this section)
 ## Core Concepts
-
 ### Container Isolation
 Each Claude session runs in a separate Docker container with:
@@
-### Worktree Management
-```bash
+### Worktree Management
+
+```bash
 # Worktrees stored at: ~/.local/share/packnplay/worktrees/<project>/<worktree>

Also applies to: 72-79

🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 52-52: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 58-58: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 59-59: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
In `@plugins/me/skills/claude-isolated-test/SKILL.md` around lines 50 - 60, Add
blank lines before and after the Markdown headings "Container Isolation" and
"Worktree Management" and around the fenced code block (the ```bash block
showing worktree path) to satisfy markdownlint rules MD022/MD031; ensure there
is an empty line above each heading and both an empty line before the opening
```bash and after the closing ``` (also apply the same fixes for the similar
section referenced later around the other fenced block).

Comment on lines +52 to +59
### Container Isolation
Each Claude session runs in a separate Docker container with:
- **Independent filesystem** - changes don't affect host
- **Isolated environment** - clean state for each test
- **Host path preservation** - project mounted at same path as host

### Worktree Management
```bash

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid duplicate headings (“Container Isolation”, “Worktree Management”).

MD024 is flagged; duplicate headings can confuse anchor links. Consider renaming the later ones to make anchors unique.

✏️ Example rename to make anchors unique
-### Container Isolation
+### Container Isolation (Security)

@@
-## Worktree Management
+## Worktree Management (Advanced)

Also applies to: 339-345, 367-373

🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 52-52: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 58-58: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 59-59: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
In `@plugins/me/skills/claude-isolated-test/SKILL.md` around lines 52 - 59, The
file SKILL.md contains duplicate headings "Container Isolation" and "Worktree
Management" which trigger MD024; rename the later occurrences to unique titles
(e.g., "Container Isolation (per-session)" and "Worktree Management (per-test)"
or similar) so anchor links differ, then update any internal links or references
that pointed to the old anchors and run the markdown linter to confirm MD024 is
resolved; look for the headings named "Container Isolation" and "Worktree
Management" in the document and change the later instances to unique labels.

Comment on lines 88 to +90
| Task | Command |
|------|---------|
| Install | `go install github.com/obra/packnplay@latest` |
| Run | `packnplay run claude` |
| Install (Homebrew) | `brew install obra/tap/packnplay` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix table pipe spacing to match markdownlint “compact” style.

MD060 flags missing spaces around table pipes.

🧩 Proposed fix (apply similarly to all tables)
-| Task | Command |
-|------|---------|
+| Task | Command |
+| --- | --- |

Also applies to: 295-297, 327-329, 357-359

🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 89-89: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


[warning] 89-89: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)


[warning] 89-89: Table column style
Table pipe is missing space to the right for style "compact"

(MD060, table-column-style)


[warning] 89-89: Table column style
Table pipe is missing space to the left for style "compact"

(MD060, table-column-style)

🤖 Prompt for AI Agents
In `@plugins/me/skills/claude-isolated-test/SKILL.md` around lines 88 - 90, Fix
the Markdown table spacing to satisfy markdownlint MD060 by ensuring there is a
single space on both sides of each pipe in the tables (e.g., change "| Task |
Command |" cells to have spaces around every "|" so the header and all rows
follow the compact style). Update the table block shown (the header row and its
following row entries) and apply the same spacing fix to the other table blocks
in this file that follow the same pattern so every table has consistent " | "
spacing between cells.

@baleen37
baleen37 enabled auto-merge January 31, 2026 12:11
Resolve marketplace.json conflict by including new plugins from main:
- auto-compact
- auto-updater
- lsp-support
- memory-persistence

Co-Authored-By: Claude <noreply@anthropic.com>
@baleen37
baleen37 merged commit 3216b55 into main Jan 31, 2026
2 checks passed
@baleen37
baleen37 deleted the feat/enhance-compact branch January 31, 2026 12:24
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