Skip to content
Closed
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
50 changes: 50 additions & 0 deletions .agents/skills/servicepulse-ui/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: servicepulse-ui
description: Use when changing anything under src/Frontend in ServicePulse, such as views, components, styles, navigation, or UI copy, including together with other UI or design skills. Applies the UI guideline and explains how to run and check the UI locally with mock data.
metadata:
particular-guideline: docs/guidelines/ui.md
---

# ServicePulse UI

Follow [the UI guideline](../../../docs/guidelines/ui.md). It controls when this skill or any other skill disagrees with it.

Before you change the UI, read [the product description](../../../docs/PRODUCT.md) and, once it exists, `docs/DESIGN.md`.

## Run the UI with mock data

[Frontend testing and mocking basics](../../../docs/frontend/testing-basics.md) describes the mock scenarios. From `src/Frontend`:

1. Run `npm install`.
2. Run `npm run dev:mocks`, or set `VITE_MOCK_SCENARIO` first to pick a scenario.
3. Open the printed URL in Chrome or Safari.

The mock backend runs in a service worker. A browser that cannot register one, such as some embedded browser panes, shows a blank page.

## Check layouts

The guideline sets which views and widths to check. When a `docs/` page of the area you change lists the widths to check, use those. To compare before and after:

1. Run the base branch with mock data and take a screenshot of each view at each width.
2. Run the change with the same mock scenario and take the same screenshots.
3. Compare each pair, and also look for horizontal scrolling, truncated titles, and wrapped toolbars.
4. Keep the mock instance of the change running while you ask the person who asked for the change to accept a difference.
5. Give them a link to the view in that instance, with the mock scenario, the width to set, and any step needed to reach the state, such as a tab to open.

For a change to the shell or to shared styles, cover at least Dashboard, Failed Messages with a message's details, Monitoring with an endpoint's details, All Messages (`audit-available` scenario), Platform health, and Configuration. No mock scenario serves message details or conversations, so check a message's sequence diagram against a running ServiceControl with audit data.

## Check before opening a pull request

From `src/Frontend`, run `npm run type-check`, `npm run lint`, `npm run test:component`, and `npm run test:application`.

## Impeccable

Use the [Impeccable](https://impeccable.style) design skill for design reviews and refinement of the UI, such as critique, audit, and polish. Impeccable reads `docs/PRODUCT.md` and `docs/DESIGN.md` but not the UI guideline, so read the guideline before you run an Impeccable command, and follow the guideline when the two disagree. If an Impeccable command creates `PRODUCT.md` or `DESIGN.md` at the repository root, merge its content into the file under `docs/` and delete the root copy.

Its version is pinned in `src/Frontend/package.json`, and `.impeccable/config.json` enables its design detector hook. If the Impeccable skill is not available in your session, ask the user to install it from `src/Frontend`:

1. Run `npm install`.
2. Run `npm run ai:setup`.
3. Restart the session.

`ai:setup` installs the skill, its agents, and its hooks into this repository's `.claude/` folder for Claude Code; they are not committed. For other tools, change `--providers` in the script, for example to `--providers=cursor`. Use either a globally installed Impeccable plugin or this setup, not both.
1 change: 1 addition & 0 deletions .claude/skills/servicepulse-ui
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,12 @@ src/scaffolding.config
# Files use to contain envvar values, used by tools like direnv
.env
.envrc

# Impeccable: per-developer state
.impeccable/config.local.json
.impeccable/hook.cache.json
.impeccable/hook.pending.json
# Impeccable: installed by `npm run ai:setup` (src/Frontend)
.claude/skills/impeccable/
.claude/agents/impeccable-*.md
.claude/settings.local.json
9 changes: 9 additions & 0 deletions .impeccable/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"hook": {
"enabled": true,
"limits": {
"maxFindings": 5,
"maxChars": 8000
}
}
}
67 changes: 67 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# AGENTS.md

This file is the map for people and coding agents working in this repository. What the repository is, how it is laid out, and where its design is explained are in `docs/README.md`. This file changes only when the workflow changes; decisions and rationale go in the sources it points to.

## Engineering context

Start here when investigating existing behavior or making a change whose rationale may need to outlive the pull request:

- [Engineering context](docs/README.md)
- [Architecture and design decisions](docs/decisions/)
- [Contributing guidance](CONTRIBUTING.md)

