Generated banner for Open Sourcing
Generated logo for Open Sourcing

Open Sourcing

Trail of BitsOfficialPublished by Trail of Bits

  • Skill
  • Workflow
  • Software development
  • CC-BY-SA-4.0
  • Low risk
  • Has scripts

From the author

This skill should be used when the user asks to "open source this project", "prepare this repository for public release", "make this repo public", "check open-source readiness", "choose a license for this project", or "set up release automation" ahead of a public launch. Provides a release-readiness workflow covering secrets hygiene, licensing, documentation, CI, and language-specific packaging.
— the description by Trail of Bits

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured, step-by-step procedure to transition a private repository to a public open-source project. It prioritizes security by mandating a thorough secrets audit before any other preparation steps. The workflow covers essential release readiness, including documentation standards, licensing, CI/CD configuration, branch protection, and language-specific packaging requirements. It is designed to ensure that a project is maintainable, secure, and accessible to external contributors from the moment it is made public.

What it does

  • Performs a critical secrets audit to prevent accidental exposure of sensitive data.
  • Evaluates repository readiness using a checklist of standard open-source requirements.
  • Guides the user through selecting and applying appropriate open-source licenses.
  • Standardizes documentation including README, SECURITY.md, and contribution guidelines.
  • Configures CI/CD pipelines for testing, linting, and automated release management.
  • Provides language-specific guidance for common ecosystems like Python, Go, Rust, and C/C++.

When to use it

  • When preparing to make a private repository public.
  • When auditing an existing public repository to improve its release quality.
  • When you need to choose a license for a new project.
  • When setting up automated packaging, versioning, or release workflows for a launch.

Advantages

  • Reduces the risk of leaking credentials or sensitive client data.
  • Ensures a professional and consistent standard for new open-source projects.
  • Automates repetitive release tasks through CI/CD integration.
  • Provides clear, actionable steps for complex tasks like license selection and branch protection.

Usage examples

“I want to open source this project, where do I start?”
The agent will initiate the workflow, starting with the organization profile detection and the critical secrets audit.
“How do I check if my repo is ready for public release?”
The agent will run the readiness check script to identify missing documentation, license files, or CI configurations.
“What license should I use for my new Go project?”
The agent will provide guidance on license selection based on the project's goals and the organization's policy.
“Help me set up release automation for my repository.”
The agent will guide you through configuring CI-driven releases, tagging, and trusted publishing practices.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/trailofbits/open-sourcing/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip open-sourcing.zip -d .agents/skills

Documentation by Trail of Bits

Open-Sourcing a Repository

Prepare a repository for public release so that an outsider with no prior context can build, use, and contribute to it — and so that nothing sensitive ships with it. Work through the steps in order; the secrets audit comes first because its outcome (keeping vs. recreating the repository) affects everything after it.

When to Use

  • Making a private repository public

  • Auditing an existing public repository for release quality ("make it official")

  • Choosing a license for a project

  • Setting up packaging, versioning, or release automation ahead of a public launch

When NOT to Use

  • Routine development on an already-released project (no release event)

  • Auditing third-party code for vulnerabilities (use a security-review skill)

  • Publishing a package from a repository that will stay private — only the release-management steps apply; skip the rest

Workflow

Step 1: Detect the organization profile
bash {baseDir}/scripts/detect_org.sh

The script inspects git remotes and recent committer emails, and prints a profile name. If it prints trailofbits, read references/trailofbits.md now and apply its license policy, publishing accounts, and process notes throughout the remaining steps. If it prints generic, proceed with the generic guidance alone. If the user says the detection is wrong, trust the user.

Step 2: Audit for secrets — before anything else

A repository that has ever contained secrets (API keys, credentials, client data) should not be flipped public. History rewriting is error-prone and does not reach forks, caches, or CI artifacts. The reliable fix is a fresh repository: copy the current tree over, commit, and archive the old repository privately.

  1. Ask whether the project ever handled secrets or client-confidential material. For a security consultancy's tooling, also ask whether test fixtures or example data came from client engagements.

  2. Scan the full history with a dedicated tool if available — gitleaks git . or trufflehog git file://. — rather than eyeballing.

  3. Check beyond the git tree: GitHub Actions logs and artifacts, old releases, issue and PR history, and the repository wiki all become public with the repository.

  4. After going public, enable GitHub secret scanning and push protection in the repository settings.

