shell-doc-gen-and-locate
Generate documents via shell commands and locate nested outputs using find.
- License 许可
- MIT
- 所属仓库
- HKUDS/AgentPilot
- 最近更新
- 2026-11-12
- Stars
- ★ 8.0k
- Forks
- 944
01 前言 Front Matter
- name
- shell-doc-gen-and-locate
- description
- Generate documents via shell commands and locate nested outputs using find.
02 资源文件 1
- 其他.skill_id38 B
03 SKILL.md 正文
Shell Document Generation and Retrieval Workflow
Objective
Enable reliable file creation (e.g., PowerPoint, PDFs) when direct API or library-based generation fails, ensuring the final artifact is located and moved to the working directory regardless of nested output paths.
When to Use
- Standard document generation tools (e.g., direct Python library calls in-memory) fail or are unavailable.
- The
shell_agentcapability is available for executing scripts. - Generated files may be saved in unpredictable nested directories within the workspace.
Procedure
1. Attempt Shell-Based Generation
If direct tool invocation fails, delegate file creation to a shell-executed script.
- Write a script (e.g.,
generate_presentation.pyormake_doc.sh) that produces the file. - Execute the script via the shell agent.
- Ensure the script prints confirmation upon completion.
2. Locate the Output File
Do not assume the file is in the current directory. Shell scripts often create outputs in nested folders (e.g., ./workspace/output/, ./build/).
-
Use the
findcommand to search the workspace recursively. -
Example for PowerPoint files:
find . -type f -name "*.pptx"
-
Example for PDF files:
find . -type f -name "*.pdf"
-
Filter results by modification time if multiple versions exist (e.g.,
-mmin -10).
3. Retrieve to Working Directory
Once the file path is identified:
-
Copy the file to the root working directory or the expected delivery location.
cp /path/to/nested/file.pptx ./
-
Verify the file exists and is non-zero size.
4. Verification
- Confirm the file opens correctly or meets size expectations.
- If the file is not found after
find, check stderr of the generation script for path clues.
Best Practices
- Explicit Paths: Whenever possible, configure generation scripts to output to a known relative path (e.g.,
./output/filename.pptx). - Cleanup: Remove nested temporary copies after retrieving the final version to avoid confusion.
- Logging: Echo the final absolute path of the generated file in the script stdout to simplify locating.
04 同仓库更多 Skills
agentpilot
Set up AgentPilot and use its single entry to prepare missing inputs and run configured RSI experiments. Use when the user requests AgentPilot installation or work with AgentPilot.
remember
Review auto-memory entries and propose promotions to OPENSPACE.md, OPENSPACE.local.md, or retained auto-memory topics; detect duplicates, stale facts, conflicts, and ambiguous entries before making changes.
skill-discovery
Search reusable OpenSpace skills locally, and browse cloud packages step by step when a cloud skill may help. Reusing proven skills saves tokens, improves reliability, and extends your capabilities beyond built-in tools.
delegate-task
Delegate tasks to OpenSpace — a full-stack autonomous worker for coding, DevOps, web research, and desktop automation, backed by an extensive MCP tool and skill library. Skills auto-improve through use, reducing token consumption over time. A cloud community lets agents share and collectively evolve reusable skills.
write-special-chars-ts-check
Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, plus a reliable TypeScript type-checking step that filters output to only the newly-written files to avoid being misled by pre-existing errors.
write-special-chars-readback
Workaround for write_file failures caused by special characters (apostrophes, backticks, template literals) using a Python heredoc script, with mandatory post-write verification via read_file and cleanup of /tmp helper scripts.