|
| 1 | +--- |
| 2 | +name: git-setup-skill |
| 3 | +description: Prepares Git/GitHub repositories with .gitignore, .gitattributes, README files, licensing, metadata, tags, releases, and GitHub Actions. Use when the user wants to set up or professionalize a repository, add documentation or licensing, configure CI, or prepare releases and repo metadata. |
| 4 | +--- |
| 5 | + |
| 6 | +# Git Repo Setup |
| 7 | + |
| 8 | +Use this skill when the user wants to professionalize a Git/GitHub repository. The skill should inspect before writing, infer as much as possible from the repo, and behave like a technical advisor: not just generating files, but recommending decisions with clear reasoning. |
| 9 | + |
| 10 | +## What This Skill Owns |
| 11 | + |
| 12 | +- Inspecting the repo before proposing changes |
| 13 | +- Classifying the project type: library, app, CLI, template, internal repo, or demo |
| 14 | +- Creating or refining `.gitignore` and `.gitattributes` |
| 15 | +- Generating or improving `README.md` with useful content |
| 16 | +- Recommending and adding an appropriate license |
| 17 | +- Configuring repository metadata: description, topics, and homepage when relevant |
| 18 | +- Configuring GitHub Actions for CI and releases when they make sense |
| 19 | +- Evaluating community health files such as `CODE_OF_CONDUCT.md`, `SECURITY.md`, and issue/PR templates |
| 20 | +- Guiding tags and releases with `git` and `gh` |
| 21 | + |
| 22 | +## Primary Use Cases |
| 23 | + |
| 24 | +- "I need a good .gitignore and README" |
| 25 | +- "set up GitHub Actions for tests" |
| 26 | +- "I want professional releases and tags" |
| 27 | +- "add a license and description to the repo" |
| 28 | +- "let's make this repo GitHub-ready" |
| 29 | +- "prepare this repo for open source" |
| 30 | + |
| 31 | +## Workflow |
| 32 | + |
| 33 | +For full repository setups, follow this checklist: |
| 34 | + |
| 35 | +- Inspect the repository structure |
| 36 | +- Identify project type and maturity |
| 37 | +- Detect stack, language, runtime, test runner, and package manager |
| 38 | +- Review existing files: `README.md`, `.gitignore`, `.gitattributes`, `.github/`, `LICENSE`, `CHANGELOG.md` |
| 39 | +- Confirm project purpose, audience, and expected visibility if that cannot be inferred |
| 40 | +- Choose a license based on reasoning, not popularity |
| 41 | +- Draft or refine the README with sections that match the project type |
| 42 | +- Define GitHub Actions only with real commands from the repo |
| 43 | +- Configure repository metadata aligned with the README and intended use |
| 44 | +- Evaluate community health files if the project is likely to receive external collaboration |
| 45 | +- Define a tags and releases strategy only when appropriate |
| 46 | +- Report changes, decisions, assumptions, and open follow-ups |
| 47 | + |
| 48 | +## Required Questions |
| 49 | + |
| 50 | +Ask only when the answer cannot be inferred: |
| 51 | + |
| 52 | +- What the project does and who it is for |
| 53 | +- Language/runtime and test/build commands |
| 54 | +- Desired license type when there is uncertainty |
| 55 | +- Whether the user wants CI, release automation, or both |
| 56 | +- Initial version and release strategy |
| 57 | +- Whether `CODE_OF_CONDUCT.md` or `SECURITY.md` should be created |
| 58 | + |
| 59 | +Ask explicitly if you detect: |
| 60 | + |
| 61 | +- potential need for non-trivial licenses such as `AGPL`, `LGPL`, `MPL`, dual licensing, or non-open-source licenses |
| 62 | +- corporate, academic, or client context that may require legal approval |
| 63 | +- a monorepo or structure where it is unclear whether there should be one workflow or several |
| 64 | + |
| 65 | +## Writing Rules |
| 66 | + |
| 67 | +- Never overwrite user files without reviewing their contents |
| 68 | +- Prefer section merges for README and existing docs |
| 69 | +- If the stack is unclear, ask for confirmation |
| 70 | +- Avoid placeholders when the repo already provides real facts |
| 71 | +- If something is an assumption, label it as such |
| 72 | +- Do not invent `lint`, `test`, or `build` commands |
| 73 | +- Do not default to `MIT` mechanically if there is enterprise context, patent sensitivity, or a clear copyleft preference |
| 74 | +- Do not add generic `SECURITY.md` or community files if nobody will maintain them |
| 75 | +- Do not create release automation if there is no release strategy yet |
| 76 | + |
| 77 | +## File Strategy |
| 78 | + |
| 79 | +Use this section for defaults only. For deeper decision-making, read the relevant file under `references/`. |
| 80 | + |
| 81 | +### `.gitignore` |
| 82 | + |
| 83 | +- Base it on the detected language, framework, and tooling |
| 84 | +- Include build folders, caches, and local-only files |
| 85 | +- Avoid ignoring configuration files the project actually needs |
| 86 | +- Remember that team-wide ignores belong in `.gitignore`, while personal ignores can go in `.git/info/exclude` or a global ignore file |
| 87 | + |
| 88 | +### `.gitattributes` |
| 89 | + |
| 90 | +- Use `text=auto eol=lf` as a good cross-platform default |
| 91 | +- Mark binaries and files that need special normalization |
| 92 | +- Adjust `eol` by file type if the repo is strongly Windows-centric |
| 93 | +- Add `linguist-*` rules only when the repository truly needs them |
| 94 | + |
| 95 | +### `README.md` |
| 96 | + |
| 97 | +Include minimum sections: |
| 98 | + |
| 99 | +- Clear summary |
| 100 | +- Features or use cases |
| 101 | +- Install / setup |
| 102 | +- Usage |
| 103 | +- Testing |
| 104 | +- License |
| 105 | + |
| 106 | +Then adapt by project type: |
| 107 | + |
| 108 | +- library: short usage example |
| 109 | +- CLI/app: run command and requirements |
| 110 | +- template: what the user must customize |
| 111 | +- internal repo: onboarding and operational conventions |
| 112 | + |
| 113 | +### `LICENSE` |
| 114 | + |
| 115 | +- Use the correct template for the chosen license |
| 116 | +- Add `year` and `copyright holder` when the user specifies them or they can be inferred with high confidence |
| 117 | +- If there is no license and the repo will be public, explain that the code is not automatically reusable |
| 118 | +- Recommend: |
| 119 | + - `MIT` for simplicity and adoption |
| 120 | + - `Apache-2.0` when explicit patent protection is useful |
| 121 | + - `GPL-3.0` only when there is a clear copyleft preference |
| 122 | +- If the legal case is ambiguous, escalate to the user instead of assuming |
| 123 | + |
| 124 | +### GitHub Actions |
| 125 | + |
| 126 | +- CI: push and pull request using real commands |
| 127 | +- Release: tag + `gh release create` or a tag-triggered workflow when appropriate |
| 128 | +- Use cache according to the actual package manager |
| 129 | +- Set minimal `permissions` |
| 130 | +- Separate CI and release workflows when both exist |
| 131 | +- Avoid unnecessary matrices and avoid `pull_request_target` unless there is a clear need |
| 132 | + |
| 133 | +### Repo Metadata |
| 134 | + |
| 135 | +- Define a short description and useful topics |
| 136 | +- Keep the README aligned with the description |
| 137 | +- Use 3 to 8 truthful, specific topics |
| 138 | +- Consider homepage and community health files if the repo will be externally visible |
| 139 | + |
| 140 | +## GH CLI Guidance |
| 141 | + |
| 142 | +When the user wants metadata or releases, use `gh`: |
| 143 | + |
| 144 | +- `gh repo edit --description "..." --add-topic "..."` |
| 145 | +- `gh repo edit --homepage "https://..."` |
| 146 | +- `gh release create vX.Y.Z --generate-notes` |
| 147 | + |
| 148 | +Avoid destructive or forceful git operations. |
| 149 | + |
| 150 | +## When To Read References |
| 151 | + |
| 152 | +- `references/triggers.md` for activation phrases |
| 153 | +- `references/workflow.md` for the base operational flow |
| 154 | +- `references/templates.md` for reusable snippets and quality criteria |
| 155 | +- `references/github-actions.md` for CI, security, and release automation |
| 156 | +- `references/releases.md` for tags and versioning |
| 157 | +- `references/licenses.md` for license selection with real tradeoffs |
| 158 | +- `references/repo-metadata.md` for description, topics, and community health files |
| 159 | +- `references/testing.md` for validating the quality of the skill |
| 160 | + |
| 161 | +Use these references as decision guides, not just as a checklist. |
| 162 | + |
| 163 | +## Success Criteria |
| 164 | + |
| 165 | +- Baseline files are created or improved without risky overwrites |
| 166 | +- The README is clear, actionable, and aligned with the project |
| 167 | +- CI works for the actual stack |
| 168 | +- The license is correct or the recommendation is well justified |
| 169 | +- Repository metadata is aligned with the project |
| 170 | +- Recommendations are justified when tradeoffs exist |
| 171 | +- Nothing important is invented or assumed without being marked |
| 172 | + |
| 173 | +## Output Expectations |
| 174 | + |
| 175 | +At the end, report: |
| 176 | + |
| 177 | +- files created |
| 178 | +- files updated |
| 179 | +- files skipped |
| 180 | +- key decisions: license, CI, releases, and metadata |
| 181 | +- assumptions and follow-ups for the user |
0 commit comments