用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/TuYv/ccpm --skill tw-mock-response-factory命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Use when auditing a paid ad account for incremental contribution, wasted spend, or measurement integrity before scaling; runs a typed 20-item ROAS profile with verified vetoes and a SHIP/FIX/BLOCK/UNDECIDED gate on own exported data. Not for campaign structure design — use campaign-architect; not for creative production — use ad-creative-builder. 付费广告账户审计/ROAS评分
Use when the user asks to "write ad copy", "generate RSA headlines", or "build ad creative at volume"; produces ad units — RSA headlines/descriptions, hooks, and an angle matrix — message-matched to the destination landing page. Not for scoring an ad account — use ad-account-auditor; not for the post-click page — use landing-optimizer; not for organic articles — use content-writer. 广告创意/广告文案/RSA标题
Use when the user asks to "design an A/B test", "set up a creative/landing test", "run an incrementality test", or "is this result statistically and practically material?"; produces a hypothesis, variant matrix, sample-size/duration/power plan, and a documented effect/uncertainty read from own exported results. It applies only a precommitted owner-approved action rule; the statistical helper never chooses a business action. Not for producing variants — use ad-creative-builder; not for reading back one shipped change — use paid-measurement-loop. 广告AB测试设计/实验设计/显著性判定/增效测试
基于 SOC 职业分类
正在显示 SKILL.md
| name | tw-mock-response-factory |
| description | Add GetMockResponseFactory to API contracts and register factories in the SPA mock API service. |
| when-to-use | GetMockResponseFactory, MockResponseFactory, MockCopicApiService, MockWebApiService, MockFactories, mock mode, IMockResponseFactory, SPA development without backend |
Enables Blazor SPA development without a live backend. Every API contract exposes a factory; the SPA mock service dispatches requests to it.
rg -l 'GetMockResponseFactory' --glob '**/*.cs' | head -5
rg -l 'Mock.*ApiService' --glob '**/*.cs'
rg 'delegate.*MockResponseFactory' --glob '**/*.cs'
Read an existing contract + its registration before adding a new one.
Add to the operation's public static partial class:
public static MockResponseFactory<Response> GetMockResponseFactory()
{
return _ => new Response(/* realistic sample data */);
}
Rules:
MockResponseFactory<TResponse> — locate in the repo's shared contracts projectdefaultListResponse<T>: several varied items, set totalCount correctlyResponse: return new Response() or the repo's established patternpublic static MockResponseFactory<Response> GetMockResponseFactory()
{
AnnouncementDto[] items =
[
new() { Text = "Maintenance tonight", Link = "/announcements/1" },
new() { Text = "New feature available", Link = "/announcements/2" },
];
return _ => new Response(totalCount: items.Length, items);
}
public static MockResponseFactory<Response> GetMockResponseFactory()
{
return _ => new Response { SecurityRoleId = 1, B2CGroupId = Guid.NewGuid() };
}
Mirror the registration pattern already in the repo. Common variants:
Dictionary on mock service:
{ typeof(GetProfile.Query), GetProfile.GetMockResponseFactory() },
{ typeof(CreateSecurityRole.Command), CreateSecurityRole.GetMockResponseFactory() },
Wrapper class per endpoint (MockFactories/ folder):
internal sealed class GetProfileMockFactory : IMockResponseFactory
{
public object Create(IApiRequest request) =>
GetProfile.GetMockResponseFactory()((GetProfile.Query)request);
}
Then register the wrapper class in the mock service's factory dictionary.
GetMockResponseFactory() on the contract partial classtw-web-api-contracts — full contract workflow; mock factory is step 10 of new endpoints