Skip to content

Scaffold gui-cs/cli to Editor-style .NET 10 library layout with CI/release workflows#1

Merged
tig merged 3 commits into
mainfrom
copilot/scaffold-repo-to-match-editor-structure
May 23, 2026
Merged

Scaffold gui-cs/cli to Editor-style .NET 10 library layout with CI/release workflows#1
tig merged 3 commits into
mainfrom
copilot/scaffold-repo-to-match-editor-structure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

This PR bootstraps gui-cs/cli to match the structural conventions used in gui-cs/Editor, establishing a clean starting point for Terminal.Gui.Cli (net10.0) without introducing library implementation code.

  • Repository scaffolding (Editor-aligned)

    • Added .editorconfig, Directory.Build.props, and Directory.Build.targets.
    • Set shared build/package metadata for Terminal.Gui.Cli, including:
      • Version = 0.1.0-develop
      • TerminalGuiVersion = 2.4.1-develop.11
    • Added CLAUDE.md, AGENTS.md, and specs/constitution.md adapted for this repository.
  • GitHub Actions workflows

    • Added ci.yml with OS matrix (ubuntu, macos, windows) for restore/build/format/test.
    • Added release.yml for:
      • develop pushes (computed prerelease version)
      • v* tags (tag-derived version)
      • Release build/test/pack/NuGet publish
    • Added prepare-release.yml for manual release branch + release PR creation.
    • Added finalize-release.yml for merged release PR handling (tag, GitHub Release, back-merge PR).
  • Solution and project skeleton

    • Added modern solution file: Terminal.Gui.Cli.slnx.
    • Added library project:
      • src/Terminal.Gui.Cli/Terminal.Gui.Cli.csproj
      • PackageId/Namespace = Terminal.Gui.Cli
      • TargetFramework = net10.0
      • IsAotCompatible = true
      • PackageReference to Terminal.Gui
    • Added assembly visibility for tests:
      • src/Terminal.Gui.Cli/Properties/AssemblyInfo.cs
    • Added empty executable xUnit v3 test projects:
      • tests/Terminal.Gui.Cli.Tests
      • tests/Terminal.Gui.Cli.IntegrationTests
      • tests/Terminal.Gui.Cli.SmokeTests
    • Added example app scaffold:
      • examples/Terminal.Gui.Cli.ExampleApp (console app with project reference to library)

Example scaffold from the new shared props:

<PropertyGroup>
  <TargetFramework>net10.0</TargetFramework>
  <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
  <Version>0.1.0-develop</Version>
  <TerminalGuiVersion Condition="'$(TerminalGuiVersion)' == ''">2.4.1-develop.11</TerminalGuiVersion>
</PropertyGroup>
Original prompt

Scaffold this repo to match the gui-cs/Editor repo structure. This is a .NET class library called Terminal.Gui.Cli (package ID: Terminal.Gui.Cli, namespace: Terminal.Gui.Cli, TFM: net10.0).

