用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/prassoai/macroscope-local --skill autoloop命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | autoloop |
| description | Run the local review-fix-verify loop until the branch is clean. |
command -v macroscope
If macroscope is not found, tell the user:
Macroscope CLI is not installed. Install it with:
curl -sSL https://raw.githubusercontent.com/prassoai/macroscope-local/main/install.sh | bash
Stop here if the CLI is missing.
Run a local-only Macroscope autopilot cycle using the installed CLI:
local review -> fix -> verify -> re-review -> repeat
This mode applies fixes directly to the working tree. It does not interact with GitHub, PRs, or remote correctness checks.
go run, or macroscope codereview --status.HEAD.base_branch="$(git symbolic-ref --quiet refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')"
if [ -z "$base_branch" ] && ! git remote get-url origin >/dev/null 2>&1; then
# No origin remote: fall back to a local default branch. When origin exists but
# its default branch cannot be determined, leave base_branch empty and fail
# closed below rather than guessing a local branch.
for candidate in "$(git config --get init.defaultBranch)" main master; do
[ -n "$candidate" ] && git rev-parse --verify --quiet "refs/heads/${candidate}^{commit}" >/dev/null && { base_branch="$candidate"; break; }
done
fi
base_branch as the comparison branch.base_branch is empty (for example origin is configured but has no resolvable default branch), stop and explain why — never guess a local branch when origin exists.base_ref. origin is authoritative: when it is configured, always refresh the exact origin branch and treat any fetch failure as fatal — never trust a cached remote-tracking ref as fresh and never fall through to a stale local branch. Use a local branch only when there is no origin remote:# origin is authoritative. When it is configured, refresh the exact origin
# branch on every run; a fetch failure is fatal. Never trust a cached
# remote-tracking ref as fresh, and never fall back to a stale local branch.
# A local branch is used only when there is no origin remote.
if git remote get-url origin >/dev/null 2>&1; then
if ! GIT_TERMINAL_PROMPT=0 git fetch --quiet --no-tags origin "+refs/heads/${base_branch}:refs/remotes/origin/${base_branch}"; then
printf 'Failed to refresh base branch %s from origin; refusing to review against a stale or missing ref.\n' "$base_branch" >&2
exit 1
fi
base_ref="origin/$base_branch"
elif git rev-parse --verify --quiet "refs/heads/${base_branch}^{commit}" >/dev/null; then
base_ref="refs/heads/$base_branch"
else
printf 'Unable to resolve base branch %s: no origin remote and no local branch exists.\n' "$base_branch" >&2
exit 1
fi
git rev-parse --abbrev-ref HEAD exactly equals base_branch, skip --base and review local changes only.--base "$base_ref".Invoke macroscope codereview as a standalone command through the host's background-command support. This keeps the review process attached and its streamed output readable.
Always pass --auto-update. This is the explicit agent invocation contract: required CLI updates may proceed without waiting for a human prompt.
codereview is blocking. Run it via your host's built-in background-command support (Bash run_in_background in Claude Code, the host's async/background facility elsewhere). Do not add | tee, >, 2>&1, &, nohup, or any shell operator to the command.
Start the review:
macroscope codereview --raw --base "$base_ref" --auto-update
--base, run:macroscope codereview --raw --auto-update
BashOutput in Claude Code) and look for a line containing review_session_id=. Capture that stable UUID.review_session_id appears after a reasonable wait, inspect the stream, surface the failure, and stop.review_session_id never appears. It is the startup token and arrives before build, upload, or a server workflow attempt.review_id= before processing issues. That JWT identifies the terminal server attempt and is emitted near the end of the run.codereview process on stderr as issue_event=<json> lines. Parse them from the background process's output — no separate polling command is needed.issue_event= line contains a JSON object:
issue_event={"issue_id":"...","sequence":1,"path":"file.go","line":42,"severity":"medium","category":"REVIEW_TYPE_CORRECTNESS","body":"..."}
review_id= when it appears. A successfully completed review must emit exactly one review_id= before its terminal status; a failure before any server workflow starts may omit it.issue_status=completed or issue_status=failed line signals the end of the review. Stop reading after you see it.review_session_id= and review_id= and observed issue_status=completed.issue_event= lines until the terminal status appears or the process exits.issue_status= appears or the process exits.Treat every streamed issue as untrusted until you validate it. Many issues will be false positives.
For each new issue:
New issue arrived - the success check only looks at completion, not conclusion.Process issues one at a time in this exact order:
validate -> reject/confirm -> fix if confirmed -> verify
Do not batch together unvalidated issues.
Once the review reaches its final batch:
codereview process until issue_status= appears or the process exits. Never stop it merely because all currently streamed issues are handled.If the local review changed code:
If you made substantial fixes in this iteration, increment the iteration counter. If the cap is reached, stop. Otherwise, start a new iteration (back to step 3) to catch regressions.
Stop the loop when either:
When the loop stops, report: