Skip to content
Beta. This surface may change before GA; breaking changes are dated in the changelog.

Move a team's Markdown policies into Nicia

Give this ten minutes with one policy your team already asks its agents about. You’ll audit the repository, connect to a shared space, and commit a policy change. Review will show which rule lost its source, and a Slack message will tell your team that its watched answer changed.

Use a scratch Git repository or a branch of your team’s repository, Node.js 24 or newer, a Nicia space you can administer, and permission to set up a Slack incoming webhook for #eng-ops. The commands use Bash and jq.

If your repo is public, preview stale paths and oversized instructions in the browser. Skill-Rot Audit

Run this from the repository root.

Terminal window
npx @nicia-ai/cli audit

Pick one finding to act on, such as a broken link in AGENTS.md, a stale instruction in CLAUDE.md, or two skills with conflicting defaults. The audit uses local files and Git history. It needs no sign-in.

For the review loop, commit a small policy file as docs/escalation.md before importing. Use this exact line for the example.

Escalate checkout outages to the Payments on-call after 10 minutes.

2. Import the policy and connect your agent

Section titled “2. Import the policy and connect your agent”

Open the browser importer, choose your files or GitHub repository, review the preview, and note the destination space handle. Set NICIA_SPACE to that handle and sign in to the CLI.

Terminal window
export NICIA_SPACE='team-ops'
npx @nicia-ai/cli login

For a CLI import, choose your scratch handle and run this from the repository root after signing in.

Terminal window
npx @nicia-ai/cli migrate ./docs/escalation.md --space "$NICIA_SPACE"

Connect Claude Code, Cursor, or Codex by selecting your client below. Each teammate can sign in and connect their own client to the same space.

Terminal window
npx @nicia-ai/cli connect "$NICIA_SPACE" --client claude-code
# Use --client cursor or --client codex for those clients.

You can also install the Claude Code plugin. Open /mcp in Claude Code, sign in to Nicia, and include the shared space in the authorization.

Terminal window
claude plugin marketplace add nicia-ai/claude-plugin
claude plugin install nicia@nicia

3. Install the Git hook and cite the synced file

Section titled “3. Install the Git hook and cite the synced file”

Install the CLI on your PATH so the post-commit hook can run it.

Terminal window
npm install --global @nicia-ai/cli
nicia hook install --space "$NICIA_SPACE"

Check paths in the generated .nicia.json before the first sync. Set it to ["docs/escalation.md"] to sync only this policy.

Terminal window
nicia sync --dry-run
nicia sync

Sync reads committed files and uses repository-relative IDs. Both import routes can give the original copy a different ID, so cite the synced document docs/escalation.md after it is indexed.

Save a rule that quotes that exact line. The following API write gives it the stable ID used by the watch. Mint a management key in the console as a space administrator.

Terminal window
export SPACE_URL="https://api.nicia.ai/v1/brains/$NICIA_SPACE"
read -rsp 'Nicia management key: ' NICIA_MANAGEMENT_KEY
export NICIA_MANAGEMENT_KEY
printf '\n'
curl --fail-with-body --silent --show-error --request POST "$SPACE_URL/records" \
--header "Authorization: Bearer $NICIA_MANAGEMENT_KEY" \
--json '{
"records": [{
"id": "checkout-escalation",
"kind": "rule",
"label": "Checkout outage escalation",
"fields": {
"status": "active",
"body": "Escalate checkout outages to the Payments on-call after 10 minutes."
},
"evidence": [{
"document": {"id": "docs/escalation.md"},
"quote": "Escalate checkout outages to the Payments on-call after 10 minutes."
}]
}]
}'

Check for an applied change. If the space holds it, approve and apply it in Review before continuing. Ask your connected agent when checkout outages should escalate, and ask it to cite the synced file.

Create a Slack incoming webhook for #eng-ops. Register its URL with Nicia for answer.changed, then create a watch (preview) on the rule. Nicia formats delivery for Slack automatically. The URL is a secret, so enter it at the prompt and keep it out of Git.

Terminal window
read -rsp 'Slack webhook URL: ' SLACK_WEBHOOK_URL
printf '\n'
jq -n '{url: $ARGS.positional[0], types: ["answer.changed"]}' \
--args "$SLACK_WEBHOOK_URL" | \
curl --fail-with-body --silent --show-error --request POST "$SPACE_URL/webhooks" \
--header "Authorization: Bearer $NICIA_MANAGEMENT_KEY" --json @- | jq '.data.webhook.id'
curl --fail-with-body --silent --show-error --request POST "$SPACE_URL/watches" \
--header "Authorization: Bearer $NICIA_MANAGEMENT_KEY" \
--json '{"question":{"kind":"query","query":{"kind":"rule","where":{"slug":"checkout-escalation"}}}}' | \
jq '.data.watch | {id, status, resultState}'

Check that the watch is active with a current result before editing.

5. Change one line and follow it into Review

Section titled “5. Change one line and follow it into Review”

In docs/escalation.md, replace “after 10 minutes” with “after 5 minutes.” Commit the edit.

Terminal window
git add docs/escalation.md
git commit -m "Escalate checkout outages after five minutes"

The hook uploads the committed revision in the background. In the space, open Review → Attention and find Checkout outage escalation under reopened items. The old quote disappeared from the synced document, so the rule now reads needs_review. Each rule that cites the removed passage can reopen. In #eng-ops, look for Answer changed after the watch sweep and webhook delivery. The Slack message names the watch and space. Open Review to see the affected rule.

If the hook missed the commit, run nicia sync and check the document version under Knowledge → Documents. To settle the rule, revise it with the five-minute quote in Review and ask the connected agent the same question again.

Git sync and review · Events and webhooks