Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .agents/skills/muster/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Muster MCP server is connected, use the equivalent tools instead — see

Install the CLI with `bun install -g 'github:SvalTek/Muster#main'`, then run
`muster whoami`. Use `muster install` to install the Herdr layout, theme and
mod. The Herdr install record is at `%USERPROFILE%\.config\herdr-app\muster.json`.
mod, or `muster uninstall` to turn them off while preserving data. The Herdr
install record is at `%USERPROFILE%\.config\herdr-app\muster.json`.
Add `--json` for machine-readable output.

## Details
Expand Down
5 changes: 5 additions & 0 deletions .agents/skills/muster/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ or a file, so quoting doesn't eat newlines.

```text
muster install [herdr] [--app-home DIR] [--muster-home DIR] [--no-keys]
muster uninstall [herdr] [--app-home DIR]
muster whoami [--path DIR] [--agent A] [--terminal T]
muster status <working|blocked|waiting|done|failed|idle> [summary]
muster ask --question Q [--choice id:label]... [--timeout S] [--dedupe K]
Expand Down Expand Up @@ -68,6 +69,10 @@ mcp`, `muster skill cards`, or `muster skill all` to read a guide. Other
arguments search all bundled guides case-insensitively and return matching
Markdown sections, for example `muster skill pending`.

`muster uninstall` disables the Herdr layout and mod, preserves data and
backups, and removes only recorded, unchanged key bindings. Close Herdr first;
use `--app-home DIR` when it is installed somewhere other than the default.

Card kinds: `question`, `approval`, `report`, `result`, `progress`.
Severities: `info`, `attention`, `blocked`, `success` (defaults to
`attention` for question/approval, else `info`).
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Muster CI

on:
push:
branches: [main, develop]
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.2
- run: bun install --frozen-lockfile
- run: bun run typecheck
- run: bun test
- name: Check generated content
shell: bash
run: |
bun run build-skill
bun run build-herdr-assets
git diff --exit-code -- app/skill-content.ts targets/herdr/assets.ts

build:
name: Build (${{ matrix.name }})
needs: test
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
name: windows-x64
executable: muster-windows-x64.exe
- os: ubuntu-latest
name: linux-x64
executable: muster-linux-x64
- os: ubuntu-24.04-arm
name: linux-arm64
executable: muster-linux-arm64
- os: macos-15-intel
name: macos-x64
executable: muster-macos-x64
- os: macos-latest
name: macos-arm64
executable: muster-macos-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.2
- name: Compile and smoke test
shell: bash
env:
EXECUTABLE: ${{ matrix.executable }}
run: |
mkdir -p dist
bun build --compile ./cli.ts --outfile "dist/$EXECUTABLE"
"./dist/$EXECUTABLE" version
"./dist/$EXECUTABLE" skill cli > /dev/null
- uses: actions/upload-artifact@v4
with:
name: muster-${{ matrix.name }}
path: dist/${{ matrix.executable }}
if-no-files-found: error
retention-days: 7
117 changes: 117 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Publish channel builds

on:
workflow_run:
workflows: [Muster CI]
types: [completed]

permissions:
actions: read
contents: write
pull-requests: read

concurrency:
group: publish-${{ github.event.workflow_run.event }}-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false

jobs:
publish:
if: >-
github.event.workflow_run.conclusion == 'success' &&
(github.event.workflow_run.event == 'push' || github.event.workflow_run.event == 'pull_request')
runs-on: ubuntu-latest
steps:
# This workflow is loaded from the default branch. It never checks out or
# executes PR code: artifacts from the unprivileged CI run are data only.
- name: Resolve and validate channel
id: channel
shell: bash
env:
GH_TOKEN: ${{ github.token }}
EVENT: ${{ github.event.workflow_run.event }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
HEAD_OWNER: ${{ github.event.workflow_run.head_repository.owner.login }}
run: |
set -euo pipefail
if [[ ! "$HEAD_SHA" =~ ^[0-9a-f]{40}$ ]]; then
echo 'Invalid source commit' >&2; exit 1
fi
if [[ "$EVENT" == push ]]; then
case "$HEAD_BRANCH" in
main) tag=stable ;;
develop) tag=dev ;;
*) echo 'Not a release branch'; exit 0 ;;
esac
current=$(gh api "repos/$GITHUB_REPOSITORY/branches/$HEAD_BRANCH" --jq '.commit.sha')
if [[ "$current" != "$HEAD_SHA" ]]; then
echo 'A newer branch commit exists; skip this run'; exit 0
fi
else
prs=$(gh api --paginate -X GET "repos/$GITHUB_REPOSITORY/pulls" \
-f state=open -f "head=$HEAD_OWNER:$HEAD_BRANCH" | \
jq -s --arg sha "$HEAD_SHA" '[.[][] | select(.head.sha == $sha)]')
if [[ $(jq 'length' <<< "$prs") != 1 ]]; then
echo 'No unique open PR at this commit; skip this run'; exit 0
fi
number=$(jq -r '.[0].number' <<< "$prs")
[[ "$number" =~ ^[0-9]+$ ]] || exit 1
tag="pr-$number"
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "sha=$HEAD_SHA" >> "$GITHUB_OUTPUT"
- name: Download build artifacts
if: steps.channel.outputs.tag != ''
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: gh run download "$RUN_ID" --repo "$GITHUB_REPOSITORY" --pattern 'muster-*' --dir "$RUNNER_TEMP/muster-artifacts"
- name: Publish release
if: steps.channel.outputs.tag != ''
shell: bash
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.channel.outputs.tag }}
SOURCE_SHA: ${{ steps.channel.outputs.sha }}
EVENT: ${{ github.event.workflow_run.event }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: |
set -euo pipefail
root="$RUNNER_TEMP/muster-artifacts"
files=(
"$root/muster-windows-x64/muster-windows-x64.exe"
"$root/muster-linux-x64/muster-linux-x64"
"$root/muster-linux-arm64/muster-linux-arm64"
"$root/muster-macos-x64/muster-macos-x64"
"$root/muster-macos-arm64/muster-macos-arm64"
)
for file in "${files[@]}"; do
[[ -f "$file" && ! -L "$file" && -s "$file" ]] || { echo "Missing artifact: $file" >&2; exit 1; }
done
# A newer run may have completed while artifacts were downloading.
if [[ "$EVENT" == push ]]; then
current=$(gh api "repos/$GITHUB_REPOSITORY/branches/$HEAD_BRANCH" --jq '.commit.sha')
else
number=${TAG#pr-}
current=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$number" --jq 'if .state == "open" then .head.sha else "closed" end')
fi
[[ "$current" == "$SOURCE_SHA" ]] || { echo 'Source changed; skip this run'; exit 0; }
if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$TAG" > /dev/null 2>&1; then
gh api -X PATCH "repos/$GITHUB_REPOSITORY/git/refs/tags/$TAG" -f "sha=$SOURCE_SHA" -F force=true > /dev/null
else
gh api -X POST "repos/$GITHUB_REPOSITORY/git/refs" -f "ref=refs/tags/$TAG" -f "sha=$SOURCE_SHA" > /dev/null
fi
notes="Rolling $TAG build from commit $SOURCE_SHA. PR builds are untrusted previews."
if ! gh release view "$TAG" --repo "$GITHUB_REPOSITORY" > /dev/null 2>&1; then
if [[ "$TAG" == stable ]]; then
gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --verify-tag --title 'Stable' --notes "$notes" --latest
else
gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --verify-tag --title "$TAG" --notes "$notes" --prerelease --latest=false
fi
fi
gh release upload "$TAG" "${files[@]}" --repo "$GITHUB_REPOSITORY" --clobber
if [[ "$TAG" == stable ]]; then
gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes "$notes" --prerelease=false --latest
else
gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --notes "$notes" --prerelease --latest=false
fi
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Dependencies
node_modules/
service/node_modules/

# Local configuration and credentials
.env
Expand All @@ -22,7 +21,7 @@ muster.db

# Build output
bin/muster.exe
service/dist/
dist/

# Editor / OS
.vscode/settings.json
Expand Down
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

## Project Structure & Module Organization

Muster is a Herdr package backed by a local Bun and SQLite service. Service code is in `service/src/`: `store.ts` owns persistence, `api.ts` shares operations, and `cli.ts` and `mcp.ts` expose them. Tests live in `service/test/`. The Herdr views and SVG icons are in `mods/muster/`; layout and theme definitions are in `layouts/` and `themes/`. `keys.json` contains bindings, `service/src/installer/` installs the Herdr package, and `SPEC.md` documents shared contracts.
Muster is a Bun and SQLite app with a CLI, MCP server and Herdr target. Shared app code is in `app/`: `store.ts` owns persistence, `api.ts` shares operations, and `mcp.ts` serves MCP. Root `cli.ts` is the entry point and `install.ts` dispatches installation targets. `targets/herdr/` owns its installer, mod, SVG icons, layout, themes and bindings. Tests live in `tests/`; `SPEC.md` documents shared contracts.

## Build, Test, and Development Commands

Run service commands from `service/` with Bun 1.1 or newer:
Run commands from the repository root with Bun 1.1 or newer:

- `bun test` runs the service test suite.
- `bun install` installs development dependencies for type checking.
- `bun run typecheck` runs TypeScript without emitting files.
- `bun run muster -- version` runs the CLI; `bun run mcp` starts its stdio MCP server.

From the repository root, `herdr-app check mods\muster` checks the mod. Run `muster install` to install the Herdr package; use `--app-home DIR`, `--muster-home DIR`, or `--no-keys` when needed. Run `bun run build-herdr-assets.ts` in `service/` after changing Herdr assets.
`herdr-app check targets\herdr\mods\muster` checks the mod. Run `muster install` to install the Herdr package; use `--app-home DIR`, `--muster-home DIR`, or `--no-keys` when needed. Run `bun run build-herdr-assets` after changing Herdr assets and `bun run build-skill` after changing skill files.

## Coding Style & Naming Conventions

Follow nearby TypeScript and JavaScript: two-space indentation, double-quoted strings, semicolons, and descriptive camelCase functions and variables. Use PascalCase for types and classes; retain the existing lowercase module names. TypeScript uses strict checking and explicit `.ts` import extensions. Preserve LF line endings for source, JSON, Markdown and SVG; PowerShell files use CRLF, as specified by `.gitattributes`.

## Testing Guidelines

Use Bun's `bun:test` and name service tests `*.test.ts` under `service/test/`. Add focused coverage for behavior changes, especially project identity, store operations and MCP contracts. Use temporary directories and isolated `MUSTER_HOME`/`MUSTER_DB` values; do not touch a real user database. Run `bun test` and `bun run typecheck` before submitting service changes. No coverage threshold is specified.
Use Bun's `bun:test` and name tests `*.test.ts` under `tests/`. Add focused coverage for behavior changes, especially project identity, store operations and MCP contracts. Use temporary directories and isolated `MUSTER_HOME`/`MUSTER_DB` values; do not touch a real user database. Run `bun test` and `bun run typecheck` before submitting app changes. No coverage threshold is specified.

## Commits & Pull Requests

Expand Down
69 changes: 52 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@ give it its own key, add this to the `global` section of `keys.json`:

Claude Code, Codex, or any other MCP client can now connect to the service.

## Turn off or uninstall the Herdr integration

If Herdr is open, switch to another layout and theme if possible, then close
Herdr. Run:

```powershell
muster uninstall
```

Use `muster uninstall --app-home D:\herdr-app` for a custom app home. The
command removes Muster's layout, mod and theme files, backing up modified files.
It removes only unchanged key bindings recorded as added by Muster; older
installations without that record keep their bindings. The database, backups,
global CLI and MCP client configurations are kept. Reopen Herdr with another
layout; run `muster install` to install the integration again.

If the CLI cannot start, close Herdr and rename `layouts/muster.json` and
`mods/muster/mod.json` in the Herdr app home (for example, give each a
`.disabled` extension). That makes the layout and mod unavailable without
deleting their contents or the database. The default app home on Windows is
`%USERPROFILE%\.config\herdr-app`.

## Connect an agent

The MCP server is the same executable as the CLI, with `mcp` after it. After
Expand Down Expand Up @@ -172,9 +194,9 @@ muster skill [skill|cli|mcp|cards|all]
or `all` to read guides. Other arguments search all bundled skill files, for
example `muster skill pending`. MCP clients can read `muster://skill` or use
`muster://skill?section=pending`. The resource template is
`muster://skill{?section}`. These guides are embedded in the service and
compiled executable; regenerate them with `bun run build-skill.ts` in
`service/` after editing `.agents/skills/muster/`.
`muster://skill{?section}`. These guides are embedded in the app and
compiled executable; regenerate them with `bun run build-skill` after editing
`.agents/skills/muster/`.

Add `--json` to any command for machine output. `--path` resolves a project
from another folder; `--project` uses a project key directly. `MUSTER_HOME`
Expand Down Expand Up @@ -217,33 +239,46 @@ the file stays where it is. Never put secrets in a card, note or event.
## Repository layout

```text
themes/ muster.json (dark), muster-day.json (light)
layouts/ muster.json
keys.json the layout:muster bindings
mods/muster/ one mod, one view per props.app
service/ Bun service: SQLite store, CLI, MCP server, tests
docs/ agent snippet and this package's notes
service/src/installer/ Herdr installation and embedded assets
SPEC.md the model, the wire formats and the decisions
cli.ts, install.ts command-line entry point and install dispatcher
app/ SQLite store, project logic, skill and MCP server
targets/herdr/ Herdr installer, themes, layout, mod and bindings
tests/ app and installation tests
scripts/ embedded asset and skill generators
docs/ agent snippet and package notes
SPEC.md model, wire formats and decisions
```

## Development

```powershell
cd service
bun test # 33 tests: project resolution, store, MCP protocol
bun install # only for the type checker
bun install # development dependencies, including the type checker
bun test # application and installer tests
bun run typecheck
cd ..
herdr-app check mods\muster
herdr-app check targets\herdr\mods\muster
```

The tests use temporary folders and never touch `%LOCALAPPDATA%\Muster`.

## Build channels

GitHub Actions tests changes on Windows and Linux, then builds standalone
executables for Windows x64, Linux x64/arm64, and macOS x64/arm64. Successful
builds appear in [GitHub Releases](https://github.com/SvalTek/Muster/releases):

- `stable` follows the latest successful build of `main` and is the latest release.
- `dev` follows `develop` and is a prerelease.
- `pr-N` follows the current head of open pull request N and is an untrusted
prerelease preview. A newer build replaces its assets.

The tags are rolling channels rather than permanent version numbers. CI runs
with read-only permissions; a separate publisher checks that the branch or PR
still points at the built commit before attaching artifacts. GitHub only runs
the publisher once its workflow file exists on the default branch (`main`).

## Scope

v1 is the board, cards, runbooks and stats. Deferred: inbox and mail
integrations, CI status, monitors, remote/shared stores, and any host-specific
assumptions such as unix sockets, `sh -c`, `lsof` or `sips`. The service is
assumptions such as unix sockets, `sh -c`, `lsof` or `sips`. The app is
plain TypeScript on Bun, so a hosted or remote store can be added behind the
same CLI and MCP surface later.
Loading
Loading