From gh-guard
Generates a supply chain security config file from templates like CI workflows, deny.toml, rust-toolchain.toml, or dependabot.yml, auto-filling with detected project values.
npx claudepluginhub sbom-tool/gh-guard# /generate <target> — Single File Generator Generate a single supply chain security config file from a template, with auto-detected project values. ## Usage ## Available Targets | Target | Template | Output Path | |--------|----------|------------| | `ci-workflow` | `templates/workflows/ci.yml` | `.github/workflows/ci.yml` | | `publish-workflow` | `templates/workflows/publish.yml` | `.github/workflows/publish.yml` | | `codeql` | `templates/workflows/codeql.yml` | `.github/workflows/codeql.yml` | | `scorecard` | `templates/workflows/scorecard.yml` | `.github/workflows/scorecard.yml` |...
/harden-actionsPin GitHub Actions to SHAs, fix permissions, and flag dangerous triggers
/gen-github-dirGenerates complete .github directory for Go projects with GitHub Actions workflows, Dependabot config, and funding setup. Supports --force, --minimal, --dry-run flags.
/cc-cicdGenerates, audits, or templates CI/CD workflows for GitHub Actions, GitLab CI, or Azure Pipelines, integrating Claude Code for PR reviews, testing, code generation, and security scanning.
/generateGenerates a complete wiki for the current repo as a VitePress site with catalogue, onboarding guides, pages, dark-mode Mermaid diagrams, and citations.
/generateGenerates a Context Field with name, one-sentence description, and up to 5 specific inhibition constraints from a failure description, including root cause analysis.
/generateGenerates ADVPL/TLPP code for TOTVS Protheus: functions, classes, MVC structures, REST APIs, web services, entry points, reports, and more via <type> [name] [--module].
Share bugs, ideas, or general feedback.
Generate a single supply chain security config file from a template, with auto-detected project values.
/generate <target>
| Target | Template | Output Path |
|---|---|---|
ci-workflow | templates/workflows/ci.yml | .github/workflows/ci.yml |
publish-workflow | templates/workflows/publish.yml | .github/workflows/publish.yml |
codeql | templates/workflows/codeql.yml | .github/workflows/codeql.yml |
scorecard | templates/workflows/scorecard.yml | .github/workflows/scorecard.yml |
fuzz | templates/workflows/fuzz.yml | .github/workflows/fuzz.yml |
deny-toml | templates/deny.toml | deny.toml |
rust-toolchain | templates/rust-toolchain.toml | rust-toolchain.toml |
dependabot | templates/dependabot.yml | .github/dependabot.yml |
security-md | templates/SECURITY.md | SECURITY.md |
release-script | templates/release.sh | scripts/release.sh |
osv-scanner | templates/osv-scanner.toml | osv-scanner.toml |
Parse the argument to determine which template to use. If no argument or invalid target, show the available targets table above and ask the user to choose.
Read project files to fill in placeholders:
| Placeholder | Detection Method (prefer cargo metadata, fall back to parsing) |
|---|---|
{{CRATE_NAME}} | cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].name' — fallback: sed -nE 's/^name = "([^"]+)"/\1/p' Cargo.toml | head -1 |
{{MSRV}} | cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].rust_version // empty' — fallback: sed -nE 's/^channel = "([^"]+)"/\1/p' rust-toolchain.toml |
{{REPO_OWNER}} | `git remote get-url origin | sed -E 's |
{{REPO_NAME}} | `git remote get-url origin | sed -E 's |
{{CONTACT_EMAIL}} | cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].authors[0]' | sed -E 's/.*<([^>]+)>.*/\1/' — fallback: ask user |
{{FUZZ_TARGETS}} | Parse fuzz/Cargo.toml for [[bin]] name = "..." entries |
{{WORKSPACE_CRATES}} | cargo metadata --no-deps --format-version=1 | jq -r '[.packages[] | select(.publish != false)] | sort_by(.dependencies) | .[].name' — filtered by publishable crates, in dependency order |
Important: cargo metadata handles workspace inheritance, TOML edge cases, and multi-line fields correctly. Always prefer it over sed parsing. Only fall back to sed if cargo metadata fails (e.g., no Cargo.toml or broken manifest).
If a required value can't be detected, ask the user.
If the output file does NOT exist, proceed to Step 4.
If the output file already exists:
{{PLACEHOLDER}} tokens with detected values (but do not write yet)--- existing .github/workflows/ci.yml
+++ generated from template
@@ -1,4 +1,4 @@
-old line
+new line
{{PLACEHOLDER}} tokens with detected values.github/workflows/, scripts/)release-script: make executable (chmod +x)Show target-specific notes:
ci-workflow:
publish-workflow:
crates-io environment in repo Settings > Environmentsgh workflow run publish.yml -f tag=vX.Y.Zcodeql:
scorecard:
api.securityscorecards.devfuzz:
matrix.target list with your actual fuzz target namescargo fuzz init && cargo fuzz add <target_name>deny-toml:
rust-toolchain:
dependabot:
security-md:
release-script:
gh CLI installed and authenticatedgit config user.signingkey)scripts/release.sh X.Y.Zosv-scanner: