Thank you for your interest in contributing! This document explains how to get involved, what standards we follow, and how to submit changes.
This project follows the Contributor Covenant Code of Conduct. By participating you agree to uphold it. Report unacceptable behaviour to the project maintainers via GitHub.
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/<your-handle>/cli-todo-sharp.git cd cli-todo-sharp
- Add the upstream remote so you can pull future changes:
git remote add upstream https://github.com/jacshuo/cli-todo-sharp.git
| Tool | Version | Purpose |
|---|---|---|
| .NET SDK | 10.0.x (see global.json) |
Build & run |
| VS Code | latest | Recommended editor |
| C# Dev Kit | latest | VS Code extension |
Note: The SDK version is pinned in
global.json. Runningdotnet --versionafter installing the SDK should show a10.0.xversion.
dotnet build cli-todo-sharp.slncd src/CliTodoSharp
dotnet run -- list
dotnet run -- add "My task" --priority highdotnet test cli-todo-sharp.slnRun the VS Code task "publish – all platforms" (Ctrl+Shift+P → Tasks: Run Task),
or from the terminal:
# Example: Windows self-contained single-file exe
dotnet publish src/CliTodoSharp/CliTodoSharp.csproj \
-c Release -r win-x64 --self-contained true \
-p:PublishSingleFile=true -p:PublishTrimmed=true \
-o publish/win-x64cli-todo-sharp/
├── src/CliTodoSharp/ ← Main executable project
│ ├── Models/ ← Domain types (TodoTask, enums)
│ ├── Services/ ← Business logic + storage abstraction
│ ├── Commands/ ← One file per CLI command
│ ├── Rendering/ ← All Spectre.Console output helpers
│ └── Infrastructure/ ← DI bridge for Spectre.Console.Cli
├── tests/CliTodoSharp.Tests/ ← xUnit test project
├── .github/
│ ├── workflows/ci.yml ← GitHub Actions CI
│ ├── ISSUE_TEMPLATE/
│ └── PULL_REQUEST_TEMPLATE.md
├── .editorconfig ← Code style rules
├── Directory.Build.props ← Global MSBuild settings
├── global.json ← SDK version pin
└── cli-todo-sharp.sln ← Solution file
- Create a feature branch from
main:git checkout -b feat/my-new-feature # or git checkout -b fix/issue-123-crash-on-purge - Make your changes in small, focused commits (see Commit messages).
- Keep the scope of a PR focused on one concern. Large refactors that mix unrelated changes are harder to review and more likely to introduce regressions.
- Every new feature or bug fix should come with a corresponding test.
- Tests live in
tests/CliTodoSharp.Tests/. - Use the
InMemoryTaskStoragestub forTaskManagertests — no real files. - Use a temp file (cleaned up in
IDisposable.Dispose) forJsonTaskStorageServicetests. - Run the full suite before opening a PR:
dotnet test cli-todo-sharp.sln --verbosity normal - CI runs on Ubuntu, Windows, and macOS — make sure your changes don't introduce platform-specific assumptions (e.g. path separators, line endings).
Style is enforced by .editorconfig. Run dotnet build — the compiler surfaces
any violations as warnings (errors in CI).
Key conventions:
- Primary constructors for DI (avoids boilerplate fields).
- File-scoped namespaces (
namespace Foo.Bar;). varonly when the type is obvious from the right-hand side.usingdirectives outside the namespace, sorted (System first).- Private fields named
_camelCase; constants namedPascalCase. - All public API has XML doc comments (
/// <summary>). - Comments inside methods explain why, not what (the code shows the what).
We follow Conventional Commits:
<type>(<scope>): <short summary>
[optional body]
[optional footer: Fixes #123]
| Type | When to use |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code change with no behaviour change |
test |
Adding or updating tests only |
docs |
Documentation only |
chore |
Build scripts, CI, tooling |
perf |
Performance improvement |
Examples:
feat(commands): add `search` command for full-text task search
fix(storage): handle BOM in UTF-8 JSON files on Windows
chore(ci): pin actions/checkout to v4
docs(readme): add animated demo gif
- Push your branch to your fork:
git push origin feat/my-new-feature
- Open a pull request against
mainon the upstream repository. - Fill in the PR template.
- Make sure all CI checks pass. A maintainer will review your PR and may request changes.
- Once approved, it will be merged with a squash or merge commit.
- Bugs: use the Bug Report issue template.
- Features: use the Feature Request template.
- Please search existing issues before opening a new one.
Thank you for contributing! 🎉