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:

ENV 01 // LAPTOP Local Terminal scafctl run action ci -f ci/go-ci/actions.yaml
ENV 02 // GITHUB GitHub Actions ci/github-actions/ci.yml
ENV 03 // KUBERNETES Tekton v1 Pipeline ci/tekton/go-ci-{task,pipeline}.yaml
SINGLE SOURCE // ci/go-ci/actions.yaml
SETUP install-tools Detects OS/arch (Linux, macOS, Windows) and ensures Go 1.26+, golangci-lint & gosec.
fmt-check (gofmt) vet (go vet) lint (golangci-lint) gosec (security) test (-race + coverage)
FINAL ARTIFACT build (go build -trimpath) Compiles only when every lint, security, race, and coverage check passes.

Supported Parameters (-r key=value)#

ParameterDefaultDescription
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_coverage70Minimum 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
racetrueRun go test -race when a C compiler and supported OS/arch are present
run_linttrueRun pinned golangci-lint
run_gosectrueRun 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.yaml

Copy 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=70

Apply 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.yaml

Splitting large pipelines with compose:: When a scafctl solution outgrows a single file, add compose: [resolvers.yaml, actions.yaml, tests.yaml] so scafctl merges 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 workflowexplain_kind / get_solution_schema
Inspect exact inputs/outputs of exec, file, metadata, or githubget_provider_schema
Test a CEL expression or Go template before savingevaluate_cel / validate_expression
Lint a solution file for schema or dependency issueslint_solution
Dry-run action order and resolved inputs safelypreview_resolvers / preview_action
Run spec.testing.cases in isolated temp sandboxesrun_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."