Portable Go CI & scafctl MCP Reference#
How oakwood-commons/scafctl
powers both live AI schema lookups (scafctl mcp serve) and a single-source Go
CI workflow across local terminals, GitHub Actions, and Tekton.
1. One Go CI Definition, Three Environments#
Instead of maintaining separate bash scripts inside .github/workflows/, Tekton
Task YAML, and a local Makefile,
ci/go-ci/actions.yaml
defines the entire Go action DAG once behind
simple -r key=value parameters:
scafctl run action ci -f ci/go-ci/actions.yamlci/github-actions/ci.ymlci/tekton/go-ci-{task,pipeline}.yamlinstall-tools
Detects OS/arch (Linux, macOS, Windows) and ensures Go 1.26+, golangci-lint & gosec.build (go build -trimpath)
Compiles only when every lint, security, race, and coverage check passes.Supported Parameters (-r key=value)#
| Parameter | Default | Description |
|---|---|---|
workdir | "." | Go module directory to test and build |
tools_bin | "<cwd>/.tool/bin" | Directory where missing CI tools (go, golangci-lint, gosec) are installed (relative overrides normalize to absolute paths) |
build_pkg | "./..." | Package pattern passed to go build |
output_bin | "" | Optional binary output path (go build -o) |
min_coverage | 70 | Minimum total statement coverage (0 disables threshold) |
go_version | "1.26.11" | Pinned Go version installed into tools_bin/go-sdk if Go 1.26+ is missing |
golangci_lint_version | "2.15.0" | Pinned golangci-lint version installed into tools_bin if missing |
gosec_version | "2.30.0" | Pinned gosec security scanner version installed into tools_bin if missing |
race | true | Run go test -race when a C compiler and supported OS/arch are present |
run_lint | true | Run pinned golangci-lint |
run_gosec | true | Run pinned gosec security scanner |
Copy-Paste Adapters#
# Run full Go CI
scafctl run action ci -f ./ci/go-ci/actions.yaml -r workdir=examples/go-app
# Run only lint and test during inner-loop coding
scafctl run action lint test -f ./ci/go-ci/actions.yaml -r workdir=examples/go-app
# Run the CI file's own sandboxed functional tests
scafctl test functional -f ./ci/go-ci/actions.yamlCopy ci/github-actions/ci.yml
to .github/workflows/ci.yml in your Go repository:
- name: Run portable Go CI via scafctl
run: |
scafctl run action ci -f ./ci/go-ci/actions.yaml \
-r workdir=. \
-r build_pkg=./... \
-r min_coverage=70Apply ci/tekton/go-ci-task.yaml
and ci/tekton/go-ci-pipeline.yaml:
kubectl apply -f ci/tekton/go-ci-task.yaml
kubectl apply -f ci/tekton/go-ci-pipeline.yamlSplitting large pipelines with
compose:: When ascafctlsolution outgrows a single file, addcompose: [resolvers.yaml, actions.yaml, tests.yaml]soscafctlmerges partial files cleanly at load time (scafctl render solution --effective).
2. Wiring scafctl mcp serve for AI Authoring#
When AI agents write YAML from memory, people say they "hallucinate" fields,
when really they just lack schema context
and a deterministic validator to
test their drafts against. scafctl solves both with its built-in Model Context
Protocol (MCP) server (scafctl mcp serve),
already enabled in both OpenCode (opencode.jsonc) and Antigravity
(mcp_config.json):
{
"mcp": {
"servers": {
"scafctl": {
"type": "local",
"command": ["scafctl", "mcp", "serve"]
}
}
}
}(Use the same scafctl mcp serve stdio command in .vscode/mcp.json,
.cursor/mcp.json, or claude_desktop_config.json.)
Most Useful scafctl MCP Tools#
| When You Ask the AI To... | MCP Tool It Calls |
|---|---|
Check valid fields on solution, resolver, or workflow | explain_kind / get_solution_schema |
Inspect exact inputs/outputs of exec, file, metadata, or github | get_provider_schema |
| Test a CEL expression or Go template before saving | evaluate_cel / validate_expression |
| Lint a solution file for schema or dependency issues | lint_solution |
| Dry-run action order and resolved inputs safely | preview_resolvers / preview_action |
Run spec.testing.cases in isolated temp sandboxes | run_solution_tests |
3. Connecting Jira User Stories via MCP#
If your team tracks work in Jira, connect Atlassian's official OAuth 2.1 MCP
server alongside scafctl in ~/.config/opencode/opencode.jsonc (or
~/.gemini/config/mcp_config.json for agy):
{
"mcp": {
"servers": {
"scafctl": {
"type": "local",
"command": ["scafctl", "mcp", "serve"]
},
"atlassian": {
"type": "remote",
"url": "https://mcp.atlassian.com/v2/mcp"
}
}
}
}Once authenticated via your browser (opencode mcp auth atlassian if not
prompted automatically), the create-issue, jira-issues, planner, and
work-herd skills work with Jira tickets in plain English:
- Creating a Jira ticket: "Create a Jira ticket in PROJ for optional expiring promo links..."
- Skeptical triage & planning: "Have a look at PROJ-123 and come up with a detailed plan to implement it."
- Parallel Herdr sprint planning: "Look at my open Jira tickets in PROJ for the current sprint and come up with a Herdr plan."