Skill ID
creative/bg_remover
Current manifest version
0.1.0
Proposed change
Follow-up upgrade to take creative/bg_remover from the solid v0.1.0 rembg wrapper (merged via #244) to a production-grade skill: same scope (still images, local-first), but tighter runtime behavior, clearer errors, better performance, and stronger test/docs coverage.
Baseline (current v0.1.0)
- Lazy rembg + Pillow import, structured
success / error_code envelope
- Base64 +
input_path / optional output_path, configurable model + alpha_matting
- Mocked offline bundle tests; catalog + append-only
instructions.md
- Per-skill extra:
skillware[creative_bg_remover]
Tightening gaps to address
Runtime / skill.py
- Session reuse: Cache
new_session(model) at class or module level (similar to novelty_extractor embedding cache) so repeated calls do not reload ONNX every execute.
- Input validation before rembg: Explicit checks for missing file, empty file, unsupported/corrupt format — distinct error codes where helpful (e.g.
FILE_NOT_FOUND, INVALID_INPUT) instead of generic PROCESSING_FAILED.
- Size / sanity limits: Document and optionally enforce reasonable max dimensions or byte size to avoid OOM on host.
- Path safety: Validate
input_path / output_path (no directory traversal, parent dir exists or creatable for output).
- Format normalization: Accept common inputs (JPEG, WebP) with clear behavior; document PNG-first output contract.
- First-run UX: Optional structured hint in response or docs when model download occurs (without blocking v1 simplicity).
Cognition / instructions.md
- Keep append-only skill context (no persona), see companion docs issue on instruction style.
- Add any new error codes and session/first-run behavior after code changes.
Tests
- Expand bundle tests for new error paths and session reuse (still mock rembg for CI).
- Optional maintainer integration test under
tests/skills/creative/ marked @pytest.mark.integration for real rembg (skipped in default CI).
- Consider
validate_params() usage examples if schema tightening lands.
Docs / examples
- Runnable reference script (e.g.
examples/bg_remover_demo.py) + examples/README.md row + agent_loops matrix update (replace (catalog page) where appropriate).
- Full provider loop for at least one secondary provider if maintainers want parity with
pdf_form_filler-class skills.
Manifest / packaging
- Version bump (likely
0.2.0 if error codes or behavior change; patch if additive only).
- Re-run
python scripts/sync_extras.py if requirements change.
- CHANGELOG under
[Unreleased].
Non-goals (keep out of this upgrade unless explicitly scoped)
- Video, batch folder processing, URL fetching inside the skill
- Cloud SDK integration (S3/GCS/Azure/R2 remain host/agent responsibility)
- Replacing rembg with a different engine
Acceptance criteria
Breaking change?
No — backward compatible
Likely touch points
Skill ID
creative/bg_remover
Current manifest version
0.1.0
Proposed change
Follow-up upgrade to take
creative/bg_removerfrom the solid v0.1.0 rembg wrapper (merged via #244) to a production-grade skill: same scope (still images, local-first), but tighter runtime behavior, clearer errors, better performance, and stronger test/docs coverage.Baseline (current v0.1.0)
success/error_codeenvelopeinput_path/ optionaloutput_path, configurablemodel+alpha_mattinginstructions.mdskillware[creative_bg_remover]Tightening gaps to address
Runtime / skill.py
new_session(model)at class or module level (similar tonovelty_extractorembedding cache) so repeated calls do not reload ONNX every execute.FILE_NOT_FOUND,INVALID_INPUT) instead of genericPROCESSING_FAILED.input_path/output_path(no directory traversal, parent dir exists or creatable for output).Cognition / instructions.md
Tests
tests/skills/creative/marked@pytest.mark.integrationfor real rembg (skipped in default CI).validate_params()usage examples if schema tightening lands.Docs / examples
examples/bg_remover_demo.py) +examples/README.mdrow + agent_loops matrix update (replace(catalog page)where appropriate).pdf_form_filler-class skills.Manifest / packaging
0.2.0if error codes or behavior change; patch if additive only).python scripts/sync_extras.pyifrequirementschange.[Unreleased].Non-goals (keep out of this upgrade unless explicitly scoped)
Acceptance criteria
pytest skills/creative/bg_remover/andpytest tests/passpytest tests/test_registry_docs.pypassespython scripts/sync_extras.py --checkpasses[creative_bg_remover]depsBreaking change?
No — backward compatible
Likely touch points