fix: correct script path references in skills and agents#138
fix: correct script path references in skills and agents#138tkavelli wants to merge 1 commit intoparcadei:mainfrom
Conversation
WHAT CHANGED:
1. opc/scripts/setup/wizard.py:
- Added CLAUDE_CC_DIR env var export (CC repository root)
- CLAUDE_CC_DIR = parent of CLAUDE_OPC_DIR
- WHY: Skills reference scripts at $CC_DIR/.claude/scripts/
but only CLAUDE_OPC_DIR was exported
2. Skills (7 files):
- commit, git-commits: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR
for generate-reasoning.sh
- describe_pr: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR
for aggregate-reasoning.sh
- recall-reasoning: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR
for search-reasoning.sh
- tldr-stats: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR
for tldr_stats.py
- math-unified: $CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/
→ $CLAUDE_OPC_DIR/scripts/cc_math/
- skill-developer: mixed $CLAUDE_PROJECT_DIR → $CLAUDE_OPC_DIR
(scripts) and $CLAUDE_CC_DIR (.claude/ resources)
3. Agents (8 files):
- braintrust-analyst, session-analyst: $CLAUDE_PROJECT_DIR
→ $CLAUDE_OPC_DIR for runtime.harness and braintrust scripts
- memory-extractor: $CLAUDE_PROJECT_DIR/opc → $CLAUDE_OPC_DIR
for core extraction scripts
- agentica-agent, plan-agent, validate-agent, scribe,
debug-agent: $CLAUDE_PROJECT_DIR → $CLAUDE_CC_DIR for
skill file reads (cat SKILL.md)
CONTEXT:
$CLAUDE_PROJECT_DIR is set by Claude Code to the user's current
working project (e.g. /Users/x/myapp). Skills and agents were
using it to locate CC's own scripts, which only works if the user
happens to be working inside the CC repo itself. This breaks for
any user who installed CC in a different directory.
Fixes parcadei#106
|
PR author is not in the allowed authors list. |
📝 WalkthroughWalkthroughThis PR updates environment variable references throughout agent and skill configuration files from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
opc/scripts/setup/wizard.py (1)
839-868:⚠️ Potential issue | 🟡 MinorMisleading status message when only
CLAUDE_CC_DIRis appended.When
CLAUDE_OPC_DIRalready exists in the shell config butCLAUDE_CC_DIRdoes not (theelifbranch at line 861), onlyCLAUDE_CC_DIRis appended. However, line 866 always prints "Added CLAUDE_OPC_DIR and CLAUDE_CC_DIR", which is inaccurate for that case.Proposed fix
if "CLAUDE_OPC_DIR" not in content: with open(shell_config, "a") as f: f.write(f"\n# Continuous-Claude directories (for skills to find scripts)\n{export_opc}\n{export_cc}\n") - changed = True + console.print(f" [green]OK[/green] Added CLAUDE_OPC_DIR and CLAUDE_CC_DIR to {shell_config.name}") elif "CLAUDE_CC_DIR" not in content: with open(shell_config, "a") as f: f.write(f"\n# Continuous-Claude root directory\n{export_cc}\n") - changed = True - if changed: - console.print(f" [green]OK[/green] Added CLAUDE_OPC_DIR and CLAUDE_CC_DIR to {shell_config.name}") + console.print(f" [green]OK[/green] Added CLAUDE_CC_DIR to {shell_config.name}") else: console.print(f" [dim]CLAUDE_OPC_DIR and CLAUDE_CC_DIR already in {shell_config.name}[/dim]").claude/skills/skill-developer/SKILL.md (1)
85-85:⚠️ Potential issue | 🟡 MinorFix duplicate step numbering.
Line 85 has "Step 2" but this should be "Step 3" since there's already a "Step 2" at line 69. This creates confusion in the documentation flow.
📝 Proposed fix
-### Step 2: Create the Skill +### Step 3: Create the Skill
🤖 Fix all issues with AI agents
In @.claude/skills/skill-developer/SKILL.md:
- Around line 143-144: The SKILL.md references two missing docs
(.claude/rules/skill-development.md and .claude/rules/mcp-scripts.md); either
add those markdown files under .claude/rules/ with the expected content or
update the references in SKILL.md (lines that call `cat
$CLAUDE_CC_DIR/.claude/rules/skill-development.md` and `cat
$CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md`) to point to the correct existing
file paths or filenames; ensure the referenced filenames exactly match the
created file names and commit the new files or the updated SKILL.md references.
- Around line 59-67: Update .claude/skills/skill-developer/SKILL.md so
referenced template/example files and headings are correct: replace or remove
references to nonexistent paths
($CLAUDE_CC_DIR/.claude/skills/multi-tool-pipeline/SKILL.md,
$CLAUDE_CC_DIR/.claude/rules/skill-development.md,
$CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md, commit/SKILL.md,
firecrawl-scrape/SKILL.md) and point them to existing files (or add the missing
template files), and fix the duplicate section heading "### Step 2" at line ~85
to "### Step 3"; verify wizard.py environment vars are still used but do not
rely on nonexistent files so users won't hit file-not-found errors.
| cp $CLAUDE_OPC_DIR/scripts/multi_tool_pipeline.py $CLAUDE_OPC_DIR/scripts/my_pipeline.py | ||
| ``` | ||
|
|
||
| Reference the template pattern: | ||
|
|
||
| ```bash | ||
| cat $CLAUDE_PROJECT_DIR/.claude/skills/multi-tool-pipeline/SKILL.md | ||
| cat $CLAUDE_PROJECT_DIR/scripts/multi_tool_pipeline.py | ||
| cat $CLAUDE_CC_DIR/.claude/skills/multi-tool-pipeline/SKILL.md | ||
| cat $CLAUDE_OPC_DIR/scripts/multi_tool_pipeline.py | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find template files that the review comment references
# Check for multi_tool_pipeline.py in any scripts directory
fd --type f 'multi_tool_pipeline.py'
# Check for multi-tool-pipeline SKILL.md
fd --type f --path '*multi-tool-pipeline*' 'SKILL.md'
# List structure around scripts directories
fd --type d 'scripts' | head -20Repository: parcadei/Continuous-Claude-v3
Length of output: 371
🏁 Script executed:
#!/bin/bash
# Read the actual SKILL.md file to verify the changes mentioned in the review
cat -n .claude/skills/skill-developer/SKILL.md | sed -n '55,70p'
cat -n .claude/skills/skill-developer/SKILL.md | sed -n '80,90p'
cat -n .claude/skills/skill-developer/SKILL.md | sed -n '140,165p'Repository: parcadei/Continuous-Claude-v3
Length of output: 1559
🏁 Script executed:
#!/bin/bash
# Check if CLAUDE_CC_DIR and CLAUDE_OPC_DIR are defined/exported
fd --type f 'wizard' | head -10
fd --type f -e 'sh' -e 'bash' | xargs grep -l 'CLAUDE_CC_DIR\|CLAUDE_OPC_DIR' 2>/dev/null | head -10Repository: parcadei/Continuous-Claude-v3
Length of output: 100
🏁 Script executed:
#!/bin/bash
# Check for all referenced template files
# Check for multi-tool-pipeline skill documentation
fd 'multi-tool-pipeline' --type d
# Check for rules files
fd 'skill-development.md' --type f
fd 'mcp-scripts.md' --type f
# Check for example skills
fd 'SKILL.md' --type f | grep -E '(multi-tool-pipeline|commit|firecrawl-scrape)'Repository: parcadei/Continuous-Claude-v3
Length of output: 55
🏁 Script executed:
#!/bin/bash
# Check if CLAUDE_CC_DIR and CLAUDE_OPC_DIR are defined in wizard.py
cat -n opc/scripts/setup/wizard.py | grep -E 'CLAUDE_CC_DIR|CLAUDE_OPC_DIR' | head -20Repository: parcadei/Continuous-Claude-v3
Length of output: 1059
🏁 Script executed:
#!/bin/bash
# Verify the file structure exists
ls -la .claude/skills/ 2>/dev/null | head -20
ls -la .claude/rules/ 2>/dev/null | head -20Repository: parcadei/Continuous-Claude-v3
Length of output: 2337
🏁 Script executed:
#!/bin/bash
# More specific check for multi-tool-pipeline
find .claude/skills -type d -name "*multi*" 2>/dev/null
# Check all SKILL.md files to see what exists
fd 'SKILL.md' --type fRepository: parcadei/Continuous-Claude-v3
Length of output: 55
🏁 Script executed:
#!/bin/bash
# Check what's actually in .claude/rules
cat -n .claude/rules/*.md | head -30Repository: parcadei/Continuous-Claude-v3
Length of output: 1214
Multiple referenced files do not exist; instructions are broken.
The path updates use correct environment variables (confirmed: CLAUDE_CC_DIR and CLAUDE_OPC_DIR are defined in wizard.py), but the referenced files are missing:
- Line 65:
$CLAUDE_CC_DIR/.claude/skills/multi-tool-pipeline/SKILL.md— directory does not exist - Line 143:
$CLAUDE_CC_DIR/.claude/rules/skill-development.md— file does not exist (actual rules are: agent-memory-recall.md, agent-model-selection.md, claim-verification.md, etc.) - Line 144:
$CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md— file does not exist - Lines 161-162: Example skills
commit/SKILL.mdandfirecrawl-scrape/SKILL.md— neither directory exists
Additionally, line 85 has a duplicate heading: "### Step 2" should be "### Step 3".
Users following these instructions will encounter file-not-found errors. Either create the missing template/example files or correct the references.
🤖 Prompt for AI Agents
In @.claude/skills/skill-developer/SKILL.md around lines 59 - 67, Update
.claude/skills/skill-developer/SKILL.md so referenced template/example files and
headings are correct: replace or remove references to nonexistent paths
($CLAUDE_CC_DIR/.claude/skills/multi-tool-pipeline/SKILL.md,
$CLAUDE_CC_DIR/.claude/rules/skill-development.md,
$CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md, commit/SKILL.md,
firecrawl-scrape/SKILL.md) and point them to existing files (or add the missing
template files), and fix the duplicate section heading "### Step 2" at line ~85
to "### Step 3"; verify wizard.py environment vars are still used but do not
rely on nonexistent files so users won't hit file-not-found errors.
| cat $CLAUDE_CC_DIR/.claude/rules/skill-development.md | ||
| cat $CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify reference documentation files exist
echo "=== Searching for skill-development.md ==="
fd --type f --full-path '.claude/rules/skill-development.md$' 2>&1 || echo "Not found"
echo ""
echo "=== Searching for mcp-scripts.md ==="
fd --type f --full-path '.claude/rules/mcp-scripts.md$' 2>&1 || echo "Not found"
echo ""
echo "=== All files under .claude/rules directory ==="
fd --type f '.claude/rules/' 2>&1 || echo "Directory not found"Repository: parcadei/Continuous-Claude-v3
Length of output: 584
🏁 Script executed:
#!/bin/bash
# Broader search to understand the structure
echo "=== Checking if .claude/rules directory exists ==="
fd . '.claude/rules/' 2>&1 | head -20
echo ""
echo "=== Finding SKILL.md file ==="
fd --type f 'SKILL.md$' 2>&1
echo ""
echo "=== All files under .claude directory ==="
fd . '.claude/' 2>&1 | head -30
echo ""
echo "=== Searching for skill-development or skill development files ==="
fd --type f -i 'skill.*development' 2>&1
echo ""
echo "=== Searching for mcp-scripts files ==="
fd --type f -i 'mcp.*scripts' 2>&1Repository: parcadei/Continuous-Claude-v3
Length of output: 1560
🏁 Script executed:
#!/bin/bash
# More comprehensive search for SKILL.md
echo "=== Recursive search for any SKILL.md file ==="
find . -type f -name 'SKILL.md' 2>/dev/null
echo ""
echo "=== Searching in skill-developer directory ==="
fd . 'skill-developer' 2>&1 | head -30
echo ""
echo "=== All markdown files in .claude ==="
find .claude -type f -name '*.md' 2>/dev/null | sortRepository: parcadei/Continuous-Claude-v3
Length of output: 17131
🏁 Script executed:
#!/bin/bash
# Check the specific lines in skill-developer SKILL.md
echo "=== Lines around 143-144 in ./.claude/skills/skill-developer/SKILL.md ==="
sed -n '140,150p' ./.claude/skills/skill-developer/SKILL.md
echo ""
echo "=== Total line count ==="
wc -l ./.claude/skills/skill-developer/SKILL.mdRepository: parcadei/Continuous-Claude-v3
Length of output: 468
Create missing reference documentation files or update paths to existing documentation.
The referenced files do not exist at the specified paths:
.claude/rules/skill-development.md— does not exist.claude/rules/mcp-scripts.md— does not exist
Either create these files in .claude/rules/ or update the paths in lines 143-144 to reference existing documentation.
🤖 Prompt for AI Agents
In @.claude/skills/skill-developer/SKILL.md around lines 143 - 144, The SKILL.md
references two missing docs (.claude/rules/skill-development.md and
.claude/rules/mcp-scripts.md); either add those markdown files under
.claude/rules/ with the expected content or update the references in SKILL.md
(lines that call `cat $CLAUDE_CC_DIR/.claude/rules/skill-development.md` and
`cat $CLAUDE_CC_DIR/.claude/rules/mcp-scripts.md`) to point to the correct
existing file paths or filenames; ensure the referenced filenames exactly match
the created file names and commit the new files or the updated SKILL.md
references.
| console.print(" [yellow]NOTE[/yellow] Add to your environment:") | ||
| console.print(f' set CLAUDE_OPC_DIR="{opc_dir}"') | ||
| console.print(f' set CLAUDE_CC_DIR="{cc_dir}"') |
There was a problem hiding this comment.
Bug: The setup wizard provides set command instructions for Windows, which is incorrect for PowerShell users and will cause environment variables not to be set correctly.
Severity: MEDIUM
Suggested Fix
Detect if the user is on Windows and provide PowerShell-specific instructions using $env:VARIABLE="value" for session variables and [Environment]::SetEnvironmentVariable("VARIABLE", "value", "User") for persistent variables. Alternatively, the script could provide instructions for both cmd.exe and PowerShell.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: opc/scripts/setup/wizard.py#L870-L872
Potential issue: The setup wizard prints instructions for setting environment variables
on Windows using the `set VARIABLE="value"` syntax. This is valid for `cmd.exe` but not
for PowerShell, which is a recommended shell for Windows users. In PowerShell, `set` is
an alias for `Set-Variable`, which only sets a session-local variable, not a persistent
environment variable. Consequently, when a PowerShell user follows these instructions,
the `CLAUDE_OPC_DIR` and `CLAUDE_CC_DIR` variables will not be available in subsequent
sessions or processes, causing skills that rely on these paths to fail at runtime.
Did we get this right? 👍 / 👎 to inform future reviews.
Summary
CLAUDE_CC_DIRenvironment variable export in wizard (CC repository root)$CLAUDE_CC_DIRor$CLAUDE_OPC_DIRinstead of$CLAUDE_PROJECT_DIRfor CC-internal script referencesProblem
$CLAUDE_PROJECT_DIRis set by Claude Code to the user's current working project (e.g./Users/x/myapp). Multiple skills and agents use it to locate CC's own scripts (e.g.generate-reasoning.sh,cc_math/*.py), which only works if the user happens to be working inside the CC repo itself.For any other project, scripts are not found:
Fix
CLAUDE_CC_DIR(CC repo root = parent ofCLAUDE_OPC_DIR)$CLAUDE_CC_DIR/.claude/scripts/for shell scripts$CLAUDE_OPC_DIR/scripts/for Python scripts (cc_math, etc.)$CLAUDE_CC_DIRfor skill file reads and$CLAUDE_OPC_DIRfor runtime scriptsPath mapping
$CLAUDE_PROJECT_DIR/.claude/scripts/*.sh$CLAUDE_CC_DIR/.claude/scripts/*.sh$CLAUDE_PROJECT_DIR/.claude/scripts/cc_math/$CLAUDE_OPC_DIR/scripts/cc_math/$CLAUDE_PROJECT_DIR/.claude/scripts/tldr_stats.py$CLAUDE_CC_DIR/.claude/scripts/tldr_stats.py$CLAUDE_PROJECT_DIR/.claude/skills/*/SKILL.md$CLAUDE_CC_DIR/.claude/skills/*/SKILL.md$CLAUDE_PROJECT_DIR/opc$CLAUDE_OPC_DIRFiles changed (17)
Wizard:
opc/scripts/setup/wizard.py— addCLAUDE_CC_DIRexportSkills (7): commit, commit/v6, git-commits, describe_pr, recall-reasoning, tldr-stats, math-unified, skill-developer
Agents (8): braintrust-analyst, session-analyst, memory-extractor, agentica-agent, plan-agent, validate-agent, scribe, debug-agent
Test plan
CLAUDE_CC_DIRandCLAUDE_OPC_DIRare exported to shell config/commit— verifygenerate-reasoning.shis found/tldr-stats— verifytldr_stats.pyis foundecho $CLAUDE_CC_DIRandecho $CLAUDE_OPC_DIRare set after sourcing shell configFixes #106
Summary by CodeRabbit