kinocut
AGENTS.md187 starsChanged 5 months agoApache-2.0View on GitHub
- Do not delete branches, remove worktrees, prune remotes, rebase, merge, reset, or discard changes unless the task explicitly authorizes the exact operation and target. - Clean up only artifacts created by the current task when that cleanup is safe and authorized; otherwise report them f
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- docs/llms-full.txtllms.txt
- llms.txtllms.txt
- kinocut-repurposeSkill
- kinocutSkill
- mcp-videoSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 1 is common, 9 are distinctive, and 5 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Keep the skill aligned with docs/CLI_REFERENCE.md, docs/TOOLS.md, the Python client, and public MCP tool names when those surfaces change.
- Very specific: line 11
Check if it already exists: Search ffmpeg_helpers.py, validation.py, limits.py, and defaults.py before writing any utility function.
- Very specific: line 32
Never use bare
except Exception:without logging: Always except Exception as e: logger.warning(...). - Distinctive: line 47
No module may exceed 800 LOC: If it does, split into a subpackage.
- Distinctive: line 48
No function may exceed 80 lines: If it does, extract helpers.
- Very specific: line 49
No dead code: If a function/method/constant has zero callers outside its definition, remove it.
- Very specific: line 55
Lazy imports in
server.py: keep startup fast. Follow the existing pattern: import inside the tool handler function. - Distinctive: line 60
Do not delete branches, remove worktrees, prune remotes, rebase, merge, reset, or discard changes unless the task explicitly authorizes the …
- Distinctive: line 70
When checking external contributions, own the CI investigation instead of handing the user an unexplained approval gate.
- Common: line 78
Before enabling a run, inspect the complete diff, workflow definitions and invoked scripts, token permissions, secrets exposure and runner …
- Distinctive: line 80
Do not execute untrusted code on a persistent or privileged runner merely to clear the gate.
- Distinctive: line 82
When existing user authority covers normal CI execution and review establishes that the run is safe, approve the specific pending runs and …
- Distinctive: line 85
If authority, access or safety is unresolved, state the exact blocker, the investigation already completed, and the smallest decision or …
- Distinctive: line 87
Never substitute a bare "maintainer approval required" status for that work.
- Distinctive: line 88
Keep run approval separate from code review and merge gates.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kinocut - Project Rules
Public Agent Skill
skills/kinocut/SKILL.mdis the canonical public skill for this repo.- Invoke
$kinocutin compatible agent hosts for guarded video inspection, editing, Hyperframes, repurposing, release checkpoints, and human-review workflows. skills/mcp-video/SKILL.mdis a compatibility entry point only. Keep it thin and direct new work to$kinocut.- Keep the skill aligned with
docs/CLI_REFERENCE.md,docs/TOOLS.md, the Python client, and public MCP tool names when those surfaces change.
Before Writing Any Code
- Check if it already exists. Search
ffmpeg_helpers.py,validation.py,limits.py, anddefaults.pybefore writing any utility function. Import, don't duplicate. - Check the public API. Functions registered as MCP tools in
server.pyare the public surface. Internal functions are prefixed with_. Don't break tool signatures.
FFmpeg Security
- ALL user-controlled values in FFmpeg filter strings MUST be escaped with
_escape_ffmpeg_filter_value()fromffmpeg_helpers.py. This includes: colors, fonts, text, paths, and any string that goes into a-vfor-filter_complexargument. - Gold standard pattern (from
effects_engine.py:text_animated):safe_text = _escape_ffmpeg_filter_value(text) safe_font = _escape_ffmpeg_filter_value(font) if font is not None else font safe_color = _escape_ffmpeg_filter_value(color) if color is not None else color - Never use f-string interpolation of user values directly into filter strings without escaping.
Error Handling
- Always raise custom types from
errors.py, never rawValueError,RuntimeError, orFileNotFoundError.- Input file issues →
InputFileError - FFmpeg processing failures →
ProcessingError(auto-truncates stderr to 500 chars) - Bad parameters →
MCPVideoErrorwitherror_type="validation_error"
- Input file issues →
- Never embed
result.stderrdirectly in error messages. Route throughProcessingErrorwhich truncates to 500 chars. - Never use bare
except Exception:without logging. Alwaysexcept Exception as e: logger.warning(...).
Subprocess Calls
- ALL
subprocess.run()andsubprocess.Popen()calls MUST have atimeoutparameter. UseDEFAULT_FFMPEG_TIMEOUTfromdefaults.py. - Catch
subprocess.TimeoutExpiredand raiseProcessingErrorwith a clear timeout message. - Validate input paths with
_validate_input_path()fromffmpeg_helpers.pybefore passing to subprocess.
Configuration
- All default values MUST be defined in
defaults.py. Reference by name, never hardcode magic numbers likecrf=23,timeout=600,fps=30. - Validation constants go in
validation.py. Resource limits go inlimits.py. Runtime defaults go indefaults.py.
Size Limits
- No module may exceed 800 LOC. If it does, split into a subpackage.
- No function may exceed 80 lines. If it does, extract helpers.
- No dead code. If a function/method/constant has zero callers outside its definition, remove it.
Architecture
ffmpeg_helpers.pyis the single source of truth for:_run_ffmpeg(),_validate_input_path(),_escape_ffmpeg_filter_value(),_get_video_duration(),_run_ffprobe(),_seconds_to_srt_time(). Never duplicate these.server.pyis the tool registration layer. Business logic goes in engine modules, not in server tool handlers.- Lazy imports in
server.pykeep startup fast. Follow the existing pattern: import inside the tool handler function.
Git Workspace Hygiene
Preserve user-owned repository state and inspect it before any Git cleanup.
- Do not delete branches, remove worktrees, prune remotes, rebase, merge, reset, or discard changes unless the task explicitly authorizes the exact operation and target.
- Clean up only artifacts created by the current task when that cleanup is safe and authorized; otherwise report them for owner direction.
- A clean working tree is a goal only when the task requires it. Never convert an existing dirty state into a cleanup task or overwrite user work.
Contributor CI ownership
When checking external contributions, own the CI investigation instead of handing the user an unexplained approval gate.
- An empty PR check list is not evidence that CI is absent. Inspect workflow runs
for the exact PR head; distinguish
action_required, queued, running, failed, skipped and successful runs. Confirm the reason foraction_required. - Explain first-time-contributor approval as permission to execute CI. It does not approve the code, merge the PR, or grant the contributor repository access.
- Before enabling a run, inspect the complete diff, workflow definitions and invoked scripts, token permissions, secrets exposure and runner isolation. Do not execute untrusted code on a persistent or privileged runner merely to clear the gate. Recheck that the reviewed head still matches the pending run.
- When existing user authority covers normal CI execution and review establishes that the run is safe, approve the specific pending runs and verify their actual states. Do not ask the user to repeat authorization or perform a routine click.
- If authority, access or safety is unresolved, state the exact blocker, the investigation already completed, and the smallest decision or action needed. Never substitute a bare "maintainer approval required" status for that work.
- Keep run approval separate from code review and merge gates. Do not disable protections, expand token permissions, change repository settings, approve future contributions indiscriminately, or post contributor messages without the applicable authorization.
Testing
- Every fix must pass
python3 -m pytest tests/ -x -q --tb=shortbefore committing. - Run
python3 -c "import kinocut, mcp_video; assert kinocut.Client is mcp_video.Client"to verify the canonical import and compatibility shim after changes.
<!-- EMPOWER_ORCHESTRATOR:START -->Empower Orchestrator law
The canonical law and blast-radius check live in
docs/agent-law/empower-orchestrator.md. Read that source when orchestrating
automation or durable system changes.
<!-- EMPOWER_ORCHESTRATOR:END -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

