โณ This skill is pending AI review.

Scores will appear once the review pipeline completes.

version unknown

trivia-refiner

yinon-alfred-openclaw@yinon-alfred-openclawโญ 0 starsยท last commit 4mo agoยท 0 open issues

Refine Hebrew or English trivia questions with a config-driven semi-auto workflow, guarded consensus submission, and explicit held-question review.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

โ€”/10

// RATINGS

โญGitHub Stars
โญ 0 on GitHubGitHub โ†—

New / niche

๐ŸŸขProSkills Score
โ€”
๐Ÿ“

Not yet listed on ClawHub or SkillsMP

// README

trivia-refiner

An OpenClaw skill for refining Hebrew trivia questions from a Supabase quiz database, with user approval before any database updates.

What it does now

The current workflow is:

  1. Fetch a batch of questions from raw_questions_he
  2. Fetch available categories from Supabase
  3. Build a detailed prompt with rephrasing, option-review, categorization, and formatting rules
  4. Print that prompt for Alfred to handle in the current session
  5. Wait for user review and approval
  6. Submit approved changes back to the database
  7. Track processed question IDs locally

Important model note

This skill does not currently call a hardcoded model directly from run_batch.py.

Instead, run_batch.py prints the prompt and the actual refinement work is done by Alfred in the current OpenClaw session.

So the effective model is simply:

  • whatever model Alfred is currently running

Main scripts

scripts/run_batch.py

Main entrypoint.

  • No args: fetch next 10 questions from raw_questions_he, starting after the highest ID already present in questions_he
  • With a range like 193-202: fetch that exact range
  • Fetches categories
  • Prints the full prompt for Alfred to process in-session
  • Does not directly update the database

scripts/submit_changes.py

Writes approved changes back to Supabase.

  • Validates required fields
  • Updates raw_questions_he
  • Upserts into questions_he
  • Records success/failure in tracking for audit/history

scripts/tracking.py

Manages local runtime tracking. This is audit/history only; automatic batch selection uses questions_he as the source of truth.

Tracking file:

~/.openclaw/workspace/memory/trivia-refiner-processed.json

Used for:

  • processed IDs
  • refined/failed status
  • highest processed ID for audit/history; not the next-batch source of truth
  • batch count

How to run it

Automatic / next batch

python3 scripts/run_batch.py

Specific range

python3 scripts/run_batch.py 193-202

Submit approved changes

python3 scripts/submit_changes.py changes.json

Dry run submission

python3 scripts/submit_changes.py changes.json --dry-run

What someone should know before using it

  • It is an approval-based workflow โ€” database writes should only happen after explicit approval
  • The refinement logic currently happens in the Alfred session, not inside a hardcoded Gemini/Claude pipeline
  • It depends on Supabase credentials stored at:
~/.openclaw/workspace/memory/supabase-creds.json

Expected format:

{
  "url": "https://xxxx.supabase.co",
  "key": "your-service-role-key"
}
  • It updates two tables when submitting approved changes:
    • raw_questions_he
    • questions_he

In one sentence

This skill is currently a prompt-driven, human-approved trivia refinement workflow that uses Alfredโ€™s current session model for the actual question processing.

License

MIT

// HOW IT'S BUILT

// FILES

