Skip to content

Experiment: target repo skills in triage - #10

Merged
maruiz93 merged 16 commits into
fullsend-ai:mainfrom
maruiz93:experiment/target-repo-skills
May 5, 2026
Merged

Experiment: target repo skills in triage#10
maruiz93 merged 16 commits into
fullsend-ai:mainfrom
maruiz93:experiment/target-repo-skills

Conversation

@maruiz93

Copy link
Copy Markdown
Contributor

Summary

  • Tests whether a target repository's .claude/skills/ are discovered and used by the fullsend triage agent inside OpenShell sandboxes, despite CLAUDE_CONFIG_DIR being overridden to /tmp/claude-config
  • Runs a controlled A/B experiment: control (no skill) vs treatment (triage-guidance skill committed to target repo), same issue, same agent, same harness
  • Result: hypothesis confirmed — CWD-based skill discovery works independently of CLAUDE_CONFIG_DIR

Key findings

  • Treatment transcript shows 3 mentions of triage-guidance (0 in control)
  • Severity escalated from "high" to "critical" matching the skill's taxonomy
  • Agent explicitly cited "Per triage guidance" in its reasoning
  • post-triage.sh only applies workflow labels (ready-to-code), not the taxonomy labels from the skill — noted as a potential pipeline improvement

What's included

  • Design spec and implementation plan
  • Synthetic Go REST API target repo files
  • Triage guidance skill (independent variable)
  • setup-target-repo.sh and run.sh automation scripts
  • Sanitized results (control + treatment) with JSONL transcripts
  • README with full analysis and conclusion

Triage agent output visible at: maruiz93/experiment-target-repo-skills#1

Test plan

  • setup-target-repo.sh creates synthetic repo, labels, and issue
  • run.sh executes control and treatment runs with secret sanitization
  • Control transcript: 0 mentions of triage-guidance
  • Treatment transcript: 3 mentions of triage-guidance
  • Treatment output uses skill-defined labels and severity

🤖 Generated with Claude Code

maruiz93 and others added 14 commits April 28, 2026 15:05
…experiment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HTTPS URLs fail without interactive auth in automated runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Control and treatment runs completed successfully. Target repo
skills ARE discovered and used by the triage agent in sandboxes.
Results sanitized to redact secrets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…y labels

The agent references skill-defined labels in comment text but
post-triage.sh only assigns workflow labels (ready-to-code, etc.).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maruiz93
maruiz93 requested a review from a team as a code owner April 29, 2026 09:19

@fullsend-ai-review fullsend-ai-review 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.

Review: #10

Head SHA: 3eee7fd
Timestamp: 2026-04-29T09:22:00Z
Outcome: comment-only

Summary

This PR adds a self-contained A/B experiment testing whether target repository .claude/skills/ are discovered by the fullsend triage agent inside OpenShell sandboxes. All 17 files are new additions (1751 lines, 0 deletions) under the target-repo-skills/ directory. The experiment is well-designed with clear methodology, controlled variables, and sanitized results. No critical or high findings were identified. A few medium/low observations are noted below for consideration.

Findings

