auto-repo-setup

Diagnose and repair repository setup, Git workflows, and startup hooks for Claude Code or Codex.

1.4k|216|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/daymade/claude-code-skills --skill auto-repo-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auto-repo-setup
Source: https://github.com/daymade/claude-code-skills/tree/main/auto-repo-setup
Command: npx skills add https://github.com/daymade/claude-code-skills --skill auto-repo-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Repositories often fail to run on new machines, onboarding instructions are missing or outdated, SessionStart hooks fire unexpectedly, and Git operations like sync, push, or history cleanup carry real risk. This Skill provides an evidence-driven workflow to diagnose environment failures, standardize onboarding, audit hooks, and apply guarded Git safety gates without changing how the user normally works.

Core Features & Use Cases

  • Environment Repair: Runs a read-only, stack-aware capability inventory (scripts/check_env.py) that detects toolchains from manifests and lockfiles, then repairs root causes and verifies with the project's real smoke test.
  • Git Safety Gates: Enforces guarded workflows for sync, commit, push, conflict resolution, and secret/PII history cleanup, including hosting-service visibility checks before any push.
  • Startup Hook Management: Diagnoses duplicated SessionStart output across all hook scopes and installs a single guarded, idempotent Claude Code startup nudge via scripts/init_session_start_hook.py with dry-run preview and managed removal.
  • Use Case: A teammate clones a TypeScript repository that will not start. The Skill reads project instructions and lockfiles, detects npm from package-lock.json, repairs the missing prerequisite, runs the documented start command, and reports verified results without inventing Python or .env requirements.

Quick Start

Ask the agent to diagnose why this repository will not run and repair the environment using the auto-repo-setup workflow.

Frequently Asked Questions about auto-repo-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a repository that will not run on a new machine?

Read the project instructions and manifests first, then run the read-only check_env.py inventory to detect missing toolchains from lockfiles. Repair each root cause with the smallest project-consistent change and verify with the project's documented smoke test or start command.

How to safely sync a Git repository before starting work?

Inspect branch, upstream, and working-tree state first. Run git pull --ff-only only when the tree is clean; never auto-stash, merge, rebase, or force when local changes exist or histories diverged. Report the state instead of hiding it.

Why does my SessionStart hook message appear multiple times?

Repeated output does not prove duplicate registration. Enumerate hook entries across project, local, user, managed, and plugin scopes, then correlate firings with root, resumed, compacted, and subagent sessions before editing any configuration.

Does this work with Codex as well as Claude Code?

Yes, but startup behavior differs by runtime. Codex repositories should use AGENTS.md for stable instructions; do not copy a Claude Code SessionStart hook into Codex without verifying the installed version's payload and root/subagent behavior.

When should I use a lifecycle hook instead of project instructions?

Use a hook only when behavior must occur before the first prompt and an agent instruction cannot achieve it. Static rules belong in AGENTS.md or CLAUDE.md; the hook gate in the references requires a concrete answer before installing anything.

What approvals are required before pushing or rewriting Git history?

Verify repository visibility through the hosting service API before any push. Public pushes, force pushes, and history rewrites require explicit user approval, and leaked credentials must be revoked before history cleanup is considered complete.