agentleFS
timmo001timmo001/skills/github-repository-setup/SKILL.md

github-repository-setup

Skill1 starsChanged 56 days agoApache-2.0View on GitHub

Create GitHub repositories with the preferred settings, ask about licensing using GitHub templates, enable watching during creation or induction, offer CI and automerge workflows, and finish first-push setup with a Development ruleset. Use when creating or inducting a GitHub repository, using gh repo create or dot repo induct, applying repository defaults, or completing initial GitHub setup.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use these defaults for personal repositories.

    line 10
  2. Very specific:

    Use the selected key for other licences.

    line 35
  3. Distinctive:

    Verify the final file against the retrieved source, allowing only the intended project-specific substitutions, and report the licence and …

    line 38
  4. Very specific:

    Read back from the selected HOST and OWNER/REPO:

    line 87

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitHub Repository Setup

Use these defaults for personal repositories. Resolve the authenticated account and destination owner at runtime. For organisation repositories, follow the owner's policy rather than automatically imposing personal settings.

For induction of an existing GitHub repository, resolve its actual host and owner/name from the selected remote, check Choose and create the licence, and complete Watch the repository after induction succeeds. Induction alone does not request the creation, settings, CI or ruleset steps below.

Workflow

  1. Resolve the destination and visibility before creation. Establish the host, owner, repository name and local source. Use an explicitly requested public/private choice, or infer it only from unambiguous task context such as a stated private project. An account's other repositories, a local directory, or GitHub's defaults do not establish visibility. If visibility is unspecified and cannot be inferred, ask public or private with the question tool before creating anything; fall back to chat when unavailable. Record the chosen visibility and its basis. Complete Choose and create the licence before creation or the first authorised push.
  2. Create the repository and apply the defaults. Check current gh repo create --help and gh repo edit --help. Pass the resolved owner/name and an explicit visibility flag to creation, with --disable-wiki. For an existing local repository, use its actual source and selected remote without overwriting another remote. A creation request alone does not authorise committing or pushing: use --push only when a push was explicitly requested. Apply the settings below as part of the requested setup and read them back. Complete Watch the repository once the repository exists, even if the first push is deferred. Report unsupported settings or policy/plan restrictions rather than claiming success.
  3. Offer missing workflows using relevant evidence. Inspect the destination's workflows, language, package manager, build/test commands, deployment targets and Renovate configuration. If CI is missing, offer to set it up. Base the recommendation on a small sample of related or heavily used repositories in the user's personal account: prefer matching stacks and release/deployment needs, recent successful runs and sustained maintenance. Show the source repositories, workflow paths and why they fit. A recent timestamp or high star count alone is not evidence of personal use. Resolve candidates dynamically rather than maintaining a hardcoded repository list. Keep private repository details and configuration out of public files.
    • Apply shared-workflows for reusable workflow selection and caller setup. Inspect the selected contracts at their pinned revisions and adapt to the destination's real commands. Offer relevant lint, build, test and release/deployment workflows, without copying unrelated jobs or inventing required secrets. Implement the accepted selection and validate it locally.
    • Inspect existing automerge workflows by behaviour, including .github/workflows/renovate-automerge.yml, reusable workflow calls and other workflows using gh pr merge --auto --squash. If missing, offer the matching automation. For personal setup using timmo001/workflows, source Renovate automation from its maintained reusable Renovate automerge workflow. Resolve the current default-branch SHA, inspect the contract at that exact revision and create a minimal job-level uses: caller pinned to it. Do not bundle a snapshot of its implementation in this skill. Confirm Renovate is configured or include its setup in the offer. Other automerge workflows should follow the owner-selected shared source's eligibility rules, triggers and token requirements. Reuse an existing shared caller; migrate an inline equivalent when replacing it is in scope.
  4. Complete the first push and Development ruleset in order. When a push is authorised, push the initial code and selected CI workflows, then establish successful CI on the pushed revision. Apply github-development-rulesets for ruleset selection, permissions, observed required-check identities and verification. If the first push already happened, resume here using the latest pushed revision. If CI is absent, make the workflow offer first; defer CI-backed enforcement until real checks exist. Keep test-check selection and policy decisions with the ruleset skill. Do not copy required-check names from another repository.
  5. Activate and verify selected automerge automation. The repository's auto-merge switch enables the capability; workflows opt eligible PRs into it. Put required checks and the Development ruleset in place before activating a new automerge workflow. --auto waits for merge requirements, not every workflow merely present in the repository. Preserve squash merging, bot/PR eligibility checks and required permissions. For the reusable Renovate workflow, use a pull_request_target caller with contents: write and pull-requests: write; its current contract needs no inputs or extra secrets. Let the shared workflow own bot filtering, merge commands and concurrency. Verify these details against the selected revision. Keep this privileged workflow metadata-only: no checkout or execution of PR code. Validate the selected workflows and confirm their behaviour on the next eligible PR when one is available; do not create or merge a PR just to test setup.
  6. Report the result. Include repository URL and visibility, licence choice and source, verified settings and watching status with the authenticated account, workflows added or retained with source refs, first-push/CI evidence, ruleset result, and any declined or deferred setup. If no push was authorised, clearly identify the post-push steps still pending.

