zernie/vigiles

edit-spec

Edit a vigiles .spec.ts to change a compiled instruction file (CLAUDE.md / AGENTS.md) — add, modify, or remove a rule, section, command, or key file.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/zernie/vigiles --skill edit-spec

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

Edit a .spec.ts file to update the project's instruction files. The spec is the source of truth — CLAUDE.md and AGENTS.md are compiled build artifacts that must not be edited directly.

Arguments

$ARGUMENTS — What the user wants to change. Examples:

  • "add a rule about always using the custom logger"
  • "update the architecture section"
  • "add src/services/auth.ts to key files"
  • "add npm run lint to commands"
  • "change the testing guidance"

Instructions

Step 1: Find the Spec

Look for spec files in the repo root:

  • CLAUDE.md.spec.ts — source for CLAUDE.md
  • AGENTS.md.spec.ts — source for AGENTS.md
  • Any *.spec.ts matching instruction files

If no spec exists: if there's a hand-written CLAUDE.md, suggest the adopt-spec skill; otherwise suggest npx vigiles init to scaffold one.

Step 2: Read and Understand the Spec

Read the spec file. It's a TypeScript file that exports a claude() call with these fields:

typescript
import { claude, enforce, guidance, check, every } from "vigiles/spec";

export default claude({
  // Optional: output target (defaults to "CLAUDE.md")
  target: "CLAUDE.md",
  // or multi-target:
  // target: ["CLAUDE.md", "AGENTS.md"],

  // Prose sections — become ## headings in compiled output
  sections: {
    positioning: "What this project does...",
    architecture: "How the codebase is structured...",
  },

  // File paths verified to exist at compile time
  keyFiles: {
    "src/index.ts": "Main entry point",
  },

  // Commands verified against package.json
  commands: {
    "npm run build": "Compile the project",
    "npm test": "Run all tests",
  },

  // Rules — three types
  rules: {
    // enforce() — backed by a linter rule, verified to exist AND be enabled
    "no-any": enforce(
      "@typescript-eslint/no-explicit-any",
      "Use unknown and narrow with type guards.",
    ),

    // check() — filesystem assertion run by vigiles
    "test-pairing": check(
      every("src/**/*.service.ts").has("{name}.test.ts"),
      "Every service must have tests.",
    ),

    // guidance() — prose only, no enforcement
    "research-first": guidance("Google unfamiliar APIs before implementing."),
  },
});

Step 3: Make the Changes

Based on what the user asked for:

Adding a rule (this absorbs the old generate-rule skill):

  • Classify the rule from the request:
  • enforce() — a linter rule can back it. Check the project's linter configs

(ESLint, Ruff, Clippy, Pylint, RuboCop, Stylelint) for a matching rule; also consider an architectural tool (ast-grep, Dependency Cruiser, Steiger). If uncertain whether a rule exists, ask the user rather than guessing.

  • check() — a filesystem structural convention ("every X needs a Y"). Only

for file-pairing; never for code content.

  • guidance() — can't be mechanically enforced (subjective conventions,

process rules, migration context).

  • For enforce(): use the real linter rule name (e.g. eslint/no-console,

@typescript-eslint/no-explicit-any, ruff/T201).

  • Add to the rules object with a kebab-case key derived from the intent,

preserving alphabetical order if the existing rules are alphabetical. Import any new builders needed (e.g. check and every for the first check()).

Updating a section:

  • Edit the string in sections. Sections are plain strings or tagged template literals with file(), cmd(), ref() for verified references
  • Do NOT add # or ## headers inside sections — they break the document structure

Adding a key file or command:

  • Add to keyFiles or commands. The compiler verifies these exist at compile time
  • For commands: must match a script in package.json
  • For key files: must exist on disk
  • 🔴 **KEEP THE DESCRIPTION TO ONE LINE — aim for 120 characters, never exceed

~200.** A keyFiles entry is a POINTER: what the file is for, so a reader knows whether to open it. The explanation of how it works belongs in that file's own header comment, where it is read when someone is actually in the file. An instruction file is loaded on EVERY request, so a paragraph here is paid for every turn, forever, by every reader — including the ones who never touch that file.

  • This list only ever grows unless you shrink it. Every session adds entries

and none removes them, so before adding, check whether a NEARBY entry is now stale (the file moved, the role changed, the description restates its header) and fix it in the same edit. Adding without ever pruning is how an instruction file reaches four times its harness's budget — vigiles audit reports that number as Always-loaded instructions, so check it when you touch this list.

Step 4: Compile

After editing the spec, run:

bash
npx vigiles compile

This regenerates the compiled instruction file(s). Review the output for any errors:

  • stale-file — a key file path doesn't exist
  • stale-command — a command isn't in package.json
  • invalid-rule — a linter rule doesn't exist or is disabled
  • section-has-header — a section contains # headers (break into separate named sections)

Step 5: Verify

bash
npx vigiles lint

If the vigiles plugin is installed (/plugin marketplace add zernie/vigiles then /plugin install vigiles@vigiles, or npx vigiles init), the PostToolUse hook recompiles automatically after you save the spec.

Important

  • Do what's asked; don't silently escalate enforcement. Add the rule the user asked for. If making it an enforce() would need a linter-config edit or a plugin install (a cost), or if it could fail a clean CI, say so and let the user choose — don't change linter config or flip on strict / workflow gating on your own. A pure win (a rule that's already enabled) you can just apply. The strengthen skill owns guidance() → enforce() upgrades.
  • Never edit CLAUDE.md or AGENTS.md directly — they have a vigiles hash comment and are build artifacts
  • The spec is TypeScript — you get type checking, autocomplete, and verified references
  • `enforce()` rules are verified — the compiler checks the rule exists AND is enabled in your linter config
  • Sections must not contain `#` or `##` headers — use separate named sections instead

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
zernie
커뮤니티

adopt-spec

Adopt a typed .spec.ts for an existing hand-written CLAUDE.md — start from the file you already have, non-destructively

설치 수
4
GitHub Stars
15
업데이트
10월 7일
zernie
커뮤니티

debug-my-harness

Diagnose why an agent harness misbehaved by reading the local flight-recorder ledger (.vigiles/runs.jsonl) — which skills fired or got hijacked, which hooks blocked or wrongly allowed, which subagent tool-contract violations happened, and how a skill's trigger rate moved. Use when asked why a skill stopped firing, why a hook didn't block, why the wrong skill ran, or to debug/investigate what the harness actually did. NOT for writing new rules (use strengthen) or editing the spec (use edit-spec).

설치 수
4
GitHub Stars
15
업데이트
10월 7일
zernie
커뮤니티

linter-docs

Deep linter reference for authoring or debugging a vigiles enforce() rule — plugin tables, AST selectors, type-aware rules, auto-fix, and edge cases for ESLint, Ruff, Pylint, RuboCop, Stylelint, and Clippy. Use when you need the exact rule name or config for a specific linter, not for running a linter. (JVM/Go linters — detekt, ktlint, Checkstyle, golangci-lint — and Cedar have no deep-dive file yet; their reference lives in docs/linter-support.md.)

설치 수
4
GitHub Stars
15
업데이트
10월 7일
zernie
커뮤니티

strengthen

Upgrade a vigiles spec's guidance() rules to enforce() — scan the guidance rules in a CLAUDE.md/AGENTS.md spec and find existing linter rules (ESLint, Ruff, Clippy, Pylint, RuboCop, Stylelint) that back them. Use when asked to strengthen, harden, or make vigiles rules enforceable; NOT for general linting or fixing lint errors.

설치 수
4
GitHub Stars
15
업데이트
10월 7일