Medium

  • [Correctness] target-repo-skills/setup-target-repo.sh:48 — The trap statement uses unquoted variable expansion: trap "rm -rf ${WORK_DIR}" EXIT. If WORK_DIR were to contain spaces or special characters (unlikely with mktemp -d but possible), this could behave unexpectedly. Safer: trap 'rm -rf "${WORK_DIR}"' EXIT — but note that single-quoting prevents variable expansion at trap-set time, so the pattern used here (double-quoted, expanded at set time) is actually correct for this use case. However, run.sh does not use a trap for its temp dirs (repo_dir, run_output_dir, SKILL_WORK_DIR), relying only on explicit rm -rf. If the script exits early (e.g., set -e triggers), temp dirs are leaked.
    Remediation: Add trap-based cleanup in run.sh for temp directories, or use a single top-level temp dir with a trap.

  • [Correctness] target-repo-skills/setup-target-repo.sh:53-55 — The cp -r of target-repo-files/* followed by a separate mkdir -p handlers && cp -r handlers/* is redundant. The first cp -r already copies handlers/ recursively. The extra copy is harmless but unnecessary.
    Remediation: Remove lines 53-55 (the mkdir -p and conditional cp of handlers).

Low

  • [Style/conventions] Multiple files are missing a trailing newline (go.mod, health.go, users.go, main.go, SKILL.md, README.md, HOW_TO.md, setup-target-repo.sh, run.sh). While not functionally impactful, POSIX convention expects text files to end with a newline, and some tools may warn.
    Remediation: Add trailing newlines to all text files.

  • [Correctness] target-repo-skills/setup-target-repo.sh:37 — The label parsing uses IFS=: read -r prefix name color <<< "${entry}" where entries like "area:api:#0e8a16" are split on :. This produces prefix=area, name=api, color=#0e8a16. The color field then has its # stripped with ${color#\#}. This works correctly for the current label format but would break if a label name itself contained a colon.
    Remediation: Current labels don't contain extra colons, so this is fine as-is. Just noting the fragility.

Info

  • [Intent alignment] The PR has no linked issue, which is expected for an experiment. The scope is appropriate — it adds experiment infrastructure and results without modifying any existing code or production paths.

  • [Platform security] The run.sh script sources .experiment-state (line 17), which is a file generated by setup-target-repo.sh. This is safe in the experiment context since the user controls both scripts. The .experiment-state file is correctly gitignored.

  • [Content security] The design doc (line 199-203) correctly identifies that target repo skills are user-controlled content and flags prompt injection risk as a follow-up concern. The experiment itself does not introduce this risk — it merely measures existing behavior.

  • [Injection defense] PR body, commit messages, and code comments were inspected. No prompt injection patterns, non-rendering Unicode, or bidirectional override characters detected. The PR description accurately reflects the diff contents.

  • [Platform security] The sanitize function in run.sh (lines 57-80) redacts GH tokens, GCP project IDs, credential paths, OAuth tokens, and service account emails from result files before they can be committed. The committed result files (results/control/ and results/treatment/) show no residual secrets — the transcripts contain only session IDs, tool calls, and triage output.

Footer

Outcome: comment-only
This review applies to SHA 3eee7fd856db806d247b565d3a461567c22ea377. Any push to the PR head clears this review and requires a new evaluation.

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Multi-Agent Review — 4 agents (security, quality, cursor, gemini)

Overall: Well-designed A/B experiment with sound methodology and clear results. No secrets found committed. Approve with fixes for the issues below.

Summary of inline comments (9 findings, medium+)

# Severity File Finding
1 High run.sh:64 sed -i not portable to macOS — sanitization silently fails, risking secret leakage
2 High run.sh:57-68 Incomplete sanitization patterns — missing ghs_, gho_, github_pat_, IP addresses, Vertex IDs
3 High run.sh:25 source of unvalidated state file is arbitrary code execution vector
4 Medium run.sh:95-101 No cleanup trap for temp dirs — unsanitized secrets may persist on failure
5 Medium run.sh:106-110 || true silently swallows fullsend failures
6 Medium run.sh:96 SSH clone URLs not portable for HTTPS-only auth users
7 Medium run.sh:104 export GH_TOKEN leaks token to all child processes
8 Medium setup-target-repo.sh:53 --force push to main without safety check
9 Medium setup-target-repo.sh:41 Trap uses double quotes — fragile variable expansion

Strengths

  • Rigorous A/B design with clear hypothesis, controls, and measurable outcomes
  • Proactive secret sanitization before committing results
  • Excellent documentation (design spec, HOW_TO, README with analysis)
  • set -euo pipefail in both scripts
  • Clean .experiment-state pattern for cross-script state
  • Design doc proactively addresses prompt injection risks from target repo skills

Comment thread target-repo-skills/run.sh Outdated
Comment thread target-repo-skills/run.sh Outdated
Comment thread target-repo-skills/run.sh Outdated
Comment thread target-repo-skills/run.sh
Comment thread target-repo-skills/run.sh Outdated
Comment thread target-repo-skills/run.sh Outdated
Comment thread target-repo-skills/run.sh Outdated
Comment thread target-repo-skills/setup-target-repo.sh
Comment thread target-repo-skills/setup-target-repo.sh Outdated
- Replace `source` of state file with safe key-value parsing
- Use portable `sed > tmp && mv` instead of `sed -i`
- Add missing sanitization patterns (ghs_, gho_, github_pat_, IPs)
- Add cleanup trap in run_triage for temp dirs
- Log fullsend exit code instead of silent `|| true`
- Scope GH_TOKEN and GITHUB_ISSUE_URL to fullsend command
- Fix trap quoting to use single quotes in setup script
- Remove redundant handlers copy in setup script
- Re-run experiment to validate changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fullsend-ai-review

fullsend-ai-review Bot commented May 4, 2026

Copy link
Copy Markdown

Review: #10

Head SHA: f602212
Timestamp: 2026-05-04T00:00:00Z
Outcome: approve

Summary

This PR adds a well-structured A/B experiment testing whether target repository .claude/skills/ are discovered by the fullsend triage agent inside OpenShell sandboxes when CLAUDE_CONFIG_DIR is overridden. The change is entirely additive (17 new files, 0 deletions) within a new target-repo-skills/ directory and does not modify any existing code. The shell scripts demonstrate solid practices: set -euo pipefail, safe state-file parsing via allowlisted read instead of source, proper temp-directory cleanup with traps, and thorough secret sanitization before committing results. The experiment's hypothesis, method, and results are clearly documented. No security, correctness, or injection concerns were found.

Findings

Info

  • [Style] target-repo-skills/.gitignore — Missing trailing newline (cosmetic; \ No newline at end of file in diff). Not blocking.
  • [Style] target-repo-skills/docs/superpowers/plans/2026-04-28-target-repo-skills.md — The 816-line implementation plan is verbose relative to the ~300 lines of actual implementation. Consider trimming completed task checkboxes in future experiment PRs to reduce review surface.
  • [Correctness] target-repo-skills/setup-target-repo.sh:76git push -u origin main --force is intentional for the synthetic throwaway repo, but a comment noting why force-push is acceptable here would help future readers.

Footer

Outcome: approve
This review applies to SHA f602212b433a3e55e70dd9656f6c02e5b62a62a8. Any push to the PR head clears this review and requires a new evaluation.

Previous run

Review: #10

Head SHA: ed298f0
Timestamp: 2026-05-04T00:00:00Z
Outcome: comment-only

Summary

This PR adds a well-structured A/B experiment testing whether Claude Code discovers .claude/skills/ from a target repository's CWD when CLAUDE_CONFIG_DIR is overridden. The scripts are sound, secret sanitization is thorough, and the primary hypothesis (skill discovery) is confirmed by the treatment transcript. However, the README's claims about behavioral impact (severity escalation, structured labeling) are not supported by the committed result files — both control and treatment agent-result.json show "action": "duplicate" with no taxonomy labels or severity differences. The README should be reconciled with the committed evidence, or the correct result files should be committed.

Findings

Medium

  • [Correctness] target-repo-skills/README.md:153-211 — README claims treatment results show severity escalated from "high" to "critical" with labels area:api, area:data, priority:critical, type:bug and reasoning citing "Per triage guidance." The committed results/treatment/agent-result.json shows "action": "duplicate" with no mention of those labels, severity, or skill-based reasoning. The control result is also "action": "duplicate". The primary evidence (transcript showing skill loading) supports the discovery hypothesis, but the secondary behavioral claims in the README are contradicted by the committed artifacts.
    Remediation: Either commit the result files from the run that produced the behavioral differences described in the README, or update the README to accurately reflect the committed results (both runs found a duplicate because issue experiment: add reasoning monitor agent for prompt injection detection #2 was identical to issue Add CODEOWNERS #1).

Low

  • [Style/conventions] Multiple files — 12 files are missing trailing newlines (\ No newline at end of file). This includes README.md, HOW_TO.md, go.mod, main.go, health.go, users.go, SKILL.md, run.sh, setup-target-repo.sh, and others.
    Remediation: Add trailing newlines to all text files.

Info

  • [Correctness] target-repo-skills/results/treatment/transcript.jsonl — The treatment transcript confirms the primary hypothesis: the triage agent invoked Skill("triage-guidance"), the skill content was loaded from /tmp/workspace/repo/.claude/skills/triage-guidance, and its instructions appeared in context. This validates CWD-based skill discovery independent of CLAUDE_CONFIG_DIR. The control transcript has 0 mentions. This is solid evidence for the experiment's core question.

  • [Correctness] target-repo-skills/setup-target-repo.sh:68 — Uses git push --force to main on the synthetic repo. Intentional for experiment setup but worth noting — the script will overwrite any existing content in the target repo.

Footer

Outcome: comment-only
This review applies to SHA ed298f03c3470939733eebc176a0ffc65e3c8794. Any push to the PR head clears this review and requires a new evaluation.

@fullsend-ai-review fullsend-ai-review 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.

See the review comment for full details.

@maruiz93

maruiz93 commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

/fix

Restore the original experiment result files that match the README's
behavioral analysis — the re-run produced "duplicate" results because
issue fullsend-ai#2 was identical to fullsend-ai#1. Add trailing newlines to all text files.

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

@fullsend-ai-review fullsend-ai-review 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.

See the review comment for full details.

@maruiz93
maruiz93 added this pull request to the merge queue May 5, 2026
Merged via the queue into fullsend-ai:main with commit 2c14364 May 5, 2026
15 checks passed
@maruiz93
maruiz93 deleted the experiment/target-repo-skills branch May 5, 2026 10:46
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.

3 participants