Skip to content

feat(bg_remover): harden skill to v0.2.0#266

Open
AyushSrivastava1818 wants to merge 8 commits into
ARPAHLS:mainfrom
AyushSrivastava1818:feat/bg-remover-hardening-v0.2
Open

feat(bg_remover): harden skill to v0.2.0#266
AyushSrivastava1818 wants to merge 8 commits into
ARPAHLS:mainfrom
AyushSrivastava1818:feat/bg-remover-hardening-v0.2

Conversation

@AyushSrivastava1818

Copy link
Copy Markdown
Contributor

Description

This PR upgrades the creative/bg_remover skill to v0.2.0 by improving performance, robustness, and documentation.

Changes

  • Cache rembg inference sessions to avoid repeated session creation.

  • Add comprehensive input validation:

    • Invalid Base64 input
    • Missing files
    • Empty files
    • Corrupt images
    • Directory paths
  • Enforce a maximum input size of 25 MB.

  • Automatically create parent directories for output_path.

  • Update skill documentation and usage guidance.

  • Bump the skill version to 0.2.0.

  • Expand tests to cover the new validation and caching behavior.

Type of Change

  • New Skill
  • Skill Upgrade
  • Bug Fix
  • Documentation
  • Framework Feature
  • CLI
  • Examples
  • Packaging
  • RFC / meta

Checklist (all PRs)

  • Linked GitHub issue (Fixes #257)
  • Scope matches the issue — no unrelated refactors
  • python -m black --check . and flake8 pass locally (or CI-equivalent subset)
  • pytest skills/ and pytest tests/ pass locally when relevant
  • CHANGELOG.md updated under [Unreleased] when user-visible behavior changes
  • examples/README.md updated if this PR adds, renames, or removes a runnable script (not applicable)
  • Ran pytest tests/test_registry_docs.py when skills, examples index, or agent-loops matrix changed (not applicable)

New or updated skill

Bundle and metadata

  • Skill at skills/<category>/<skill_name>/
  • manifest.yaml updated with version and metadata
  • Optional metadata preserved where applicable

Logic, cognition, tests

  • Deterministic skill.py
  • instructions.md updated
  • card.json issuer matches manifest (unchanged)
  • test_skill.py updated to cover new behavior
  • Skill loads successfully

Documentation and catalog

  • docs/skills/bg_remover.md updated
  • Usage examples for providers updated (not required for this change)

Constitution and safety (skills only)

The skill performs all processing locally using rembg. It validates inputs before processing, rejects invalid or oversized inputs, and does not make external network requests after the initial model download.

Related Issues

Fixes #257

@AyushSrivastava1818 AyushSrivastava1818 changed the title Feat/bg remover hardening v0.2 feat(bg_remover): harden skill to v0.2.0 Jul 24, 2026
@rosspeili

Copy link
Copy Markdown
Contributor

Thanks for picking this up @AyushSrivastava1818, the hardening direction looks right (session cache, validation, size limits, v0.2.0). Before I can review the code, the branch history needs a clean reset.

  • This PR includes 8 commits, including the original bg_remover add (6fd01d4 / review follow-ups). That work is already on main via feat(creative): add offline background removal skill #244.
  • So GitHub is replaying “add the skill” on top of a tree that already has it → conflicts on almost every bundle file + CHANGELOG.md.
  • A PR opened today shouldn’t need to re-land last week’s merge history.

What to do

  1. Sync your fork, then start fresh from current upstream main:
git fetch upstream
git checkout main
git pull upstream main
git checkout -b feat/bg-remover-hardening-v0.2-clean
  1. Cherry-pick only the hardening delta (or re-apply the v0.2 changes by hand onto the existing skills/creative/bg_remover/ on main). Do not include the “add offline background removal skill” commits.
  2. Resolve CHANGELOG.md by adding a single [Unreleased]Changed line for the v0.2 hardening, don’t re-add the “Added creative/bg_remover” entry (that’s already released history).
  3. Force-push the clean branch here, or open a new PR and close this, up to you:
git push -u origin feat/bg-remover-hardening-v0.2-clean

Scope check vs #257

Keep this PR to: session reuse, input/path/size validation + distinct error codes, docs/tests/manifest 0.2.0, CHANGELOG. Optional later: examples/bg_remover_demo.py + registry-docs matrix if you touch those.

Once the diff is only v0.1 → v0.2 on top of current main, ping us and we’ll review properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Skill Upgrade]: creative/bg_remover — hardening to 0.2.0

2 participants