SuperAPI AI Directory

photocraft-cli-resize

Design & creation

View repository

Updated 10-15 21:47

About this skill

PhotoCraft Size Fitting

This skill handles resizing canvases and images and creating poster cover variants. It hands off to skills in the same package by name and can be installed and used on its own without reading sibling directories. It invokes the pinned maintenance build photocraft-cli and preserves native editing projects.

Input and Delivery

The input is the user-confirmed task, assets, project or object, output directory, and modification scope; when an existing project is required, verify the summary first. It returns the actual CLI results, the saved native project, required derived outputs, and verification records. Installation success, command directory existence, and creative task completion are reported separately.

First Use and Common Entry Points

Execution implementations converge in the built-in photocraft-harness skill (installed bundled with the plugin; for standalone installation use npx skills add full-aigc-skills/photocraft-skills --skill photocraft-harness). Set HARNESS_DIR to the actual load directory of that skill (absolute path); this skill's SKILL_DIR is used only to read its own examples/ and references/。

Locate the real directory of the current SKILL.md. Currently macOS arm64 and Python 3.11+ are supported; the pinned CLI is installed to the user data directory. When existing task authorization covers the necessary dependencies, run this skill's installer directly without creating a separate approval process.

Set SKILL_DIR to the directory containing this SKILL.md actually loaded by the host (absolute path). User-level installations may be located at ~/.agents/skills/photocraft-cli-resize, project-level ones may be at .agents/skills/photocraft-cli-resize, and plugin ones may be in its skills/photocraft-cli-resize or host cache directory; use the actual load path, do not guess based on the current working directory, and do not search and arbitrarily pick a duplicate version. The skill directory and the CLI's user data installation directory are two independent locations.

: "${SKILL_DIR:?请先设置为本 SKILL.md 的实际所在目录}"
python3 -I -B "$HARNESS_DIR/scripts/bootstrap.py"
python3 -I -B "$HARNESS_DIR/scripts/cli.py" -- --version
python3 -I -B "$HARNESS_DIR/scripts/cli.py" -- commands --json

After -- in the CLI argv, the native subcommand must come first. Installation parameters go before the delimiter;--runtime-home can isolate the cache. Stop when locked artifact digest verification fails, the installation is corrupted, or the platform is unsupported; do not modify PATH and do not perform floating upgrades. The native help entry point is help; the launcher's own --help only explains startup parameters.

Scenario Operations

Verify this scenario's input, native project, target object, version, and output boundaries. Select the current command according to the Scenario Guide save an independent checkpoint, then execute; after completion, reopen the native project and check the actual output and non-target content.

Read params from commands --json --filter <关键词> ;run <工程> --cmd <id> --params <JSON> ... --out <新工程.pcraft>, each --params belongs to the preceding --cmd; serve/MCP can maintain a single session.

Distinguish between canvas cropping and image resampling; save each size as a separate variant, and keep text and products editable.

For native composition and source project revisions, use the built-in photocraft-harness skill's scripts/workflow.py; read the workflow contract, with templates in this skill's examples. Modify only authorized objects; preserve the native project and dependent assets; for derived format loss, read the exchange report。

Verification and Recovery

A non-zero command exit does not count as completion; you need to inspect the actually saved project, exports, dimensions, and media decoding. Mark timed-out results as unknown; check the original task/project first, and do not automatically replay edits. Existing native workflows support save-as revisions; refuse to overwrite when the corresponding project summary does not match.

On-Demand Reference and Handoff

  • Actual command evidence: Fixed-version observations, for routing and parameter reference only; real-time results take precedence, disabled items are not executed.
  • Workflow contract: Combined operations, native saving, dependency collection, and revision.
  • When installation/diagnostics are needed, hand off to photocraft-cli-setup, full task routing is handed off to photocraft-use; when skills are missing, use npx skills add full-aigc-skills/photocraft-skills --skill <skill-name>. Do not load other skills through adjacent file paths.