2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • trivia-refiner/SKILL.md7.9 KBupstream โ†—
    ---
    name: trivia-refiner
    description: "Refine Hebrew or English trivia questions with a config-driven semi-auto workflow, guarded consensus submission, and explicit held-question review."
    ---
    
    # Trivia Refiner โ€” Semi-Auto Review Workflow
    
    **๐ŸŽฏ DATABASE: Quiz Supabase (`uhfsfedwteeoxsvixvtr`)**
    
    This skill refines Hebrew and English trivia questions with guarded automation. Yinon has approved semi-auto mode: clean high-confidence questions may be submitted automatically, while risky questions must be held for review.
    
    Language selection is explicit and config-driven. Do not rely on session memory to choose the language:
    
    ```bash
    python3 scripts/run_batch.py --lang he
    python3 scripts/run_batch.py --lang en
    python3 scripts/submit_changes.py changes.json --lang he
    python3 scripts/submit_changes.py changes.json --lang en
    ```
    
    Configs:
    - `config/he.json`: `raw_questions_he` -> `questions_he`, tracking `memory/trivia-refiner-processed.json`, artifacts `memory/trivia-consensus/he`
    - `config/en.json`: `questions_raw_en` -> `questions_en`, tracking `memory/trivia-refiner-en-processed.json`, artifacts `memory/trivia-consensus/en`
    
    Compatibility:
    - Hebrew cron wrapper calls `run_batch.py --lang he`
    - English cron wrapper calls `run_batch.py --lang en`
    - The old English skill wrapper delegates to this unified runner with `--lang en`
    
    **Current mode:** Auto-submit only clean questions with score **7+**. Send all flagged, reconstructed, fragile, or score โ‰ค6 questions to Yinon before any DB write for those held items.
    
    ---
    
    ## The Workflow
    
    ### Stage 1: FETCH (Automatic via cron)
    
    ```bash
    0 12 * * 0-5 python3 scripts/fetch_batch.py
    ```
    
    **What happens:**
    - Fetches next 10 unprocessed questions from Quiz DB
    - Shows raw questions
    - Asks: "Ready to rephrase? Reply: REPHRASE X-Y"
    - **STOPS and waits**
    
    **What it does NOT do:**
    - No processing
    - No database changes
    - No assumptions
    
    ---
    
    ### Stage 2: REPHRASE + SEMI-AUTO UPDATE
    
    When you reply `REPHRASE X-Y`:
    
    1. **I pre-fact-check every raw question before rephrasing**
       - Validate the question premise, correct answer, all options, and ambiguity/currentness risk
       - Use internal knowledge for simple stable facts; use web verification when the fact is uncertain, disputed, current/time-sensitive, superlative-based, nickname-based, percentage/date-based, or otherwise suspicious
       - Classify the fact-check as `passed`, `web_verified`, `valid_with_rewording`, `uncertain`, or `failed`
    2. **I rephrase** the questions (improve Hebrew phrasing, clarity) using the verified fact-check result
    3. **I review options** (replace overly specific ones with plausible alternatives, and ensure no distractor is also correct)
    4. **I assign categories & difficulty** (best match from available categories)
    5. **I add a self-score (1-10)** for each refined question
    6. **I include the fact-check data in the shared review artifact** so Alfred/main review can audit the premise, answer, options, notes, and sources
    7. **I classify each question** as AUTO-SUBMIT or HOLD FOR REVIEW
    8. **I auto-submit only clean AUTO-SUBMIT questions** with the `update_question` RPC/submit script
    9. **I send Yinon only the held questions** plus a daily summary of how many were updated and how many need review
    10. **Held questions are updated only after explicit approval/fixes**
    
    **Critical:** Semi-auto approval applies only to clean high-confidence questions. Anything risky is still approval-first.
    
    ### Auto-submit eligibility
    
    Auto-submit a question only when **all** are true:
    - Final score is **7+** and Alfred/main agrees with the exact proposed final version
    - No ๐Ÿšฉ warning
    - No โš ๏ธ low-score line
    - Not reconstructed from damaged/missing source text
    - Not a fragile โ€œื›ืœ ื”ืชืฉื•ื‘ื•ืช ื ื›ื•ื ื•ืชโ€ / โ€œืืฃ ืชืฉื•ื‘ื” ืื™ื ื” ื ื›ื•ื ื”โ€ logic question
    - No factual uncertainty, ambiguity, disputed wording, or outdated-fact risk
    - Fact-check is visible in the batch artifact and is `passed` or `web_verified` with clean premise, correct answer, and option validation
    - Correct answer is preserved and the option set is safe
    - Alfred/main is a reviewer only. Do not ask Alfred/main for rewrites, improved wording, or replacement update fields; if Alfred/main returns a rewrite anyway, treat that question as rejected/unresolved and hold it for review
    
    Hold for review when **any** are true:
    - Final score is **โ‰ค6**, including after Alfred/main review
    - Any ๐Ÿšฉ or โš ๏ธ appears
    - Question was reconstructed from options/damaged source
    - Question has โ€œall/none of the aboveโ€ fragile logic
    - Fact requires external verification or feels uncertain
    - Fact-check status is `uncertain` or `failed`, or fact-check data is missing/incomplete
    - Any option is ambiguous, duplicated, accidentally correct, outdated, or source-dependent
    - Options are weak, ambiguous, duplicated, or may create a second correct answer
    - The model is not confident enough to submit unattended
    - The refiner ranks it low and Alfred/main agrees the final version remains low/risky
    
    Always send a daily summary, even when nothing is held:
    - `Hebrew trivia: updated X questions automatically, held Y for review.`
    - If Y > 0, include only the held question blocks for review.
    
    Every held question should include a safe suggested replacement when one can be made without inventing unsupported facts. The suggestion must address the exact flag/rejection reason and include source URLs when web verification was needed.
    
    If no safe suggestion can be made, say so and explain the blocker instead of forcing a weak rewrite.
    
    ---
    
    ## Step-by-Step Detail
    
    ### Fetch Stage
    
    **Script:** `scripts/fetch_batch.py`
    - Reads the highest existing ID from `questions_he`
    - Fetches the next 10 raw questions from `raw_questions_he`, starting at `max(questions_he.id) + 1`
    - Prints them for user review
    - Exits and waits
    
    Example output:
    ```
    ๐Ÿ“‹ BATCH FETCHED โ€” 10 questions (IDs 203โ€“212)
    
    ID 203 | Hebrew question text...
    ID 204 | Hebrew question text...
    ...
    
    โธ๏ธ Ready to rephrase? Reply:
       REPHRASE 203-212
    ```
    
    ---
    
    ### Rephrase + Review Stage
    
    **When you reply:** `REPHRASE 203-212`
    
    **What I do:**
    
    1. **Fetch questions 203-212** from Quiz DB
    2. **Pre-fact-check each raw question before rephrasing**
       - Check the core premise, the stored correct answer, and every option
       - Confirm that exactly one answer is correct unless the original structure is explicitly `ื›ืœ ื”ืชืฉื•ื‘ื•ืช ื ื›ื•ื ื•ืช` / `ืืฃ ืชืฉื•ื‘ื” ืื™ื ื” ื ื›ื•ื ื”`
       - Detect outdated, source-dependent, ambiguous, disputed, exaggerated, or overly broad facts before spending effort on rewriting
       - Use web search/fetch for facts involving nicknames, superlatives, percentages, dates, โ€œfirst/most/largestโ€, current facts, geography/history claims that feel uncertain, or anything the model cannot verify confidently from stable knowledge
       - If the fact is valid only with narrower wording, mark `valid_with_rewording` and use that safer wording in the rephrase
       - If the fact cannot be verified confidently, mark `uncertain` or `failed`, keep it out of auto-submit, and hold/skip according to severity
       - Preserve a compact fact-check block in the output/JSON for Alfred/main review; do not keep the evidence hidden inside the trivia manager
    3. **Rephrase each question** in natural Hebrew
       - Keep question meaning identical
       - Improve phrasing for clarity
       - Hebrew only (no English, no translations)
       - If the source question is damaged/missing but the options and correct answer exist, flag it and try to reconstruct a sensible question from that context
       - If reconstruction is plausible, include the reconstructed question in the batch with a ๐Ÿšฉ warning and a low confidence score
       - If no good question can be inferred safely, skip it; do not invent a weak question just to fill the batch
       - True/false questions are valid when Option 1/2 are the only answers and Option 3/4 are null/empty; do **not** mark them damaged just because they have only two answers
    4. **Review wrong options**
       - Preserve correctness over forced option changes
       - Rephrase the 
  • README.mdupstream โ†—

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/yinon-alfred-openclaw-trivia-refiner-trivia-refiner.md

// REPO STATS

0 stars
0 open issues
Last commit: 4mo ago