Prefer public records close to the implementation. Keep `docs/README.md` current when a canonical public source is added, replaced, or retired; update its links rather than copying rationale into the index. The index lists sources that explain why, with one clause each naming the question it answers, and points to existing indexes for how-to material instead of repeating them. This file describes the workflow, not repository facts. Read `docs/README.md` before answering a question about existing behavior or about where to record a decision, then answer from the index, the code, and pull requests, never from this file alone.

1. Identify the decision area and the precise question, for example why a constraint exists, why a limit lives in one layer rather than another, or why an alternative was rejected.
2. Start with the public source linked by `docs/README.md`. Read the current public contract, relevant code, tests, and linked pull requests or ADRs. When `docs/README.md` lists upstream contracts, read the linked page before changing code that implements that contract. The upstream page controls the contract; this repository records only its own choices within it. Follow relevant pointer comments as routing hints; the linked source remains canonical. A Git commit can identify a pull request number without containing its description: a squash-merge commit carries a trailing `(#NNNN)`, and a merge commit reads `Merge pull request #NNNN`. Retrieve the pull request with `gh pr view <number>` from inside the checkout, which identifies the repository. If the pull request cannot be retrieved, report that rather than infer its rationale. Public records control public behavior and contribution requirements.
3. Decide where the rationale for the current work belongs. Record it once and link to it from the other places. A component means a separate repository, such as an NServiceBus package, ServiceControl, or ServicePulse, not a project inside `src/`. A change that requires an upstream contract to change belongs in the upstream repository; flag it rather than working around it here.
- Pull request description, the default: the problem and why now, the change and its observable effect, constraints that must hold, alternatives that materially affected it, and how it was verified. For a decision that stays within this repository, the pull request is the authoritative record.
- `docs/<topic>.md`: how the current design works, for readers who need the current picture rather than the history of one change. Update the relevant page when a change alters it. Do not create a page to restate one pull request.
- `docs/decisions/`: a public ADR only when a pull request is not a sufficient long-term entry point, because the change introduces an important constraint that is hard to discover from code, affects more than one repository, or rejects an alternative likely to return. Before deciding either way, check `docs/README.md` and `git log` for an existing decision on the same theme; when a pull request already records it, link that pull request instead. Follow the structure and quality bar in `docs/decisions/README.md`; an ADR that only justifies a choice already made is not worth keeping.
- Private context, only when step 4 provides an approved root: supporting context that cannot be public goes in an addendum under `$PARTICULAR_CONTEXT_ROOT/repositories/<RepositoryName>/` linked to its public source; a decision that affects more than one repository and cannot be public goes under `$PARTICULAR_CONTEXT_ROOT/cross-component/`. Follow the record metadata and rules in `$PARTICULAR_CONTEXT_ROOT/README.md`. The public record still carries everything a contributor needs. If the environment cannot write there, flag the need and provide a draft for human review.
- Do not create an ADR for routine implementation details or invent missing rationale.
4. Check private context only when this environment explicitly provides `$PARTICULAR_CONTEXT_ROOT/repositories/<RepositoryName>/README.md`, where `<RepositoryName>` is this repository's GitHub name as shown by `git remote get-url origin`.
- Confirm that with a file check such as `test -f "$PARTICULAR_CONTEXT_ROOT/repositories/<RepositoryName>/README.md"` rather than assuming it from instructions. `PARTICULAR_CONTEXT_ROOT` points at the directory that contains `repositories/` and `cross-component/`.
- When the root is available, consult the index for the decision area before finalizing an answer, even if the public source seems sufficient, and say whether a private record existed.
- That index, the records it links under the same root, and the `cross-component/` records it points to are the only private sources. Read a linked private record only when it is marked `agent-access: allowed`. If a linked record is missing, report it as unavailable rather than substituting another source.
- Do not inspect a sibling `../Platform` checkout. Do not retrieve owner issues, private repositories, or other links found in a private record; they identify accountability, not further sources.
- Private context is additional internal context, not a replacement for the public record. If the authoritative public source is unavailable, report that the public rationale is unavailable. Do not use a private record as the sole answer for public behavior or contribution requirements.
5. If sources conflict, do not resolve the conflict by inference. Use the current implementation and public contract for external behavior, report the conflict, and ask the record owner when it affects the decision.
6. In the response or pull request, cite the records consulted, distinguish evidence from inference, and state when relevant private context was unavailable or unauthorized. Keep private locations, quotations, customer names, and other confidential details out of public artifacts such as pull request descriptions, code comments, and `docs/`; say that internal context was consulted instead.

