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
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
},
"metadata": {
"description": "Five AI specialists that bring user-centred design roles into government digital delivery teams – service design, content and interaction design, delivery, development and cyber security. For any government, anchored to a country-agnostic service standard baseline, the GOV.UK Design Principles and the GDS Way, with country profiles for local standards and design systems.",
"version": "0.1.1"
"version": "0.8.0"
},
"plugins": [
{
"name": "xstack",
"source": "./",
"description": "Five UCD specialists as AI team members for government digital teams. Turn a brief into testable prototypes, iterate from research, assess against your country's service standard.",
"version": "0.1.1",
"version": "0.8.0",
"category": "service-design",
"keywords": [
"government",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xstack",
"version": "0.2.0",
"version": "0.8.0",
"description": "Five AI specialists that bring user-centred design roles into government digital delivery teams – service design, content and interaction design, delivery, development and cyber security. For any government, anchored to a country-agnostic service standard baseline, the GOV.UK Design Principles and the GDS Way, with country profiles for local standards and design systems.",
"author": {
"name": "Public Digital",
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/constraints.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Constraints

# The backstop for xstack's constraint hooks. The hooks only see the Write and
# Edit tools; this runs on every pull request, whoever or whatever made the change.

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: constraints-${{ github.ref }}
cancel-in-progress: true

jobs:
runner:
name: Runner and hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Test the runner and the hooks
run: node --test scripts/xstack-check.test.mjs
- name: Vendored copies match the source
run: |
for dir in $(git ls-files '*/.xstack/constraints.json' | xargs -n1 dirname | xargs -n1 dirname); do
node scripts/xstack-check.mjs --vendor --root "$dir"
done
git diff --exit-code -- '*/.xstack/vendor/*' || {
echo "::error::A vendored xstack-check is out of date. Run: node scripts/xstack-check.mjs --vendor --root <service>"
exit 1
}

example:
name: Example service (ci stage)
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: examples/production-renew-medical-licence
env:
GITLEAKS_VERSION: 8.21.2
GITLEAKS_SHA256: 5bc41815076e6ed6ef8fbecc9d9b75bcae31f39029ceb55da08086315316e3ba
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: examples/production-renew-medical-licence/package-lock.json
- name: Install gitleaks
working-directory: ${{ runner.temp }}
run: |
curl -sSfL -o gitleaks.tar.gz "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
echo "${GITLEAKS_SHA256} gitleaks.tar.gz" | sha256sum --check
tar -xzf gitleaks.tar.gz gitleaks
sudo install gitleaks /usr/local/bin/gitleaks
- name: Install dependencies
run: npm ci
- name: Install browsers
run: npx playwright install --with-deps
- name: Start a server for the header check
run: |
PORT=8081 ./scripts/serve.sh &
for i in $(seq 1 20); do curl -sf -o /dev/null http://localhost:8081/ && exit 0; sleep 1; done
echo "::error::The local server did not start"; exit 1
- name: Run every constraint
env:
BASE_URL: http://localhost:8081
run: node .xstack/vendor/xstack-check.mjs --stage ci
- name: Add the evidence to the run summary
if: always()
run: node .xstack/vendor/xstack-check.mjs --stage stop --format md --no-report >> "$GITHUB_STEP_SUMMARY" || true
- name: Keep the reports
if: always()
uses: actions/upload-artifact@v4
with:
name: constraint-reports
path: |
examples/production-renew-medical-licence/.xstack/check-report.json
examples/production-renew-medical-licence/reports/
include-hidden-files: true
if-no-files-found: ignore
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ coverage/
# Local scratch
scratch/
notes-private/

# xstack constraint check output (regenerated on every run)
**/.xstack/check-report.json

# Playwright output
test-results/
playwright-report/
reports/
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ This file is the canonical roster. For the full definition of any agent, read th

**Owns:** Right technology, Open platforms and standards, Works first time (with the service designer), Measuring performance (with the delivery manager). Supports Sustainable and reliable and Whole problem.

**Tools:** has a shell, to run the constraint checks and the tests it writes.

**Default deliverables:** clickable prototypes, production code, architecture decision records, runbooks, README and developer setup, technical-readiness reports.

**Skills it calls into:** `xstack:brief-to-prototypes`, `xstack:build-for-production`, `xstack:government-design-systems` (via `/xstack:design-system`), `xstack:government-dpi` (via `/xstack:dpi`), `frontend-design:design-from-scratch`, `design:design-system`, plus any house-style skills listed in the profile's Related skills section.
Expand All @@ -108,9 +110,11 @@ This file is the canonical roster. For the full definition of any agent, read th

**Owns:** Trust, security and privacy. Supports Inclusion (security mustn't lock out disabled citizens), Right technology, Sustainable and reliable, Working in the open.

**Tools:** has a shell, to run the constraint checks and the scanners.

**Default deliverables:** threat models, data inventories, privacy notices, DPIAs, incident runbooks, security testing plans, phase-gate security readiness reports.

**Skills it calls into:** none specific (cyber work is mostly bespoke per service; the agent reaches for STRIDE / LINDDUN frames documented in its own file).
**Skills it calls into:** none specific (cyber work is mostly bespoke per service; the agent reaches for STRIDE / LINDDUN frames documented in its own file). Turns each threat-model control into a constraint that xstack checks – see `constraints/README.md`.

**Triggers:** threat model, security review, pen test, privacy, data protection, incident, secure by design, PII, vulnerability, encryption, auth.

Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to xstack will be recorded here. Format inspired by [Keep a

## [Unreleased]

## [0.8.0] – 2026-11-19

### Changed

- **xstack now works for any government** – the agents, skills and commands no longer assume Barbados. xstack brings user-centred design roles into government digital delivery teams as AI team members, especially for teams in regions that can't easily staff them
Expand All @@ -18,6 +20,18 @@ All notable changes to xstack will be recorded here. Format inspired by [Keep a

### Added

- **Constraints** – rules a production service must meet, written so a machine checks them, and enforced by xstack instead of left to instructions. See `constraints/README.md`
- A service opts in with `.xstack/constraints.json`. It extends the baseline in `constraints/baseline.json` (secrets, inline script and inline styles, POST for uploads, page landmarks, alt text, dead links, inline styles, prototype chrome, dependency checks) and a profile layer where there is one. Barbados and Kestria each have one (`profiles/<country>/constraints.json`), and `profiles/_template/constraints.json` is the starting point for another country
- `scripts/xstack-check.mjs` runs them at three stages – `write`, `stop` and `ci` – and reports PASS, FAIL, WAIVED or NOT RUN. It has no dependencies, and `--vendor` copies it into a service for CI
- Plugin hooks in `hooks/`: a write that breaks a constraint is refused, a change to the constraints file or other protected path needs a person's approval, and an agent cannot finish while a "must" constraint fails
- CI: `.github/workflows/constraints.yml` tests the runner and hooks and runs the `ci` stage on the example. `constraints/ci/github-actions.yml` is the same job for a service to copy
- The developer and cyber-engineer agents now have a shell, so they run the checks and tests instead of describing them. `hooks/guard-bash.mjs` asks a person before a shell command changes a protected path
- The Kestria layer has ten rules: the fictional-country notice, GovKestria markup and tokens, the reserved phone numbers and domains, the language switcher, page weight, and no home-made sign-in or account fields. The GovKestria starter page no longer uses a `style` attribute
- Relaxing a constraint takes a waiver with a reason, an approver and an expiry date
- `/xstack:productionise` now writes the constraints file and builds PRODUCTION-READINESS.md from the check results, and no longer generates its own `audit.sh`. `/xstack:threat-model` turns each control into a drafted constraint
- The medical-licence production example is retrofitted. The shipped checks failed two things its generated audit had passed: a file upload sent by GET, and 50 links to pages that did not exist. Both are fixed – the upload uses POST and the ten missing pages are built

- **`/xstack:help`** and the `help` skill – a starting point for anyone new to xstack. It shows the staircase, an interactive page of the five steps from first conversation to a live service, with every skill and command and what comes before and after each one. Then it asks where the team is and gives the one thing to run next, in the name that works in Claude Code or in the Claude app and Cowork. The page lives in `skills/help/assets/staircase.html`
- **`/xstack:form-to-spec`** and the `form-to-spec` skill – a new entry point, **form → spec → build**. Most government services already exist as a paper or PDF form. The skill turns one – fillable PDF, flat PDF, scan, photo or Word document – into a `form-spec.md` that `/xstack:build` takes as its brief
- Keeps every item with the form's own numbering, groups items into sections a citizen would recognise, and gives each a digital treatment: ask (with the component), lookup, lookup opportunity, conditional, add-another, government already holds this, drop or challenge, or back office
- Uses only the lookups the country profile lists. Anything government plausibly holds but the profile doesn't cover becomes a lookup opportunity, never an assumed lookup
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ xstack/
├── commands/ one .md per slash command, frontmatter + body
├── skills/ one folder per skill, with SKILL.md
├── references/ one .md per reference, the canonical, country-agnostic xstack view
├── constraints/ the baseline constraints every production build must meet, and how they work
├── hooks/ plugin hooks that enforce constraints when an agent writes or stops
├── scripts/ xstack-check, the constraint runner
└── profiles/ one folder per country profile, plus _template/
```

Expand Down Expand Up @@ -68,6 +71,7 @@ Don't guess facts about a government. Only include what you can point to.
- [ ] If you've added an agent: README roster updated, AGENTS.md updated, plugin manifest updated
- [ ] If you've added a skill: SKILL.md frontmatter present, agents that should call it know about it
- [ ] If you've added a command: README command table updated, frontmatter present
- [ ] If you've added, renamed or removed a skill or command: the staircase in `skills/help/assets/staircase.html` updated
- [ ] CHANGELOG.md updated under the next version

## What we won't accept
Expand Down
4 changes: 4 additions & 0 deletions GETTING-STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Upload `xstack.zip` via **Customize → Plugins → upload a custom plugin file*

> **If `/` invocations fail with "Unknown command" (even for valid skills):** there's a known Cowork bug where the slash-command resolver breaks — skills appear in the `/` menu but won't run, and even the built-in `/feedback` fails. When that happens, **trigger skills by natural language instead.** Don't type the slash name; just describe what you want and Claude picks the right skill from its description. For example, instead of `/discovery-kit`, write: *"Using xstack, scope a discovery for … — give me the problem statement, stakeholder map, research plan, and interview guide."* Fully quitting and reopening the app or starting a fresh conversation sometimes clears it.

## Not sure where to start?

Run **`/help`** from the xstack skills, or ask *"How do I use xstack?"*. It shows the staircase – one interactive page with every step from first conversation to a live service. Tap any skill to see what comes before it and what it leads to. Then it asks where you are and tells you the one thing to run next.

## Set up your country profile

Do this once per project, before your first real piece of work. A country profile tells xstack about your government: its service standard, design system, shared platforms, terms and data formats.
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ xstack/
│ ├── service-standard-assessment/
│ ├── plain-language-check/
│ ├── weeknote/
│ ├── help/ start here – shows the staircase and tells you what to run next
│ ├── discovery-kit/
│ ├── research-coach/ router + mentor across the research cycle
│ ├── research-planning/ objectives first, then the discussion guide
Expand Down Expand Up @@ -111,6 +112,9 @@ xstack/
│ ├── page-composition/
│ ├── token-cross-check/
│ └── show-the-thing/
├── constraints/ rules a production build must meet, checked by machine
├── hooks/ plugin hooks that enforce the constraints
├── scripts/ xstack-check, the constraint runner
├── references/ the canonical, country-agnostic knowledge base
│ ├── service-standard-baseline.md the 14 themes
│ ├── govuk-design-principles.md
Expand All @@ -136,6 +140,8 @@ Run `/xstack:profile` to set one up for your project. It writes `.xstack/profile

## New to xstack?

Run `/xstack:help`, or ask *"How do I use xstack?"*. It shows the staircase – one interactive page with every step from first conversation to a live service – then asks where you are and tells you what to run next.

Read **[MANUAL.md](./MANUAL.md)** – the single onboarding guide for new colleagues, partner departments, and vendor teams. About two hours to read and walk the worked example, after which you'll know which command to run, which agent to ask, and what good looks like at each phase.

## Day-to-day usage
Expand Down Expand Up @@ -190,6 +196,7 @@ If you're not sure, ask the **delivery manager** first – they'll route you.

| You want to… | Run | Hands off to |
|---|---|---|
| Find out where to start | `/xstack:help` | help skill |
| Set up your country profile | `/xstack:profile` | delivery-manager |
| Use your government's design system | `/xstack:design-system` | developer |
| Sign people in, pull what government knows and take payments | `/xstack:dpi` | developer |
Expand Down
14 changes: 13 additions & 1 deletion agents/cyber-engineer.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: cyber-engineer
description: The Cybersecurity Engineer. Use when threat modelling a service, reviewing privacy, writing a privacy notice, planning a pen test, responding to an incident, hardening infrastructure, or assessing the service against the trust, security and privacy parts of the service standard. Triggers on "threat model", "security review", "pen test", "privacy", "data protection", "incident", "secure by design", "PII", "vulnerability", "harden", "encryption", "auth", "identity platform".
tools: Read, Write, Edit, Glob, Grep, WebSearch, WebFetch
tools: Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch
model: sonnet
---

Expand Down Expand Up @@ -139,6 +139,18 @@ When you say no, you say no with a reason and an alternative.

---

## Running the checks

You have a shell. A control that nothing checks is a hope, so check it.

- **Run the constraints.** In a folder with `.xstack/constraints.json`: `node .xstack/vendor/xstack-check.mjs --stage ci`. Read `constraints/README.md` for the format.
- **Run the scanners the service has:** the secret scan, the dependency audit, the header check. Review as the adversary – you did not write this code, and your job is to find what its author missed.
- **Report evidence, not opinion.** Quote the result and the constraint ids. If a tool is missing, say NOT RUN. A rating of Met needs a passing check behind it.
- **Never loosen a control to get a pass.** Do not use the shell to change `.xstack/constraints.json`, `.xstack/vendor/`, the security tests, or any path the service lists as protected. Draft new constraints for a person to approve. Only a person adds a waiver.
- **Stay inside the project, and stay passive.** Read and test what is in the repository and on localhost. No scanning or probing of any system the team has not put in scope in writing.

---

## Iron laws

1. **Collect less.** Personal data the service doesn't have can't be lost. Trust, security and privacy.
Expand Down
14 changes: 13 additions & 1 deletion agents/developer.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: developer
description: The Developer. Use when choosing a technology, building a prototype or production service, integrating with the national identity platform or other shared platforms, wiring up analytics, or making architecture decisions. Triggers on "build this", "what stack should we use", "integrate with", "deploy", "infrastructure", "analytics", "API", "identity platform", "payments", "design system", "design system component", "performance".
tools: Read, Write, Edit, Glob, Grep, WebSearch, WebFetch
tools: Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch
model: sonnet
---

Expand Down Expand Up @@ -148,6 +148,18 @@ You write British English. You favour n-dashes over m-dashes.

---

## Running the checks

You have a shell. Use it to prove your work, not to describe what would happen.

- **Run the constraints before you say something is done.** In a folder with `.xstack/constraints.json`: `node .xstack/vendor/xstack-check.mjs --stage stop`, and `--stage ci` when the tools are installed. Read `constraints/README.md` for the format.
- **Run the tests you write.** `npm ci`, then the suite. A test that has never run is not evidence.
- **Report what happened.** Quote the result – how many passed, which constraint ids failed. If a tool is missing, say NOT RUN. Never write "passes" for something you did not run.
- **Fix the code, not the check.** Do not use the shell to change `.xstack/constraints.json`, `.xstack/vendor/`, or any path the service lists as protected, and do not delete or skip a failing test. If a constraint is wrong or cannot be met, stop and tell the user which one and why. Only a person adds a waiver.
- **Stay inside the project.** No installing global tools, no pushing, no deploying, and nothing destructive, unless the user asked for it.

---

## Iron laws

1. **Reuse before rebuild.** Before writing any code, check whether the digital team, another department, or a Digital Public Good already covers the need. Open platforms and standards, Principle 2.
Expand Down
Loading
Loading