Clone and adapt from gui-cs/Editor:

  • .editorconfig
  • Directory.Build.props (set Version to 0.1.0-develop, add TerminalGuiVersion property pinned to 2.4.1-develop.11)
  • Directory.Build.targets
  • CLAUDE.md and AGENTS.md (adapt for this library)
  • specs/constitution.md (adapt from Editor's constitution)
  • .github/workflows/ci.yml (restore, build, format check, run test projects on ubuntu/macos/windows matrix)
  • .github/workflows/release.yml (develop push + v* tags: version compute, Release build/test, pack, NuGet push)
  • .github/workflows/prepare-release.yml (manual dispatch: create release branch + PR)
  • .github/workflows/finalize-release.yml (release PR merge: tag, GitHub Release, back-merge PR)

Create the solution and empty project structure:

  • Terminal.Gui.Cli.slnx (modern solution format)
  • src/Terminal.Gui.Cli/Terminal.Gui.Cli.csproj (class library, net10.0, IsAotCompatible=true, PackageReference to Terminal.Gui)
  • src/Terminal.Gui.Cli/Properties/AssemblyInfo.cs (InternalsVisibleTo for test projects)
  • tests/Terminal.Gui.Cli.Tests/Terminal.Gui.Cli.Tests.csproj (xunit.v3 executable, ProjectReference to library)
  • tests/Terminal.Gui.Cli.IntegrationTests/Terminal.Gui.Cli.IntegrationTests.csproj
  • tests/Terminal.Gui.Cli.SmokeTests/Terminal.Gui.Cli.SmokeTests.csproj
  • examples/Terminal.Gui.Cli.ExampleApp/Terminal.Gui.Cli.ExampleApp.csproj (console app, ProjectReference to library)

Use develop as the default branch. The repo should build with zero warnings and have a passing CI before any library code is added. Do NOT implement the library itself — only scaffolding.

@tig tig marked this pull request as ready for review May 23, 2026 22:58
Copilot AI changed the title [WIP] Scaffold repo to match gui-cs/Editor structure Scaffold gui-cs/cli to Editor-style .NET 10 library layout with CI/release workflows May 23, 2026
Copilot AI requested a review from tig May 23, 2026 23:01
Copilot finished work on behalf of tig May 23, 2026 23:01
Copy link
Copy Markdown
Member

@tig tig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: gui-cs/cli PR #1 ? Scaffold

Overall: Good scaffolding. A few issues to fix before merge.

Issues:

1. Test projects use wrong xUnit v3 pattern

The test .csprojs include Microsoft.NET.Test.Sdk and xunit.runner.visualstudio ? that is the xUnit v2/dotnet-test pattern. For xUnit v3 executable tests (which is what clet and Editor use), you only need:

<PackageReference Include="xunit.v3" Version="3.2.2" />

Remove Microsoft.NET.Test.Sdk and xunit.runner.visualstudio. The test projects are already <OutputType>Exe</OutputType> which is correct for xUnit v3 self-hosted runners (dotnet run --project). The extra packages will cause conflicts.

2. Missing LICENSE and README.md

Directory.Build.props references LICENSE and README.md for packaging (<None Include="..." Pack="true" />), and the solution file lists them in /Docs/. But neither file exists in the PR. The build will warn or fail on pack. Add at minimum a placeholder MIT LICENSE file and a stub README.

3. Constitution is too thin

The constitution should include the Terminal.Gui.Cli-specific rules from the spec (C1-C8):

  • C1: Only CliHost calls TG lifecycle APIs
  • C2: Public API changes require spec update
  • C3: No reflection-based command discovery
  • C4: Source-generated JSON only
  • C5: Tests run in parallel (no process-global mutation)
  • C6: Commands never call Environment.Exit
  • C7: Schema v1 is append-only
  • C8: Zero warnings

The current version is generic project-management boilerplate. It should be the engineering authority document per the spec.

4. CLAUDE.md should reference constitution and coding conventions

The clet CLAUDE.md is much more detailed ? it documents space-before-parens, file-scoped namespaces, always-braces, early returns, one-type-per-file, etc. The scaffolded one just says "follow .editorconfig" which misses the non-enforceable conventions. At minimum add the key style rules or say "see specs/constitution.md" once that is fleshed out.

5. CI workflow missing: --configuration on test steps

CI builds in Debug (no -c flag), but test steps use --no-build. This works. However, the release workflow builds Release and tests with --no-build -c Release. The CI workflow should probably also pass -c Debug explicitly to be clear, or at minimum match its build and test configurations.

6. .gitignore is minimal

Missing common entries: packages/, publish/, *.nupkg, .idea/, *.DotSettings.user, launchSettings.json. Not blocking but worth adding.

Looks good:

  • .editorconfig ? correct space-before-parens rules including ReSharper hints
  • Directory.Build.props ? Version, TerminalGuiVersion pin, TreatWarningsAsErrors all correct
  • Solution file ? modern .slnx format, correct project paths, doc/settings folders
  • Workflow structure ? all 4 workflows present (ci, release, prepare-release, finalize-release)
  • AssemblyInfo.cs ? InternalsVisibleTo for all 3 test projects
  • Library csproj ? IsAotCompatible, correct PackageReference to Terminal.Gui via property
  • ExampleApp ? ProjectReference to library, IsPackable=false

Verdict: Request changes (items 1-3 are blocking; 4-6 are nice-to-have).

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 23, 2026

Review: gui-cs/cli PR #1 ? Scaffold

Overall: Good scaffolding. A few issues to fix before merge....

Implemented in 9422945.

  • Switched all three test projects to the xUnit v3 executable pattern (kept only xunit.v3, removed Microsoft.NET.Test.Sdk and xunit.runner.visualstudio).
  • Expanded specs/constitution.md to include C1–C8 as repository engineering rules.
  • Expanded CLAUDE.md to reference the constitution and added key coding conventions.
  • Updated CI to use explicit Debug configuration for build/test steps.
  • Expanded .gitignore with the requested common generated-artifact entries.

Also confirmed root LICENSE and README.md are present and packaging still succeeds (dotnet pack creates Terminal.Gui.Cli.0.1.0-develop.nupkg).

Copilot finished work on behalf of tig May 23, 2026 23:07
Copilot AI requested a review from tig May 23, 2026 23:07
@tig tig merged commit 38b3337 into main May 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants