一键导入
github-legal
GitHub legal compliance — generate LICENSE, SECURITY.md, CITATION.cff, NOTICE; handle fork attribution and dependency compatibility.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
GitHub legal compliance — generate LICENSE, SECURITY.md, CITATION.cff, NOTICE; handle fork attribution and dependency compatibility.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
GitHub repository optimization suite. Orchestrates sub-skills to audit and professionalize repos across README, legal, metadata, SEO, community, and releases.
Generate GitHub community health files — CONTRIBUTING, CODE_OF_CONDUCT, SUPPORT, CODEOWNERS, issue/PR templates, dependabot, devcontainer.
Portfolio-level GitHub empire builder — scans presence, builds profile README, syncs topics, cross-links repos, generates avatars.
GitHub repo health audit with 0-100 scoring across README, metadata, legal, community, releases, SEO. Single, remote, or portfolio mode.
Optimize GitHub repo metadata for discoverability — descriptions, topics, homepage, feature toggles, social preview, gitattributes.
Generate or optimize GitHub README files with SEO-optimized structure, badges, and 21:9 banner image generation via GPT Image 2.
| name | github-legal |
| description | GitHub legal compliance — generate LICENSE, SECURITY.md, CITATION.cff, NOTICE; handle fork attribution and dependency compatibility. |
For API agents and non-interactive runs, use the deterministic legal runner:
python3 scripts/run_headless.py legal --path /path/to/repo
python3 scripts/run_headless.py legal --path /path/to/repo --write-files
python3 scripts/run_headless.py legal --path /path/to/repo --write-files --license MIT
This writes:
.github-audit/legal-data.json.github-audit/output/<repo>-<timestamp>/LEGAL-REPORT.md.github-audit/output/<repo>-<timestamp>/LEGAL-PLAN.md.github-audit/output/<repo>-<timestamp>/LEGAL-SUMMARY.jsonBy default this is a plan-only pass. --write-files is the explicit approval
gate for writing LICENSE, SECURITY.md, CITATION.cff, and NOTICE.
Complex or ambiguous legal situations must be flagged for human review instead
of being guessed.
This tool provides best-effort compliance assistance for common open source licensing scenarios on GitHub. It is NOT legal advice. The output of this skill does not constitute a legal opinion and should not be relied upon as such.
Users are responsible for their own due diligence. For complex licensing situations (dual licensing, contributor license agreements, patent disputes, commercial use of copyleft code, trademark issues), consult a qualified attorney.
Include this disclaimer at the top of every output:
> This analysis is automated compliance assistance, not legal advice.
> Always verify licensing decisions with your own due diligence.
> For complex or high-stakes situations, consult a qualified attorney.
Step 0 -- Check shared data cache:
Before gathering, check .github-audit/ for cached data from other skills.
Reference: github/references/shared-data-cache.md for schemas.
repo-context.json (optional) -- repo type, intent, is_fork flag. If missing,
gather yourself via gh repo view.
Read existing LICENSE file (if any)
Fork and upstream detection (two checks):
gh repo view --json isFork,parentisFork: false, scan the
README and repo description for upstream signals:
If fork or upstream detected, read upstream LICENSE and NOTICE files
Scan dependency manifests for license compatibility:
pip install X, import statements, "requires X") and note their licensesCheck for existing SECURITY.md, CITATION.cff, NOTICE
Check for vendored/copied code: look for third-party directories (vendor/, third_party/, lib/external/) and check if they have their own LICENSE files
Get user intent from orchestrator context
Start every recommendation output with the disclaimer block (see above).
Every recommendation must cite its source:
Reference: Read github/references/license-guide.md for compatibility matrix and fork obligations.
When edge cases are detected, flag them clearly:
> REQUIRES HUMAN REVIEW: [description of the edge case]
> This situation is beyond automated analysis. Consult a qualified attorney.
Do NOT attempt to resolve ambiguous or complex legal questions. Flag them, explain why they're complex, and recommend professional review. Better to say "I don't know, get a lawyer" than to give wrong advice.
Confirmation gate -- STOP and present before writing any files: After completing the Recommend step, present the user with:
Wait for the user to confirm before proceeding. If running inside the
orchestrator (github or github-audit), skip the confirmation gate
and proceed -- the orchestrator has already obtained user consent.
Author info for CITATION.cff: Pull the author name from git config user.name
first. If not set, use the GitHub username from gh api user --jq .name. If neither
is available, use the repo owner's login as a fallback and note it as a placeholder.
Write to shared data cache after generating legal files:
mkdir -p .github-audit
grep -qxF '.github-audit/' .gitignore 2>/dev/null || echo '.github-audit/' >> .gitignore
Write .github-audit/legal-data.json with: timestamp, license_type, license_file_exists,
license_file_path, security_md_exists, security_md_path, citation_cff_exists,
notice_file_exists, is_fork, fork_compliant, dependency_conflicts array.
Reference: github/references/shared-data-cache.md for exact schema.
gh release list. Pull date from today's date.
Pull author from git config user.name or gh api user --jq .name.| Intent | Default | Reasoning |
|---|---|---|
| Open Source Community | MIT | Maximum adoption, minimal friction |
| Professional Portfolio | MIT | Simple, universally understood |
| Business / Brand | Apache 2.0 | Patent protection for enterprise users |
| Internal to Public | Apache 2.0 | Patent grant protects company and users |
| Academic / Research | MIT or BSD-3 | Academic tradition, simple attribution |
| Hobby / Learning | MIT | Simplest option |
| Keep forks open | GPL v3 | Copyleft ensures derivatives stay open |
| SaaS / Server app | AGPL v3 | Copyleft covers network use (prevents closed SaaS forks) |
| Library used by proprietary code | LGPL v3 | Linking exception lets proprietary apps use it |
| Balanced copyleft | MPL 2.0 | File-level copyleft (modified files stay open, new files can be anything) |
| Public domain / no restrictions | Unlicense or CC0 | Maximum freedom, zero obligations |
| Documentation / data | CC BY 4.0 or CC0 | Creative Commons designed for non-code content |
| Source-available commercial | BSL 1.1 | Visible source but not free to compete with; converts to open after delay |
When upstream exists: The upstream license constrains your options. You cannot choose a less permissive license than what the upstream allows. Examples:
When the repo is a fork OR has a detected upstream project:
Generate based on:
gh release list)cff-version: 1.2.0
message: "If you use this software, please cite it as below."
type: software
title: "[Project Name]"
version: "[version]"
date-released: "[YYYY-MM-DD]"
authors:
- family-names: "[Last]"
given-names: "[First]"
orcid: "https://orcid.org/XXXX-XXXX-XXXX-XXXX" # optional
url: "https://github.com/[owner]/[repo]"
license: "[SPDX-ID]"
After completing legal fixes, always end with this handoff:
Legal fixes complete. Next recommended step:
github-community -- set up community health files and templates
If running as part of the audit SOP (the user ran github-audit first and is
following the Recommended Next Steps table), reference the step number:
"Step 1 complete. Next skill: github-community"