shell-doc-gen-and-locate
Generate documents via shell commands and locate nested outputs using find.
- License 许可
- MIT
- 最近更新
- 2026-04-06
- Stars
- ★ 0
- Forks
- 0
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
zip-export-deliverable
Ensures codebase deliverables are properly exported as ZIP archives through a dedicated finalization step
zip-deliverable-finalization
Ensure codebase deliverables are properly packaged as ZIP exports in a dedicated final step
zero-iteration-failure-analysis
Identify and handle agent failures with 0 iterations as pre-execution system issues
write-file-fallback-report
Generate professional documents using write_file when primary data sources fail, leveraging embedded domain knowledge instead of external retrieval
fallback-doc-with-delegation
Generate professional documents after tool failures using shell_agent for complex formats or write_file for simple text/markdown
context-anchored-fallback-report
Generate documents with write_file when retrieval tools fail, with explicit guardrails against task context drift