Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-test-output-logginggit clone --depth 1 https://github.com/kevintsengtw/dotnet-testing-agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-test-output-logging)<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-test-output-logging"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-test-output-logging/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-test-output-logging"><img src="https://agentmods.dev/badge/skills/kevintsengtw/dotnet-testing-agent-skills/dotnet-testing-test-output-logging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00163 | $0.02834 |
| Opus 5.5 | $0.00065 | $0.01134 |
| Sonnet 5.5 | $0.00033 | $0.00567 |
| Haiku 4.5 | $0.00016 | $0.00283 |
Grade A, and why
dotnet-testing-test-output-logging scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 328 lines — stays where its author put it; the contents beside it link to each section on GitHub.
測試輸出與記錄專家指南
本技能協助您在 .NET xUnit 測試專案中實作高品質的測試輸出與記錄機制。
核心原則
1. ITestOutputHelper 使用原則
正確的注入方式
- 透過建構式注入
ITestOutputHelper - 每個測試類別的實例與測試方法綁定
- 不可在靜態方法或跨測試方法間共用
public class MyTests
{
private readonly ITestOutputHelper _output;
public MyTests(ITestOutputHelper testOutputHelper)
{
_output = testOutputHelper;
}
}
常見錯誤
- 靜態存取:
private static ITestOutputHelper _output - 在非同步測試中未等待即使用
- 嘗試在 Dispose 方法中使用
2. 結構化輸出格式設計
建議的輸出結構
private void LogSection(string title)
{
_output.WriteLine($"\n=== {title} ===");
}
private void LogKeyValue(string key, object value)
{
_output.WriteLine($"{key}: {value}");
}
private void LogTimestamp(DateTime time)
{
_output.WriteLine($"執行時間: {time:yyyy-MM-dd HH:mm:ss.fff}");
}
輸出時機
- 測試開始時:記錄測試設置與輸入資料
- 執行過程中:記錄重要的狀態變化
- 斷言前:記錄預期值與實際值
- 測試結束時:記錄執行時間與結果摘要
3. ILogger 測試策略
挑戰:擴充方法無法直接 Mock
ILogger.LogError() 是擴充方法,NSubstitute 無法直接攔截。需要攔截底層的 Log<TState> 方法:
// ❌ 錯誤:直接 Mock 擴充方法會失敗
logger.Received().LogError(Arg.Any<string>());
// ✅ 正確:攔截底層方法
logger.Received().Log(
LogLevel.Error,
Arg.Any<EventId>(),
Arg.Is<object>(o => o.ToString().Contains("預期訊息")),
Arg.Any<Exception>(),
Arg.Any<Func<object, Exception, string>>()
);
解決方案:使用抽象層
建立 AbstractLogger<T> 來簡化測試:
public abstract class AbstractLogger<T> : ILogger<T>
{
public IDisposable BeginScope<TState>(TState state)
=> null;
public bool IsEnabled(LogLevel logLevel)
=> true;
public void Log<TState>(
LogLevel logLevel,
EventId eventId,
TState state,
Exception exception,
Func<TState, Exception, string> formatter)
{
Log(logLevel, exception, state?.ToString() ?? string.Empty);
}
public abstract void Log(LogLevel logLevel, Exception ex, string information);
}
測試時使用
var logger = Substitute.For<AbstractLogger<MyService>>();
// 現在可以簡單驗證
logger.Received().Log(LogLevel.Error, Arg.Any<Exception>(), Arg.Is<string>(s => s.Contains("錯誤訊息")));
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago Changed · -1 lines · -46 tokens per session ad35d19458ea
- 3mo ago First seen · 329 lines · 209 tokens per session scan A 679b29bf0af1
dotnet-testing-test-output-logging is a skill published in the GitHub repository kevintsengtw/dotnet-testing-agent-skills (30 stars, last pushed 1mo ago), licensed MIT. It adds 163 tokens to every session and 2,834 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
dotnet-testing-test-output-logging compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| dotnet-testing-test-output-loggingkevintsengtw/dotnet-testing-agent-skills | Skill | 30 | 1mo ago | MIT | A | 163 | Claude Code, Codex |
| author-testAzure/azure-sdk-for-net | Skill | 6.1k | yesterday | MIT | A | 68 | Claude Code, Codex |
| migrate-xunit-to-xunit-v3managedcode/dotnet-skills | Skill | 527 | 16d ago | MIT | A | 149 | Claude Code, Codex |
| clean-architecture-dotnetSebastienDegodez/copilot-instructions | Skill | 199 | 23d ago | Apache-2.0 | A | 50 | Claude Code, Codex |
| creating-dotnet-mcp-serversSebastienDegodez/copilot-instructions | Skill | 199 | 23d ago | Apache-2.0 | A | 43 | Claude Code, Codex |
| csharp-xunitPracticalSwan/agent-skills | Skill | 25 | 14d ago | MIT | A | 25 | Codex |
| cratis-specifications-isolate-behaviorCratis/AI | Skill | 4 | today | MIT | A | 46 | Claude Code, Codex |