IronWord와 ChatGPT Codex 사용법
회사가 이름을 변경할 때, 법무팀은 업데이트할 서명된 계약서 폴더를 받습니다. 이전 이름은 본문 단락, 당사자 표, 대문자 제목 및 페이지 헤더에서 발견됩니다. Word는 또한 몇 년 전 강조된 한 조각을 저장할 때 여러 서식 실행에 걸쳐 이름을 저장할 수 있습니다. 각 파일에 대한 표준 찾기-바꾸기는 일부 경우에만 수정되며, 다른 경우에는 경고 없이 변경되지 않은 상태로 남아 있습니다.
ChatGPT Codex는 OpenAI의 코딩 에이전트입니다. 저장소 내에서 파일을 편집하고, dotnet run 같은 명령을 실행한 후 변경 사항을 요약합니다. 하나의 에이전트가 터미널, IDE, ChatGPT 데스크톱 앱 및 클라우드 작업을 수행합니다. IronWord는 Iron Software의 .NET 라이브러리로, 기존 Word 문서를 코드가 편집하고 저장할 수 있는 문단, 실행 및 표의 객체 모델로 엽니다. 이는 Microsoft Office 없이 가능합니다.
Codex는 사실 기반 매니페스트가 포함된 계약 백로그를 처리합니다. 일괄 프롬프트는 계약 당 한 행이 있는 CSV를 작성하여 Codex가 보고하는 각 수를 파일에 기반합니다.
빠른 시작.NET 콘솔 프로젝트의 계약 폴더에 Codex를 시작하고 편집 전 인벤토리를 요청하세요.
$ironword Add the IronWord 2026.10.4 NuGet package to this console project.
Then have Program.cs open every .docx in Contracts/sample/ without changing it.
For each file, write one row to out/quickstart.csv with these columns:
- file
- body count, how often "Northwind Traders" appears in the body text
- table count, the same name counted separately in every table cell
- the exception type, when the file fails to open
Print the totals by reading that CSV back.
Program.cs reads the key from IRONWORD_LICENSE_KEY itself.
Don't print the key's value, and don't list environment variables.
Nothing gets saved here, so an unset key is no reason to stop.
Build and run it with at most three repair attempts, then tell me the result.
최소 워크플로우(5단계)
- NuGet에서 C# Word 라이브러리 다운로드
- IronWord의 기술을 .agents/skills/ironword/SKILL.md로 저장하여
$ironword언급을 해결합니다. - 원본을 읽기 전용으로 표시하고 모든 수를 위한 CSV가 필요함을 나타내는 AGENTS.md를 커밋하세요.
- 먼저 모든 위치를 인벤토리한 다음, 본문 및 대문자 제목의 텍스트를 바꿔 바뀐 각 표 셀을 새 셀로 교체하십시오.
- 저장된 복사본을 다시 검사하고 결과 파일을 매니페스트와 비교하여 상태를 수락하기 전에 확인하세요.
ChatGPT Codex란 무엇이며 .NET Word 문서 작업에 어떻게 적합한가요?
설치 단계는 Codex CLI 문서에 있으며, 릴리스는 오픈 소스 저장소에 게시됩니다.
Codex는 훈련 데이터와 제공된 파일에서 IronWord를 알고 있으며, 새 릴리스는 둘 다 구식으로 만들 수 있습니다. 2026.10 릴리스는 스트리밍과 비동기 호출을 통해 로드하고 저장합니다.
IronWord 프롬프트를 작성하고 Codex를 설정하는 방법은?
효과적인 일괄 프롬프트는 입력, 이름의 각 위치, 출력, 증거, 읽기 전용 실제 상태 및 제약을 명명합니다.
OpenAI의 언어 모델이 잘못된 답을 생성하는 이유에 대한 논문은 추측을 보상하는 훈련 및 평가 부분을 추적하며, 이름 변경 작업에서의 추측은 모든 계약이 깨끗하다는 것입니다.
Codex는 작업 디렉토리와 저장소 루트 사이의 각 디렉토리에서 .agents/skills에 있는 기술을 찾습니다. .agents/skills/IronWord/SKILL.md로 저장된 IronWord의 skill.md는 $ironword 언급을 해결합니다.
작업 전에 Codex는 저장소 루트와 작업 폴더 사이 경로상의 각 디렉토리에서 최대 하나의 AGENTS.md를 읽습니다. 작업 폴더에 가장 가까운 파일이 우선입니다. /init 명령어는 시작 AGENTS.md를 작성합니다.
Give this repository a top-level AGENTS.md with a Contract rebrand section.
List these rules in it:
- No DOCX library other than IronWord is allowed.
- IronWord's package is IronWord, and its namespaces are IronWord and IronWord.Models.
- The ironword skill in .agents/skills/ironword/ is one API reference.
- https://ironsoftware.com/word/csharp/llms.txt is the other.
- Contracts/inbox/ and Contracts/manifest.csv are read-only.
- Rebranded copies go to out/rebranded/ under their original names.
- IRONWORD_LICENSE_KEY holds the key, and its value never appears in output, logs or files.
- Checking the variable means its presence and length, nothing more.
- Any count you report is read from a CSV written in the same turn.
- The reply names that CSV.
IronWord를 추가하고 라이선스를 확인하도록 Codex에 요청하는 방법은?
Print the IronWord PackageReference from ContractRebrand.csproj and the version restore resolved.
Then quote every IronSoftware entry that dotnet list package --include-transitive prints.
Leave the package references exactly as they are.
IronWord 2026.10.4에서는 IronSoftware.Abstractions 2026.1.2, IronSoftware.Common 2026.4.2, IronSoftware.System.Drawing 2026.11.3을 참조합니다. 또한 IronSoftware.Drawing.Abstractions 2026.1.2도 나열된 복원합니다. 빌드는 Windows, Linux 및 macOS용 네이티브 LayoutEngineInterop 라이브러리를 실행 시간 폴더에 복사합니다. OpenXML 충돌 페이지는 2025.7.13 이전 릴리스에서 DocumentFormat.OpenXml과의 충돌에 대해 다루고 있습니다. IronWord 변경 로그를 확인한 후 고정하십시오.
키가 없으면 열기, 읽기 및 교체는 성공하지만, 비동기를 포함한 모든 저장 오버로드는 'Production License Required'라는 메시지와 함께 LicensingException을 던집니다.
Add Startup.ApplyIronWordKey and call it first in Program.cs.
It copies the IRONWORD_LICENSE_KEY value into IronWord.License.LicenseKey.
It also reports whether License.IsLicensed is true.
Add a --dry-run switch that opens and edits in memory and never saves.
Then run the sample twice with the variable removed:
1. Run it once with --dry-run.
2. Run it once copying each file to out/licence-check/ through SaveAs.
Clear the variable inside each child process only, never for the session.
Write out/licence-check.csv with the columns run, file, call, exception type name and message.
Tell me which calls threw.
The licensing exception type isn't public, so catch Exception and record its GetType().FullName.
Stop after three repair attempts.
라이선스 키 페이지는 Web.config, App.config 및 appsettings.json도 다룹니다.
텍스트 교체가 Word 문서의 어떤 부분에 도달합니까?
Create Services/MentionScanner.cs.
For one DOCX it returns a count for each of these:
- "Northwind Traders" in body paragraphs
- "Northwind Traders" in table cells
- the name in upper case
- the name inside "Northwind Traders Pension Trust"
- the name in headers and footers
- the old notice address
- the Fax notices paragraph
The body and table cell counts leave out the pension trust name.
IronWord has no header or footer model.
For that column only, read word/header*.xml and word/footer*.xml with System.IO.Compression.
Then run it over Contracts/inbox/ into out/inventory.csv.
Mark files that fail to open as Unreadable.
List every file whose counts differ from manifest.csv.
In that comparison, the body count is body_mentions plus split_run_mentions.
내장된 탐색 에이전트가 실제 파일을 대상으로 교체를 테스트합니다.
Create a scratch console project under scratch/replace-probe/ yourself.
Add a Compile Remove line for scratch/** to ContractRebrand.csproj.
Then ask the explorer agent to use that project.
It finds which parts of a contract the document-level ReplaceText call changes.
It tests copies of the Contracts/sample/ files in memory, with these four cases:
- a name split across runs
- a table cell
- the upper-case title
- the pension trust
The header has no object in the API, so the explorer answers that one from IronWord.xml.
It changes nothing under Services/ or in Program.cs.
Write the five answers to out/replace-reach.csv.
Beside each answer, quote the ironword skill or IronWord documentation.
Where a page and the test disagree, say so.
2026.10.4에서의 조정은 이러한 메모리 내 결과를 제공했습니다.
| 위치 | 문서 수준 교체 | 도달 가능한 것 |
|---|---|---|
| 본문, 한 번의 실행 | 교체됨 | 문서 호출 |
| 본문, 실행 간 분할 | 교체됨 | 문서 호출 |
| 표 셀 | 변경되지 않음 | 각 TableCell에서 ReplaceText |
| 대문자 제목 | 변경되지 않음 (대소문자 일치) | 대문자 형식으로 두 번째 호출 |
| 연금 신탁 이름 | 변경됨 (단순 부분 문자열 일치) | 자리 표시자가 먼저 대체되고 나중에 복원됨 |
| 헤더 또는 푸터 | 객체 모델에 없음 | 보고한 다음 수동으로 편집 |
분할 실행 행에는 부작용이 있습니다. 굵게 된 북쪽으로 저장된 이름이 평범한 바람 상인들로 이어진 후 Contoso Ltd라는 굵은 실행 하나가 됩니다.
문서의 ExtractText에서 통과하는 단순 검사기는 당사자 표가 여전히 오래된 회사를 나타내는 계약을 통과시킵니다. 분할 실행 일치와 같은 FindText는 전체 문구를 포함하는 텍스트 요소와만 일치하므로 놓칩니다.
전체 문서 폴더에서 텍스트를 교체하는 방법은?
Have the worker agent write Services/Rebrander.cs.
It applies every rule in Contracts/README.md to Contracts/inbox/.
It builds on the explorer's findings and follows these rules:
- Replace inside each table cell as well as the body.
- Keep the pension trust intact.
- Delete the Fax notices paragraph.
- Leave header and footer parts as they are, since IronWord can't edit them.
- Report those contracts as HeaderFlagged.
- Save each copy to out/rebranded/ with SaveAs.
- Never call Save() on a document opened from inbox/.
Add a --sequential mode that rescans the saved copies with MentionScanner.
It writes out/sequential.csv with these columns:
- file
- status from the README, always one of its four
- mentions left per location
- milliseconds
- header_lost, set to yes when a copy lacks a header or footer part its original had
The header_lost column is reported on its own and never changes a status.
Tell me the status counts.
IronWord 2026.10.4에서 표가 있는 로드된 DOCX를 저장하면 표 내부 및 첫 번째 표 뒤의 모든 단락에서 모든 텍스트 편집이 버려집니다. 디스크의 사본은 오래된 텍스트를 유지하며, 예외는 발생하지 않으며 메모리 내 문서는 여전히 교체된 상태를 보여줍니다. 첫 번째 표 이전의 편집은 지속되며, 새 TableCell로 교체된 셀도 지속됩니다. 이 계약들은 서명이 당사자 표 다음에 오기 때문에 메모리 내 검사는 저장된 서명이 변경되지 않은 복사본을 통과시킵니다.
파라미터가 없는 Save은 로드된 문서의 소스 파일을 덮어쓰도록 문서화되어 있으므로 일괄 처리는 이를 호출하지 않아야 합니다. 텍스트 제거 안내서는 팩스 규칙을 제거하는 단락 제거를 보여줍니다.
조정 중에 0바이트 파일을 로드하자 NullReferenceException이 발생했으며, 텍스트 파일, 잘린 패키지 및 임의 바이트 패키지가 각각 파일에 손상된 데이터가 포함되어 있다는 메시지와 함께 난독화된 네임스페이스에서 FileFormatException을 발생시켰습니다. System.IO 타입에 대한 캐치는 이를 놓칩니다. 파일당 Exception를 잡아서 그 타입을 기록하세요.
복사본은 SaveAs를 사용하며, IronWord의 문제 해결 페이지는 저장 후 사라지는 헤더와 같은 이름을 지정합니다.
Check whether SaveAs lost a header anywhere in this backlog.
IronWord's troubleshooting page header-disappears-after-saveas reports that in one environment.
For every HeaderFlagged file, compare the inbox original with its out/rebranded/ copy.
Look at the word/header*.xml and word/footer*.xml parts.
Write out/header-check.csv with these columns:
- file
- header parts before
- header parts after
- whether each part is present with its text unchanged
If a part went missing, rebrand that contract again from its inbox original.
Write it with the Save overload that takes the out/rebranded/ path.
Don't use the parameterless Save().
If the part is still missing, record it and stop.
Tell me which files lost a part.
문서 폴더를 병렬로 처리하는 방법은?
비동기 호출은 파일 I/O를 차단 없이 수행하지만, 문서에는 파싱과 직렬화가 동기화 상태로 유지되고 하나의 문서 인스턴스는 스레드 안전하지 않다고 명시되어 있습니다.
Add a --parallel mode that works like this:
- It runs Task.WhenAll over the inbox.
- Each task holds a slot of a SemaphoreSlim whose size comes from --concurrency.
- Then it awaits WordDocument.LoadAsync and SaveAsAsync on its own WordDocument.
Run the mode three times:
1. At concurrency 1 into out/parallel-c1/.
2. At concurrency 4 into out/parallel-c4/.
3. At Environment.ProcessorCount into out/parallel-max/.
Write out/parallel-compare.csv with the columns file, folder and a yes or no.
The yes or no says whether the extracted body and cell text match out/rebranded/.
Log each run as a new line of out/runs.csv.
Give it the mode, concurrency, elapsed seconds and match count from out/parallel-compare.csv.
Tell me the quickest setting in runs.csv.
조정 중에 메모리 내 수신함을 열고 편집했을 때, 읽을 수 없는 파일 4개를 포함해 순차적으로 4.8초가 걸렸고, 제한 4에서 1.4초, 16에서 1.8초가 걸렸으며, SaveAsAsync 추가로 14.4, 5.5, 4.7초가 걸렸습니다. 저장은 제한 단계입니다.
여전히 오래된 텍스트가 표시되는 문서를 진단하는 방법은?
Codex는 새로운 세션에서 --image의 -i 플래그를 통해 이미지를 허용하거나 codex exec resume와 함께, 또는 작곡가에 붙여넣는 방법으로 허용합니다.
I attached the first page of out/rebranded/MSA-1050.docx as an image with -i.
Its header still names Northwind Traders.
Look at the image, then explain from the file itself why the batch left that text.
Tell me whether out/sequential.csv already flags this file.
Don't change any code.
정답은 헤더 부분과 파일의 HeaderFlagged 행을 명명합니다.
오류가 있는 배치 출력을 끝에서 끝까지 디버그하는 방법은 무엇인가요?
Find out why the nightly job passed contracts that legal later flagged.
The log reports 0 contracts still naming Northwind Traders.
Contracts/legal-review.csv lists contracts where legal still found the old name.
It was in the party table or an upper-case title.
The file also lists a pension trust that was renamed.
Send the explorer agent through Jobs/NightlyRebrand.cs and Logs/nightly-2026-10-07/ first.
Then write your own report in out/nightly-diagnosis.md with these parts:
- why the job's own check passed them
- the smallest fix
- the command that proves the fix
Don't run or edit any code.
진단은 작업이 계약을 깨끗하게 표시하는 행을 인용해야 합니다.
1회성 코드를 재사용 가능한, 테스트된 구성요소로 어떻게 변환하나요?
Put the worker agent on a RebrandJob class, built like this:
- Install the Microsoft.Extensions.DependencyInjection package.
- Have its container resolve RebrandJob.
- Set it up through a RebrandOptions record with inbox, output folder, concurrency and dry run.
- Keep every README rule, the header check and the per-file CSV.
- RebrandJob.cs stays under 180 lines, with XML doc comments.
The README rules cover body and cell replacement, upper case and the pension trust guard.
They also cover the address and the fax deletion.
Run the job over the whole inbox into out/final/ and out/final.csv.
Then tell me whether every status matches manifest.csv.
Also confirm no copy keeps an old name, old address or fax paragraph.
Old names in a copy's header or in the pension trust don't count.
리팩터는 규칙을 제거해도 여전히 빌드할 수 있습니다.
Add an xUnit project at tests/ContractRebrand.Tests.
Exclude it from the main project's compile items, and join both projects in a solution file.
Write tests on real inbox files that check these:
- a split-run contract comes back with no old name
- a table contract is clean in its cells
- a pension trust mention survives
- a header contract is HeaderFlagged
- the zero-byte file is Unreadable without stopping the batch
- 20 files rebranded in parallel equal their sequential copies
Assert on extracted text and statuses, never on DOCX bytes.
Keep test copies in out/tests/work/.
Run dotnet test on the solution with a trx logger into out/tests/.
Report the totals from the trx file.
OpenAI의 맞춤 프롬프트 문서는 ~/.codex/prompts에 저장된 프롬프트를 더 이상 사용되지 않음으로 기록하고 반복되는 질문이 속하는 기술을 사용하여 대체합니다.
$ironword Look in the installed IronWord.xml.
List the WordDocument members that load or save a document, and answer these:
- Which ones are asynchronous?
- Which one overwrites the source file a document was loaded from?
List only members you can call from a line that compiles in a probe under scratch/.
Also name any member anywhere in IronWord.xml that is documented but doesn't compile.
Check by compiling only.
Don't run Save() on any document loaded from Contracts/inbox/.
Then show the line in RebrandJob that keeps Contracts/inbox/ untouched.
이 프롬프트를 다른 문서 백로그에서 재사용하는 방법은?
이름, 경로 및 규칙이 변경됨에 따라 이러한 프롬프트는 다음 백로그에 적합하며, IronWord AI 코딩 어시스턴트 가이드는 모든 5개의 어시스턴트를 위한 설정을 다룹니다.
실제 실행에서 프롬프트가 무엇을 생성했습니까?
프롬프트는 하나의 Codex 세션에서 순서대로 실행되었습니다. .NET 9 프로젝트는 124개의 계약과 예상 상태 및 수의 매니페스트를 보유하고 있었고, 모든 릴리스 빌드는 성공했습니다. 우리의 스캐너는 저장된 모든 사본을 다시 스캔했으며, 테스트는 신선한 복제본에서 다시 실행되었습니다.
- 이름 변경 전에, 인벤토리는 모든 124개 파일의 매니페스트와 일치하고, 4개의 비 DOCX 파일을 읽을 수 없음으로 표시했습니다.
- 순차적 리브랜딩 후, 120개의 저장된 사본은 당사자 표 위에 있는 114개의 오래된 이름 중 어느 것도 포함하지 않았습니다. 실행 간 분할된 22개도 마찬가지입니다.
- 13개의 대문자 제목, 38개의 오래된 통지 주소 또는 57개의 팩스 단락 중 어느 것도 남지 않았습니다.
- 모든 9개의 연금 신탁 이름은 온전하게 유지되었습니다.
- 저장으로 인해 이러한 편집이 삭제되었기 때문에, 28개의 당사자 표와 114개의 서명에 이전 이름이 남아 있었습니다.
- 작업자 sequential.csv는 각 파일에 매니페스트 상태를 부여하여, Rebranded 104, HeaderFlagged 10, NoChange 6 및 Unreadable 4로 나열했으나, 자체 수열 컬럼은 여전히 114 서명과 28 테이블 언급을 표기하고 있었습니다. 상태는 Codex 자체에서 보고한 대로 교체가 아니라 탐지를 기록합니다.
- 10개의 샘플 파일에서, 빠른 시작은 본문 언급 19개와 테이블 언급 2개를 보고하여 매니페스트에서 16개와 2개를 넘었습니다. 본문 개수는 또한 2 셀 언급과 연금 신탁 이름도 포함되었다.
- 키가 없었을 때, 건조 실행은 메모리 내에서 읽을 수 있는 모든 9개의 샘플 파일을 편집했습니다. 저장 실행은 각각에 대해 SaveAs에서 LicensingException을 던졌습니다.
- 1, 4 및 32의 제한에서 병렬 실행 시간이 11.456, 7.825 및 5.830초가 걸렸습니다. 각 폴더의 120개의 읽을 수 있는 복사본은 순차적인 것들과 일치했습니다.
- 야간 진단은 작업의 대소문자 민감특성 ExtractText().Contains 검사와 그 문서 수준 교체로 결과를 추적했습니다. 라인 번호를 인용하지 않았고, 그 증명 명령은 아직 존재하지 않는 테스트 프로젝트를 목표로 했습니다.
- 리팩터는 모든 규칙을 68줄의 RebrandJob.cs에 유지했으며, out/final 복사본은 out/rebranded와 일치했습니다.
- final.csv는 매니페스트 상태와 일치했으나 118개 행을 불완료로 표시했으며 Codex는 내용 검사를 실패로 보고했습니다.
- Codex의 실행과 신선한 복제본은 각각 6개 중 4개의 테스트를 통과했습니다. 분할 실행 테스트는 서명에서, 테이블 테스트는 당사자 테이블 셀에서 실패했습니다.
- API 응답에는 네 가지로드, 일곱 가지 저장과 다섯 가지 비동기 멤버가 나열되어 있었으며, 소스를 덮어쓰는 매개변수 없는 Save가 명명되었습니다.
- 네 개의 문서화된 멤버가 컴파일되지 않는다는 것을 올바르게 명명했습니다. 이들은 바이트와 문자열을 받는 생성자, FlushModelToBytes, 문단의 ReplaceTextAcrossRuns 및 SetNoChangeStatusAsUpdated였습니다.
- 바이트 전용 생성자도 나열되었지만, 2026.10.4에서 실패하는 FromMarkdown, FromMarkdownFile, ExportToMarkdownFile, GetMailMergeWorkingBytes 및 ApplyCellStyle on a table에서는 실패했습니다.
- 일부 단계는 페이지와 달리 작동했습니다. 이미지는 실행의 MSA-1050 복사본에서 python-docx로 렌더링되었습니다. 야간 작업, 그 로그 및 법무 리뷰 파일은 조사 프롬프트 바로 전에 추가되었습니다.
GitHub Copilot 가이드는 Tables, Rows 및 Cells를 통해 테이블을 읽어 저장된 문을 테스트합니다. 커서 가이드는 IronWord가 읽을 수 없는 DOCX의 부분들을 나열합니다.
공유된 실행 기록은 이번 실행에 대한 Codex 버전, 모델, 기계 및 타이밍을 나열합니다.
문제 해결
- Word 문서의 텍스트 교체는 문단 수준의
ReplaceText와FindText에 대한 것입니다. - Header Disappears After SaveAs는 저장된 사본에서 헤더가 사라졌을 때입니다.
- IronWord with DocumentFormat.OpenXml은 빌드가 OpenXML SDK도 참조할 때입니다.
- IronWord License in web.config는 IronWord가 Web.config에 저장된 키를 무시할 때입니다.
질문?
질문이 있으시면 support@ironsoftware.com으로 문의하세요.
커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.