IronWord ile GitHub Copilot Nasıl Kullanılır

Curtis Chau
Curtis Chau
Güncellendi: 19 Ekim 2026

Bir .NET hizmeti, her biri stil verilmiş bir başlık, iki özet satırı ve verilerle oluşturulmuş bir tablo içeren aylık hesap özetlerini Word dosyaları olarak üretebilir. Bu kılavuzda, hizmet, verilerini sağlayan işlerin yanında bir Visual Studio çözümünde bulunur, dolayısıyla bunu değiştirecek asistan, aynı çözüm içerisinde çalışmalıdır.

GitHub Copilot, Visual Studio veya VS Code'da sohbet ya da ajan modunda, Copilot CLI ile bir terminalden ve bulut ajanının atanmış bir sorun için bir çekme isteği açtığı GitHub'dan bu çözüm üzerinde çalışabilir. IronWord, stil verilmiş metinler ve birleştirilmiş hücreler ile gölgeli satırlar içeren tablolarla kodda DOCX oluşturur. IronWord kuralları, depodaki talimat dosyalarında saklanır ve bu yüzeylerin her biri onları okur.

tablo kılavuzu ve metin stil kılavuzu, bu kılavuzun dayandığı API'nin iki bölümünü kapsar.

Hızlı Başlangıç
NuGetNuGet ile Yükle

PM > Install-Package IronWord

Yukarıdaki komutu NuGet Paket Yöneticisi Konsolunda çalıştırarak veya NuGet Paket Yöneticisinde arama yaparak IronWord'u yükleyin.

Aşağıdaki talimatı yapıştırarak çözüm kökünden Copilot CLI başlatın. Visual Studio'daki Copilot Chat, # ile bir dosyayı referans alır, CLI ise @ kullanır.

Fill in @src/Statements/Documents/StatementBuilder.cs with a public static Build method.
Its signature is Build(Account account, IReadOnlyList<Transaction> transactions, string outputPath).
Add Account and Transaction as small records in the same folder.

Write the DOCX with IronWord, from the IronWord NuGet package.
The types are in the IronWord and IronWord.Models namespaces.

Lay out the statement exactly as @docs/statement-layout.md describes. Three parts need care:
- the bold heading row
- the merged closing-balance cell
- the alternate row shading

Save the file to outputPath, then compile the solution and clear every build error.
Tell me which files you added or changed.
Text

Talimat stili belirtilmiyor. Aşağıdaki yol spesifik talimat dosyası, kullanılacak üyeleri belirtir.

Çözümdeki Program.cs, IRONWORD_LICENSE_KEY kodunu ortamdan okur ve IronWord.License.LicenseKey'a atar, dolayısıyla Copilot'u başlatmadan önce değişkeni ayarlayın. lisans anahtarı kılavuzu aynı atama ve anahtarı barındırabilecek yapılandırma dosyalarını gösterir.



IronWord konvansiyonlarını Copilot için nasıl belirlersiniz?

Tüm depo için kurallar .github/copilot-instructions.md dosyasına yazılır. Copilot CLI, Copilot kod incelemesi, bulut ajanı ve JetBrains IDE'lerde, Visual Studio ve VS Code'daki Copilot Chat hepsi GitHub'ın destek matriksine göre dosyayı okur. Visual Studio, bu özel talimatlar onay kutusu Copilot Chat seçeneklerinde seçildikten sonra yükler.

Statement code in this repository follows these rules:

- Statements are DOCX files written with IronWord, from the NuGet package IronWord.
- Import both namespaces, IronWord and IronWord.Models.
- Use no other Word library and no OpenXML SDK code.
- Keep the IronWord version set in Directory.Packages.props, unless the task is upgrading it.
- IRONWORD_LICENSE_KEY holds the license key, and Program.cs reads it there.
- Do not put the key in source, settings files, tests or logs.
- Never print its value, and don't list environment variables.
- docs/statement-layout.md is the layout contract. Do not edit it.
- Propose changes to that layout in your reply instead.
- IronWord's documentation for agents is at https://ironsoftware.com/word/csharp/llms.txt
- An IronWord member is real only when it builds and a saved file shows its effect.
- The documentation, its samples and IronWord.xml list some that do not compile or are not saved.

Statement tests follow these rules:

- Build statements in a temp directory and reopen the saved file with IronWord.
- Compare cell text, values and run styles. Never compare DOCX bytes.
Markdown

Belge kodu için nasıl kendi kurallarınızı verirsiniz?

Bazı klasörler için sadece belgeleri içeren .github/instructions/documents.instructions.md gibi bir yol spesifik dosyaya gidilir ve burada belirtilen applyTo desenleri, belge kodunu ve testlerini kapsar. GitHub'ın Copilot CLI belgeleri, CLI'nin yalnızca yönettiği bir dosya listelenen bir desene uyduğunda dosyayı bir isteğe eklediğini belirtir. Çalışmamızda, CLI her oturumun başında dosya desenleri ve yolunu listeledi ve Copilot, ilk düzenlemeden önce dosyayı okudu.

---
applyTo: "src/Statements/Documents/**,tests/Statements.Tests/**"
---

The document code and its tests follow these IronWord rules:

- Style text on a Run, with new Run(new TextStyle { ... }) or Run.Style.
- TextContent.IsBold, TextContent.FontSize and Run.FontSize are read-only.
- SaveAs drops a TextStyle assigned to TextContent.Style.
- SaveAs writes a TextStyle's FontSize only when its TextFont is set too.
- Add each body line as its own paragraph with AddParagraph.
- WordDocument.AddText joins its text onto whichever paragraph came last.
- Table.ApplyCellStyle is listed in IronWord.xml but does not compile.
- Style each cell's runs in place of ApplyCellStyle.
- new Table(rows, columns) creates every cell, with zero-based indexes.
- Fill a cell with AddChild or AddText on table[row, column].
- Table.Rows, TableRow.Cells and a TableRow indexer return ITableRow and ITableCell.
- ITableRow and ITableCell have no AddText, AddChild or ExtractText.
- Cast to TableRow or TableCell first.
- SaveAs writes no merge made with Table.MergeCells.
- For a cell that spans two columns, add a new TableRow of two TableCells with AddRow.
- Give the first of those two cells GridSpan = 2.
- Shade alternate rows with Table.Zebra = new ZebraColor(first, second).
- SaveAs writes no fill set through TableCell.Shading.
- With no key set, every save throws LicensingException.
- An in-memory build does not throw it, so it proves nothing about the saved file.
Markdown

Bu dosyadaki her kural bir derleme, hafıza kontrolü veya kaydedilmiş bir dosyadan türetilmiştir. Gönderilen XML belgeleri tablodaki ApplyCellStyle listesini verir, ancak derleyici CS1061 ile çağrıyı reddeder, dolayısıyla yalnızca XML, bir üyenin derlenip derlenmediğini göstermez. Bir hücreden Shading özelliği üzerinden bir dolgu ayarlandığı ancak kaydedilmiş dosyaya hiç yazılmadığı, oysa Zebra her hücreye bir dolgu yazdığı görüldü.

CSV verilerinden bir ifade tablosu nasıl oluşturulur?

Bu aşamada ifade kodu, hata üretmeden başarısız olabilir. Kaydedilmiş dosyalarda, MergeCells ile birleşik kapanış satırı hala üç düz hücre içeriyordu, ancak tablo bellekte birleştirmeyi kaydetti. Font olmadan 18 punto ayarlanmış bir başlık boyutsuz kaydedildi. Yalnızca kaydedilmiş dosyanın incelenmesi her iki sorunu da tespit eder.

Rework @src/Statements/Pipeline/StatementJob.cs to write one statement per account, in this order:

1. Read Data/accounts.csv and Data/transactions.csv.
2. Group the transactions by account.
3. Call StatementBuilder.Build once per account.
4. Write <AccountId>.docx into the output folder that StatementJob.Run receives.

That folder is out/statements under the solution root.

The data needs care in a few places:
- Descriptions such as "Rent, September" hold commas.
- Parse quoted fields with a few lines of your own code, and add no CSV package.
- Parse amounts as decimal with the invariant culture.
- An account with no transactions still gets a statement, with its heading and closing rows.

Run the job.
For every statement, print its path, its transaction row count and its closing balance.
Text

Dört hesap içeren bir düzenleme, beş, iki, üç ve sıfır işlemle. CSV dosyasında, tasarruf hesabının satırları tarih sırasına göre değil ve düzen en eski ile başlamayı gerektirir.

Kaydedilmiş bir IronWord ifadesi nasıl test edilir?

Belgedeki ExtractText paragraflarını döndürdü ancak tablo metnini döndürmedi, dolayısıyla ona dayalı bir test tüm hücreler boş olduğunda bile geçer.

Bu istemi göndermeden önce Copilot CLI'yi plan moduna Shift+Tab ile değiştirin.

Plan an xUnit suite in tests/Statements.Tests, and wait for my approval before you write any code.

Every test loads IRONWORD_LICENSE_KEY into the License.LicenseKey property first.
ExtractText leaves out the text inside tables.
Read the statement table through Tables, Rows and Cells instead.
A reopened file reads GridSpan and MergedCells back empty.
The merged label shows up there as a closing row of two cells.

