一键导入
development-workflow
General .NET development workflow patterns. Use when implementing features, fixing bugs, or refactoring code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
General .NET development workflow patterns. Use when implementing features, fixing bugs, or refactoring code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Interactively elicit, capture, and maintain software/system requirements as a living, traceable repository. Use whenever the user wants to gather, write, refine, or organize requirements — including producing or updating an SRS (software/system requirements specification), writing ADRs / architecture decision records, building a requirements traceability graph (DAG), or keeping a decision ledger. Trigger proactively when the working folder already holds requirements artifacts (a `requirements/` folder of YAML, `decisions/` ADRs, an `srs.md`, or `ledger.md`), or when the user shares documents that are clearly specs, RFCs, or feature briefs and wants them structured. Also use for phrases like "let's spec this out", "interview me about what we're building", "capture these requirements", "write a decision record", or "turn these notes into a spec". Not for project management, code review, application code, dependency manifests like requirements.txt, or hardware "system requirements" (RAM/CPU).
Use this skill whenever the user wants to create a bash script that drives an autonomous coding loop — scripts that run Claude Code on a schedule (cron, GitHub Actions, systemd timer) or on-demand to make repository improvements, execute plans, triage issues, or otherwise do agentic work with minimal human intervention. Triggers include phrases like "scout script", "autonomous script", "agent harness", "script that runs on a schedule", "script that implements a plan", ".scripts/*.sh", or any request for a bash script whose body is "run Claude Code with a prompt and commit the results". Always use this skill before writing such a script — it encodes the interview flow, the adversarial-reviewer pattern, and the locking/ledger conventions.
Task structure and atomic commit patterns for granular, verifiable work units
Conflict identification and resolution patterns for requirements, decisions, and plans
Context window management techniques for maintaining efficiency and preventing context bloat
Exploration map management for tracking discussed areas and uncharted territory during DISCUSS phase
| name | development-workflow |
| description | General .NET development workflow patterns. Use when implementing features, fixing bugs, or refactoring code. |
| allowed-tools | Read, Grep, Glob, Bash, Edit, Write |
┌─────────────────────────────────────────────────────────────────┐
│ DEVELOPMENT WORKFLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ │
│ │ Understand │ Read requirements, explore codebase │
│ │ Task │ │
│ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ Implement │ Write code following patterns │
│ │ Changes │ │
│ └──────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Validate │────▶│ Report │ │
│ │ Build/Test/ │ │ Results │ │
│ │ Analyze │ │ │ │
│ └──────────────┘ └──────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────┐ ┌──────────┐ │
│ │ PASS? │───NO───▶│ Fix │ │
│ └─────────┘ │ Issues │ │
│ │ └──────────┘ │
│ │ │ │
│ YES │ │
│ │ │ │
│ ▼ │ │
│ ┌──────────────┐ │ │
│ │ Ready to │◀──────────┘ │
│ │ Commit │ (re-validate) │
│ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
// Find existing patterns
// Look for similar implementations in the codebase
// Follow established conventions
// Example: If services follow this pattern
public class ExistingService : IExistingService
{
private readonly IRepository _repository;
private readonly ILogger<ExistingService> _logger;
public ExistingService(IRepository repository, ILogger<ExistingService> logger)
{
_repository = repository;
_logger = logger;
}
}
// New service should follow same pattern
public class NewService : INewService
{
private readonly IRepository _repository;
private readonly ILogger<NewService> _logger;
public NewService(IRepository repository, ILogger<NewService> logger)
{
_repository = repository;
_logger = logger;
}
}
# 1. Build (catch compilation errors)
dotnet build --no-incremental
# 2. Run tests (verify behavior)
dotnet test --no-build
# 3. Static analysis (code quality)
dotnet build /p:TreatWarningsAsErrors=true
dotnet format --verify-no-changes
| Gate | Requirement | Blocking |
|---|---|---|
| Build | 0 errors | Yes |
| Tests | 100% pass | Yes |
| Critical Warnings | 0 | No |
| All Warnings | < 10 | No |
dotnet format for auto-fixable issuesdotnet build succeeds with no errorsdotnet test passes all tests# Full validation
dotnet build --no-incremental && \
dotnet test --no-build && \
dotnet format --verify-no-changes
// Group related code
// 1. Fields
private readonly IService _service;
// 2. Constructors
public MyClass(IService service) => _service = service;
// 3. Public methods
public void Execute() { }
// 4. Private methods
private void Helper() { }
// Be specific with exceptions
public User GetUser(int id)
{
var user = _repository.Find(id);
if (user == null)
throw new EntityNotFoundException($"User {id} not found");
return user;
}
// Use guard clauses
public void Process(Request request)
{
ArgumentNullException.ThrowIfNull(request);
ArgumentException.ThrowIfNullOrEmpty(request.Name);
// Main logic
}
// Always use async suffix
public async Task<User> GetUserAsync(int id)
{
return await _repository.FindAsync(id);
}
// Don't block on async
// BAD
var user = GetUserAsync(id).Result;
// GOOD
var user = await GetUserAsync(id);
// Register services
services.AddScoped<IUserService, UserService>();
services.AddSingleton<ICacheService, MemoryCacheService>();
services.AddTransient<IEmailSender, SmtpEmailSender>();
// Inject via constructor
public class UserController
{
private readonly IUserService _userService;
public UserController(IUserService userService)
{
_userService = userService;
}
}
See patterns.md for detailed implementation patterns.