docx-read-fallback
하는 일
이 스킬은 다른 방법이 실패할 때 python-docx 라이브러리로 .docx 파일에서 텍스트, 표, 제목을 꺼내는 방법을 보여 줍니다. 다른 방법으로는 열 수 없는 Word 문서를 읽어야 하는 사람에게 맞습니다.
사용하는 경우
- ✓.docx 파일에서 파일 리더가 실패하거나 시간 초과될 때.
- ✓Word 문서의 텍스트, 표 또는 제목이 필요할 때.
- ✓코드 샌드박스가 Word 파일을 읽지 못하는 경우.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/docx-read-fallback/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“AI가 제 Word 파일을 열 수 없습니다. 텍스트와 표가 있다면 꺼내 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 셸에서 짧은 Python 명령을 실행합니다. 이 명령은 python-docx로 파일의 단락, 표 또는 제목을 출력합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
DOCX Read Fallback
When read_file or execute_code_sandbox fails to read .docx files, use run_shell with python-docx as a reliable workaround.
When to Use
read_filefails, times out, or returns errors on.docxfilesexecute_code_sandboxattempts to read the docx fail- You need to extract text content from a Word document
- Multiple standard approaches have been exhausted
How to Use
Basic Text Extraction
python -c "import docx; doc = docx.Document('path/to/file.docx'); print('\n'.join([p.text for p in doc.paragraphs]))"
Using run_shell Tool
run_shell command="python -c \"import docx; doc = docx.Document('path/to/file.docx'); print('\n'.join([p.text for p in doc.paragraphs]))\"" timeout=60
Extract Paragraphs with Indices
python -c "import docx; doc = docx.Document('file.docx'); [print(f'P{i}: {p.text}') for i, p in enumerate(doc.paragraphs) if p.text.strip()]"
Extract Tables
python -c "import docx; doc = docx.Document('file.docx'); [[print([[cell.text for cell in row.cells] for row in table.rows]) for table in doc.tables]]"
Extract Headings (by style)
python -c "import docx; doc = docx.Document('file.docx'); [print(p.text) for p in doc.paragraphs if p.style.name.startswith('Heading')]"
Prerequisites
Ensure python-docx is available:
python -c "import docx; print('docx available')"
If not installed:
pip install python-docx
Tips
- Use absolute paths to avoid working directory issues
- Set appropriate
timeout(30-60 seconds for large documents) - Escape quotes properly when embedding in shell commands
- For large documents, extract content in chunks or filter by paragraph index
- This approach bypasses file type detection issues in read_file
Example Workflow
- Try
read_fileon the .docx file - If it fails, verify python-docx availability
- Use
run_shellwith the python-docx extraction command - Parse the stdout to get document content
- Proceed with your analysis using the extracted text
자주 묻는 질문
python-docx는 무엇인가요?
Word 파일을 읽고 쓰는 Python 라이브러리입니다.
표도 읽을 수 있나요?
네, 가이드에는 표 내용을 출력하는 명령이 들어 있습니다.
무엇을 설치해야 하나요?
명령을 실행하기 전에 python-docx가 있어야 한다고 가이드가 안내합니다.
상세 정보
작성자의 원본 설명
Use run_shell with python-docx as reliable fallback when read_file fails on .docx files
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #12866
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.
비슷한 스킬
feishu-doc
394k에이전트가 문서 도구를 사용해 텍스트, 이미지, 표를 포함한 Feishu 클라우드 문서를 읽고, 만들고, 편집하도록 돕습니다.
feishu-drive
394k에이전트가 봇과 공유된 Feishu 클라우드 폴더의 파일을 찾아보고, 정리하고, 댓글을 달도록 돕습니다.
feishu-perm
394k에이전트가 요청을 충족하는 가장 작은 권한을 골라, Feishu 파일에 누가 접근할 수 있는지 확인하고 바꾸도록 돕습니다.