new_hwpx_master
- Repo stars 0
- Author updated Live
- Author repo Labs
- Domain
- AI
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @zasfe · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: new_hwpx_master
description: hwpx 공문/기안문 양식을 첨부하면 주제에 맞춰 공문 내용을 자동 작성 mkdir -p hwpxwork && cd hwpxwork cp 원본.hwpx 원본.zip unzi…
category: ai
runtime: Python
---
# new_hwpx_master output preview
## PART A: Task fit
- Use case: hwpx 공문/기안문 양식을 첨부하면 주제에 맞춰 공문 내용을 자동 작성 mkdir -p hwpxwork && cd hwpxwork cp 원본.hwpx 원본.zip unzip -o 원본.zip -d original Contents/section0.xml을 파싱하여 공문 필드를 식별한다. 텍스트를 수정한 <hp:p> 에서 반드시 <linesegarray> 자식 요소를 삭제해야 한다. runs entirely locally; runs on Python. Works with Claude Code, Cursor, Cline and 23 more..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “1단계: HWPX 파일 해제 / 2단계: section XML 분석 / 3단계: XML 수정” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “hwpx 공문/기안문 양식을 첨부하면 주제에 맞춰 공문 내용을 자동 작성 mkdir -p hwpxwork && cd hwpxwork cp 원본.hwpx 원본.zip unzip -o 원본.zip -d original Contents/section0.xml을 파싱하여 공문 필드를 식별한다. 텍스트를 수정한 <hp:p> 에서 반드시 <linesegarray> 자식 요소를 삭제해야 한다. runs entirely locally; runs on Python. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “1단계: HWPX 파일 해제 / 2단계: section XML 분석 / 3단계: XML 수정” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “1단계: HWPX 파일 해제 / 2단계: section XML 분석 / 3단계: XML 수정”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: new_hwpx_master
description: hwpx 공문/기안문 양식을 첨부하면 주제에 맞춰 공문 내용을 자동 작성 mkdir -p hwpxwork && cd hwpxwork cp 원본.hwpx 원본.zip unzi…
category: ai
source: zasfe/Labs
---
# new_hwpx_master
## When to use
- hwpx 공문/기안문 양식을 첨부하면 주제에 맞춰 공문 내용을 자동 작성 mkdir -p hwpxwork && cd hwpxwork cp 원본.hwpx 원본.zip unzip -o 원본.zip -d origina…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “1단계: HWPX 파일 해제 / 2단계: section XML 분석 / 3단계: XML 수정” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "new_hwpx_master" {
input -> user goal + target files + boundaries + acceptance criteria
context -> 1단계: HWPX 파일 해제 / 2단계: section XML 분석 / 3단계: XML 수정
rules -> SKILL.md triggers / order / output contract
runtime -> Python | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} HWPX 공문/기안문 자동 채우기 스킬
1단계: HWPX 파일 해제
mkdir -p hwpx_work && cd hwpx_work
cp 원본.hwpx 원본.zip
unzip -o 원본.zip -d original
해제 후 핵심 파일:
- Contents/section0.xml: 본문 (수정 대상)
- Contents/header.xml: 서식 정의
- mimetype, META-INF/, BinData/, Preview/: 수정하지 않음
2단계: section XML 분석
Contents/section0.xml을 파싱하여 공문 필드를 식별한다.
3단계: XML 수정
★★★ 가장 중요한 규칙: linesegarray 삭제 ★★★
텍스트를 수정한 hp:p 에서 반드시
linesegarray는 원본 편집기가 저장한 "줄 배치 캐시"이다. 텍스트를 변경하면 이 캐시가 무효화되어 글자가 겹쳐 보이는 현상이 발생한다. 삭제하면 한컴오피스가 파일을 열 때 자동으로 줄 배치를 재계산한다.
from lxml import etree
import copy
with open('original/Contents/section0.xml', 'rb') as f:
tree = etree.parse(f)
root = tree.getroot()
# 텍스트를 수정한 모든 <hp:p>에서 linesegarray를 반드시 삭제
def remove_linesegarray(p_element):
"""수정된 문단에서 linesegarray를 삭제한다. 필수!"""
for child in list(p_element):
if etree.QName(child.tag).localname == 'linesegarray':
p_element.remove(child)
# 텍스트 교체 예시
for elem in root.iter():
local = etree.QName(elem.tag).localname
if local == 't' and elem.text:
if elem.text.strip() == '기존텍스트':
elem.text = '새 텍스트'
# ★ 반드시 해당 <hp:p>의 linesegarray를 삭제
p = elem.getparent().getparent()
remove_linesegarray(p)
안전하게 모든 수정된 문단 처리하는 방법
# 수정 대상 <hp:p>를 추적
modified_paragraphs = set()
# 텍스트 수정 시마다 기록
def safe_set_text(t_element, new_text):
"""텍스트를 안전하게 변경하는 함수"""
t_element.text = new_text
# run -> p 순서로 올라가서 <hp:p> 찾기
run = t_element.getparent()
p = run.getparent()
modified_paragraphs.add(id(p))
# 즉시 linesegarray 삭제
remove_linesegarray(p)
# 모든 수정이 끝난 후 최종 확인 (안전장치)
for elem in root.iter():
local = etree.QName(elem.tag).localname
if local == 'p':
if id(elem) in modified_paragraphs:
remove_linesegarray(elem) # 이중 확인
절대 금지 사항
- 절대로 XML을 문자열(f-string, concat, replace)로 조합하지 않는다.
- 절대로 XML 선언()을 수동으로 추가하지 않는다.
- 절대로 section0.xml 전체를 새로 작성하지 않는다.
- 절대로 .replace()나 re.sub()로 XML을 조작하지 않는다.
긴 텍스트 삽입 시 문단 분할
def insert_multiline(parent, ref_p, texts):
"""ref_p를 복제하여 여러 문단으로 삽입. 각 문단의 linesegarray도 삭제."""
p_index = list(parent).index(ref_p)
# 첫 번째 텍스트: 원본 <hp:p>에 넣기
for t in ref_p.iter():
if etree.QName(t.tag).localname == 't':
t.text = texts[0]
break
remove_linesegarray(ref_p) # ★ 필수
# 나머지: <hp:p> 복제 후 삽입
for i, txt in enumerate(texts[1:], 1):
new_p = copy.deepcopy(ref_p)
for t in new_p.iter():
if etree.QName(t.tag).localname == 't':
t.text = txt
break
remove_linesegarray(new_p) # ★ 필수
parent.insert(p_index + i, new_p)
XML 저장
tree.write('original/Contents/section0.xml',
xml_declaration=True,
encoding=tree.docinfo.encoding or 'UTF-8',
standalone=tree.docinfo.standalone)
4단계: HWPX 재패키징
import zipfile, os
output_path = '결과물.hwpx'
with zipfile.ZipFile(output_path, 'w') as zf:
# mimetype은 반드시 첫 번째, 비압축으로
mimetype_path = os.path.join('original', 'mimetype')
if os.path.exists(mimetype_path):
zf.write(mimetype_path, 'mimetype', compress_type=zipfile.ZIP_STORED)
for dirpath, dirnames, filenames in os.walk('original'):
for filename in filenames:
filepath = os.path.join(dirpath, filename)
arcname = os.path.relpath(filepath, 'original')
if arcname == 'mimetype':
continue
zf.write(filepath, arcname, compress_type=zipfile.ZIP_DEFLATED)
5단계: 검증
from lxml import etree
import zipfile
with zipfile.ZipFile(output_path, 'r') as zf:
assert zf.testzip() is None, "ZIP 손상"
with zf.open('Contents/section0.xml') as f:
tree = etree.parse(f)
print("검증 완료")
6단계: 공문 작성 원칙
- 경어체 (합니다/습니다체)
- 두괄식 서술 (결론 → 배경 → 세부내용)
- 본문 순서: 목적/배경 → 세부 내용 → 요청/협조 사항 → 붙임
- 관용 표현: "
와 관련하여", "아래와 같이", "하여 주시기 바랍니다"
Decide Fit First
Design Intent
How To Use It
Boundaries And Review