Reject these rationalizations — this is the one step that cannot be fixed after publication:

  • "The key was revoked, so the history is fine." Revoked credentials still leak infrastructure names, internal URLs, and patterns attackers use for targeting.

  • "We'll rewrite history with git-filter-repo." Rewrites miss forks, clones, caches, and CI artifacts; the fresh-repository approach does not.

  • "It's only test data." Fixtures derived from client engagements or production systems are confidential regardless of how they are labeled.

Step 3: Run the readiness check
bash {baseDir}/scripts/check_readiness.sh

The script prints a checklist of presence indicators (README, LICENSE, CONTRIBUTING, SECURITY.md, CI, tests, semver tags, ...) and warns about tracked files that commonly contain secrets. Treat unchecked items as discussion prompts, not hard failures — a research prototype does not need everything a flagship library needs. Walk through the gaps with the user and fix the ones that matter for this project.

Step 4: Documentation

The README is the project's front door. Confirm it explains:

  • What the project is and what problem it solves (first paragraph)

  • How to install it — package manager, container image, or build from source; a fresh-clone build must work using only what is in the repository

  • How to use it — at least one concrete, copy-pasteable example

  • How to contribute — inline or via CONTRIBUTING.md

  • The license — a short section naming it

Also add:

  • SECURITY.md with vulnerability-reporting instructions (a contact address or GitHub private vulnerability reporting). For security tooling this is table stakes.

  • API documentation, built and hosted (GitHub Pages via CI is the usual route), linked from the README and the repository website field. See the language references below for per-ecosystem doc tooling.

  • A code of conduct if the project expects outside contributors.

Step 5: Licensing

No license means not open source, regardless of visibility. Read references/licensing.md for selection criteria and mechanics. The short version:

  1. Apply the organization's policy if one was detected in Step 1.

  2. Otherwise: Apache 2.0 as the permissive default, AGPLv3 when private modification by competitors is a real concern, Creative Commons for non-code artifacts.

  3. Add the LICENSE file, set SPDX identifiers in package metadata, state the license in the README, and verify all three agree.

Step 6: Tests and CI
  • Confirm the test suite exists and passes; a public repository with a failing default branch signals abandonment.

  • Ensure CI runs the tests on every PR, across the supported language-version and platform matrix.

  • Enforce formatting and linting in CI (per-language tooling in the references below), so style debates never reach review.

  • Respect existing tooling. Do not replace a working formatter, linter, or type checker as part of open-sourcing. If it lags the current generation (the language references name the current tools), warn the maintainer and let them decide; only when a category is missing entirely — no type checker, no formatter — add the current default.

  • Consider a coverage gate that fails CI when coverage drops.

  • Harden the workflows themselves before they become public attack surface:

    • Pin third-party actions to full commit SHAs; enable Dependabot for github-actions so pins stay current.

    • Set least-privilege permissions: blocks (start from permissions: {}).

    • Audit with zizmor .github/workflows/ and lint with actionlint.

Step 7: Repository settings
  • Branch protection on the default branch: no force pushes, PRs required. Prefer rulesets for new repositories; classic branch protection remains supported.

  • Merge protection: required status checks so PRs cannot merge with failing tests.

  • Dependabot or Renovate for dependency and Actions updates. Group updates to cut PR noise, and set a cooldown window (e.g., 7 days) so freshly published — and occasionally hijacked — versions age before adoption.

  • .editorconfig so contributors' editors agree on whitespace basics.

  • Labels: create them as soon as more than one issue or PR needs one; prefixes for facets scale well (C: component, P: platform). See blight's labels for a worked example.

Step 8: Releases and versioning
  • Tag every release vX.Y.Z, following semver; use -rc.N / -pre.N suffixes for release candidates and prereleases.

  • Make releases CI-driven: pushing a tag (or publishing a GitHub Release) triggers build, packaging, and upload with no manual steps. A release should be git tag vX.Y.Z && git push origin vX.Y.Z.

  • Publish packages under an organization-owned account, not a personal one, and use trusted publishing (OIDC) instead of long-lived tokens wherever the index supports it.

Step 9: Language-specific practices

Identify the project's languages from its marker files and read the matching reference for packaging, publishing, and quality tooling:

Marker fileReference
pyproject.toml, setup.pyreferences/python.md — defers to the modern-python skill for tooling
CMakeLists.txt, Makefile (C/C++)references/c-cpp.md
Cargo.tomlreferences/rust.md
go.modreferences/go.md
package.jsonreferences/javascript.md
Gemfile, *.gemspecreferences/ruby.md

