Automated summary
Engineering guide for working in the gcx repository, a Go CLI for cross-compilation, publishing, and deployment.
Strengths
- Provides a precise map of the internal architecture and package responsibilities.
- Gives concrete procedures for adding CLI commands, config fields, and publish or deploy providers.
- Captures project conventions for validation, templates, and factories.
Limitations
- Highly specific to the gcx repository and its internal APIs.
- Assumes familiarity with Go, urfave/cli/v3, and the project’s interfaces.
- Does not explain operational setup of real S3 or SSH targets in depth.
Use it whenever a task changes code, configuration, or tests in the gcx repository.
Avoid it when building another Go cross-compilation tool or when simply using gcx on the command line without modifying its code.
Security analysis
SafeThe skill is a documentation and development guide for the gcx codebase. It contains no executable commands that would harm the user's environment, no data exfiltration, no obfuscated payloads, and no instructions to disable safety. References to SSH, S3 publishing, and hook execution are descriptive of existing project architecture, not directives for the agent to perform risky actions. Since no tools are declared and the skill is non-invocable, there is no meaningful execution risk.
No concerns found
How this analysis is madeExamples
In the gcx codebase, add a new publish provider for an S3-compatible service. Implement the Publisher interface, add BlobConfig fields and validation, register it in the factory, and update examples/gcx.yaml.In gcx, add an ArchiveConfig option to control whether zip archives are created, including the YAML tag, validation, and an updated example config.Help me trace why the gcx build command is not passing the correct version template into archive creation; inspect the relevant internal/build and internal/tmpl code paths and suggest a fix.name: gcx description: > Go cross-compilation, build, publish, and deploy CLI tool (github.com/sxwebdev/gcx). Use this skill whenever working in the gcx codebase — editing build/publish/deploy logic, CLI commands, config structs, archive creation, SSH/S3 publishing, deployment alerts, or tests. Also triggers when code imports "sxwebdev/gcx", references gcx.yaml configuration, or when the user mentions: gcx CLI, Go cross-compilation tool, gcx build, gcx publish, gcx deploy, gcx release changelog, gcx config init, BlobConfig, BuildConfig, DeployConfig, ArchiveConfig, HooksConfig, Publisher, Deployer, Archiver, AlertData, shoutrrr alerts, or GoReleaser alternative. user-invocable: false
gcx — Go Cross-Compilation & Deploy Tool
Overview
gcx is a lightweight CLI tool for cross-compiling Go binaries and publishing them to S3 or SSH servers. It reads YAML configuration (gcx.yaml), manages secrets via .env files, uses git tags for versioning, and supports deployment with notifications.
The codebase follows a clean package architecture with each concern separated into its own package under internal/.
Architecture
See references/architecture.md for the full codebase map including file layout, key packages, and data flow.
Key packages:
cmd/gcx/main.go— thin CLI layer (~200 lines): command definitions, flag wiring, package orchestrationinternal/config/— all config structs, YAML loading, comprehensive validationinternal/build/— build orchestration, BuildArtifact struct, archive creationinternal/archive/— Archiver interface with tar.gz and zip implementationsinternal/publish/— Publisher interface with S3 and SSH implementationsinternal/deploy/— Deployer interface with SSH implementationinternal/notify/— notification sending via shoutrrrinternal/git/— git operations (tag, changelog, commit hash)internal/sshutil/— shared SSH client factory, known hosts managementinternal/tmpl/— shared template processing utilityinternal/hook/— hook execution viash -cinternal/shellutil/— shell escaping utilitiesinternal/helpers/— path expansion utility
Configuration Schema
See references/config-schema.md for the complete config schema with all fields, types, defaults, and template variables.
Instructions
Adding a new CLI command
- Define the command in
cmd/gcx/main.goinside thecli.Commandtree - Use
urfave/cli/v3patterns —cli.CommandwithName,Usage,Flags, andAction - The action handler receives
context.Context— pass it to all package functions - Access config via
config.Load(cmd.String("config"))when the command needs configuration
Modifying config structs
- Add the new field to the appropriate struct in
internal/config/config.go - Include the
yaml:"field_name,omitempty"tag - Add validation in the struct's
Validate()method - Update
examples/gcx.yamlto document the new field
Adding a new publish provider
- Create a new file
internal/publish/{provider}.go - Implement the
Publisherinterface:Name() stringandPublish(ctx, artifactsDir, version) error - Add provider-specific fields to
config.BlobConfigwithyaml:"...,omitempty"tags - Add validation in
BlobConfig.Validate()for the new provider - Register the provider in
publish.NewPublisher()factory - Use
tmpl.Process()for directory template processing - Use
sshutil.NewClient()if the provider needs SSH (eliminates code duplication)
Adding a new deploy provider
- Create a new file
internal/deploy/{provider}.go - Implement the
Deployerinterface:Name() stringandDeploy(ctx) error - Add provider-specific fields to
config.DeployConfig - Add validation in
DeployConfig.Validate() - Register in
deploy.NewDeployer()factory
Working with templates
gcx uses internal/tmpl.Process() — a wrapper around Go's text/template:
result, err := tmpl.Process("name", templateStr, data)
Template data for builds:
{{.Version}}— git tag{{.Commit}}— short commit hash{{.Date}}— RFC3339 build timestamp{{.Env.VAR_NAME}}— environment variable (security-filtered)
For archive naming (ArchiveTemplateData): {{.Binary}}, {{.Version}}, {{.Os}}, {{.Arch}}
Adding deployment alerts
Alerts use the shoutrrr library via internal/notify/.
notify.Send(urls, notify.AlertData{
AppName: "myapp",
Version: "v1.0.0",
Status: "Success",
})
Error handling patterns
- Wrap errors with context:
fmt.Errorf("doing X: %w", err) - All config structs have
Validate()methods - Alert failures are logged but don't block deployment
- Hook failures stop execution immediately
- Git command failures return sensible defaults ("0.0.0" for tag, "none" for commit)
Building and testing
make build # builds to ./bin/gcx
go test ./... # run all tests
make docker-build # build Docker image
make install # go install
Key principles
-
Clean package architecture: Each concern is in its own package.
cmd/gcx/main.gois a thin CLI layer that wires packages together. -
Interfaces for providers:
Publisher,Deployer, andArchiverinterfaces enable testability and easy extension via factory functions. -
Shared SSH client factory:
sshutil.NewClient()eliminates SSH client code duplication between publish and deploy. -
Shell safety: Hooks run via
sh -c(not naivestrings.Fieldsparsing). SSH remote commands useshellutil.Quote()for shell escaping. -
Context propagation: All operations accept
context.Contextfor cancellation support. -
Template safety: Environment variables are selectively exposed — only vars explicitly referenced in
{{.Env.X}}patterns are loaded. -
Structured artifact metadata:
build.Artifactcarries binary name, version, OS, arch as structured data — no fragile filename parsing. -
Parallel builds:
errgroupwith configurable concurrency limit handles concurrent compilation and archiving.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/gcx-go-cross-compilation-deploy-tool-mrzxuq5x/download' --output '.skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x/SKILL.md.part' && mv '.skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x/SKILL.md.part' '.skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x/SKILL.md' && test -s '.skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/gcx' && cp -R '.skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x' '.claude/skills/gcx'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x'openskills read 'gcx-go-cross-compilation-deploy-tool-mrzxuq5x'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/gcx-go-cross-compilation-deploy-tool-mrzxuq5x/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.