Skip to content

Add Mockly Copilot skill and auto-copy to .agents/skills#108

Merged
dennisdoomen merged 2 commits into
mainfrom
add-mockly-copilot-skill
May 23, 2026
Merged

Add Mockly Copilot skill and auto-copy to .agents/skills#108
dennisdoomen merged 2 commits into
mainfrom
add-mockly-copilot-skill

Conversation

@dennisdoomen

@dennisdoomen dennisdoomen commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a Copilot skill (SKILL.md) to the Mockly NuGet package, following the same pattern as StructId.

What's included

SKILL.md — A comprehensive AI skill guide for Mockly, derived from all unit tests under Mockly.Specs and FluentAssertions.Mockly. Covers:

  • Basic setup and HttpMock configuration
  • HTTP method mocking (GET, POST, PUT, PATCH, DELETE)
  • URL matching: path, query, scheme, host, wildcards, URL shortcut overloads
  • Request body matching: wildcard, JSON equivalence, regex, custom predicates (sync/async)
  • Response configuration: status code, JSON, raw content, OData v4 envelope, HttpContent, custom lambda
  • IResponseBuilder<T> integration for test-data builders
  • Request capture — global mock.Requests and scoped RequestCollection
  • Invocation limits: Once(), Twice(), Times(n)
  • Fluent continuation building and Reset() / Clear()
  • IHttpClientFactory support
  • FluentAssertions.Mockly assertions (HaveAllRequestsCalled, NotContainUnexpectedCalls, BeExpected, etc.)

Mockly/Mockly.targets — MSBuild CopyMocklySkill target that runs BeforeTargets="PrepareForBuild". It resolves the consuming project's repo root (via git SourceRoot → $(SolutionDir) → nearest AGENTS.md) and copies SKILL.md to .agents/skills/mockly/SKILL.md. Uses SkipUnchangedFiles="true" and ContinueOnError="true" so it never breaks builds.

Mockly/Mockly.csproj — Two new <None> pack items:

  • SKILL.mdskills/mockly/SKILL.md (inside the package)
  • Mockly.targetsbuildTransitive/Mockly.targets (auto-imported by consumers)

Opt-out

Consumers can disable the skill copy by adding to their project or Directory.Build.props:

<PropertyGroup>
  <MocklySkill>false</MocklySkill>
</PropertyGroup>

- Add SKILL.md with comprehensive documentation derived from unit tests
- Add Mockly.targets with CopyMocklySkill MSBuild target
- Update Mockly.csproj to bundle both files in the NuGet package

The skill is copied to .agents/skills/mockly/SKILL.md in the consuming
repo root on build (via buildTransitive/Mockly.targets), following the
same pattern as StructId. Opt-out with <MocklySkill>false</MocklySkill>.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented May 23, 2026

Copy link
Copy Markdown

Test Results

  3 files  ±0    3 suites  ±0   6s ⏱️ -7s
 89 tests ±0   89 ✅ ±0  0 💤 ±0  0 ❌ ±0 
175 runs  ±0  175 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 2e514d2. ± Comparison against base commit 60348c0.

♻️ This comment has been updated with latest results.

@coveralls

coveralls commented May 23, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 26331555331

Coverage remained the same at 83.649%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1010
Covered Lines: 899
Line Coverage: 89.01%
Relevant Branches: 311
Covered Branches: 206
Branch Coverage: 66.24%
Branches in Coverage %: Yes
Coverage Strength: 334.8 hits per line

💛 - Coveralls

Remove redundant sections and examples; keep one concise example per
feature. Reduces token cost when the skill is injected into AI context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants