Rules and patterns for writing tests of Avalonia UI visual elements (controls, dialogs, panels). Use when creating or modifying tests for XAML controls, dialogs, or panels.
日本語の概要は準備中です。原文の説明を表示しています。
Author and modify documentation for projects that use Gehtsoft's docgen utility. Use this skill whenever the user mentions docgen, .ds files, the doc/ directory of a repository, project.xml or project.proj for documentation, or wants to write/edit/build/debug API documentation in any codebase that uses docgen. Also use it whenever the user asks about generating C#, C++, or Java API documentation that follows Gehtsoft conventions, even if they don't say "docgen" explicitly.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Docgen is Gehtsoft's documentation tool. It reads hand-written .ds source files plus auto-generated .ds files (extracted from C# XML doc comments via Asm2Xml, or from C++/Java via doxygen) and produces HTML, CHM, or Markdown output through XSLT templates.
Use this skill to:
.ds content (articles, namespace overviews, class/member descriptions).There are three layers; understanding all three is the difference between fixing problems quickly and chasing ghosts.
Source code --[extractor]--> raw XML --[XSLT]--> auto-generated .ds
|
v
hand-written .ds (index, articles, key namespaces) --[docgen]--> HTML/CHM/MD
Asm2Xml for C# DLLs (uses Mono.Cecil); doxygen for C++ and Java sources.%docgen% (the docgen install root): %docgen%/template/cs2ds/main.xsl for C#, %docgen%/template/doxygen2ds/main.xsl for C++/Java. The template emits .ds files into a prepare/.../dst or src/raw directory..ds listed in <dg:source>, builds a model keyed by @key, and renders through an output template such as %docgen%/template/html/main.xsl.Pick the one that matches the user's project before scaffolding.
Everything is hand-written. No prepare/ step, no raw/ folder. Use this when:
Layout:
doc/
├── project.proj # MSBuild target MakeDoc
├── project.xml # docgen config; <dg:source> lists hand-written files only
├── doc.bat # dotnet build project.proj /t:MakeDoc
├── src/
│ ├── index.ds
│ ├── articles/
│ └── ...
└── dst/ # output (gitignored)
A two-stage build. The prepare/ stage runs Asm2Xml on built DLLs and an XSLT (cs2ds/main.xsl) to emit .ds files. The main stage consumes hand-written files plus the generated files.
Layout:
doc/
├── project.proj # main MSBuild
├── project.xml # main docgen config
├── doc.bat
├── prepareproject.xml # docgen project for the cs2ds conversion
├── preparesettings.xml # cs2ds tuning (assembly path, namespaces to strip)
├── prepare.bat # dotnet build project.proj /t:Scan,Raw
├── obj/raw.xml # Asm2Xml output (intermediate)
├── src/
│ ├── index.ds
│ ├── ns/ # hand-written namespace/class overviews
│ ├── null.ds # stub for prepareproject.xml
│ └── raw/ # auto-generated .ds files
└── dst/
Two assembly patterns exist:
project.xml lists both src/ns/ and src/raw/. Scan and Raw targets live in the same project.proj as MakeDoc. Simpler.prepare/ is its own MSBuild sub-project with its own project.proj; the main build doesn't run prepare automatically. Useful for multi-language projects.The single-stage pattern is the recommended default for new projects.
Same shape as the C# pattern, but the extractor is doxygen (configured by a Doxyfile) and the XSLT is doxygen2ds/main.xsl. Per-language prepare directories are typical when documenting multiple languages:
doc/
├── prepare/
│ ├── cpp/ Doxyfile + project.proj + prepareproject.xml + dst/
│ └── java/ Doxyfile + project.proj + prepareproject.xml + dst/
├── src/
│ ├── cpp/ hand-written + .ds copied from prepare/cpp/dst/
│ └── java/ same
└── ...
Every .ds element has a @key (e.g., Foo.Bar for a namespace, Foo.Bar.MyClass for a class). Docgen parses every file in <dg:source> order and builds one model. When two files define the same @key, the first one wins.
Behavior depends on the element type:
| Element | First-defined behavior | Member merge? |
|---|---|---|
@group | First wins; later duplicates silently removed | No |
@class | First wins for class-level fields (brief, etc.) | Yes — non-conflicting members from later class are added |
@member | First wins; later duplicate members silently dropped | n/a |
@article | First wins | n/a |
The class-level member merge is the whole reason for the dual-source pattern. Hand-write a @class block in src/ns/ documenting only the methods you care about; let the auto-generated src/raw/ file fill in the rest. As long as the class @key matches, members merge automatically.
The merge is silent. No warning, no error if a hand-written entry shadows an auto-generated one. If something looks wrong:
@brief you wrote isn't appearing → check whether another file (loaded earlier) defines the same class.@member with the same key (often a CRC-suffixed name) in a hand-written file.Order of <dg:source> matters. Put hand-written first, auto-generated last. Always.
<dg:source>
<dg:file name="src/index.ds" encoding="utf-8" />
<dg:folder name="src/ns" encoding="utf-8" />
<dg:folder name="src/raw" encoding="utf-8" /> <!-- last -->
</dg:source>
doc/ at the repository root.assets/:
assets/manual-only/ — 100% hand-written.assets/csharp-single-stage/ — C# library with auto-generation (recommended default for new C# projects).assets/doxygen-cpp-only/ — C++ library with doxygen auto-generation.assets/doxygen-java-only/ — Java library with doxygen auto-generation.assets/doxygen-multilang/ — both C++ and Java in one docs site.REPLACE_WITH_* placeholders in the copied files (project name, project title, assembly path, source paths)..csproj has <GenerateDocumentationFile>true</GenerateDocumentationFile>, then run prepare.bat once to populate src/raw/, then doc.bat to build.INPUT in each Doxyfile, run prepare.bat from each prepare/<lang>/, copy generated .ds files into doc/src/<lang>/, then doc.bat from doc/.assets/README.md for the per-scaffold checklist; see references/source-extraction.md for what each prepare file does.src/ns/Namespace.Name.ds; cross-cutting articles → src/articles/topic.ds.@group (for a namespace) or @class (for a single class) block. Set @key to the fully-qualified name; set @ingroup to the parent group's @key.@key matches.references/ds-format.md for the tag and BBCode reference.Auto-generated @member keys for methods/overloaded members carry a CRC suffix (e.g. Tessellate.A1B2C3D4) so different overloads don't collide. To override one with a hand-written version you must use the same key, suffix included — otherwise both members appear in the rendered docs as separate entries.
prepare.bat, open the generated file: src/raw/<Namespace>.<Class>.ds.@member block whose @name (or signature) matches the method you want to override. Note its @key — copy it verbatim, CRC suffix included.src/ns/<Namespace>.<Class>.ds, write a @class block with @key=<Namespace>.<Class> and inside it a @member block using the exact key from step 2.src/raw/.prepare.bat, re-verify the suffix hasn't changed (it normally won't unless the signature changed).For methods without overloads, the suffix is stable; for overloaded methods, watch out — adding/removing parameters changes the signature CRC and your override will silently stop working (you'll see the auto-generated method reappear). Always copy the key from the generated file rather than trying to compute it.
src/articles/topic.ds (or wherever the project organizes articles).@article, set @key, @title, @ingroup, @brief, write the body, close with @end.index.ds or another article, add a [link=topic-key]link text[/link].<dg:source> in project.xml covers the location (folder include is usually enough).For C#:
cd doc && prepare.bat
This rebuilds obj/raw.xml from the assemblies and regenerates src/raw/*.ds.
For doxygen:
cd doc/prepare/<lang> && prepare.bat
Then copy or sync the generated .ds files into the location referenced by the main project.xml.
cd doc && doc.bat
or
cd doc && dotnet build project.proj /t:MakeDoc
Output lands in doc/dst/.
The source→.ds→HTML transforms have surprises that are invisible in the source (see the gotchas in references/source-extraction.md and references/ds-format.md). Always verify against the generated .ds and, where possible, the rendered HTML — not just the /// comments or hand-written .ds. After a prepare.bat / doc.bat run, these cheap deterministic checks catch the common failures:
# Multi-line @brief (a C# <summary> with no blank-line paragraph break dumps everything into @brief)
awk '/@brief=/{b=substr($0,index($0,"=")+1); getline n; gsub(/^[ \t]+/,"",n);
if (b!="" && n!="") print FILENAME": multi-line @brief -> "b}' src/raw/*.ds
# C# formatting tags that should be docgen BBCode ([c]/[i]/[b]); leave <see cref>/<paramref> as XML
grep -rnoE '</?(c|i|b|u)>' --include=*.cs .
# Line-leading bullet markers that aren't an intentional @list (both consumed .ds and source comments)
grep -rnE '^[[:space:]]*[-*][[:space:]]' src/index.ds src/ns/*.ds src/raw/*.ds
grep -rnE '^[[:space:]]*///[[:space:]]*[-*][[:space:]]' --include=*.cs .
# Raw & in hand-written .ds (must be &, else single & emits unescaped and && loses a character)
# uses -P (PCRE) for the negative lookahead; on macOS/BSD grep without -P, use ripgrep: rg '&(?!amp;|lt;|gt;|quot;|#)'
grep -rPn '&(?!amp;|lt;|gt;|quot;|#)' src/index.ds src/ns/*.ds src/articles/*.ds
Also eyeball any @example with relative indentation (does it need !-prefixed lines?) and any run of @see blocks (prefer a "See also" @headline + @list).
Docgen validates [link=key] against defined @key values. The build emits errors listing keys that aren't defined. Typical causes:
@key or in the link itself.@import referencing a key that no longer exists (parser emits @import key X is not found).Read the relevant reference when working on the matching task. Don't load all of them at once.
references/project-files.md — project.proj, project.xml, doc.bat structure with annotated examples. Read when scaffolding or modifying the build.references/ds-format.md — .ds DSL: @group, @article, @class, @member, @param, @declaration, @example, @list, @table; the two inline-formatting syntaxes (markdown **/`/#/|...| and BBCode [b]/[c]/[link=]/[clink=]/[img=]/[eurl=]) and when to use each; escaping rules. Read when writing or editing .ds content.references/source-extraction.md — Asm2Xml (C#), doxygen (C++/Java), cs2ds/doxygen2ds XSLT, prepare project layout. Read when wiring auto-generation.These are not enforced by the tool but are the de-facto Gehtsoft standard. Match them when scaffolding so the project blends in with sibling projects:
doc/ at the repository root.doc/dst/ (gitignored).project.proj; the docgen config is project.xml. Don't invent new names.doc.bat wraps the MSBuild invocation: dotnet build project.proj /t:MakeDoc.prepare.bat (when auto-gen is wired up) runs Scan,Raw for C# or Doxygen,Prepare for doxygen.simplified-text-syntax=yes is always set in <dg:common>.<dg:source> order: index.ds first, hand-written folders next (src/ns/, src/articles/), src/raw/ last..ds files go into src/raw/ (single-stage) or are produced by prepare/ and either copied into src/raw/ or referenced directly from prepare/.../dst/.src/raw/ is committed to the repo. The docs build does not require source code to be present — it requires having run prepare.bat previously..ds content@brief to one sentence. It appears in indexes and tooltips; longer briefs make navigation noisy.simplified-text-syntax=yes): a compact markdown style and the original BBCode. Pick by these rules: (a) match the style already established in the project/document — don't mix the two within one file for no reason; (b) for brand-new documentation, prefer markdown (**bold**, `code`, # heading, */0 lists, |a|b| tables). Reach for BBCode for what markdown can't express — code-style API links [clink=key]name[/clink], colors, [sub], [img], [eurl]. Full mapping and reference in references/ds-format.md.[clink=key]name[/clink] for API references (renders the symbol in code style); use [link=key]text[/link] (or markdown [text]key) for narrative links.@example (or a markdown ```-fence) — the fence also preserves indentation, which a bare @example body does not.Because shadow-merges are silent, the diagnostic process when something seems missing or wrong is:
.ds file under <dg:source> for the @key in question (grep -r "@key=Foo.Bar").@brief, that explains the empty brief.Calculate.A1B2C3D4) that won't match a hand-written @key=Calculate. Different keys mean both members exist and the auto-generated one shows up under a different name.まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Rules and patterns for writing tests of Avalonia UI visual elements (controls, dialogs, panels). Use when creating or modifying tests for XAML controls, dialogs, or panels.
日本語の概要は準備中です。原文の説明を表示しています。
Rules and patterns for creating Avalonia UI visual elements (controls, dialogs, panels, windows). Use when creating or modifying XAML controls, dialogs, panels, or windows in this project.
日本語の概要は準備中です。原文の説明を表示しています。
Use whenever writing, reviewing, or debugging .NET/C# code that uses the BallisticCalculator NuGet package (namespace BallisticCalculator) or its Gehtsoft.Measurements unit types — even when the user doesn't name the package explicitly but is clearly doing external/interior ballistics in .NET (bullet drop, velocity, energy, windage, spin drift, time of flight, zeroing a scope) for rifles, air rifles, bows, or artillery. Covers the full public API (Ammunition, Rifle, Atmosphere, Wind, ShotParameters, TrajectoryCalculator, TrajectoryPoint); standard, custom, .drg, and multi-BC drag tables; saving/loading data and building your own file format around it (BXml and System.Text.Json serialization); and building or rendering scope reticles (e.g. to SVG). Also use it for this library's Gehtsoft.Measurements Measurement<T> unit types (DistanceUnit, VelocityUnit, AngularUnit, WeightUnit, PressureUnit, …). Skip for: generic physics or projectile-motion exercises, a different ballistics library (e.g. GNU/JBM), game-engine or Unity projectile motion, plain unit conversions, and non-code ballistics questions (load-data or forensics advice). Self-contained: no access to the library source or binaries is required — prefer this over scanning the package to rediscover the API. Describes 1.1.13+, including the named ZeroRangeCantBeReachedException / TrajectoryCannotBeCalculatedException failures.
日本語の概要は準備中です。原文の説明を表示しています。
Design a rifle-scope reticle from a plain-language description and emit it as a BallisticCalculator `.reticle` file (BXml) plus a rendered SVG preview. Covers the complete `.reticle` element/attribute specification, reticle design principles (mrad vs MOA subtension, FFP/SFP, stroke-weight hierarchy, hash-mark ladders, christmas-tree wind holds, clutter budget, BDC anchors) and worked, verified patterns for duplex, mil-dot, hash-ladder, christmas-tree, chevron, circle-dot, dense-grid and rangefinding-stadia reticles. Also covers reproducing an existing commercial reticle from its manufacturer's technical data sheet. Use this skill whenever the user wants to create, modify, review or render a scope reticle, crosshair, mil-dot / MOA grid, holdover ladder, christmas tree, BDC ladder or rangefinding stadia — including any mention of a `.reticle` file, `ReticleDefinition`, `ReticleDrawController`, `SvgCanvasFactory`, or "draw me a reticle", and including requests to clone or model a named commercial reticle (Horus H58/H59, TReMoR, Mil-C, MOAR, Tremor3, EBR, and the like). Trigger it even when the user only says something like "make a crosshair with 0.2 mil hashes out to 5 mils" or "turn this reticle picture into a file", and trigger it before hand-writing reticle XML or hand-rolling reticle geometry, because the file format silently ignores misspelled attributes and mis-cased booleans.
日本語の概要は準備中です。原文の説明を表示しています。