| name | secondhand-listing |
| description | Prepare Hebrew secondhand-item listings for Facebook Groups with fact-safe copy, optional Gemini image cleanup, joined-group research through the user's Chrome session, and human-approved drafting. Use when the user asks to sell, list, or publish a used item, including requests such as "ืคืจืกืื ืคืจืื ืื ืฉื ืืื", while requiring the user to review and click the final Post button. |
Secondhand Listing
Prepare a secondhand sale listing from item details through a ready-to-review Facebook Group draft.
Non-negotiable rules
- Treat user-provided item details as the only source of truth. Never invent purchase date, original price, reason for sale, warranty, condition, scarcity, or flexibility.
- Never click the final Facebook Post button. Stop after text and image are loaded so the user can review and publish personally.
- Never send messages, call advertisers, contact buyers, join groups, or change account settings.
- Search only for relevant groups the user already belongs to. Respect group rules and Facebook terms.
- Never print, store in generated output, or commit API keys, cookies, passwords, or session data.
- Keep the Hebrew copy natural and concise. Do not use an em dash. Put one space before question marks and exclamation marks.
Requirements
- Python 3 with dependencies from
requirements.txt
- Chrome with an existing Facebook login
- Chrome DevTools Protocol on port 9222 for the preferred browser flow
GEMINI_API_KEY in .env.secrets, .env, or the process environment for Gemini copy and image workflows
If Gemini is unavailable, use the keyless workflow with user-approved text and the original image.
Workflow
1. Collect facts
Ask for:
- item type and brand
- size or dimensions
- exact condition
- asking price in ILS
- pickup city or area
- additional facts the user wants disclosed
- at least one source image when image handling is requested
If a missing detail would change the public claim, ask for it. Do not fill it in.
2. Create two listing variations
Run interactively:
python scripts/generate_listing.py
Or provide values directly:
python scripts/generate_listing.py \
--brand "IKEA" \
--size "120x80" \
--condition "Good condition" \
--price "250" \
--location "Ramat Gan" \
--description "Pickup only"
The script writes listing_draft.txt. Show both variations to the user and get a selection before drafting a post.
3. Clean the product image
When the user requests image cleanup and Gemini is configured, run:
python scripts/generate_image.py product.jpg -o catalog.jpg
The script must send this fixed prompt exactly:
ืชืฉื ื ืืช ืชืืื ืช ืืืืฆืจ ืืชืืื ืช ืงืืืื ืืงืฆืืขืืช ืืกืื ืื ืืืืื. ืืจืืฉืืช: ืจืงืข ืืื ื ืงื (#FFFFFF) ยท ืชืืืจืช ืกืืืืื ืจืื ืืืคืืืจืช ืืฉื ื ืืฆืืืื ืขื ืฆื ืขืืื ืืืืขื ืืชืืช ืืืืฆืจ ยท ืืืืฆืจ ืืืืจืื ืืชืืคืก 85% ืืืคืจืืื ยท ืืืืืช 3/4 ืฉืืจืื ืขืืืง ยท ืืืืช ืืืื ืืื ืืฉืืืฉ ยท ืืืืืช ืงืืืื ืืกืืจื ืคืืืืจืืืืืกืื ยท ืืจืื ื ืงื ืืืื ืืืืืกืื ยท ืฉืืืจื ืขื ืืฆืืขืื ืืืงืืจืืื ยท ืกืื ืื ืืืงืจื ยท ืืจืื ืคืจืืืืื ืืืืืฉ ยท 32k UHD ยท ืชืฉืืืจ ืขื ืืืชื ืืืฆืจ ืืืืืง ืขื ืืืชื ืฆืืขืื ืืคืจืืื ืืชืฉืืจื ืจืง ืจืงืข, ืชืืืจื ืืงืืืคืืืืฆืื.
Check that the output preserves the product's shape, color, labels, damage, and identifying details. If it changes a material detail, use the original image.
If Gemini is unavailable or processing fails, keep the original image.
4. Research joined groups and prepare drafts
Prefer an already-open Chrome session launched with CDP:
chrome.exe --remote-debugging-port=9222
Then run:
python scripts/facebook_post.py --text-file listing_draft.txt --image catalog.jpg
The script asks for city, optional category, target groups, and listing variation. It loads the selected text and image in each group and pauses.
At every pause:
- Tell the user which group is open.
- Ask the user to verify the group rules, facts, price, image, and audience.
- Let the user click Post personally.
- Continue only after the user confirms.
The script waits 30 to 60 seconds between groups.
Keyless workflow
Use prepared content without Gemini:
python scripts/facebook_post.py --text "Your approved listing" --image path/to/photo.jpg
Or:
python scripts/facebook_post.py --text-file path/to/approved-draft.txt --image path/to/photo.jpg
CLI reference
generate_listing.py
--brand: item brand or type
--size: size or dimensions
--condition: exact condition
--price: asking price in ILS
--location: pickup location
--description: additional facts
generate_image.py
image: required source image path
-o, --output: output path, default catalog.jpg
facebook_post.py
--text: direct listing text
--text-file: approved draft path
--image: image path
--cdp: Chrome CDP port, default 9222
--profile: Chrome profile directory for the non-CDP fallback
Completion criteria
The task is complete only when:
- the public facts match the user's input
- the user selected or approved the copy
- the chosen image was checked for material alterations
- the draft is loaded in the intended group
- the user retains the final publishing action
Do not claim that a post was published unless the user confirms the final click and the live post is visible.