Whenever the user requests PPTX generation with external material (link, file, or text):

----------------------------------------------
STEP 0 – FIXED WORKING DIRECTORY (MANDATORY)
----------------------------------------------

All operations MUST occur inside:
$HOME/.openclaw/workspace/openclaw_folder

Execute:
cd $HOME/.openclaw/workspace/openclaw_folder

STEP 1 – PREPARATION (MANDATORY)

The file generate_openclaw_ppt_template.py is located in $HOME/.openclaw/workspace/openclaw_folder
The file read_url is located in $HOME/.openclaw/workspace/openclaw_folder
The file read_file is located in $HOME/.openclaw/workspace/openclaw_folder

Required:

read_url for links
read_file for local files

🔄 GITHUB LINK HANDLING (REQUIRED)

If the link contains:
github.com/.../blob/...
Automatically convert to:
raw.githubusercontent.com/USER/REPO/BRANCH/PATH
BEFORE calling read_url.

Example:
Original:
https://github.com/user/repo/blob/main/app.py
Convert to:
https://raw.githubusercontent.com/user/repo/main/app.py
Then call:
read_url <raw_url>

If the returned content contains <html or <script>, extract only visible text, removing HTML tags.

* If the content cannot be read successfully → ABORT.

MANDATORY PIPELINE:

1) Save material to file:
(exec read_url <url> > $HOME/.openclaw/workspace/openclaw_folder/material_raw.txt)

2) Analyze material_raw.txt and generate content.json explicitly:
(exec cat > $HOME/.openclaw/workspace/openclaw_folder/content.json << 'EOF'
<valid JSON only>
EOF)

    cover_title (string)
    introduction, technologies, architecture, problems, demo, conclusion (objects)
    - Each chapter object MUST have:
    bullets: 3–6 bullets (short, objective)
    keywords: 5–12 terms that appear literally in the material
    evidence: 2–4 short excerpts (10–25 words) taken from the material, without HTML
    - It is FORBIDDEN to use generic bullets without keywords from the material.
    - VALIDATION: if it is not possible to extract at least 20 unique keywords from the total material → ABORT.

3) Validate JSON:
(exec python -m json.tool $HOME/.openclaw/workspace/openclaw_folder/content.json)

Only after successful validation:
(exec export OCI_LINK_DEMO="<url>")
(exec python generate_openclaw_ppt_template.py)

STEP 4 – MODIFICATION VALIDATION [STRICT VERSION]

Before running:

- Verify that each chapter contains at least 1 literal keyword from the material.
- Verify that at least 8 keywords appear in 4 or more slides.
- Verify that each chapter contains at least 1 piece of evidence.
If it fails → ABORT.

STEP 5 – EXECUTION

Only now execute:

SET THE ENVIRONMENT VARIABLE WITH THE URL PASSED AS A BASIS FOR DOCUMENTATION: `export OCI_LINK_DEMO=<link passed as documentation>`

SET THE ENVIRONMENT VARIABLE WITH THE FILE NAME GENERATED WITH CONTENT READ FROM THE LINK: `export OCI_CONTENT_FILE=<NAME OF THE GENERATED FILE>`

`python $HOME/.openclaw/workspace/openclaw_folder/generate_openclaw_ppt_template.py`

STEP 6 – UPLOAD

First, delete the file in object storage: `openclaw_oci_presentation.pptx`

And only then upload it to Object Storage: `oci os object put \
--bucket-name hoshikawa_template \
--file` $HOME/.openclaw/workspace/openclaw_folder/openclaw_oci_presentation.pptx \

--force

STEP 7 – GENERATE PRE-AUTH LINK
oci os preauth-request create ...