Skip to content
Development
Command

/updaterules

Update the 1c-rules ruleset from GitHub (https://github.com/comol/ai_rules_1c)

BOOST
From plugin
ai-rules-1c
48745 skills13 agents45 commands
Install
> /plugin marketplace add comol/ai_rules_1c
> /plugin install 1c-rules@1c-rules

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/updaterules

Context preview

What this command does when you run it.

Update the 1c-rules ruleset from GitHub (https://github.com/comol/ai_rules_1c)

Command definition

updaterules.md
description: Update the 1c-rules ruleset from GitHub (https://github.com/comol/ai_rules_1c)
userOnly: true

/updaterules — update 1c-rules

Source: `https://github.com/comol/ai_rules_1c`.

Action: update managed files in the current installation to the latest repository version (on-demand rules, subagent descriptions, slash commands, SKILL packages, MCP config, OpenSpec bundle, rendered `AGENTS.md`). Preserve:

  • `USER-RULES.md`, `memory.md`, and `LLM-RULES.md` — one-time templates, never overwritten (a missing `LLM-RULES.md` on an older install is placed by this update);
  • contents of `openspec/specs/` and `openspec/changes/` — copied in skip-if-exists mode;
  • any managed file marked `userModified: true` in `.ai-rules.json`.

Steps

1. Make sure `.ai-rules.json` exists at the project root. If it is missing, this is a first install: run `init` by `AGENT-INSTALL.md`, not `/updaterules`.

2. **Prefer the PowerShell channel** from the project root. `install.ps1` expects a local path in `-Source`, so first clone or update the source into a cache under `$env:TEMP`:

$src = Join-Path $env:TEMP '1c-rules'
if (Test-Path (Join-Path $src '.git')) {
    git -C $src fetch --depth 1 origin HEAD
    git -C $src reset --hard FETCH_HEAD
} else {
    git clone --depth 1 https://github.com/comol/ai_rules_1c.git $src
}
& "$src\install.ps1" update -Source $src -AssumeYes

The PowerShell channel applies every adapter frontmatter transform (including OpenCode `toolsToPermission` and Claude Code / Kimi / Qwen `toolsToDenylist`) and runs both agent frontmatter gates before reporting success. Prefer it over the agent channel whenever `git` / PowerShell are available.

3. Check installer output:

  • `Update complete.` — success;
  • `User-modified files detected: N` / files left at previous version — local edits preserved; use `-Force` / `-ForcePaths` only when the user wants the shipped version;
  • `Verification OK` / `Verification found N mismatch(es)` — hash check of freshly placed files;
  • `OpenCode agent frontmatter OK` — OpenCode gate passed (or skipped when `.opencode/agent/` is absent);
  • `OpenCode agent frontmatter INVALID` / exit code 1 — **update failed the hard gate** (see Step 5). Do not treat the run as successful.
  • `Agent tool vocabulary OK` — the Claude Code / Kimi / Qwen gate passed (or skipped when none of those agent directories exists);
  • `Agent tool vocabulary INVALID` / exit code 1 — **update failed the hard gate** (see Step 5). Do not treat the run as successful.

4. If PowerShell is unavailable (restricted environment, no `git`/`pwsh`), execute *Update / add / remove* from `AGENT-INSTALL.md` through the agent channel: re-place managed files from the updated clone, re-render `AGENTS.md`, and update `version` and `updatedAt` in `.ai-rules.json`. Do not touch `USER-RULES.md`, `memory.md`, or `LLM-RULES.md` (place the latter from the template only if absent).

**OpenCode hard obligation on the agent channel.** When `opencode` is an active tool (or `.opencode/agent/` exists), every placed agent file **must** go through `adapters/opencode.yaml → agents.frontmatter.toolsToPermission` before write-back: convert the source `tools` array into a `permission` object, then apply `keep` / `drop` / `rename` / `addIf` so that `tools`, `modelTier`, `isSubagent`, and `allowParallel` are **not** left in the file. Copying `content/agents/*.md` into `.opencode/agent/` verbatim is a defect — OpenCode rejects a `tools` array and will not start. Canon — `AGENT-INSTALL.md → OpenCode agents: tools array → permission object`.

**Claude Code / Kimi / Qwen hard obligation on the agent channel.** For those tools every placed agent file **must** go through `adapters/<tool>.yaml → agents.frontmatter.toolsToDenylist` before write-back: turn the source `tools` array into that host's `disallowedTools` string and emit no `tools` key. Copying `content/agents/*.md` verbatim is a defect — the abstract `Shell` / `MCP` match nothing there, and the subagent silently loses shell and every MCP server. Canon — `AGENT-INSTALL.md → Claude Code / Kimi / Qwen agents: tools array → disallowedTools`.

**Cursor hard obligation on the agent channel.** Placed Cursor agent files **must** go through `adapters/cursor.yaml → agents.frontmatter.toolsToFlag`: emit no `tools` key (Cursor does not document the field) and set `readonly: true` on the agents whose source list grants none of `Write` / `Edit` / `Shell`. Canon — `AGENT-INSTALL.md → Cursor agents: tools array → readonly`.

5. **Mandatory post-update gates (both channels).** After the update, if `.opencode/agent/` or `.opencode/agents/` exists, verify that **no** agent markdown still has a `tools` **array** in its YAML frontmatter:

Get-ChildItem .opencode\agent, .opencode\agents -Filter *.md -File -ErrorAction SilentlyContinue |
  ForEach-Object {
    $raw = Get-Content $_.FullName -Raw
    if ($raw -match '(?ms)\A---\r?\n.*?^tools:\s*\[') {
      "FAIL: $($_.FullName)"
    }
  }
  • Any match → **update is incomplete / failed**. Report FAIL, list the files, and repair by re-running the PowerShell channel with `-ForcePaths .opencode/agent/*` (or re-applying `toolsToPermission` correctly on the agent channel). Do not tell the user the update succeeded.
  • Optional live check when `opencode` is on PATH: `opencode agent list` must not print `Configuration is invalid` / `Expected object | undefined, got [...] tools`.
  • If neither OpenCode agent directory exists → skip this gate.

Then, if `.claude/agents/`, `.kimi-code/agents/`, `.qwen/agents/`, `.cursor/agents/`, `.commandcode/agents/`, `.zcode/agents/` or `.mimocode/agents/` exists, verify that no agent markdown there still names an abstract tool:

Get-ChildItem .claude\agents, .kimi-code\agents, .qwen\agents, .cursor\agents, .commandcode\agents, .zcode\agents, .mimocode\agents -Filter *.md -File -ErrorAction SilentlyContinue |
  ForEach-Object
Read more
Ships withai-rules-1c

Rules\skills\subagens for vibecoding in 1C(bsl)

Get the whole plugin

Other commands on ai-rules-1c.