For other ecosystems, apply the cross-cutting principles: reproducible builds from a fresh clone, CI-driven releases, trusted publishing or organization-owned accounts, and license metadata in the package manifest.

Final Review

Before the visibility switch is flipped, verify from an outsider's perspective:

  1. Clone into a clean directory and follow the README's build instructions verbatim — do they work with no tribal knowledge?

  2. Re-run {baseDir}/scripts/check_readiness.sh and confirm the remaining gaps are deliberate choices, stated to the user.

  3. Confirm the secrets audit (Step 2) actually happened; it is the one step that cannot be fixed after publication.

Making the repository public is then a repository-settings change. Pair the release with an announcement where the organization has a process for one.

Additional Resources

Reference Files
Scripts
  • scripts/detect_org.sh — prints the organization profile (trailofbits or generic) from git remotes and committer emails

  • scripts/check_readiness.sh — prints presence indicators for release-readiness files and flags tracked files that commonly hold secrets

Files

references/licensing.md

Choosing and Applying an Open-Source License

A repository is not open source until it has a license. Without one, default copyright applies and nobody can legally use, modify, or redistribute the code regardless of it being publicly visible.

Decision criteria

Choose a license based on the answers to these questions, in order:

  1. Does the organization have a license policy? Apply it. If an organization profile was loaded in Step 1 of the workflow, its policy takes precedence over the generic guidance below.

  2. Is this software at all? Datasets, detection rulesets, documentation, and publications are often better served by Creative Commons licenses than software licenses.

  3. Would competitors gain a significant advantage by modifying this work without contributing changes back? If yes, a network-copyleft license (AGPLv3) protects against service providers privatizing improvements.

  4. Do the project's dependencies constrain the choice? A project that statically links GPL code cannot be released under a permissive license. Check dependency licenses before deciding.

  5. What does the ecosystem expect? Libraries intended for broad adoption (especially ones businesses must get legal approval to use) see far more uptake under permissive licenses.

Common choices

LicenseTypeChoose when
Apache 2.0PermissiveDefault for libraries and tools; includes an explicit patent grant, which MIT lacks
MITPermissiveMaximum simplicity; ecosystem convention (e.g., much of npm)
AGPLv3Network copyleftThe project offers competitors a significant advantage if modified privately, including as a hosted service
GPLv3CopyleftCopyleft desired but the network-use clause is not needed
CC BY-SA 4.0Share-alike (non-software)Publications and documentation; allows commercial use with attribution
CC BY-NC-SA 4.0Non-commercial (non-software)Rulesets or datasets where commercial use should require a separate agreement

Avoid novel, custom, or "source-available" licenses (BSL, custom non-competes) unless legal counsel is driving that decision; they create adoption friction and are not open source under the OSD.

Applying the license

Choosing is half the job. Then:

  • Add a LICENSE file at the repository root containing the full license text. For Apache 2.0, fill in the copyright notice; for CC licenses, link the legal code and state the license clearly in the README.

  • Set the license in package metadata using SPDX identifiers so package indexes display it correctly:

    • Python: license = "Apache-2.0" (SPDX expression, PEP 639) in pyproject.toml

    • Rust: license = "Apache-2.0" in Cargo.toml

    • Ruby: spec.license = "Apache-2.0" in the gemspec

    • Node: "license": "Apache-2.0" in package.json

  • State the license in the README, typically a short section at the end.

  • Keep all of these consistent. A LICENSE file that says AGPLv3 with pyproject.toml metadata that says MIT is a real (and common) bug.

A copyright line uses the current year only; open-ended ranges ("2020-present") add nothing legally:

Copyright (c) 2026 Example Org <[email protected]>

Forks and adopted projects

When taking over maintenance of an existing open-source project:

  • Keep the existing license and add a copyright line for the new maintainer below the original:

    Copyright (c) 2019 John Q. Public <[email protected]>
    Copyright (c) 2026 Example Org <[email protected]>
  • Do not relicense unless every copyright holder agrees or the original license explicitly permits it. Permissively licensed projects may be re-released under a stronger license for new contributions, but the original code remains under its original terms and the original notices must be preserved.

When in doubt about any licensing question, consult whoever handles legal or open-source policy for the organization before publishing.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an API key, Needs Python

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Trail of Bits
Publisher
Trail of Bits (Official)
Source
trailofbits/skills · plugins/open-sourcing/skills/open-sourcing · commit e4dd0bb
Licence
Creative Commons Attribution-ShareAlike 4.0 International (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Trail of Bits or Trail of Bits.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download open-sourcing.zip