Embedded Agent Skills
This guide explains how Go SDK Generator includes its product skills inside its own binary. For installing and using skills, see the Agent Skills guide and product reference.
Source, mirror and installed copies
generator/templates/*.skill.md.tmpl
| generate from generate.yml
v
.agents/skills/<product-skill>/
| copy selected complete directories after rendering
v
generator/skills/<product-skill>/
| go:embed at build time
v
go-sdk-generator binary
| agent --init in a target repository
v
<target>/.agents/skills/<product-skill>/
The templates are the source of the generated instructions. .agents/skills/ is the repository's discovery location and also contains handwritten contributor skills. generator/skills/ is a generated build input, not a second independently maintained implementation.
The mirror exists because Go's go:embed paths are relative to the package directory and cannot reach a parent directory using ... Keeping the selected skills inside the generator package lets the binary provide them without downloading the source repository.
Generation responsibilities
Generate coordinates the stages. Skill naming, metadata catalogues, installation paths and generation helpers live together in skill_extension.go:
addAgentFilesselects agent instructions and product skills whenever a CLI is defined.addSkillQualityFilesselects the generic guide and validation workflow. Generated workflows always callARM-software/go-sdk-generator/actions/validate-skills@latest, including when command actions are disabled. The generator's own local workflow and action implementation are handwritten repository customizations, not template outputs.copyGoSDKGeneratorSkillsForEmbeddingcoordinates the build-time mirror, after the product skill templates have been rendered.discoverEmbeddedSkillFileswalks the selected directories and returns their regular files, including nested references, examples and scripts.copyEmbeddedSkillFilecreates parent directories and copies one resource with its source permission bits.
The embedding step runs only when the manifest's package_name is go-sdk-generator. Ordinary generated CLI projects receive skills, documentation and a workflow referencing the shared validation action, but are not automatically given an embedded-skills API or an agent --init command.
embeddedAgentSkillPaths in skills.go selects the generator's three product directories: run, install and GitHub Action integration. Each listed SKILL.md identifies a directory; the mirror includes the whole directory, not just that file. Unregistered contributor skills are not copied. Missing source directories are skipped.
Overwrite rules and resource changes
Discovered mirror files are registered with the agent overwrite group before copying. Consequently, excluding that group also protects supporting resources. Exact file selectors still apply; when selecting individual outputs, include both the source and mirror paths if both should be refreshed.
Copying is an overlay: it updates selected files and does not prune obsolete mirror files. When removing or renaming a resource, review and remove its obsolete mirror explicitly. Keep generator/skills/ free of unrelated content: //go:embed all:skills includes the entire tree, including hidden files.
When adding a new embedded product skill, update its template/generation wiring and the directory selection in embeddedAgentSkillPaths. Review the catalogue too. Adding a file inside an already selected directory does not require another registry entry. metadata.scope describes the audience but does not change this explicit embedding selection.
Building and installing
- Change the appropriate skill template, or supporting resources in the selected source skill directory.
- Build the generator CLI and regenerate this repository from
generate.yml, following generate and regenerate a project. Ensure the agent outputs and their mirror are included by any generation selectors. - Review
.agents/skills/andgenerator/skills/together. - Rebuild the CLI after refreshing the mirror. The binary used to perform regeneration contains the old embedded files; editing files on disk does not change an already-built binary.
- In a temporary target repository, run the rebuilt binary's
agent --initcommand and inspect the installed skills.
EmbeddedAgentSkills() reads the compiled tree. InitialiseAgentSkills() writes those files under the target repository's .agents/skills/, creating nested directories as needed. New files are written with mode 0644; scripts under a scripts/ directory with a shebang use 0755 (subject to the operating system's permission handling). Existing matching target files are overwritten; unrelated files are not removed. This is an explicit command, not a package-install hook.
DEB/RPM packages follow a separate, broader delivery path: GoReleaser packages the entire .agents/skills/ collection into /etc/<package-name>/.agents/skills/, including handwritten manifest-authoring skills and contributor workflows. APK retains its original explicit entries for the three generated SKILL.md files because of the nfpm tree-packaging issue. Scope is informational and does not filter either delivery path.
Handwritten repository customizations
Shared templates contain no generator-specific package-name branches. This repository maintains its own agent --init documentation and local-action workflow in the files initially generated from those templates. The validation action and its Python support files are maintained directly under actions/validate-skills/ and are never regenerated.
When dogfooding, preserve the customized README, SDK/CLI reference, skills guide and workflow. Use exact file exclusions such as:
--exclude-files README.md,DOCUMENTATION.md,guides/agent-skills.md,.github/workflows/skills.yml
To refresh their generic sections, generate into a temporary directory, review the diff and apply the relevant changes by hand. Keep the generator-specific agent --init, local validation and release notes in this repository rather than adding conditions to shared templates.
Verification
Run the local validation commands. Validation checks that the repository and embedded copies have matching complete file inventories and content, normalising text line endings. Those intentional mirrors are the only duplicate-name exception; other duplicate names fail validation.
The Go tests in skills_test.go cover embedded loading, explicit installation, recursive resource copying and overwrite protection. The generation tests verify that CLI projects receive skill outputs and library-only projects do not. Regeneration changes should follow the integration/regression workflow.