publish

A command workflow for publishing a local repository to GitHub, a service for hosting Git repositories and collaborating on code. It checks the repository state and guides setup through the GitHub command-line tool.

In plain words
What is it for?
Use it to initialize or publish a repository, configure an existing GitHub project, choose public or private access, set a license, and optionally enable GitHub Pages.
Why use it?
It organizes decisions about the owner, visibility, description, license, and GitHub Pages before creating or updating the remote repository.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/defaultperson/agent-setup/publish
Clone the repo
git clone --depth 1 https://github.com/DefaultPerson/agent-setup

Made for: Claude Code.

Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,851 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00009 $0.01851
Opus 5 $0.00005 $0.00925
Sonnet 5 $0.00002 $0.00370
Haiku 4.5 $0.00001 $0.00185

Measured yesterday against content hash f0864f6cc5ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

publish scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/publish.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context

  • Remote: !git remote -v 2>/dev/null || echo "No remote"
  • Branch: !git branch --show-current 2>/dev/null || echo "Not a git repo"
  • GitHub repo: !gh repo view --json nameWithOwner,visibility,description --jq '"\(.nameWithOwner) (\(.visibility)) — \(.description)"' 2>/dev/null || echo "Not on GitHub yet"

Interactive repo publication workflow. Uses gh CLI for everything.

Algorithm

  1. Detect state: git remote -v — check if origin points to GitHub.

    • New repo (no origin): full creation flow (steps 2-13).
    • Existing repo (origin exists): update flow — go to step 2 to review/update settings.
    • No git repo: git init first.
  2. Ask questions (AskUserQuestion, single batch — all repos):

    • Owner: personal account or organization? List available with gh api user/orgs --jq '.[].login' + personal account from gh api user --jq .login.
    • Visibility: public / private / Keep current (existing repos only)
    • Description: show auto-detected (from README.md or CLAUDE.md), ask to use or enter custom
    • License: MIT (Recommended for public) / Apache-2.0 / GPL-3.0 / Keep current / None
    • GitHub Pages: Yes (MkDocs Material) / No / Keep current
    • Dependabot: Enable dependency updates? Yes / No / Keep current
    • CI workflow: Set up GitHub Actions CI? Yes (auto-detect stack) / No / Keep current
    • .gitignore: Generate smart .gitignore? Yes (auto-detect stack + scan repo) / No / Keep current
    • README.md: Scaffold README if missing? Yes / No
  3. Auto-detect (no user input needed):

    • Repo name: from current directory name
    • Topics: detect from stack files:
      • package.json → nodejs, javascript/typescript
      • pyproject.toml / requirements.txt → python
      • go.mod → golang
      • Cargo.toml → rust
      • Dockerfile → docker
      • Also infer from README content (keywords, frameworks)
    • For existing repos: fetch current values with gh repo view --json description,repositoryTopics,visibility and show diff

Read the full file on GitHub · 172 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 172 lines · 9 tokens per session scan A f0864f6cc5ce

Subscribe to this mod's changes

publish is a command published in the GitHub repository DefaultPerson/agent-setup (11 stars, last pushed 1mo ago), licensed MIT. It adds 9 tokens to every session and 1,851 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.