/lstack-extras:agent-profilefrom lstack-extras
Delegates a task to another coding agent using a saved profile (harness, model, thinking level). User-invoked via /agent-profile. Detects available harnesses and options from the local machine.
Ships in lstack-extras. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Delegate one task to another coding agent, configured by a named agent profile: harness + optional harness profile + model + thinking level + permission mode. The user picks a saved profile or creates one, picks where and how it runs, and the skill runs it headless and reports what came back.
User-invoked only: /agent-profile [profile-name] [task].
references/harnesses.md has each adapter.[profiles.*] entry for Codex.agent_profile.py detect on this machine, this run.--cwd): the current
directory or a new git worktree.~/.cache/agent-profile/runs/<stamp>-<profile>-<id>/ with prompt.md,
command.json, output.log, the pid files and result.json.$AP below is python3 <this skill's directory>/scripts/agent_profile.py. To keep the
context budget small, read a reference file only in the step that names it, and use
detect text output for the user and --json only for picking values.
python3 3.9 or later (3.11+ to read Codex profiles) and git on PATH.claude or mcc login, pi auth, opencode auth, …). The skill never handles credentials.detect did not report. Accept a typed model only when the harness's
models_complete is false, and pass --typed-model.full
permissions needs its own explicit yes every time; only then pass --confirm-full.pi auth print-* style commands never run.Take the task from the request. If there is none, ask for it once. Write it verbatim to
$TMPDIR/agent-profile-<stamp>.md.
Done when the prompt file exists and holds the user's words unchanged.
Run $AP list --project "$PWD". Each line is a brief: name, harness/harness profile,
model, thinking, permissions, scope.
Create a new profile, and ask which one. With
more than 3 saved profiles, print the numbered list and ask the user to answer with a
number or name (AskUserQuestion holds only 4 options).Done when a profile name is chosen, or Step 3 is next.
$AP detect once and show its output: harnesses with version and adapter status
(verified or untested), harness profiles, models, thinking levels, permissions.
Keep $AP detect --json for the choices below; never re-type a value by hand. A
harness whose models say LIST FAILED cannot be saved until a re-run of detect lists
them.models_complete is false, add Type a model id. For pi, keep the model's provider for --provider. For opencode, a listed
model may take a #<variant> suffix the user types.harness default. Skip the question when the
harness has no levels, or when the model's thinking is false.references/harnesses.md
(ask, edits, full). Recommend edits where it exists. pi has only ask and full:
say so, and that full means a separate yes on every run.<harness>-<model>-<thinking> in lowercase with hyphens; the user
may change it..agent-profiles.json at the repo root, overriding a global profile of the same
name).$AP save --name … --harness … --model … [--harness-profile …] [--provider …] [--thinking …] --permissions … --scope … [--typed-model].
--replace.Done when save prints the new profile's brief.
Ask both in one AskUserQuestion call:
Current directory or New git worktree. Offer the worktree only inside
a git repo. Note that uncommitted changes in the current directory are not in a new
worktree.Foreground (wait for the result) or Background (return at once, check
later).For a worktree, plan the path ../<repo>-agent-<stamp> and the branch
agent/<profile>-<stamp> now; Step 6 creates them only after the user says Run it.
For a Foreground task likely to take more than 9 minutes, recommend Background.
Done when the working directory (existing or planned) and the mode are recorded.
The delegated agent edits files in a git repo, so before Step 6:
sync: skipped (not a git repo) and continue.branch="$(git rev-parse --abbrev-ref HEAD)". With no origin, or a branch not on
origin, record sync: skipped (<reason>) and continue.git status --porcelain shows changes, run git stash push -u -m agent-profile-sync
first. Then git fetch origin && git pull --rebase origin "$branch", then git stash pop
if you stashed.git rebase --abort, then git stash pop if you stashed, then
stop and ask the user.git stash pop conflicts → leave the stash in place (it is
not dropped), show git status --short, and stop and ask the user.Run $AP command <name> --prompt-file <file> --cwd <dir> --project "$PWD" (for a
planned worktree, --cwd is the current directory; the command is the same apart from
the path) and show:
Profile: <brief>
Location: <dir> (<current directory | new worktree on branch …>)
Mode: <foreground | background>
Command: <display>
Notes: <notes, or none>
Notes cover a typed model, a harness version that changed since the profile was saved,
a project profile (check it is one you trust), an untested adapter, why a harness offers
fewer permission modes (pi), and, for opencode ask/edits, that its resolved rules were
checked (MCP servers and plugins are not). A command error (harness removed, model no
longer listed, opencode rules that do not confine the run) goes back to Step 2; never work
around an opencode refusal with a full profile without the user's yes.
Ask Run it, Change (back to Step 2 or 4) or Cancel. When
needs_full_confirmation is true, ask a separate question first: "This profile runs
with full permissions: the agent can run any command without asking. Run it?" Cancel
leaves nothing behind: no worktree or run folder exists yet.
Done when the user chose Run (and confirmed full permissions when needed), or cancelled.
For a new worktree: run Repo Sync, then
git worktree add -b agent/<profile>-<stamp> ../<repo>-agent-<stamp> HEAD, and use that
path as --cwd.
$AP run <name> --prompt-file <file> --cwd <dir> --project "$PWD" [--background] [--confirm-full].
status (done, failed, timeout,
interrupted, failed-to-start), exit_code, duration_s, run_dir. If the shell tool stops the script (SIGTERM, SIGINT or SIGHUP), the harness is stopped
too and result.json says interrupted. After a SIGKILL nothing can clean up: status
then reports orphaned, and stop ends the harness.run_dir and the pid. When the user asks, or before ending
the conversation, run $AP status <run_dir> (running, done, failed, timeout, stopped,
orphaned, lost). To end it early on the user's request: $AP stop <run_dir>.Done when a result exists (foreground), or the run folder and pid are reported (background).
In the working directory, run git status --short and git diff --stat. Then print:
Result: <done | failed (exit N) | timeout | interrupted | stopped | running in background>
Evidence: profile <brief>; exit <code> in <duration>; <N> files changed; log <run_dir>/output.log
Uncertainty: <the agent's claims are unverified; untested adapter; typed model>
Decision: <review the diff; keep, merge or delete branch agent/…; or "No approval needed.">
Quote the harness's final answer from the log (at most 20 lines). Never commit, merge or
push. Remove a worktree only on the user's yes:
git worktree remove <path> && git branch -D agent/<…>.
/agent-profile fix the flaky date test in tests/dates.test.ts, with one saved profile.
After the user picks it, Current directory and Foreground, Step 5 shows:
Profile: cc-sonnet — claude/twmaisie · sonnet · thinking low · permissions edits · global
Location: /home/me/app (current directory)
Mode: foreground
Command: /usr/local/bin/mcc exec twmaisie -- /usr/local/bin/claude -p --model sonnet --effort low --permission-mode acceptEdits < /tmp/agent-profile-20261110-0912.md
Notes: none
Expected output after the run:
Result: done
Evidence: profile cc-sonnet — claude/twmaisie · sonnet · thinking low · permissions edits · global; exit 0 in 48.2s; 1 file changed; log ~/.cache/agent-profile/runs/20261110-091233-cc-sonnet-3fa2c1/output.log
Uncertainty: the agent says the test passes; this skill did not run the tests
Decision: review the diff in tests/dates.test.ts. No other approval needed.
After each step, print:
◆ <Step name> (step N of 7)
··································································
<check>: √ <evidence> | × <reason> | — <note>
____________________________
Result: PASS | FAIL | PARTIAL
Checks: Step 1 prompt file written; Step 2 profiles listed (N), choice; Step 3 harnesses
detected (N installed / M known), each answer from the detected list, save exit 0;
Step 4 location and mode, sync recorded; Step 5 command shown, user answer; Step 6 exit
code or run folder; Step 7 Result line first.
references/profile-format.md → Errors has the script's exit codes and messages, and
Edge cases covers a harness removed since the profile was saved, an empty model list,
a run that leaves no result.json, and other cases.
Optional and propose-only. After the run's result is delivered, run this check:
mcc, a model list, or the run folder failed and a workaround worked.references/ (the directory holding this SKILL.md). Bump the patch number of metadata.version. If the skill is an installed copy or tracked in git, say so. Commit nothing unless the user asks.Off — the user opted out.| File | Read in | Holds |
|---|---|---|
references/harnesses.md | Steps 3, 5 | each adapter: detection, models, thinking, permissions, headless command, status |
references/profile-format.md | Steps 2, 3, 6 | storage, profile fields, run folder, script exit codes, errors, edge cases |
scripts/agent_profile.py | every step | detect, list, show, save, delete, command, run, status, stop |
What SKILL.md sets; muted values are Claude Code's defaults
mediumThree short reads, in order
32 skills in this plugin
/ai-job-scoutFind open AI engineering jobs that fit a candidate, verify location and apply links, and assess each employer's product. Use for one-off shortlists or a job alert's research step. Don't use for résumé writing, job applications, or company news./appstore-assetsGenerate App Store screenshots, header/search images and looping videos for iPhone, iPad, Mac from code or a landing page, or re-render a set. Use when preparing a submission. Don't use for App Previews, ASO, review audits, icons, Google Play./appstore-review-checkerAudit iOS/macOS apps against App Store Review Guidelines before submission, with evidence-backed verdicts and fixes. Don't use for Google Play, general code review, or rejection appeals./aso-marketingOptimize App Store and Google Play listings via a 7-phase, plan-approval-gated ASO workflow: keywords and rank tracking, metadata, screenshot captions, localization. Don't use for web SEO, Search Ads/paid UA, or pre-submission compliance audits./brand-name-checkerCheck product and brand names for conflicts across trademarks, domains, social handles, and package registries. Returns a risk level and Proceed/Modify/Abandon verdict. Don't use for name brainstorming, logo design, or trademark filings./codebase-modernizerAudit a stale, inherited, or messy codebase — deps, bugs, security, tests, CI, docs, UI/UX — then emit a phased, testable modernization plan. Read-only: plans upgrades, never applies them. Not for single-PR review, PRD-to-tasks, or UX-only audits.npx claudepluginhub luongnv89/skills --plugin lstack-extrasOther plugins' skills for the same job