The suite has to prove these points:
- Each account in Data/accounts.csv gets a table of its transactions.
- The table also holds a heading row and that closing row.
- Cell values and the closing balance match the CSV files.
- Every heading run that holds text is bold.
- The title is bold and 18 point.
- CHK-40902 has the heading and closing rows and no others.

Once I approve, write the tests, run dotnet test and tell me the pass and fail counts.
Text

Önce bir plan ile, birleşik bir hücreyi ve bir çalıştırmanın stilini bir doğrulama yazılmadan önce nasıl okuduğunu kontrol edebilirsiniz.

Derlenmeyen IronWord stil kodu nasıl düzeltilir?

IronWord'un tablo kılavuzu bir hücrenin metnini TextContent üzerinde bir nesne başlatıcı ile stillendirir. Bu örnek, bu özelliklerin salt okunur olduğu için CS0200 ile derlenmez.

A teammate adapted @src/Statements/Documents/OverdraftNotice.cs from IronWord's add-table how-to.
Now the solution no longer builds.

Before you edit anything, work through these steps:
1. Build and quote each compiler error.
2. Open the IronWord.xml file inside the IronWord package in the NuGet cache.
3. List the styling members it gives for TextStyle and Run.

Then rewrite just the styling in that file.
The saved notice must keep its bold 14 point heading and its bold amount.
Rebuild and confirm the error count is zero. Don't touch any other file.
Text

Derleyici başlık ve miktar üzerinde hataları rapor eder ve XML araması bu sabitin kullandığı TextStyle üyelerini listeler.

Bulut ajanının etkili olduğu bir sorun ne yapar?

Bulut ajanı, atama sırasında sağlanan talimatlar artı başlık, açıklama ve mevcut yorumlardan çalışır. GitHub'a göre, sonradan eklenen yorumlar hiçbir zaman ajan'a iletilmez, bu yüzden tamamlanma kriterleri sorun gövdesinde olmalıdır.

Title: Show debit amounts in red on statements

The change covers these files and versions:
- Files: src/Statements/Documents/StatementBuilder.cs, tests/Statements.Tests
- IronWord version: the one Directory.Packages.props sets
- Framework: .NET 9

The expected result is this:
- In the Amount column, every negative amount is red (C00000).
- Positive amounts, the heading row and the closing row keep their current color.
- docs/statement-layout.md gains the rule in the pull request text only.

The actual result is that every amount is black.

The constraints are these:
- Keep the Build signature.
- Style the runs as .github/instructions/documents.instructions.md says.
- Add no packages.

The acceptance test is this:
- The current tests still pass.
- A new test reopens CHK-40211.docx and finds red runs in exactly the four debit cells.
Markdown

Test, bilinen bir ifadedeki renklendirilmiş hücreleri saydığı için tüm sütunu renklendiren bir değişiklik bunu başarısız kılar.

Bulut ajanının testleri neden bir IronWord projesinde başarısız olur?

Varsayılan olarak, bulut ajanı Ubuntu Linux ortamında çalışır. IronWord 2026.10.4, paketin içindeki linux-x64 için bir yerel kütüphane sevk eder, dolayısıyla bir NuGet geri yüklemesi çalıştırıcıda onu içerecektir. Çalıştırıcının bir lisans anahtarı yok. Anahtarsız bir test makinesinde, ifade hafızada hatasız şekilde oluşturuldu ve probedaki her kaydetme çağrısı "Üretim Lisansı Gerekli" mesajıyla bir LicensingException fırlattı. Bir dosya yazan her test, kod doğru olsa bile başarısız olur.

Copilot işe başlamadan önce GitHub Actions, .github/workflows/copilot-setup-steps.yml'den copilot-setup-steps işini çalıştırır. Çalışma dosya varsayılan dalda bulunmadıkça tetiklenmez.

The cloud agent's Ubuntu runner needs .github/workflows/copilot-setup-steps.yml.
GitHub picks up a single job called copilot-setup-steps, so give the file exactly that job.

Set the job up like this:
- Give it read access to the repository contents.
- Trigger it on workflow_dispatch and on pull requests that touch the file itself.
- Fetch the code and install whichever .NET SDK the projects use.
- Run a restore, then build in Release.

Without a license key, every IronWord save throws a LicensingException.
Add a step that checks IRONWORD_LICENSE_KEY, which is an Agents secret.
GitHub documents Agents secrets for the cloud agent's environment.
That includes this workflow when it runs for the agent.
So the check works like this:
- In pull_request and workflow_dispatch runs, it prints a warning and passes.
- In any other run, it exits non-zero with a clear message when the key is empty.

Put that step last, because a failing setup step makes Copilot skip whatever follows it.
Write the file, then show me the finished YAML.
Text