Choose And Create The Licence

  • Inspect existing LICENSE*, COPYING* and package licence metadata first. Preserve an existing licence and its notices; do not replace it with the default. Ask about conflicting declarations before changing them.
  • When no licence exists, ask which licence to use with the question tool (chat fallback). For public repositories, offer Apache 2.0 (Recommended) first, another licence, or no licence. Apache 2.0 is the proposed default, not permission to apply it without an answer. For private repositories, ask whether to add a licence without assuming the public default. An explicit licence choice in the current request already answers the question.
  • Source the selected text from GitHub's licence templates, available through the Licenses API. Discover keys with gh repo license list or GET /licenses; Apache 2.0 uses apache-2.0. Retrieve the template body, for example:

    gh api --hostname "$HOST" licenses/apache-2.0 --jq .body

    Use the selected key for other licences. Fetch successfully before writing the root LICENSE file. Do not bundle internal template copies, reconstruct legal text from memory, or shorten it.

  • A licence from a known existing repository is also an acceptable source. Inspect its full text, verify the chosen licence and record the source path and commit. Account for project-specific notices rather than blindly copying another project's owner or year. If the source cannot be verified, report that and leave creation pending.
  • Fill project-specific template fields from the actual copyright holder and year, asking when unclear. Preserve legal terms and instructional examples. For an existing local source, add LICENSE locally and keep package licence metadata consistent with the selected SPDX identifier. Leave committing and pushing to explicit authorisation. For remote-only creation, GitHub can generate the file with gh repo create --license <key> when its initial commit is authorised; do not initialise a separate remote history for an existing local repository.
  • Verify the final file against the retrieved source, allowing only the intended project-specific substitutions, and report the licence and source URL or repository ref. If the user chose no licence, record that choice without creating a file.

Watch The Repository

Watching is part of creation and induction by default. Resolve the authenticated user on the selected HOST; the subscription belongs to that account, not the repository owner. Enable watching with notifications unignored, then read the subscription back:

gh api --hostname "$HOST" user --jq .login
gh api --hostname "$HOST" --method PUT "repos/$REPO/subscription" \
  -F subscribed=true -F ignored=false
gh api --hostname "$HOST" "repos/$REPO/subscription" \
  --jq '{subscribed, ignored}'

Require subscribed: true and ignored: false before reporting the repository as watched. Report authentication or API failures as incomplete setup. Honour an explicit request not to watch; do not assume repository ownership or creation automatically subscribes the user.

Repository Defaults

These are the requested baseline, so do not ask the user to reconfirm each switch.

SettingValue
WikisDisabled
ProjectsDisabled
DiscussionsDisabled
Allow merge commitsDisabled
Allow rebase mergingDisabled
Allow squash mergingEnabled
Squash default commit messagePull request title and commit details
Always suggest updating pull request branchesEnabled
Allow auto-mergeEnabled, supporting the selected automerge workflows
Automatically delete head branchesEnabled

Apply to the explicitly resolved repository URL (REPO_URL):

gh repo edit "$REPO_URL" \
  --enable-wiki=false \
  --enable-projects=false \
  --enable-discussions=false \
  --enable-merge-commit=false \
  --enable-rebase-merge=false \
  --enable-squash-merge \
  --squash-merge-commit-message=pr-title-commits \
  --allow-update-branch \
  --enable-auto-merge \
  --delete-branch-on-merge

Read back from the selected HOST and OWNER/REPO:

gh api --hostname "$HOST" "repos/$REPO" --jq '{
  full_name, visibility, has_wiki, has_projects, has_discussions,
  allow_merge_commit, allow_rebase_merge, allow_squash_merge,
  squash_merge_commit_title, squash_merge_commit_message,
  allow_update_branch, allow_auto_merge, delete_branch_on_merge
}'

Compare every field with the table. The squash setting must read back as squash_merge_commit_title: "PR_TITLE" and squash_merge_commit_message: "COMMIT_MESSAGES". Missing fields are unverified, not false. Scope the edit to these settings; repository visibility is resolved separately before creation.

Sources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.