sc-startup Skill
Thin orchestration for the /sc-startup command. Validates config, launches background agents, aggregates statuses, and emits a concise startup report. Delegates all heavy lifting to agents via Agent Runner (registry enforced, audited).
Command
/sc-startup [--pr] [--pull] [--fast] [--readonly]
/sc-startup --init (config discovery and guided setup)
Agents
ci-pr-agent (PR list/fix; list-only when --readonly)
sc-worktree-scan / sc-worktree-cleanup (worktree hygiene; scan-only when --readonly)
ci-automation (pull-only master → develop; must complete before checklist updates)
sc-checklist-status (report/update checklist; report-only when --readonly; no auto-commit)
sc-startup-init (detection-only: config presence, candidates, package detection; returns fenced JSON with YAML payload)
Flow (best-effort)
- If
--init: Agent Runner → sc-startup-init (detection-only). Parse results, use AskQuestion to fill missing/ambiguous settings (prompt path, checklist path, worktree-scan, pr-enabled, worktree-enabled). If not --readonly, write .claude/sc-startup.yaml; otherwise show synthesized YAML. Then continue.
- Load
.claude/sc-startup.yaml; validate required keys and enabled feature dependencies. Fail closed with DEPENDENCY.MISSING if enabled package absent.
- If
--fast: read startup prompt only, summarize role, exit (no agents/checklist).
- If
--pr and enabled: Agent Runner → ci-pr-agent (--list --fix, or list-only when --readonly).
- If worktree scan/cleanup enabled in config: Agent Runner →
sc-worktree-{scan|cleanup} (scan/report-only when --readonly).
- If
--pull: Agent Runner → ci-automation (pull-only master → develop); wait for completion before checklist updates.
- Agent Runner →
sc-checklist-status (default update; report-only when --readonly). Checklist changes stay in workspace (no commit).
- Read startup prompt + checklist (post-update). Aggregate task statuses in deterministic order; never abort on agent errors/timeouts.
- Emit concise report: prompt summary, checklist deltas, PR/worktree/CI outcomes, partial failures, and next steps.
If sc-checklist-status reports VALIDATION.INVALID_PATH (path escape), explicitly flag it as a warning/issue in the final report (include the word "warning" or "issue").
Config (.claude/sc-startup.yaml)
startup-prompt (string, required)
check-list (string, required)
worktree-scan (string: scan|cleanup|none|"")
pr-enabled (bool, optional; must be false if PR package absent)
worktree-enabled (bool, optional; must be false if worktree package absent)
Safety
- Path safety: repo-root-relative only.
- Default mutating;
--readonly forces report-only everywhere.
- No auto-commit of checklist changes.
- Dependency validation required before launch; fail closed if missing.
- Logging: Agent Runner audit logs under
.claude/state/logs/sc-startup/; prune after ~14 days.
Output Contract
- Aggregate per-task status objects
{agent_id, status: success|failure|timeout|partial, results, error?} plus narrative summary.
- Agents return fenced JSON minimal envelope; treat malformed/unfenced JSON as failure status.
- Dependency failure format (example):
{
"success": false,
"data": null,
"error": {
"code": "DEPENDENCY.MISSING",
"message": "Feature 'pr' enabled but required agent 'ci-pr-agent' is not installed",
"recoverable": true,
"suggested_action": "Install ci-pr-agent or set pr-enabled: false in .claude/sc-startup.yaml"
}
}
1---2name: sc-startup3description: Run repo startup: prompt load, checklist sync, optional PR triage, worktree hygiene, and CI pull. Best-effort with structured status.4---5
6# sc-startup Skill
7
8Thin orchestration for the `/sc-startup` command. Validates config, launches background agents, aggregates statuses, and emits a concise startup report. Delegates all heavy lifting to agents via Agent Runner (registry enforced, audited).
9
10## Command
11- `/sc-startup [--pr] [--pull] [--fast] [--readonly]`
12- `/sc-startup --init` (config discovery and guided setup)
13
14## Agents
15- `ci-pr-agent` (PR list/fix; list-only when `--readonly`)
16- `sc-worktree-scan` / `sc-worktree-cleanup` (worktree hygiene; scan-only when `--readonly`)
17- `ci-automation` (pull-only master → develop; must complete before checklist updates)
18- `sc-checklist-status` (report/update checklist; report-only when `--readonly`; no auto-commit)
19- `sc-startup-init` (detection-only: config presence, candidates, package detection; returns fenced JSON with YAML payload)
20
21## Flow (best-effort)
221. If `--init`: Agent Runner → `sc-startup-init` (detection-only). Parse results, use AskQuestion to fill missing/ambiguous settings (prompt path, checklist path, worktree-scan, pr-enabled, worktree-enabled). If not `--readonly`, write `.claude/sc-startup.yaml`; otherwise show synthesized YAML. Then continue.
232. Load `.claude/sc-startup.yaml`; validate required keys and enabled feature dependencies. Fail closed with `DEPENDENCY.MISSING` if enabled package absent.
243. If `--fast`: read startup prompt only, summarize role, exit (no agents/checklist).
254. If `--pr` and enabled: Agent Runner → `ci-pr-agent` (`--list --fix`, or list-only when `--readonly`).
265. If worktree scan/cleanup enabled in config: Agent Runner → `sc-worktree-{scan|cleanup}` (scan/report-only when `--readonly`).
276. If `--pull`: Agent Runner → `ci-automation` (pull-only master → develop); wait for completion before checklist updates.
287. Agent Runner → `sc-checklist-status` (default update; report-only when `--readonly`). Checklist changes stay in workspace (no commit).
298. Read startup prompt + checklist (post-update). Aggregate task statuses in deterministic order; never abort on agent errors/timeouts.
309. Emit concise report: prompt summary, checklist deltas, PR/worktree/CI outcomes, partial failures, and next steps.
31
32If `sc-checklist-status` reports `VALIDATION.INVALID_PATH` (path escape), explicitly flag it as a warning/issue in the final report (include the word "warning" or "issue").
33
34## Config (`.claude/sc-startup.yaml`)
35- `startup-prompt` (string, required)
36- `check-list` (string, required)
37- `worktree-scan` (string: `scan|cleanup|none|""`)
38- `pr-enabled` (bool, optional; must be false if PR package absent)
39- `worktree-enabled` (bool, optional; must be false if worktree package absent)
40
41## Safety
42- Path safety: repo-root-relative only.
43- Default mutating; `--readonly` forces report-only everywhere.
44- No auto-commit of checklist changes.
45- Dependency validation required before launch; fail closed if missing.
46- Logging: Agent Runner audit logs under `.claude/state/logs/sc-startup/`; prune after ~14 days.
47
48## Output Contract
49- Aggregate per-task status objects `{agent_id, status: success|failure|timeout|partial, results, error?}` plus narrative summary.
50- Agents return fenced JSON minimal envelope; treat malformed/unfenced JSON as failure status.
51- Dependency failure format (example):
52 ```json
53 {
54 "success": false,
55 "data": null,
56 "error": {
57 "code": "DEPENDENCY.MISSING",
58 "message": "Feature 'pr' enabled but required agent 'ci-pr-agent' is not installed",
59 "recoverable": true,
60 "suggested_action": "Install ci-pr-agent or set pr-enabled: false in .claude/sc-startup.yaml"
61 }
62 }
63 ```