name: "large-file-lfs"
description: "Use to detect large, binary, generated, or LFS-managed files before they are committed or pushed."
maturity-level: "L3"
risk-scope: "R0-R3"
version: "1.0.0"
Large File LFS
Core Question
Are large, binary, generated, or LFS-managed files being handled correctly for the requested Git action?
When To Use
Use this skill when:
- large or binary files appear in staged, unstaged, or untracked work
- the user asks whether files should use Git LFS
- generated artifacts might be accidentally committed
- preflight detects file-size or binary risks
When Not To Use
Do not use this skill when:
- secret detection
- rewriting history to remove already-pushed large files
- normal commit grouping
- general
.gitignore authoring without size/binary evidence
Route to:
- secret-like content routes to
secret-scan - already committed or pushed large-file recovery routes to
undo-recover - commit exclusion routes to
atomic-commits - ignore rule edits may be handled by the repository editing workflow
Required Evidence
Before action, inspect or establish:
- staged/unstaged/untracked file list
- file sizes and binary indicators
.gitattributes and LFS tracking rules- generated/build directory patterns
- whether file is already committed or pushed
- project policy for artifacts
No-evidence rule:
- Do not make strong claims without observed evidence.
- State assumptions when proceeding under incomplete evidence.
- Stop when missing evidence affects safety, correctness, user work, remote state, or irreversible action.
Operating Contract
You MAY:
- inspect relevant repository state and project files.
- generate a plan, report, or local artifact within the declared risk scope.
- route to another skill when the requested action is outside this skill's owner boundary.
You MUST:
- inspect before acting.
- keep the task within the declared owner boundary.
- classify state and risk before any meaningful action.
- preserve unrelated user work.
- verify outcomes proportional to risk.
- report evidence, assumptions, actions, verification, and residual risk.
You MUST NOT:
- invent project policy.
- expose secrets or sensitive values.
- mutate unrelated files or refs.
- perform destructive, remote, shared, history-rewriting, or irreversible actions without explicit action-specific confirmation.
- continue after unexpected destructive output.
State / Risk Table
| State | Evidence | Risk | Default Action | Confirmation | Verification |
|---|
| No large/binary risk | file list and size evidence | R1 | Report no issue within scan scope | no | scope stated |
| Large untracked/generated file | file size/path evidence | R1/R2 | Recommend exclude or ignore; do not stage | no | file listed |
| Large file staged | cached names and size | R2/R3 | Block commit until user confirms tracking or LFS plan | yes if keeping staged | cached names verified |
| Large file already pushed | log/remote evidence | R5 | Route to recovery/history plan | yes + recovery | no mutation here |
Workflow
- Identify the user goal and current owner boundary.
- Inspect required evidence.
- Classify repository/task state.
- Classify risk using the declared scope.
- Choose the minimal sufficient action or route.
- Execute only allowed actions, if any.
- Verify outcome or self-check the artifact.
- Report result, evidence, verification, assumptions, and residual risk.
Decision Rules
- Do not treat large-file checks as secret scans.
- Do not stage or unstage from this skill by default.
- Do not rewrite history to remove large files.
- When recommending LFS, cite
.gitattributes evidence or state policy gap.
- May inspect file sizes, file types, tracked attributes, and staged names.
- May not commit, push, or rewrite history.
- Must not print binary file contents.
Verification
Minimum verification:
- Verify file path, size class, and tracking state.
- State if LFS tooling is unavailable.
- Route recovery if file is committed or pushed.
Risk-based floor:
- R0-R1: evidence inspected and output self-checked.
- R2: inspect resulting diff or local state.
- R3: verify local state and report recovery limits.
- R4-R5: require explicit confirmation, preflight evidence, and post-action verification where this skill owns the action.
Output Contract
Final response must include:
## Result
- Decision, action, or artifact produced.
## Evidence
- Files, commands, diffs, refs, or assumptions used.
## Verification
- Checks performed and their result.
## Risks / Limitations
- Remaining uncertainty, blocked actions, or routed next steps.
Stop / Confirmation Rules
Stop when the repository state is dirty, conflicted, diverged, missing required evidence, or ambiguous in a way that could overwrite user work, invalidate the requested scope, or require a gated action.
Require explicit action-specific confirmation for:
- destructive local mutation.
- remote/shared mutation.
- history rewriting.
- security/secret/data impact.
- irreversible or hard-to-recover operation.
Broad approval such as "do whatever" is not enough for R4-R5 actions.
Lazy-load References
Load references/lfs-tracking.md when:
- the task needs the detailed guidance described by the file name.
- the state/risk table identifies an ambiguous or high-risk path.
Load references/generated-artifacts.md when:
- the task needs the detailed guidance described by the file name.
- the state/risk table identifies an ambiguous or high-risk path.
Load references/recovery-routing.md when:
- the task needs the detailed guidance described by the file name.
- the state/risk table identifies an ambiguous or high-risk path.