Context
Depends on #37 (shared lib modules).
Each workflow's actions/github-script block contains 190-400 lines of inline JavaScript. This should be extracted into standalone .js files.
Task
-
Create main script files in .github/agent-workflow/scripts/:
guardrail-scope.js
guardrail-test-ratio.js
guardrail-dependencies.js
guardrail-api-surface.js
guardrail-commits.js
orchestrator-check.js
human-review.js
pr-context.js
-
Each file exports module.exports = async function({ github, context, core }) { ... }
-
Import shared lib modules from ./lib/ instead of duplicating logic
-
Slim each workflow YAML to a thin shell:
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
with:
script: |
const run = require('./.github/agent-workflow/scripts/guardrail-scope.js');
await run({ github, context, core });
No functional changes — pure extraction refactor.
Files
.github/agent-workflow/scripts/*.js (8 new files)
.github/workflows/*.yml (8 modified — inline JS replaced with require+run)
Context
Depends on #37 (shared lib modules).
Each workflow's
actions/github-scriptblock contains 190-400 lines of inline JavaScript. This should be extracted into standalone.jsfiles.Task
Create main script files in
.github/agent-workflow/scripts/:guardrail-scope.jsguardrail-test-ratio.jsguardrail-dependencies.jsguardrail-api-surface.jsguardrail-commits.jsorchestrator-check.jshuman-review.jspr-context.jsEach file exports
module.exports = async function({ github, context, core }) { ... }Import shared lib modules from
./lib/instead of duplicating logicSlim each workflow YAML to a thin shell:
No functional changes — pure extraction refactor.
Files
.github/agent-workflow/scripts/*.js(8 new files).github/workflows/*.yml(8 modified — inline JS replaced with require+run)