SpecRunnerDocs
ドキュメント設定リファレンス
REFERENCE

設定リファレンス

2層のconfig、上書き規則、既定値、認証変数を実装上の挙動と同じ単位で確認します。

このページの内容

設定は2層をdeep mergeする

project configはrepositoryへcommitされる前提で扱います。GitHubとruntimeのsecretは環境変数、keychain、または~/.config/specrunner/credentials.jsonで解決します。詳しくは権限・認証・環境変数を参照してください。

prioritypathrole
1 / base~/.config/specrunner/config.json個人・実行環境の既定値。initが作成
2 / overlay<repo>/.specrunner/config.jsonrepository固有の差分。手動で作成

merge規則。 objectは再帰的にmergeし、project localが勝ちます。arrayは連結せず、project localのarrayで全体を置き換えます。

設定の置き場所を分ける

USER GLOBAL端末とruntimeの既定

runtimesteps.defaults、model registry、heartbeatなど。

PROJECT LOCALteamで共有する契約

verification、test配置、forbidden surfaces、archive guardなど。

CREDENTIALS / ENVsecretと実行時override

GitHub token、Claude OAuth、managed API key。repositoryへcommitしません。

.specrunner/*はignoreし、!.specrunner/config.jsonだけを追跡する設定がinitで追加されます。

Project configの実用例

自動検出に任せる項目は書かず、repositoryとして固定したい契約だけを宣言します。

.specrunner/config.json
{
  "version": 1,
  "verification": {
    "commands": [
      { "name": "typecheck", "run": "npm run typecheck" },
      { "name": "test", "run": "npm test" },
      { "name": "lint", "run": "npm run lint" }
    ]
  },
  "tests": {
    "placement": { "style": "sibling", "suffix": ".test.ts" }
  },
  "archive": {
    "protectedPaths": [".github/workflows/**"],
    "postMergeVerify": ["npm ci"]
  }
}
1

version: 1standaloneでも読めるproject configにします。

2

verificationを明文化環境ごとの自動検出差をなくします。

3

危険なmergeを止めるprotectedPathsへ運用上の高リスク領域を置きます。

Step configは6段階で解決する

modelmaxTurnstimeoutMsは各fieldごとに、最初に定義された値を使用します。

  1. 1steps.<step>.byRequestType.<type>.<field>
  2. 2steps.<step>.<field>
  3. 3steps.defaults.byRequestType.<type>.<field>
  4. 4steps.defaults.<field>
  5. 5step hardcoded default
  6. 6SDK default
config.json — steps example
{
  "version": 1,
  "steps": {
    "defaults": {
      "model": "claude-sonnet-4-6",
      "maxTurns": null,
      "timeoutMs": null
    },
    "design": {
      "byRequestType": {
        "spec-change": { "model": "claude-opus-4-6[1m]" },
        "chore": { "model": "claude-sonnet-4-6" }
      }
    }
  }
}

managed runtimeではmodel指定を実行に使いません managed agentは登録済みmodelを使用します。config effectiveは設定値を表示しますが、実行時に無視される旨も表示します。

built-in model、provider dispatch、custom modelの制約は対応プロバイダーを参照してください。

主要な設定キーと既定値

keydefaultbehavior
runtimelocallocal / managed。managedのresource IDはsetupが管理
steps.<step>step既定値model、maxTurns、timeoutMs、byRequestType
models.<name>.providerbuilt-in registryanthropic / openaiを追加・上書き
workspace.setupJS traceを検出してinstallShellCommand[]。[]で明示的にskip
verification.commandspackage.jsonのscriptを検出ShellCommand[]を順番にfail-fast実行
verification.coverage未宣言ならskipchanged-line coverageをlcovで検証
tests.placement既存配置に追従siblingまたはmirror
pipeline.maxRetries2spec-review loop。1〜10
pipeline.fast.forbiddenSurfaces[]fast profileで触れてはいけないpath glob
logs.maxJobs20保持job数。1〜1000
progress.heartbeatIntervalSecTTY 30 / non-TTY 600またはnullで無効
transientRetry3回 / 1000mslocal runtimeのみ。指数backoff

Verificationを言語非依存にする

workspace.setupverification.commandsは、文字列または{ name?, run }の配列です。POSIX shellで順番に実行し、最初のnon-zeroで停止します。

workspace.setup未宣言JS traceがあればpackage manager install、なければskip
workspace.setup: []JS projectでもinstallを明示的にskip
verification.commands未宣言package.jsonのbuild・typecheck・test・lintを検出
verification.coverage宣言base…HEADの変更行をlcovでfail-closed検証
coverage gate example
{
  "verification": {
    "commands": ["npm run typecheck", "npm test"],
    "coverage": {
      "command": "npm test -- --coverage",
      "lcovPath": "coverage/lcov.info",
      "include": ["src/**"],
      "exclude": ["src/generated/**"],
      "minChangedLineCoverage": 0.8
    }
  }
}

coverage command失敗、lcovの欠落・空ファイル、対象fileのlcov欠落はfailです。

Archiveと任意連携

keydefaultbehavior
archive.mergeWaitTimeoutMs600000null=無制限、0=待機なし
archive.mergeWaitPollIntervalMs15000checksのpoll間隔
archive.protectedPaths[]一致したPRのauto-mergeを停止
archive.postMergeVerify[]merge SHAの一時worktreeで順次実行
github.hostgithub.comGitHub Enterprise hostname
github.apiBaseUrlhostから導出明示時はhttps URL
inbox.approveLabelspecrunner-approvedIssue連携を使う場合の承認label
inbox.maxStartsPerRun30はresume-only
designLayer.enabledfalseaozu連携をopt-in
designLayer.commandaozu起動するcommand
designLayer.requireCitationTypes[]citation必須のrequest type
designLayer.topicEmissiontruearchive時のtopic出力

inboxは運用オプションです GitHub Issue起点の無人運用を前提にしません。CLIでrequestを投入する運用ではinbox設定は不要です。

archive guardの設計と実行順はPR・merge・archiveで確認できます。

認証・診断の環境変数

variablerole
GH_TOKENGitHub API tokenの最優先。cron・CI向け
GITHUB_TOKENGitHub tokenの第2優先。GitHub Actionsで利用
CLAUDE_CODE_OAUTH_TOKENlocal Claude runtimeのheadless token。保存済みcredentialより優先
OPENAI_API_KEYlocal OpenAI runnerがCodex SDKのapiKeyへ明示的に渡す
SPECRUNNER_API_KEYmanaged runtimeのAnthropic API key
SPECRUNNER_LOG_LEVELquiet / verbose / debug。CLI flagが優先
SPECRUNNER_DEBUGpipelineなど診断subsystemをcomma区切りで指定
SPECRUNNER_HEARTBEAT_INTERVAL秒数、0またはoffで無効。configが優先

GitHub tokenの解決順はGH_TOKENGITHUB_TOKENgh auth token → credentials.jsonです。

runtime別の必須変数、GitHub最小権限、GHES、secretの受け渡しは権限・認証・環境変数を参照してください。

変更前後に解決結果を確認する

config effectiveはstandard agent stepのmodel・maxTurns・timeoutMsと、それぞれの取得元を表示します。config全体のdumpではありません。

terminal
npx specrunner config effective
npx specrunner config effective --type spec-change
npx specrunner config effective --type chore --json
npx specrunner doctor

確認範囲。 config変更後は構文だけでなく、対象request typeでどのstep値が採用されたかまで確認します。

目的別の最小例は設定レシピを参照してください。

参照ソース 6