Set up a new workspace
This guide is for a project that is not the SWARQ repository but will use a SWARQ board to plan and track its work. It creates the board, the handoff document, the credential rules, and the pre-commit gate. Then it shows how to connect the board to GitHub.
Before you start, finish Install SWARQ so that the swarq CLI runs on your machine.
What you get
swarq init-workspace creates these files in the project. Running it again changes nothing that already exists.
| Path | Purpose |
|---|---|
.swarq/board.json |
Board config: name, agent slots, milestones |
.swarq/tasks/ |
One file per task, added later with swarq board plan |
CHANGELOG.md |
Starter changelog with one Workspace created entry, in the rock-hardened contract |
release-contract.config.json |
Minimal config for @h4shed/rock-hardened, named after the workspace |
docs/project/handoff.md |
Handoff document for the next session or agent |
.gitignore (appended) |
Ignores *.pat, *.token, .netrc, .secrets/ |
.githooks/pre-commit |
Runs swarq check-secrets --staged before each commit |
git core.hooksPath |
Set to .githooks, so git runs the hook (only in a git repository) |
The CLI never writes a token. Credentials go in environment variables, not in these files.
1. Create or open the project
mkdir my-project && cd my-projectgit init -b main # skip if the project is already a git repository2. Create the workspace
Run from the project root:
swarq init-workspace --name "My Project" --agents developer-1,developer-2,tester-1| Option | Default | Meaning |
|---|---|---|
--dir <path> |
. |
Project root |
--name <text> |
folder name | Name used in the board and the handoff title |
--agents <a,b,c> |
developer-1,developer-2,tester-1 |
Agent slots, at most 12. A slot holds one task at a time |
--force |
off | Refreshes only the pre-commit hook and core.hooksPath. Board state, CHANGELOG.md, release-contract.config.json and the handoff are never overwritten. To reset the board, delete .swarq/board.json by hand after a backup |
--json |
off | Prints the steps as JSON |
Each line of output reads created, updated, or skipped. A second run prints skipped for every step, which is the expected result.
If swarq is not on your PATH, run the command from the SWARQ checkout instead: node /path/to/swarq/packages/cli/dist/bin.js init-workspace --name "My Project".
3. Check the result
swarq board show # the board as Markdown, with no tasks yetgit config --get core.hooksPath # prints .githooksEdit docs/project/handoff.md. Replace the placeholder “Open decisions” line with the decisions this project needs.
4. Add the CLI and the changelog tool to the project
The changelog tool is optional, but the scaffold expects it. Install it with the CLI:
npm install --save-dev @h4shed/rock-hardenednpx hardened-changelogger validateThe scaffolded CHANGELOG.md passes validate. Add an entry under [Unreleased] for each change, and see Changelog contract for the format.
The CLI for the hook and the workflows
The pre-commit hook runs npx --no-install swarq, so the CLI must be a dependency of the project:
pnpm add -D @h4shed/swarq # or npm install --save-dev @h4shed/swarqIf the package is not yet on the registry you use, the hook cannot find swarq, and every commit fails until it is installed. Do not bypass the hook to get past that. Install the CLI first.
5. Plan the first tasks
Write a JSON file that lists tasks. The planner rejects cycles and unknown dependencies:
swarq board plan --file plan.jsonswarq board next # the ready queue, in the order to startswarq board assign <id> --agent developer-1 --check-in-min 60Use swarq board help for the full options. When an agent finishes, it runs swarq board release <id> --to done --agent <slot> --note "<result>" in its own branch and commits the task file with its change.
Check overdue check-ins at any time:
swarq board check6. Connect the board to GitHub (optional)
This step needs a token. Follow step 7 of Install SWARQ to set SWARQ_PAT, scoped to your project’s repository. Then:
swarq github sync --repo <owner>/<repo> # dry run: prints the planswarq github sync --repo <owner>/<repo> --apply # writes labels, milestones, and issuesRead the dry-run output first. --apply changes GitHub. A task marked done closes its issue.
7. Keep GitHub in step (no workflows)
SWARQ updates GitHub through the GitHub API from the command line. It does not use GitHub Actions, and init-workspace copies no workflows. With the token set (step 6), run these from your shell or from an agent session:
swarq github sync --repo <owner/repo>prints the plan. Add--applyto update labels, milestones, and issues.swarq board nextandswarq board assignrun the same sync first whengithub.repois set inboard.json.swarq github checkin --repo <owner/repo> --applycomments on the issue of each overdue task. Run it whenswarq board checklists one.
8. Install the Claude Code plugin (optional)
The swarq-pm plugin gives Claude Code the planning, delegation, and review skills. Add the marketplace and install the plugin in Claude Code:
/plugin marketplace add Fused-Gaming/swarq/plugin install swarq-pm@fused-gaming-swarqThe skills use the swarq_ MCP tools when the plugin’s server is connected (see Connect Claude to a workspace) and fall back to the CLI, so the CLI from step 4 or the checkout must still be available.
To connect Claude Code on the web to the board through the plugin’s MCP server, and to see which tools and write policy it uses, read Connect Claude to a workspace.
9. Commit the setup
git add -Agit status # check that no token or .env file is listedgit commit -m "Set up the SWARQ workspace"The pre-commit hook runs on this commit. If it blocks the commit, read the file, line, and pattern it reports, and remove the value.
Checklist
-
swarq init-workspaceran, and a second run skipped every step -
CHANGELOG.mdandrelease-contract.config.jsonexist, andnpx hardened-changelogger validatepasses -
docs/project/handoff.mdnames the project and its open decisions -
git config --get core.hooksPathprints.githooks -
swarq board showruns - The CLI is available to the hook (step 4), or the gap is noted in the handoff
-
SWARQ_PATis set in the environment only, and a dry-run sync was read before any--apply - The two board workflows are copied (step 7), if GitHub sync is wanted
- No token,
.env, or.secrets/file is tracked
Troubleshooting
| Symptom | Fix |
|---|---|
swarq: command not found |
Use the full path to packages/cli/dist/bin.js, or install the CLI (step 4) |
swarq github: no board at .swarq/board.json |
Run swarq init-workspace in this project, or pass --board <dir> |
swarq check-secrets: the swarq CLI is not installed, so this commit is blocked |
Install the CLI (step 4). The hook fails closed on purpose, so a commit is never scanned by nothing |
--apply needs SWARQ_PAT (or GITHUB_TOKEN or GH_TOKEN) in the environment |
Set SWARQ_PAT in this shell, then rerun |
init-workspace says skipped for a file you want replaced |
skipped is correct: the scaffold does not overwrite files that hold your state. Edit the file by hand |