Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
mpauloskyPublic archive

About

Files to support setting up a new computer with powershell and posh-git with themes

Topics

Resources

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

dotfiles

This repository is retired and is being archived. Nothing here is maintained.

  • The repo-ci-baseline Template, the shared skills and the starting-point files moved to mpaulosky/Application_Factory.
  • The shell profiles and prompt themes moved to a secret Gist.
  • Not carried over to either place, and unmaintained: the systemd sync script, the dev container, .copilot/ (the Copilot skills and MCP config) and the Dygma keyboard layers. They stay in this repository as history.

The rest of this file is kept for history and may be out of date.

Configuration and support files for quickly bootstrapping .NET projects and developer environments.

Purpose: This repository is a template and support-file library — it holds reusable configurations, starter projects, shell profiles, CI workflows, and documentation templates that can be quickly copied into new repositories.


Repository Structure

BaseNewProject/          Starter template for new .NET Blazor projects
  docs/                  Project-specific docs (PRDs, specs)
Bashrc/                  Linux shell profile templates (.bashrc, .profile)
PowerShell 7/            PowerShell profile template
Posh-Git Themes/         Posh-Git theme files for PowerShell prompt
docs/                    This repository's own docs (SECURITY.md)
.devcontainer/           Dev Container definition (.NET 10)
.github/
  instructions/          Copilot instruction files (Blazor, MongoDB DBA)
  workflows/             CI workflows (Squad automation, linting)
  agents/                GitHub Copilot agent definitions
.copilot/                Copilot CLI configuration and skills
.squad/                  Squad AI team orchestration

Working in this repo

