[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C4PWBHB5WX1KQ1E4M8DPZF":3,"skill-same:01M7C4PWBHB5WX1KQ1E4M8DPZF":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":13,"repositoryHtmlUrl":31,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7C4PWBHB5WX1KQ1E4M8DPZF","for-each-line",null,"Processes every line of a file one by one, transforming or extracting information from each line","SillyHippy\u002Fzo-skills","SillyHippy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F159052837?v=4","01M7C43A8PDYMCDPTNFYF2RSC1","01M7C43A9CBS76QPH4PPTKXX54",0,"MIT","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-for-each-line\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: for-each-line\ndescription: Processes every line of a file one by one, transforming or extracting information from each line\nmetadata:\n  author: Zo\n  category: Official\n  display-name: Process file line-by-line with script\n  emoji: 🔄\n---\n\nProcess files line-by-line using `zo` to transform or extract data from each line.\n\n#### Notes on zo\n\n`zo` is a command-line program that gives Zo access to Zo itself, with all the same prompts, tools, and power. It's located at `\u002Fusr\u002Flocal\u002Fbin\u002Fzo`.\n\n```bash\n➜  ~ zo -h\nusage: zo [-h] [--output-format OUTPUT_FORMAT] input\n\nCall Zo AI with optional structured output\n\npositional arguments:\n  input                 Input text to send to Zo\n\noptions:\n  -h, --help            show this help message and exit\n  --output-format OUTPUT_FORMAT\n                        JSON schema for structured output (optional)\n\nExamples:\n  zo \"hello\"\n  zo \"what's 2+2?\" --output-format '{\"type\": \"object\", \"properties\": {\"answer\": {\"type\": \"number\"}}, \"required\": [\"answer\"]}'\n\noutput_format uses OpenAI's structured output JSON schema format.\nKeep schemas flat (max 1-2 levels) for best results.\n```\n\n# Protocol\n\n## Step 1: Ask clarifying questions\n\nDo NOT assume. Ask the user:\n\n- What should be extracted\u002Ftransformed from each line?\n- What format should the output be?\n- What happens if a line fails - halt everything or continue?\n\n## Step 2: Create the processing script\n\nCreate a script in the conversation workspace.\n\nRequirements:\n\n- Flat schemas: Keep `output_format` max 1-2 levels deep\n- Never swallow errors: Use `check=True`, no try\u002Fexcept hiding failures\n- Sequential processing: Each line waits for the previous (70s timeout per line)\n- Include context necessary to the task in every call: Each zo call is independent\n- Incremental writes: Flush after each line so partial results are saved if script crashes\n\n**Use this template** and customize the `process_line` function based on user requirements:\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport subprocess\nimport json\nimport sys\nfrom pathlib import Path\nfrom typing import List, Dict, Any\n\ndef parse_file_lines(filepath: Path) -> List[str]:\n    \"\"\"Split file into lines, keeping newlines. Must satisfy: ''.join(lines) == original.\"\"\"\n    with open(filepath, 'r') as f:\n        content = f.read()\n    lines = content.splitlines(keepends=True)\n    return lines\n\ndef call_zo(prompt: str, output_format: Dict[str, Any] = None) -> Any:\n    \"\"\"Call zo with the given prompt. Errors bubble up for visibility.\"\"\"\n    cmd = [\"zo\", prompt]\n    if output_format:\n        cmd.extend([\"--output-format\", json.dumps(output_format)])\n\n    result = subprocess.run(\n        cmd, capture_output=True, text=True, check=True, timeout=70\n    )\n    response = json.loads(result.stdout)\n    return response[\"output\"]\n\ndef process_line(line: str, instruction: str) -> str:\n    \"\"\"Process a single line. Customize based on user requirements.\"\"\"\n    # Keep output_format flat (max 1-2 levels)\n    output_format = {\n        \"type\": \"object\",\n        \"properties\": {\n            \"result\": {\"type\": \"string\", \"description\": \"the processed result\"}\n        },\n        \"required\": [\"result\"]\n    }\n\n    # Include all context in each call (calls are independent)\n    prompt = f\"{instruction}\\n\\nInput: {line.strip()}\"\n    output = call_zo(prompt, output_format)\n    return output[\"result\"]\n\ndef process_file(input_path: Path, output_path: Path, instruction: str) -> None:\n    \"\"\"Process each line sequentially, writing results incrementally.\"\"\"\n    lines = parse_file_lines(input_path)\n\n    if not lines:\n        print(\"No lines to process\")\n        return\n\n    with open(output_path, 'w') as f:\n        for i, line in enumerate(lines, 1):\n            print(f\"Processing line {i}\u002F{len(lines)}...\", file=sys.stderr)\n            result = process_line(line, instruction)\n            f.write(result + '\\n')\n            f.flush()  # Write immediately for crash recovery\n\n    print(f\"\\nComplete! Output written to {output_path}\")\n\ndef main():\n    if len(sys.argv) \u003C 3:\n        print(\"Usage: .\u002Fscript.py \u003Cinput_file> \u003Coutput_file> [instruction]\")\n        sys.exit(1)\n\n    input_path = Path(sys.argv[1])\n    output_path = Path(sys.argv[2])\n    instruction = sys.argv[3] if len(sys.argv) > 3 else \"process this line\"\n\n    if not input_path.exists():\n        print(f\"Error: Input file {input_path} does not exist\", file=sys.stderr)\n        sys.exit(1)\n\n    process_file(input_path, output_path, instruction)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Step 3: Test with the first line and get confirmation\n\nBefore running the batch script, test by calling `zo` directly on the first line:\n\n1. Read the first line from the file\n2. Construct a test prompt matching what the script will use: `{instruction}\\n\\nInput: {first_line_content}`\n3. Call `zo` via Bash with the same output format the script will use\n4. Show the user the test result\n5. **Ask the user**: \"Does this result look correct? Should I proceed with processing all lines?\"\n6. Wait for user confirmation before continuing\n\nIf the user is not satisfied, ask what needs to be adjusted and refine the approach. You may need to revise the instruction, output format, or processing logic.\n\n**Example test command:**\n\n```bash\nzo \"Extract the email address.\\n\\nInput: John Doe \u003Cjohn@example.com>\" \\\n  --output-format '{\"type\": \"object\", \"properties\": {\"result\": {\"type\": \"string\"}}, \"required\": [\"result\"]}'\n```\n\n## Step 4: Create the output file\n\nYou must use `tool create_or_rewrite_file` to create an empty output file. This allows the user to open it in their editor and watch results stream in. You must never use touch to create the output file.\n\n## Step 5: Run the full batch\n\nExecute the script via Bash to process all lines:\n\n```bash\npython3 process_script.py input.txt output.txt \"instruction\"\n```\n\nThe script writes results incrementally to the output file.\n\n# Output\n\nInform the user when processing is complete. Show:\n\n- Total lines processed\n- Location of output file\n- Any errors encountered\n\n","Process files line-by-line using `zo` to transform or extract data from each line.\n\n#### Notes on zo\n\n`zo` is a command-line program that gives Zo access to Zo itself, with all the same prompts, tools, and power. It's located at `\u002Fusr\u002Flocal\u002Fbin\u002Fzo`.\n\n```bash\n➜  ~ zo -h\nusage: zo [-h] [--output-format OUTPUT_FORMAT] input\n\nCall Zo AI with optional structured output\n\npositional arguments:\n  input                 Input text to send to Zo\n\noptions:\n  -h, --help            show this help message and exit\n  --output-format OUTPUT_FORMAT\n                        JSON schema for structured output (optional)\n\nExamples:\n  zo \"hello\"\n  zo \"what's 2+2?\" --output-format '{\"type\": \"object\", \"properties\": {\"answer\": {\"type\": \"number\"}}, \"required\": [\"answer\"]}'\n\noutput_format uses OpenAI's structured output JSON schema format.\nKeep schemas flat (max 1-2 levels) for best results.\n```\n\n# Protocol\n\n## Step 1: Ask clarifying questions\n\nDo NOT assume. Ask the user:\n\n- What should be extracted\u002Ftransformed from each line?\n- What format should the output be?\n- What happens if a line fails - halt everything or continue?\n\n## Step 2: Create the processing script\n\nCreate a script in the conversation workspace.\n\nRequirements:\n\n- Flat schemas: Keep `output_format` max 1-2 levels deep\n- Never swallow errors: Use `check=True`, no try\u002Fexcept hiding failures\n- Sequential processing: Each line waits for the previous (70s timeout per line)\n- Include context necessary to the task in every call: Each zo call is independent\n- Incremental writes: Flush after each line so partial results are saved if script crashes\n\n**Use this template** and customize the `process_line` function based on user requirements:\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\nimport subprocess\nimport json\nimport sys\nfrom pathlib import Path\nfrom typing import List, Dict, Any\n\ndef parse_file_lines(filepath: Path) -> List[str]:\n    \"\"\"Split file into lines, keeping newlines. Must satisfy: ''.join(lines) == original.\"\"\"\n    with open(filepath, 'r') as f:\n        content = f.read()\n    lines = content.splitlines(keepends=True)\n    return lines\n\ndef call_zo(prompt: str, output_format: Dict[str, Any] = None) -> Any:\n    \"\"\"Call zo with the given prompt. Errors bubble up for visibility.\"\"\"\n    cmd = [\"zo\", prompt]\n    if output_format:\n        cmd.extend([\"--output-format\", json.dumps(output_format)])\n\n    result = subprocess.run(\n        cmd, capture_output=True, text=True, check=True, timeout=70\n    )\n    response = json.loads(result.stdout)\n    return response[\"output\"]\n\ndef process_line(line: str, instruction: str) -> str:\n    \"\"\"Process a single line. Customize based on user requirements.\"\"\"\n    # Keep output_format flat (max 1-2 levels)\n    output_format = {\n        \"type\": \"object\",\n        \"properties\": {\n            \"result\": {\"type\": \"string\", \"description\": \"the processed result\"}\n        },\n        \"required\": [\"result\"]\n    }\n\n    # Include all context in each call (calls are independent)\n    prompt = f\"{instruction}\\n\\nInput: {line.strip()}\"\n    output = call_zo(prompt, output_format)\n    return output[\"result\"]\n\ndef process_file(input_path: Path, output_path: Path, instruction: str) -> None:\n    \"\"\"Process each line sequentially, writing results incrementally.\"\"\"\n    lines = parse_file_lines(input_path)\n\n    if not lines:\n        print(\"No lines to process\")\n        return\n\n    with open(output_path, 'w') as f:\n        for i, line in enumerate(lines, 1):\n            print(f\"Processing line {i}\u002F{len(lines)}...\", file=sys.stderr)\n            result = process_line(line, instruction)\n            f.write(result + '\\n')\n            f.flush()  # Write immediately for crash recovery\n\n    print(f\"\\nComplete! Output written to {output_path}\")\n\ndef main():\n    if len(sys.argv) \u003C 3:\n        print(\"Usage: .\u002Fscript.py \u003Cinput_file> \u003Coutput_file> [instruction]\")\n        sys.exit(1)\n\n    input_path = Path(sys.argv[1])\n    output_path = Path(sys.argv[2])\n    instruction = sys.argv[3] if len(sys.argv) > 3 else \"process this line\"\n\n    if not input_path.exists():\n        print(f\"Error: Input file {input_path} does not exist\", file=sys.stderr)\n        sys.exit(1)\n\n    process_file(input_path, output_path, instruction)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Step 3: Test with the first line and get confirmation\n\nBefore running the batch script, test by calling `zo` directly on the first line:\n\n1. Read the first line from the file\n2. Construct a test prompt matching what the script will use: `{instruction}\\n\\nInput: {first_line_content}`\n3. Call `zo` via Bash with the same output format the script will use\n4. Show the user the test result\n5. **Ask the user**: \"Does this result look correct? Should I proceed with processing all lines?\"\n6. Wait for user confirmation before continuing\n\nIf the user is not satisfied, ask what needs to be adjusted and refine the approach. You may need to revise the instruction, output format, or processing logic.\n\n**Example test command:**\n\n```bash\nzo \"Extract the email address.\\n\\nInput: John Doe \u003Cjohn@example.com>\" \\\n  --output-format '{\"type\": \"object\", \"properties\": {\"result\": {\"type\": \"string\"}}, \"required\": [\"result\"]}'\n```\n\n## Step 4: Create the output file\n\nYou must use `tool create_or_rewrite_file` to create an empty output file. This allows the user to open it in their editor and watch results stream in. You must never use touch to create the output file.\n\n## Step 5: Run the full batch\n\nExecute the script via Bash to process all lines:\n\n```bash\npython3 process_script.py input.txt output.txt \"instruction\"\n```\n\nThe script writes results incrementally to the output file.\n\n# Output\n\nInform the user when processing is complete. Show:\n\n- Total lines processed\n- Location of output file\n- Any errors encountered\n\n",{"name":5,"metadata":23,"description":7},{"emoji":24,"author":25,"category":26,"display-name":27},"🔄","Zo","Official","Process file line-by-line with script","main","3641543f81ae80504027d6b012e0dadce4e2de40","skills\u002Fzo-for-each-line","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills","https:\u002F\u002Fgithub.com\u002FSillyHippy","2026-09-18 11:42:22",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add SillyHippy\u002Fzo-skills --skill for-each-line",{"tool":40,"command":41},"bunx","bunx skills add SillyHippy\u002Fzo-skills --skill for-each-line",{"tool":43,"command":44},"pnpm","pnpm dlx skills add SillyHippy\u002Fzo-skills --skill for-each-line","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-for-each-line\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"DISPLAY.json","REFERENCE","参考文档",69,"https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-for-each-line\u002FDISPLAY.json",[55,62,69,76,83,90],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7C4RK2ZCHPKQT393RVSC6ER","zopack","Export and import zo.space route setups as shareable .zopack.md files. Use when the user wants to package their zo.space routes for sharing, or when they receive a .zopack.md file to deploy. Triggers on \"export my zo.space\", \"create a zopack\", \"import this zopack\", or any mention of .zopack.md files.","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzopack\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M7C4REH5EJ22X3C1SF88X6KQ","zoho-mail-inbox","Full inbox management for Zoho Mail (info@justlegalsolutions.org) — list unread, mark all as read, delete by sender\u002Fkeyword, search, send from aliases, list folders. Fully self-contained — zero setup needed.","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzoho-mail-inbox\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M7C4RAJF1N9R8ZRT25GMHFBF","weekly-meeting-reminder","Get an email every Sunday evening listing your meetings for the coming week.","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-weekly-meeting-reminder\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M7C4R65Q9T6TPBRFQPWJSW4Z","twitter","Let Zo use your X (Twitter) account","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-twitter\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M7C4R358YM59EZRM3SW763VK","zo-tools","Internal process tools for Zo and Hermes — local search, document processing, OCR, and embeddings. All services run on localhost, zero HTTP slots consumed.","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-tools\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M7C4R0J4C3RQWKZ5W5W3CZ3X","ssh-setup","Sets up secure remote access to your Zo Computer so you can connect from anywhere","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-ssh-setup\u002FSKILL.md",[],[]]