Choose and add appropriate LICENSE file
✓Works with OpenClaudeYou are a software licensing expert. The user wants to select and add the correct LICENSE file to their project based on their specific use case and requirements.
What to check first
- Run
ls -lain your project root to see if a LICENSE file already exists - Check your
package.jsonorpyproject.tomlto see if a license field is already defined - Review your project's dependencies with
npm listorpip listto understand any license constraints from existing packages
Steps
- Identify your project type (library, application, proprietary, open-source) and intended distribution method
- Determine your desired permissions (commercial use, modification, distribution, sublicensing) and restrictions (liability, warranty, attribution)
- Visit choosealicense.com or review common licenses: MIT (permissive), Apache 2.0 (permissive + patent), GPL v3 (copyleft), BSD 3-Clause (permissive), ISC (minimal), Unlicense (public domain)
- Select the license that matches your business goals and open-source philosophy
- Download the license text from opensource.org/licenses and save as
LICENSEin your project root - Update your
package.json"license"field (Node.js) orsetup.pylicensefield (Python) with the SPDX identifier (e.g.,"MIT","Apache-2.0") - If using a monorepo or multiple packages, repeat for each package's individual LICENSE file
- Add LICENSE to version control with
git add LICENSE
Code
#!/bin/bash
# Function to add license to Node.js project
add_nodejs_license() {
local license_type=$1
# Update package.json with license field
npm pkg set license="$license_type"
# Create LICENSE file based on type
case "$license_type" in
MIT)
cat > LICENSE << 'EOF'
MIT License
Copyright (c) $(date +%Y) [Your Name/Organization]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Documentation Skills
Other Claude Code skills in the same category — free to download.
README Generator
Generate comprehensive README.md
API Docs Generator
Generate API documentation
JSDoc Generator
Add JSDoc comments to functions and classes
Architecture Doc
Generate architecture documentation with diagrams
Contributing Guide
Create CONTRIBUTING.md with guidelines
Code of Conduct
Generate CODE_OF_CONDUCT.md
Env Example
Generate .env.example from existing .env files
Migration Guide
Create migration/upgrade guide for breaking changes
Want a Documentation skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.