hpe-copyright
Check, add, or fix HPE copyright headers in source files. Use this skill when (1) Adding copyright headers to new files, (2) Checking if files have valid copyright headers, (3) Updating outdated copyright years, (4) Preparing code for CI that enforces copyright headers, (5) User mentions "copyright", "HPE header", or "copyright check". Format is "Copyright YYYY-YYYY Hewlett Packard Enterprise Development LP" as a comment on the first line.
When & Why to Use This Skill
This Claude skill automates the management of HPE copyright headers across diverse source code repositories to ensure legal compliance and CI/CD readiness. It provides an intelligent way to check, add, or update standardized copyright notices in over 50 file types—including Python, JavaScript, Go, and SQL. By automatically handling annual year updates and respecting .gitignore or .copyrightignore patterns, it streamlines repository maintenance and prevents build failures caused by missing or malformed headers.
Use Cases
- New File Initialization: Automatically inserting the correct HPE copyright header into newly created source files with the appropriate comment syntax for the specific programming language.
- Annual Compliance Updates: Performing bulk updates of copyright year ranges (e.g., changing 2024-2024 to 2024-2025) across an entire codebase to maintain legal currency.
- CI/CD Pre-flight Checks: Validating that all files in a pull request contain the required copyright headers to ensure the build passes automated compliance gates.
- Legacy Code Standardization: Scanning and fixing inconsistent or missing headers in older repositories to bring them up to current organizational standards.
- Multi-Language Repository Management: Managing headers across complex projects containing a mix of shell scripts, web assets, and backend code using a single automated tool.
| name | hpe-copyright |
|---|---|
| description | > |
HPE Copyright Header Management
Ensure all source files have the required HPE copyright header to pass CI checks.
Copyright Format
Copyright {start_year}-{end_year} Hewlett Packard Enterprise Development LP
- start_year: Year the file was created
- end_year: Current year (must be updated annually)
- Placement: First line of the file, as a comment
Examples by Language
| Language | Copyright Line |
|---|---|
| Python | # Copyright 2024-2025 Hewlett Packard Enterprise Development LP |
| JavaScript/TypeScript | // Copyright 2024-2025 Hewlett Packard Enterprise Development LP |
| Go | // Copyright 2024-2025 Hewlett Packard Enterprise Development LP |
| SQL | -- Copyright 2024-2025 Hewlett Packard Enterprise Development LP |
| HTML/XML | <!-- Copyright 2024-2025 Hewlett Packard Enterprise Development LP --> |
| CSS | /* Copyright 2024-2025 Hewlett Packard Enterprise Development LP */ |
Quick Reference
Check all files (dry run)
python scripts/copyright_check.py /path/to/repo --dry-run
Fix all files
python scripts/copyright_check.py /path/to/repo
CI check mode (fails if issues found)
python scripts/copyright_check.py /path/to/repo --check-only
Rules
- Missing header: Add
Copyright CURRENT_YEAR-CURRENT_YEAR Hewlett Packard Enterprise Development LP - Outdated year: Update only the second year to current year (e.g.,
2024-2024→2024-2025) - Exclusions: Respects both
.gitignoreand.copyrightignorefiles (gitignore-style patterns)
Manual Fixes
When manually adding or fixing a copyright header:
- Determine the correct comment syntax for the file type
- Add as the very first line of the file
- Use current year for both years if creating new:
Copyright 2025-2025 Hewlett Packard Enterprise Development LP - If updating existing, only change the second year
Supported File Types
The script supports 50+ file extensions including:
- Hash (#):
.py,.sh,.rb,.pl,.r,.jl - Double-slash (//):
.js,.ts,.jsx,.tsx,.go,.c,.cpp,.java,.kt,.swift,.rs - Dash-dash (--):
.sql,.lua,.hs - Block comments:
.html,.xml,.css,.vue
Exclusion Patterns
The script automatically reads patterns from both .gitignore and .copyrightignore in the repo root. Use .copyrightignore for additional exclusions specific to copyright checking:
# Directories
vendor/**
third_party/**
# File types not in .gitignore
*.generated.go
# Specific files
Makefile