SDLC Preflight
Verify that an Agent SDLC issue is safe to dispatch before a worker edits code.
Workflow
- Inspect live repo and GitHub state:
git status --short --branchgit fetch origin --prunegh issue view <number> --json number,title,body,labels,url,stategh issue list --label agent:active --state opengh issue list --label agent:blocked --state opengh pr list --state open
- Extract
## Dependencies,## Worker Dispatch, and## Agent State. - Verify the declared base ref resolves. Default to
origin/HEAD, thenorigin/main, when the issue does not declare a base. - Run the plugin guard for declared scope paths and verification commands:
node plugins/agent-sdlc/scripts/guardrails.js validate-base --base <declared-base> --file <scope-path> --command "<verification-command>"- Scope paths may be files or directories; directory scopes are expanded to child files.
- Stop if it reports files, child files, or package scripts that exist only in the current worktree but not at the declared base.
- Verify the declared branch is available or belongs to this issue. If it is already checked out in another worktree, inspect that worktree before reusing it.
- Re-check active issues and PRs for path/domain overlap. If dependency mode changed, stop and mark/report the issue as blocked or stacked.
- If the current checkout is detached or on the wrong branch for issue-specific work, stop before reading more repo workflow context or editing files.
- For a fresh worker lane, require branch provisioning from the declared base SHA, a pushed
origin/<branch>ref, and a worker bootstrap that verifiesgit branch --show-currentplusgit rev-parse HEADbefore implementation instructions or edits are allowed. - On success, update
## Agent StatewithStatus: preflight_passed, base, branch, and any safe non-local-path worktree note.
Rules
- Do not create implementation changes in this role.
- Do not put local absolute paths in GitHub issue bodies or comments.
- Before
gh issue edit --body-fileorgh pr edit --body-file, runnode plugins/agent-sdlc/scripts/guardrails.js body --body-file <draft> > <safe-body>. - Treat
HEAD (no branch)as a hard stop unless the user explicitly asks to repair the checkout.