Kontrol son sıraya yerleştirildiğinde, eksik bir gizli bilgi, geri yüklenmiş ve derlenmiş bir çözümü ve sorunu belirleyen bir satırı bırakır.

Anahtarı bir Ajan gizlisi olarak saklayın: Actions, Codespaces veya Dependabot için kaydedilen gizlilikler bulut ajanına iletilmez. Depodaki Ayarlar altında Güvenlik, Secrets ve değişkenler, Ajanlar sekmesinde IRONWORD_LICENSE_KEY ekleyin ve ajan bunu bir ortam değişkeni olarak alır.

Birleştirmeden önce neyi kontrol etmelisiniz?

Kod yazan oturumdan farklı bir oturumda çalışması için incelemeyi kendi copilot -p çağrısı ile başlatın.

/review every change committed after the first commit on this branch.
Hold every IronWord call up against .github/instructions/documents.instructions.md.
Check it against the XML API documentation in the IronWord NuGet package as well.
List each place they conflict.

Also flag any of these:
- styling set on TextContent instead of on runs
- a table cell filled anywhere but on the cell the table already holds
- a closing row that spans its label with MergeCells instead of GridSpan
- a font size with no TextFont beside it
- a test that reads table data with ExtractText instead of reloading the saved file
- any line that prints IRONWORD_LICENSE_KEY

Tell me what you find, and don't edit any file.
Text

Gerçek bir çalıştırmada istemler ne üretti?

Copilot CLI bu kılavuz için oluşturulmuş bir ifade çözümünde altı yönlendirmeyi de insansız çalıştırdı. Her bir taahhüdü yeniden oluşturduk, işi ve testleri tekrar çalıştırdık ve IronWord kullanmayan bir betikle DOCX dosyalarını okuduk.

  • Takım arkadaşının duyuru dosyası, stil yönlendirmesinden önce 3 CS0200 derleme hatasına ve ardından 0'a neden oldu.
  • Stil düzeltmesinde yalnızca o dosya değiştirildi.
  • Duyuru, kalın 14 punto başlık ve kalın miktarını korudu.
  • 4 ifadenin tamamı, CSV isteminden itibaren DOCX kontrolünden geçti.
  • 4 kapanış bakiyesinin tamamı, CSV verilerine uygun hale geldi.
  • Her kapanış satırı, iki sütuna yayılan etiket ile iki hücreye sahipti.
  • Başlık kalın ve 18 puntodu.
  • Başlık satırı kalındı.
  • Satırlar FFFFFF ve F2F2F2 ile dönüşümlüydü.
  • Copilot'un 3 testi geçti.
  • Her test, kaydedilmiş tabloyu satırları ve hücreleri üzerinden okudu.
  • Kurulum iş akışı YAML olarak ayrıştırılmış, bir copilot-setup-steps işi ve anahtar kontrolü son sıradaydı.
  • İnceleme çağrısı hiçbir dosyayı değiştirmedi ve yapılandırıcıda iki yeri işaretledi. Biri yolu belirtildiği gibi, satırı eklemeden önce kapanış satırının hücrelerini doldurur. Diğeri AddChild veya AddText yerine TableCell.SetContent kullanır.
  • Bazı adımlar sayfadan farklı çalıştı. Oturum arka planda çalıştı, bu yüzden plan modu --plan bayrağını kullandı ve onay yazılı bir yanıt oldu. Sorun, bulut ajanı, Ajan gizlisi ve kurulum iş akışı bir barındırılan depo gerektiriyordu ve çalışmadı.

Cursor kılavuzu, IronWord kuralını, buradaki gibi yol spesifik talimat dosyasında applyTo ile globlarla dosya desenleriyle sınırlar. Google Antigravity kılavuzu, bulut ajanının çalıştığı linux-x64 platformu için bir IronWord sayfası yayınlar.

Copilot CLI sürümü, Auto'nun seçtiği model, test makinesi ve çalıştırma süresi paylaşılan çalıştırma kaydında yer alır.


Hata Ayıklama


Sorular?

Herhangi bir sorunuz varsa, support@ironsoftware.com adresinden bize ulaşın

Curtis Chau, Bilgisayar Bilimleri alanında Lisans Derecesine (Carleton Üniversitesi) sahip ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirmeyle ilgileniyor. Sezgisel ve estetik açıdan hoş kullanıcı arayüzleri oluşturma tutkunu, Curtis modern çerçevelerle çalışmayı ve iyi yapılandırılmış, görsel olarak çekici kılavuzlar oluşturmayı seviyor.

Daha Fazla Oku

Başlamaya Hazır mısınız?

NuGet İndirmeleri 62,392Sürüm:2026.11yeni çıktı