Build orchestration SDK for PostSharp/Metalama repositories.
Important
Read this file entirely before doing any work or answering any question for this project, especially regarding loading skills.
-
The
postsharp-engineeringplugin provides skills and slash commands. To discover them: -
ALWAYS Read which plug-ins and skills are available to you before doing ANY work, and confirm to the users that you have read these skills before any session.
- Never update DockerBuild.ps1, Dockerfile. Dockerfile.claude, eng/RunClaude.ps1. These files are generated by
Build.ps1. Their source code is in the Resources directory.
When running inside a Docker container, you have access to the host-approval MCP server for executing privileged commands on the host machine. These commands require human approval before execution.
Source code: src/PostSharp.Engineering.McpApprovalServer/
The MCP Approval Server is a WPF GUI application that:
- Receives command execution requests from Claude in Docker via MCP protocol
- Analyzes risk using both regex rules and AI (Claude CLI with Haiku/Opus)
- Prompts the human for approval via a GUI dialog
- Executes approved commands via PowerShell on the host
See src/PostSharp.Engineering.McpApprovalServer/CLAUDE.md for architecture details and how to add command rules.
The MCP Approval Server is a standalone GUI application with system tray integration. Before running Claude in Docker mode, start the server:
- Build the solution:
dotnet build - Run the GUI application:
.\src\PostSharp.Engineering.McpApprovalServer\bin\Debug\net8.0-windows\PostSharp.Engineering.McpApprovalServer.exe - The server will appear as a tray icon (green = ready, orange = pending requests)
- Now run
DockerBuild.ps1 -Claude- it will detect the running server automatically
The MCP server uses localhost-only binding for security:
- Server binds exclusively to
localhost:9847(not exposed to the network) - Docker containers access via the host gateway IP
- No authentication tokens needed since only local processes can connect
- Human approval required for all non-low-risk commands via the GUI
Use the ExecuteCommand tool from the host-approval MCP server for:
gh pr create- Creating pull requestsgh pr merge- Merging pull requestsgh pr view- Viewing PR details (private repos)gh release create- Creating releasesgh issue create/close/comment- Issue management- Any
ghcommand that requires authentication
git push- Pushing commits to remotegit push --tags- Pushing tagsgit push --force- Force pushing (use with caution)
- Any API calls to TeamCity
- Triggering builds
- Accessing build artifacts
- Managing build configurations
dotnet nuget push- Publishing NuGet packages- Any operation that publishes artifacts externally
Call the ExecuteCommand tool with:
command: The command to executeworkingDirectory: The working directory (use forward slashes:c:/src/RepoName)claimedPurpose: A clear explanation of why this command is needed
To push a feature branch:
ExecuteCommand(
command: "git push origin feature/my-feature",
workingDirectory: "c:/src/PostSharp.Engineering",
claimedPurpose: "Push the feature branch with MCP implementation to remote for PR creation"
)
Do NOT use the MCP server for:
- Local git operations (commit, branch, checkout, status, diff, log)
- Local builds (
dotnet build,dotnet test) - File operations within the container
- Reading files or exploring the codebase
These operations should be done directly in the container using standard tools.
Before scheduling a TeamCity build or deploy, the version must be bumped. This is done via the VersionBump build configuration on TeamCity.
Use the MCP ExecuteCommand tool to trigger the VersionBump build via TeamCity API (requires TEAMCITY_CLOUD_TOKEN on host):
$headers = @{
"Authorization" = "Bearer $env:TEAMCITY_CLOUD_TOKEN"
"Content-Type" = "application/json"
"Accept" = "application/json"
}
$body = @{
buildType = @{ id = "<ProjectPrefix>_VersionBump" }
branchName = "<branch>"
} | ConvertTo-Json
Invoke-RestMethod -Uri "https://postsharp.teamcity.com/app/rest/buildQueue" -Method Post -Headers $headers -Body $body- Check
.teamcity/settings.ktsfor the VCS root:AbsoluteId("...") - The build type ID is:
<VcsRootId>_VersionBump - For this repo:
Engineering_PostSharpEngineering_VersionBump
- Commit
- Push
- Wait 1 seconds
- Bump version (see above)
- Monitor version bumping
- When completed, schedule deploy public
NEVER COMMIT WITHOUT USER APPROVAL. Even if the user has given approval for a prior commit.