1.4 KiB
1.4 KiB
AGENTS.md
Project Scope
- Repository contains a small PHP CLI utility for SFTP-based sync/delete operations.
- Main executable:
src/SFTPsync.php - Connection layer:
src/SFTPconnection.php
Goals When Editing
- Preserve backward-compatible CLI behavior unless the user explicitly requests a breaking change.
- Keep the tool dependency-free (only PHP core +
ext-ssh2). - Prefer minimal, readable changes.
Important Behavior to Preserve
- Actions are repeatable and executed in the same order as provided on CLI.
- Exit codes:
0success1runtime/SFTP error2argument/usage error
- Missing
--host,--user,--passwordshould still support interactive prompt mode. --skipand--skip-deletematching semantics should remain stable.--delete-dirsafety guard against dangerous paths (/, empty path, dot paths) must remain intact.
Coding Conventions
- Target PHP 8+ compatibility.
- Keep strict types in
src/SFTPsync.php. - Avoid adding external libraries or framework structure.
- Use clear runtime exceptions for operational failures.
Validation Checklist
- Lint changed PHP files:
php -l src/SFTPsync.phpphp -l src/SFTPconnection.php
- If CLI options are changed, update
README.mdin the same change. - Ensure examples in
README.mdremain executable from repository root.
Documentation Rules
- Keep
README.mdin English. - Document user-visible flags/behavior changes in README immediately.