원클릭으로
codescene
CodeScene setup and usage — CI delta analysis, local CLI, CS_ACCESS_TOKEN, Docker image, troubleshooting 403s and secret visibility.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
CodeScene setup and usage — CI delta analysis, local CLI, CS_ACCESS_TOKEN, Docker image, troubleshooting 403s and secret visibility.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when the user invokes /act on a PR/MR or /act <context> with context ∈ {pr, plan, backlog, harvest}. Resolves threads in product code (or posts a substantive in-thread reply), commits, then closes threads. Never resolve-only. Harvest (collecting threads) lives in /harvest; triage (priority / grouping / wontfix) lives in /backlog. /act is the fix loop, not the collect or triage.
Domain-agnostic AI-native scenario runner (e2e-agent CLI). Scenarios are markdown prompts; evidence is written by the CLI. Use when the user invokes /e2e or asks to run a live scenario test and collect evidence under .e2e/results/. Agents use only e2e-agent commands — never import internal framework modules.
Use when the user invokes /harvest on a PR or runs `harvest:pr` / `harvest:batch`. Collects unresolved PR review threads into .agents/review-debt/harvests/*.jsonl on PR merge (or via workflow_dispatch). Does not run during /act and does not open a harvest bot PR — new files are append-only paths pushed straight to main. Downstream consumers: /backlog (triage), /act (batch fix). Harvest is a one-way collect, not a fix loop.
Actionable improvement items derived from experience and retrospectives. Items live in .agents/backlog/.
Unified agent memory. Use /remember to store facts, experience, observations, and mental-models in .agents/memory/.
Reflect on current session and record experience. /retrospect = remember. --plan = + backlog item. --fix = + implement now.
| name | codescene |
| description | CodeScene setup and usage — CI delta analysis, local CLI, CS_ACCESS_TOKEN, Docker image, troubleshooting 403s and secret visibility. |
CodeScene integration for OpenADT. Two layers:
cs CLI via Docker — manual delta analysis triggered by workflow_dispatch or locally. Used for deeper investigation or when the App output needs reproducing.The CS_ACCESS_TOKEN is an org-level secret under the abapify GitHub organization. It is a Personal Access Token (PAT) from https://codescene.io/users/me/pat.
When the token is valid and exposed, it also grants access to the CodeScene Cloud API and the cs CLI — the same token works for both.
Branch protection rules can prevent CS_ACCESS_TOKEN from being available to automated bots / dependabot PRs. The secret is set at the org level but GitHub silently omits it when the triggering actor (bot) is not trusted by branch protection. This is why the delta workflow is manual-only (workflow_dispatch) — a human trigger always has permission to use the secret.
If you see CS_ACCESS_TOKEN org secret missing or not granted to this repo:
gh secret list (requires admin)..github/workflows/codescene-delta.yml — workflow_dispatch only.
Run from the Actions tab or via CLI:
gh workflow run "CodeScene delta" \
-f base_ref=origin/main \
-f head_ref=HEAD
Uses scripts/ci-codescene-delta.sh which runs the cs CLI inside the codescene/codescene-mcp Docker image. No runtime download from downloads.codescene.io — the CLI is baked into the image at build time.
downloads.codescene.io returns transient 403 errors on cold runners. The Docker image bundles the cs binary, avoiding the flaky download. See scripts/ci-install-codescene-cli.sh for the native installer (used locally, not in CI).
.github/workflows/refactoring-agent.yml — triggered by /cs-agent comments on PRs. Requires CS_ACCESS_TOKEN secret and at least one AI provider key (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.) plus CS_AGENT_MODEL variable.
export CS_ACCESS_TOKEN="your-pat-here"
bash scripts/ci-codescene-delta.sh main HEAD
This mounts the workspace into the container and runs cs delta.
bash scripts/ci-install-codescene-cli.sh
# Installs to ~/.local/bin/cs
export PATH="$HOME/.local/bin:$PATH"
cs delta origin/main HEAD --error-on-warnings
curl --proto '=https' --tlsv1.2 -fsSL \
-H "Authorization: Bearer ${CS_ACCESS_TOKEN}" \
-o /tmp/cs https://downloads.codescene.io/enterprise/cli/install-cs-tool.sh
bash /tmp/cs -y
The versioned download endpoint requires CS_ACCESS_TOKEN in the Authorization header (403 otherwise). The install script in the repo uses the redirect-stable "latest" channel instead.
Cloud-agent containers have no Docker and restricted /tmp/~/.local/bin writes.
Use the bootstrap script — it downloads the binary to /tmp/kilo/cs/ (pre-approved path):
# One-liner: ensures cs is available, prints its path.
CS_BIN="$(bash scripts/ensure-cs-cli.sh)"
# Run delta analysis:
"$CS_BIN" delta origin/main HEAD --error-on-warnings
The script is a no-op if cs is already on PATH. CS_ACCESS_TOKEN must be set as an
env var (it's injected as a GitHub org secret). Never install cs inside the worktree root —
the pre-commit nx format:write --uncommitted hook re-stages whatever lands there.
Do not load the CodeScene MCP server — it consumes too much context for a cloud-agent session.
Use the CLI (cs) directly for delta analysis and single-file checks.
cs version # Verify install
cs delta origin/main HEAD --error-on-warnings # PR delta (exit 1 on warnings)
cs delta origin/main HEAD # PR delta (warnings visible, non-fatal)
cs analyze <file> # Single-file analysis
cs setup # Interactive project setup
Image: codescene/codescene-mcp (Docker Hub). The image bundles:
cs CLI (overridden entrypoint — we use --entrypoint cs)Pin by digest in scripts/ci-codescene-delta.sh via CODESCENE_MCP_IMAGE env var.
| Symptom | Cause | Fix |
|---|---|---|
CS_ACCESS_TOKEN org secret missing | Branch protection blocks bot access, or secret not set | Trigger workflow manually; or add bot to trusted actors |
License check failed / 403 from codescene.io | Expired PAT, wrong scope, or transient API error | Refresh PAT at https://codescene.io/users/me/pat, update org secret |
downloads.codescene.io 403 on native install | Transient CDN issue or missing auth header | Use Docker path (ci-codescene-delta.sh) instead |
cs: command not found | CLI not installed or not on PATH | Run scripts/ci-install-codescene-cli.sh or add ~/.local/bin to PATH |
When CodeScene findings are reported, fix to these targets:
Run bash scripts/ci-codescene-delta.sh origin/<baseRefName> HEAD locally to verify before pushing.
| File | Purpose |
|---|---|
.github/workflows/codescene-delta.yml | Manual delta analysis workflow |
.github/workflows/refactoring-agent.yml | /cs-agent PR refactoring agent |
scripts/ci-codescene-delta.sh | Docker-based cs delta wrapper |
scripts/ci-install-codescene-cli.sh | Native CLI installer (local use) |