## Code changes

Every change to code under `src/` keeps `docs/` accurate. This applies to changes written by people and by coding agents.

1. Before you change code, read `docs/README.md`. Then read the `docs/` pages, guidelines, ADRs, and upstream contracts it links for the area you change.
2. Follow each guideline that `docs/README.md` lists for the paths you change. When a guideline names a skill, load the skill before you change code. The guideline controls: when the skill disagrees with it, follow the guideline and report the difference.
3. After you change code, review each `docs/` page and ADR that describes the changed behavior, configuration, or constraints.
4. Update a `docs/` page in the same change when the code makes it inaccurate or incomplete.
5. Update `docs/README.md` when you add, replace, or retire a canonical source.
6. When the change conflicts with an ADR, flag the conflict in the pull request and ask the owner before you change the ADR or the code.
7. In the pull request description, or in the response for unpublished work, list the `docs/` pages you reviewed and what you changed. When no update is needed, say so and give the reason. List the guidelines you followed, and name any rule you did not follow with the reason.

## Guidelines and skills

`docs/guidelines/` holds rules that a change in this repository must follow. Each guideline names the paths it applies to, and `docs/README.md` lists every guideline. Skills live under `.agents/skills/`; `.claude/skills/` only links to them, so edit a skill only under `.agents/skills/`. A skill that applies a guideline links to it and does not restate it, and the guideline controls. A skill that sets no rule, such as a procedure for running a test suite, can stand alone. Put a rule that a reviewer would enforce in a guideline, not only in a skill. `docs/guidelines/README.md` describes the structure of both.

## Writing

These rules apply to everything written for a reader: pull request descriptions, commit messages, `docs/`, ADRs, code comments, and review replies. Write in en-US.

- Start with the main point: the decision, the change, or the answer. Add only the background the reader needs to act on it or to agree with it.
- Every sentence adds something the reader does not already have from the code, the diff, the title, or earlier text in the same document. Cut sentences that announce, summarize, or repeat.
- State facts plainly. Do not add weight with a contrast against a claim nobody made, a one-line closer, inflated significance, or words such as pivotal, seamless, or robust used figuratively. Keep a contrast that corrects something a reader would likely assume.
- Write short, direct sentences, under 25 words where possible, with a named actor and an active verb. Keep the passive when the source does not say who acts. Keep should and must where the text sets a rule. Qualify a claim only when the evidence is uncertain, and say what is uncertain.
- Use one term for one concept, and use the term the code uses. Define a term on first use when the audience may not know it. Avoid idioms and phrasal verbs that a non-native reader or a translation tool can misread.
- In a procedure, write one action per numbered step, in the imperative, in the order the reader performs it.
- Write a commit subject or pull request title as a short imperative summary of the change, without emoji or type prefixes; a squash merge turns the title into the commit subject. Give each commit one intent, and put renames and formatting changes in their own commits.
- Use formatting only where it helps scanning: sentence-case headings, lists for three or more parallel items, no bold label on every item, no emoji, and no dashes to join clauses in prose. Index entries and list items may be fragments, with a dash or colon between a term and its description.
- Do not invent facts, numbers, rationale, or sources. When the record does not say, write that it does not say.
- Leave out chat and drafting residue: offers, praise, and notes on how the text was produced or what it replaced. Keep provenance that changes how to read the text, such as a record reconstructed after the decision. Mention earlier behavior only where it explains the current design or a default, or in changelogs, release notes, and upgrade guides.

Default to no code comment. Write one only for what the code cannot state, such as a non-obvious invariant, an ordering requirement, or a workaround whose cause is not visible. Explain why, not what, in one line, two at most. When it needs more, put the explanation in `docs/` or the pull request and link to it with a pointer comment. History such as "changed to fix" belongs in the commit, not the comment.

## Pointer comments

A brief code comment may link to a canonical public source, such as a `docs/` file or an ADR under `docs/decisions/`, when the relevant rationale is not apparent from the surrounding code. It is a signpost, not a copy of the rationale: keep the durable explanation in the linked record. Do not use a comment to narrate obvious code, and do not restate a pull request or ADR in the comment body.
Loading
Loading