This skill does not provide a fictional login interface; local headless does not require a cloud account. The PhotoCraft bridge's control-token is local application access control, which is different from cloud login. Full GUI, cross-editor fidelity, and creative quality are stated according to actual evidence.

Complete native command usage

The current skill comes with parameter descriptions for the complete catalog and same-session entry points, and is not subject to the creation template whitelist. Read Complete usage guide, query as needed command reference; each instruction has skill routing, prerequisite observations, and acceptance status.

python3 -I -B "$HARNESS_DIR/scripts/commands.py" list --filter QUERY
python3 -I -B "$HARNESS_DIR/scripts/commands.py" describe COMMAND_ID
python3 -I -B "$HARNESS_DIR/scripts/commands.py" run "$SKILL_DIR/examples/commands-advanced.json" --output /absolute/new-command-result

Before executing a new entry point, check the real registry and current executable status, retain return value references and step-by-step receipts; semantic errors or timeouts must not be passed off as success. Catalog coverage and direct native usage do not mean that all instructions, GUI, delivery, or Art orchestration have been accepted.

For the complete workflow command gateway, see usage instructions. The version and artifact digest of the fixed CLI are subject to the built-in photocraft-harness skill's scripts/runtime.lock.json ; the skill package version is subject to the corresponding release tag. Independent installation re-verification and full command-by-command acceptance are recorded separately, and release is not a substitute for acceptance.

For editable local adjustments and source rework, see Mask adjustment usage instructions; paired plans are in this skill's examples, with source candidates and fixed installation evidence kept separate.

For GUI tasks, you can first use this skill's built-in fixed desktop installation; installation, startup, and actual GUI editing are verified separately.

Complete attribution commands are listed by command family in categorized usage list, and each item can be viewed through this skill's commands.py describe parameters; the general CLI list also retains all commands not assigned to specialized skills.

Business tasks start from scenario operation manual and are executed according to input checks, template adaptation, native delivery, local rework, and result verification.

When installation fails, read first-use diagnosticsand use the receipt to locate the current skill's own setup entry point; installation failures and native invocation failures are handled separately.

For product local filters, background blur, and output sharpening tasks, read filter scenarios, distinguish editable filters from baked pixels, and verify selections, layers, and non-target content.

For size, color mode, or automatic pixel adjustment tasks, read this skill's built-in image transformation guide, and first check the layer retention requirements and transformation impact.

Same-target execution protection

Before calling a public workflow, read this skill's execution registration and interruption handling. In case of contention or unknown status, do not delete the registration, automatically replay, or switch targets to bypass verification.

Before delivery, moving the package, or source project rework, verify all files and exchange identities according to the delivery integrity checklist; read-only checks do not require installing a runtime.

Scenario contract and routing

According to scenario contract , verify input, target and protection scope, recovery and acceptance. For a complete task, select the shortest skill chain by name; when the known result is unclear, first verify the original task, do not replay. For explicit intent, you may use the photocraft-harness skill's scripts/route.py INTENT query entry; this is a contract query and does not prove that host model dispatch has passed.

PSD delivery requires clearly specified necessary features; observed loss/degradation and unknown necessary items will block success. When the user explicitly accepts, record according to the same source version and the actual observation summary, do not accept automatically; see this skill'sPSD exchange and acceptance gate。

When flat export requires clearly specified color/ICC/transparency requirements or preserving the source of externally generated assets, read this skill's flat export and source contract。

For runtime/backend identity and capability drift issues, read this skill's capability snapshot and refusal contract。

Continuous tasks and instance reuse

When continuously checking, editing, saving, reopening, and reworking the same user task, use this skill's task-level session and the built-in photocraft-harness skill's scripts/task_session.py, maintaining the same foreground process and input handles. After a failure/unknown, first verify the original receipt and project, do not start a substitute instance to replay.