Check License

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Verify that source and test files in this repository carry a license header consistent with the repository’s license, and add one to any file that’s missing it or has it wrong. This skill only adds/fixes header comments — it never changes code logic, signatures, formatting, or existing non-header comments.

Purpose

iru-check-license closes the gap between a repository’s declared license and what its individual files actually say at the top. It never assumes a fixed license or a fixed header format: it reads the repository’s own LICENSE-family file (and any license identifier declared in pom.xml/package.json/pyproject.toml/etc. — for Python, [project].license as an SPDX expression or the legacy table, plus License :: classifiers) to know which license applies, then learns the exact header wording and comment-syntax convention from files that already carry one — falling back to drafting a standard header, shown to the user for explicit accept/reject, only when no file in the repository has one yet. It makes no assumption about language or project layout, discovering the real source/test roots and file extensions present each run — including Android Gradle module source sets, SwiftPM’s Sources//Tests/, Hilla’s embedded frontend, and React Native/Capacitor’s native ios//android/ directories, and Python packages (src/<pkg>/, FastAPI’s app/, Django’s config/ + apps/) — and it knows the native comment syntax for .kt, .swift, .py (a block of # lines, never a docstring) and .ts/.tsx headers alongside the languages it already covered, plus .rs and .go (a block of // lines or /* …​ */, never Rust //////! doc comments). For Python it keeps a shebang and PEP 263 encoding line on lines 1-2 with the header inserted after them, and skips generated Django/Alembic migrations and empty init.py files unless existing ones are headered. For Rust it inserts the header above inner attributes and //! crate docs; for Go it keeps the header above any //go:build constraint with a blank line before package (so go doc doesn’t treat it as the package comment) and skips generated // Code generated …​ DO NOT EDIT. files. When no repo-wide inception year is stamped in a config field (e.g. Maven’s <inceptionYear> or a Gradle library module’s lib/build.gradle.kts), it falls back to each file’s first-commit year, or, when a single repo-wide year is needed and no field supplies one, to the repository’s own first-commit year.

Purpose group

Plugin

Shipped by the iru-core plugin of the ai-catalog marketplace (install with /plugin install iru-core@ai-catalog; see Plugins).

Invocation

/iru-check-license
/iru-check-license <path-or-glob>

Inputs

Argument Required Description Default

path-or-glob

No

Scopes the check to specific files or directories instead of the whole repository.

None — defaults to every source and test file in the repository’s discovered source roots (src/main/src/test for Maven/Gradle Java; app/src/main/lib/src/main for Android Gradle module source sets; Sources//Tests/ for SwiftPM; src/main/frontend for Hilla’s embedded frontend; ios//android/ for React Native/Capacitor native projects; the packages pyproject.toml builds plus tests//scripts/ for Python; src//lib//test/ for other stacks), skipping generated/vendored directories and non-code files.

Outputs

  • A per-file status recorded before any edit: missing header, wrong/stale header, or already compliant.

  • License headers inserted (via Edit, or Write only for brand-new files) into every file found missing one, and corrected in every file whose header diverges in substance from the learned/accepted template — with the rest of each file, including any code-level Javadoc/docstring, left untouched.

  • A final report stating which license was identified, where the header template came from (learned from an existing file, with an example path, or drafted fresh and accepted by the user, noting how many revision rounds it took), a grouped list of compliant vs. fixed files, any header-format inconsistency spotted across existing files, and any file skipped as ambiguous.

  • If no license file/identifier exists anywhere in the repository, or the user chose to skip header generation with no pre-existing header to learn from: no files are checked or modified, and the report says so plainly.

Execution flow

flowchart TD A[Start /iru-check-license] --> B{License file or declared\nlicense identifier found?} B -- no --> B1[Tell user there is nothing\nto check against; stop] B -- yes --> C[Identify license family from its text] C --> D{Path/glob argument given?} D -- yes --> E[Scope check to matching files] D -- no --> F["Scope to discovered source/test roots,\nskipping generated/vendored dirs"] E --> G[Determine distinct file extensions in scope] F --> G G --> H{Existing header found\non sampled in-scope files?} H -- yes --> I["Use it verbatim as the template per extension\n(cross-check 2-3 more instances for consistency)"] H -- no --> J["Ask user: skip header handling,\nor generate one from the license text?"] J -- skip --> K["Report-only mode:\nno template, nothing audited"] J -- generate --> L["Draft header from license boilerplate +\ncopyright holder/year; show example on one real file"] L --> M{User response?} M -- reject with changes --> L M -- accept --> I I --> N["Audit every in-scope file:\nmissing / wrong / compliant"] N --> O["Fix: insert missing headers at top;\nreplace wrong header blocks only"] O --> P[Report: license, template source,\nper-file status, inconsistencies, skips] K --> P

Dependencies

Invokes

None — iru-check-license is a leaf skill; it does not call any other skill in this catalog.

Invoked by

Source

SKILL.md on GitHub — the file this page was generated from.