dotfiles follows the Baseline's branch and worktree rules, with copies of the repo-ci-baseline Template's git hooks in .github/hooks/: commit in a worktree under ../dotfiles-worktrees/, on a branch named feature|fix|hotfix/<issue>-<slug> or chore/<slug>, and push through the pre-push gate, which runs scripts/gate.sh (the skill's test.sh). Switch the hooks on once per clone:

git config core.hooksPath .github/hooks

test.sh fails if a copied hook drifts from the Template's; change the Template's and copy it over.

Quick Start

Using a Starter Template

  1. Copy the BaseNewProject/ folder contents into your new repository
  2. Take the project documentation (SECURITY.md and the rest) from the repo-ci-baseline skill's Seed: Support For New Projects/.claude/skills/repo-ci-baseline/template/seed/docs/
  3. Copy .github/instructions/copilot-instructions.md for Copilot guidance
  4. Adjust to your project's specifics

Shell Profiles

  • Bash: Copy files from Bashrc/ to your home directory
  • PowerShell: Copy the profile from PowerShell 7/ to your PowerShell profile path
  • Posh-Git: Copy theme files from Posh-Git Themes/

Keeping ~/github checkouts in sync

PRs merge on GitHub (mostly through PR Auto-Merge), so a local checkout of main falls behind until someone pulls. systemd/sync-github-repos.sh fast-forwards the primary checkout of every repo under ~/github to its origin's default branch, and sync-github-repos.timer runs it every 5 minutes. It only runs git merge --ff-only: a checkout that's on another branch, has local changes or commits of its own, or is mid-merge or mid-rebase is skipped and logged, never merged, stashed or reset. Install it once:

install -Dm755 systemd/sync-github-repos.sh ~/.local/bin/sync-github-repos.sh
install -Dm644 -t ~/.config/systemd/user systemd/sync-github-repos.service systemd/sync-github-repos.timer
systemctl --user daemon-reload
systemctl --user enable --now sync-github-repos.timer

See what it did with journalctl --user -u sync-github-repos.service. Set GITHUB_ROOT in the service to sync another folder.

Dev Container

The .devcontainer/ folder provides a ready-to-use development container targeting .NET 10 with Aspire support. Copy it to your project for consistent dev environments.

Copilot Instructions

Files in .github/instructions/ are reusable Copilot instruction templates:

File Purpose
copilot-instructions.md .NET project coding standards (C# 14, Blazor, MongoDB, testing)
blazor-web-app.instructions.md Blazor component and application patterns
mongodb-dba.agent.md MongoDB DBA chat mode instructions

Adding Sandcastle to a Repo

Sandcastle runs Claude Code agents in a Docker sandbox. It picks up open GitHub issues labelled Sandcastle, plans them, implements and reviews each one in its own git worktree, then pushes the branch and opens a pull request that closes the issue. The reference setup is Blazor-Server's .sandcastle/; copy from it rather than starting from the stock template. dotfiles runs Sandcastle too: its .sandcastle/ is a port for a repo with no .NET, whose image carries the repo-ci-baseline skill's test tools instead of the SDK.

The repo-ci-baseline Template now carries Sandcastle's shared files: its code (main.mts, status.mts and lib/), config, intake and critique, plan, review and role prompts (Owned), and its per-repo values (lib/repo-config.mts), roles/shared-rules.md, roles/skills.md, Dockerfile, check-paths list and package.json (Seed). In a Baseline repo, create .sandcastle/ and Apply again to get them. The skill's references/sandcastle.md says what each file is and how an existing Sandcastle repo migrates.

1. Prerequisites

  • Docker running on the host, and your user able to run docker without sudo.
  • Node 22 and pnpm (enable it with corepack enable pnpm, and pin it with packageManager in package.json).
  • The gh CLI, logged in on the host (gh auth status). The host uses this auth for every GitHub call.
  • Claude Code installed on the host, for claude setup-token.
  • The repo-ci-baseline applied to the repo (see the repo-ci-baseline skill under Support For New Projects/.claude/skills/). Sandcastle relies on its scripts/gate.sh, branch-name script, rulesets and CI, the sandcastle:needs-human label and the auto-merge hand-back hold. It pushes with hooks off (step 7), so the pre-push hook doesn't guard its pushes.

2. Install the packages

pnpm add -D @ai-hero/sandcastle tsx typescript @types/node
pnpm add zod   # the planner templates validate their <plan> output with it

3. Scaffold .sandcastle/

pnpm exec sandcastle init \
  --agent claude-code --sandbox docker \
  --template parallel-planner-with-review \
  --issue-tracker github-issues --create-label true \
  --build-image false --install-template-deps true

init refuses to run if .sandcastle/ already exists. --create-label true creates the Sandcastle label on GitHub. Leave the image build until the Dockerfile is adapted (step 4).

Make sure .sandcastle/.gitignore ignores the secrets and the run output:

.env
logs/
worktrees/

4. Adapt the Dockerfile for .NET

The stock image has Node, git, curl, jq and gh only. Add what the agents and the gate need (see Blazor-Server's .sandcastle/Dockerfile):

  • libicu72 (needed by .NET), plus yamllint and anything else scripts/gate.sh calls.
  • RUN corepack enable pnpm and ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0, before switching to the agent user.
  • The .NET SDK through dotnet-install.sh --version <sdk.version> --install-dir /home/agent/.dotnet, with the exact version from the repo's global.json, which satisfies any rollForward policy. Blazor-Server uses --channel 10.0, which works only because its rollForward is latestMinor. Symlink it into /home/agent/.local/bin, with DOTNET_ROOT, DOTNET_CLI_TELEMETRY_OPTOUT=1 and DOTNET_NOLOGO=1 set.
  • /home/agent/.dotnet and /home/agent/.dotnet/tools on PATH, so dotnet works in login and non-login shells.

Then build the image (it defaults to sandcastle:<repo-dir-name> and matches the host's UID/GID):

pnpm exec sandcastle docker build-image

Rebuild it whenever the Dockerfile changes.

5. Set up the secrets

init writes a blank GH_TOKEN= into .env.example. Replace the file with Blazor-Server's .env.example (Claude token only) before copying it:

cp .sandcastle/.env.example .sandcastle/.env
claude setup-token   # paste the token into CLAUDE_CODE_OAUTH_TOKEN in .sandcastle/.env

Put only the Claude token (or ANTHROPIC_API_KEY) in .env. Don't add GH_TOKEN or GITHUB_TOKEN, not even blank: Sandcastle passes every key in .env into the sandbox, filling blanks from the host's environment, which would hand your GitHub token to the agents. Blazor-Server's main.mts refuses to start while either key is there.

6. Adapt the prompts

The prompts are Owned and read the same in every repo, so put the repo's own text in .sandcastle/roles/shared-rules.md (every role reads it) and .sandcastle/roles/skills.md (the skills block the tester, developer and UI developer read) instead of editing plan-prompt.md, review-prompt.md or a role's prompt. The Seed roles/shared-rules.md already tells every role never to push, run gh or write to GitHub (the host does that); keep that rule when you write your own. The host drops issues whose branch has an open pull request before the planner sees them. In roles/shared-rules.md:

  • Use the repo's build and test commands (dotnet build <Solution>.slnx, the test projects) instead of npm.
  • Point the agents at CONTEXT.md, docs/adr/ and the coding standards, and have them work test-first.
  • Use the repo's commit format, <type>(<scope>): <Summary> with Refs #<id>.

Skills are set up apart from the shared rules. Install the skills the agents need on the host in ~/.claude/skills; the sandbox mounts them read-only. Name each one in SANDBOX_SKILLS in lib/repo-config.mts and list them in roles/skills.md under the same names: the skills consistency check fails when the two lists differ. Point agents at a repo-local skill (one under the repo's .claude/skills/ that isn't in SANDBOX_SKILLS) from roles/shared-rules.md, not from roles/skills.md.

7. Adapt the orchestration

The stock template merges into your checked-out branch and closes the issue with no pull request. Replace that with Blazor-Server's main.mts and lib/ (gate, plan, critique, build, branches, GitHub, config), plus the critique-prompt.md and roles/ that lib/ loads. critique-prompt.md and the role prompts are Owned and used as they are; only roles/shared-rules.md and roles/skills.md are adapted, as in step 6: roles/shared-rules.md goes into every role's prompt and names Blazor-Server's solution, gate and commit rules. The orchestration:

  • Hold back issues whose blockers haven't landed or that already have an open pull request.
  • Run scripts/gate.sh in the sandbox after the implementer and again after the reviewer, with a gate-fixer role for a red gate, and comment on the issue when it still fails.
  • Keep agents out of the host's git. Sandcastle worktrees share the clone's .git, which is mounted read-write into every sandbox, and the host's git reads its config: credential.helper, core.sshCommand, core.fsmonitor, remote.*.pushurl, url.*.insteadOf/pushInsteadOf, http.* (proxy, SSL, extra headers) and include.path/includeIf.* can each run a command on the host, or send the push and its credential elsewhere. Command-line overrides can't cover them all (a url.* rewrite applies even to an explicit URL), so the protection is to mount .git/config read-only in every sandbox (as Articles and Blazor-Server do), pin GIT_DIR/GIT_COMMON_DIR, and refuse to start if .git/commondir exists. Also refuse to push if git config --get-regexp '^(url\.|http\.|include)' returns anything you didn't set yourself.
  • Turn hooks off for every git command the host runs, not just the push: git worktree add, merge, commit, switch, status and the rest, through GIT_CONFIG_COUNT/GIT_CONFIG_KEY_0=core.hooksPath/ GIT_CONFIG_VALUE_0=/dev/null in the host process's environment. A Baseline repo sets a relative core.hooksPath of .github/hooks, so the hooks that fire in a worktree are that worktree's own .github/hooks/*, which the agents can edit. A read-only .git/hooks doesn't help there; it only matters in a repo without core.hooksPath.
  • Push the exact commit that passed, from the main checkout: git -c core.hooksPath=/dev/null -c core.fsmonitor=false -c credential.helper= -c credential.helper='!gh auth git-credential' push https://github.com/<owner>/<repo>.git <sha>:refs/heads/<branch>. The overrides are a second layer; the read-only .git/config is what makes them trustworthy. Don't record a marker for the pre-push hook to skip its gate; the hook no longer honours one.
  • Hooks are off for that push, so the pre-push hook's other checks don't run. Before pushing, run scripts/check-branch-name.sh on the branch and refuse a branch behind origin/main; the protected-branch refusal can't trigger, because it only pushes issue branches. The ruleset and CI's "Branch name" job catch the same things on GitHub as a backstop.
  • Open a pull request that says Closes #<id>.

Set each role's model, effort and budget in lib/repo-config.mts (ROLE_AGENTS), and keep the onSandboxReady hook (pnpm install --frozen-lockfile --config.confirm-modules-purge=false) and copyToWorktree = ["node_modules"].

8. Gate the Sandcastle code

Add a tsconfig.json to .sandcastle/ (strict, nodenext, excluding worktrees and logs) and a script to package.json:

"scripts": {
  "check:sandcastle": "tsc --noEmit -p .sandcastle && tsx --test \".sandcastle/**/*.test.mts\""
}

Run it from .github/ci/gate-checks.sh (the repo's own Seed file, which scripts/gate.sh calls) when the Sandcastle files change:

if ! git diff --quiet "$base" HEAD -- .sandcastle package.json ':(glob)pnpm-*.yaml'; then
  pnpm run check:sandcastle
fi

9. Configure GitHub

  • Run github-settings.sh --fix mpaulosky/<repo> from the repo-ci-baseline skill to create the sandcastle:needs-human label and the rest of the standard settings.
  • If Sandcastle gets its own required check, add it to github/repos/<repo>.json in that skill.

10. Run it

pnpm exec tsx .sandcastle/main.mts

Label the issues you want worked Sandcastle. Each round prints the issues it holds back, the branches it works and the pull requests it opens, and stops when a round opens no pull request. A red gate gets a comment on the issue and no pull request. A failed review still opens one, as a draft with a note saying the review didn't finish, if the second gate passes; a person marks it ready after running the review again. Sandcastle doesn't label anything sandcastle:needs-human: add it to hand a pull request to a person, and it won't auto-merge until the owner removes it.

Finally, mention .sandcastle/ and the check:sandcastle command in the repo's README.md and CLAUDE.md.

Documentation

The docs/ folder holds this repository's own docs: SECURITY.md, its security policy. Templates of the docs for other projects are the repo-ci-baseline skill's Seed files under Support For New Projects/.claude/skills/repo-ci-baseline/template/seed/docs/, which Apply copies into a repository.

Squad AI Team

This repository uses Squad for AI-assisted development orchestration. See .squad/team.md for the current team roster.

License

See LICENSE for details.

About

Files to support setting up a new computer with powershell and posh-git with themes

Topics

Resources

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages