### Clone and Setup Archgate CLI Source: https://github.com/archgate/cli/blob/main/CONTRIBUTING.md Clones the Archgate CLI repository, installs the project's toolchain using proto, and then installs the project dependencies using Bun. ```bash # Clone the repository git clone https://github.com/archgate/cli.git cd cli # Install the toolchain (Bun, npm, Node, etc.) proto use # Install dependencies bun install ``` -------------------------------- ### Install Archgate Plugin for Claude Code Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/cli/init.mdx This example shows the output when the Archgate plugin is installed for Claude Code. If the `claude` CLI is on your PATH, the plugin is installed automatically. Otherwise, manual installation commands are printed. ```bash Initialized Archgate governance in /path/to/project adrs/ - architecture decision records lint/ - linter-specific rules .claude/ - Claude Code settings configured Archgate plugin installed for Claude Code. ``` -------------------------------- ### Login and Install Plugin Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/cursor-integration.mdx Log in to Archgate to access beta features and install the Cursor plugin. This is a one-time setup process. ```bash archgate login # one-time setup archgate init --editor cursor --install-plugin ``` -------------------------------- ### Install Archgate Plugin in Claude Code Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/cli/plugin.mdx Example of installing the Archgate plugin in Claude Code. ```bash claude plugin install archgate@archgate ``` -------------------------------- ### Setup Archgate CLI for Custom Commands Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/ci-integration.mdx Utilize the `archgate/setup-action` to install the Archgate CLI and add it to the PATH, enabling the execution of custom Archgate commands beyond basic checks. ```yaml steps: - uses: actions/checkout@v4 - uses: archgate/setup-action@v1 - run: archgate check --ci - run: archgate adr list --json ``` -------------------------------- ### Verify Archgate CLI Setup Source: https://github.com/archgate/cli/blob/main/CONTRIBUTING.md Runs the Archgate CLI locally to verify that the setup and installation were successful. ```bash bun run cli ``` -------------------------------- ### Initialize Project and Force Plugin Installation Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/copilot-cli-plugin.mdx Initialize your project and explicitly request the installation of the Copilot CLI plugin. ```bash archgate init --editor copilot --install-plugin ``` -------------------------------- ### Initialize Project and Explicitly Install Plugin Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/claude-code-plugin.mdx Use this command to initialize your project and ensure the Archgate plugin is installed, even if it was not previously. ```bash archgate init --install-plugin ``` -------------------------------- ### Install Archgate CLI via Bun Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate globally using Bun. This installs a lightweight wrapper that delegates to a platform-specific binary. ```bash # Bun bun install -g archgate ``` -------------------------------- ### Install Archgate CLI via Go Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate using `go install`. Requires Go 1.21+. The compiled Go wrapper downloads the platform binary on first run. ```bash go install github.com/archgate/cli/shims/go/cmd/archgate@latest ``` -------------------------------- ### Archgate Login Process Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/cli/login.mdx This example shows the interactive prompts and output during the `archgate login` process, including user registration and token claiming. ```bash archgate login ``` ```text Authenticating with GitHub... Open https://github.com/login/device in your browser and enter the code: ABCD-1234 Waiting for authorization... GitHub user: yourname Your GitHub account yourname is not yet registered. Let's sign you up now. Email: you@example.com Editor: Claude Code Use case: Enforcing ADRs in our monorepo Submitting signup request... Claiming archgate plugin token... Authenticated as yourname. Plugin access is now available. Run `archgate init` to set up a project with the archgate plugin. ``` -------------------------------- ### Archgate Login - First Time User Example Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt This example demonstrates the interactive process when logging into Archgate for the first time, including GitHub device flow and user registration. ```text Authenticating with GitHub... Open https://github.com/login/device in your browser and enter the code: ABCD-1234 Waiting for authorization... GitHub user: yourname Your GitHub account yourname is not yet registered. Let's sign you up now. Email: you@example.com Editor: Claude Code Use case: Enforcing ADRs in our monorepo Submitting signup request... Claiming archgate plugin token... Authenticated as yourname. Plugin access is now available. Run `archgate init` to set up a project with the archgate plugin. ``` -------------------------------- ### Install and use Archgate with proto Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt Installs and uses Archgate after configuring it as a proto plugin. Proto manages the binary, including version pinning and auto-installation. ```bash proto install archgate archgate check ``` -------------------------------- ### Install Archgate CLI via pnpm Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate globally using pnpm. This installs a lightweight wrapper that delegates to a platform-specific binary. ```bash # pnpm pnpm add -g archgate ``` -------------------------------- ### Initialize Project and Force Plugin Installation Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/vscode-plugin.mdx Explicitly request the installation of the Archgate VS Code plugin during project initialization. ```bash archgate init --editor vscode --install-plugin ``` -------------------------------- ### Install Archgate CLI via npm Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate globally using npm. This installs a lightweight wrapper that delegates to a platform-specific binary. ```bash # npm npm install -g archgate ``` -------------------------------- ### Install Archgate CLI via Yarn Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate globally using Yarn. This installs a lightweight wrapper that delegates to a platform-specific binary. ```bash # Yarn yarn global add archgate ``` -------------------------------- ### Install and Use Archgate with Proto Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx After adding the Archgate plugin to .prototools, install and execute Archgate commands using proto. Proto handles binary management and versioning. ```bash proto install archgate archgate check ``` -------------------------------- ### Install Archgate CLI via pipx Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate globally using pipx, which is recommended for CLI tools. This installs a lightweight Python wrapper that delegates to a platform-specific binary. ```bash # pipx (recommended for CLI tools) pipx install archgate ``` -------------------------------- ### Verify Archgate CLI Installation Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Run this command after installation to verify that the Archgate CLI is installed correctly and to see the installed version. ```bash archgate --version ``` -------------------------------- ### Install opencode Agents Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/opencode-integration.mdx Log in to Archgate and then initialize the opencode integration with the --install-plugin flag to download and install the Archgate agent bundle. ```bash archgate login archgate init --editor opencode --install-plugin ``` -------------------------------- ### Install Archgate using pipx Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt Installs a lightweight Python wrapper for Archgate. Requires Python 3.8+. ```bash pipx install archgate ``` -------------------------------- ### Install Archgate CLI Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/quick-start.mdx Install the Archgate CLI using curl for a standalone installation or via npm. See the installation page for other options. ```bash # Standalone (no Node.js required) curl -fsSL https://cli.archgate.dev/install-unix | sh # Or via npm npm install -g archgate ``` -------------------------------- ### Initialize Archgate and Install Cursor Plugin Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt Use this command to initialize your project with Archgate and explicitly install the Cursor plugin. This ensures all necessary components are set up for Cursor integration. ```bash archgate init --editor cursor --install-plugin ``` -------------------------------- ### Bun-based CI Installation Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/ci-integration.mdx If your CI environment already uses Bun, install Archgate using `bun` instead of `npm`. This snippet shows how to set up Bun and install Archgate globally. ```yaml jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 - run: bun install -g archgate - run: archgate check --ci ``` -------------------------------- ### Install Proto Source: https://github.com/archgate/cli/blob/main/CONTRIBUTING.md Installs the proto toolchain manager using a bash script. This is a prerequisite for setting up the Archgate CLI development environment. ```bash bash <(curl -fsSL https://moonrepo.dev/install/proto.sh) ``` -------------------------------- ### Install Archgate CLI via pip Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate globally using pip. This installs a lightweight Python wrapper that delegates to a platform-specific binary. ```bash # pip pip install archgate ``` -------------------------------- ### Standalone Installer for CI (No Node.js) Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/ci-integration.mdx Use the standalone installer script to download and run Archgate in CI environments without Node.js. This method requires only `curl` and `tar` and installs Archgate to `~/.archgate/bin`. ```yaml jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: curl -fsSL https://cli.archgate.dev/install-unix | sh - run: ~/.archgate/bin/archgate check --ci ``` -------------------------------- ### Install Archgate via npm Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt Installs the Archgate CLI globally using npm. Requires Node.js and npm. ```bash npm install -g archgate ``` -------------------------------- ### Install Archgate Plugin for Specified Editor Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/cli/plugin.mdx Installs the Archgate plugin for a given editor on an already-initialized project. Behavior varies by editor. ```bash archgate plugin install [options] ``` -------------------------------- ### Install or Reinstall Copilot Plugin on Existing Project Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/copilot-cli-plugin.mdx Install or reinstall the Copilot CLI plugin for an already initialized project. ```bash archgate plugin install --editor copilot ``` -------------------------------- ### Install Archgate CLI via dotnet global tool Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate as a .NET global tool. Requires .NET 8.0+ SDK. The tool downloads the platform binary on first run. ```bash dotnet tool install -g archgate ``` -------------------------------- ### Install Lefthook Hook Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt After configuring Lefthook in your `lefthook.yml` file, install the hook to enable it for your Git repository. ```bash lefthook install ``` -------------------------------- ### Install or Reinstall Archgate Plugin Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/claude-code-plugin.mdx If your project is already initialized, use this command to install or reinstall the Archgate plugin without re-running the full initialization process. ```bash archgate plugin install ``` -------------------------------- ### Install or Reinstall VS Code Plugin Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/vscode-plugin.mdx Install or reinstall the Archgate VS Code plugin for a project that has already been initialized. ```bash archgate plugin install --editor vscode ``` -------------------------------- ### Task runner configuration examples Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/examples/monorepo-task-runner.mdx Provides examples of how to adapt the task runner configuration check for different monorepo tools like Turborepo and Nx. ```typescript // Turborepo const configPath = file.replace("/package.json", "/turbo.json"); // Nx const configPath = file.replace("/package.json", "/project.json"); ``` -------------------------------- ### Manually Install Copilot CLI Plugin Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/copilot-cli-plugin.mdx Manually install the Archgate plugin for Copilot CLI using the provided URL. Replace placeholders with your GitHub user and token. ```bash copilot plugin install https://:@plugins.archgate.dev/archgate.git ``` -------------------------------- ### Install or Reinstall Plugin Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/cursor-integration.mdx Use this command to install or reinstall the Cursor plugin for an existing Archgate-initialized project. This ensures you have the latest plugin version. ```bash archgate plugin install --editor cursor ``` -------------------------------- ### Install Archgate CLI via RubyGems Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate as a Ruby gem. Requires Ruby 2.7+. The gem downloads the platform binary on first run. ```bash gem install archgate ``` -------------------------------- ### Install Archgate CLI Standalone (Unix) Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Use this command to install the Archgate CLI on macOS or Linux systems. It downloads a pre-built binary and adds it to your PATH. ```bash # macOS / Linux curl -fsSL https://cli.archgate.dev/install-unix | sh ``` -------------------------------- ### Install Archgate CLI via jbang Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate using jbang. Requires Java 11+. The shim downloads the platform binary on first run. ```bash jbang app install archgate@dev.archgate ``` -------------------------------- ### Install Archgate CLI Standalone (Windows PowerShell) Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Use this command to install the Archgate CLI on Windows systems via PowerShell. It downloads a pre-built binary and adds it to your PATH. ```powershell # Windows (PowerShell) irm https://cli.archgate.dev/install-windows | iex ``` -------------------------------- ### Install Archgate CLI as a dev dependency (Bun) Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate as a dev dependency using Bun. This is useful for pinning a specific version per project or running checks in CI. ```bash # Bun bun add -d archgate ``` -------------------------------- ### Install Archgate CLI Standalone (Windows Git Bash) Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Use this command to install the Archgate CLI on Windows systems using Git Bash or MSYS2. It downloads a pre-built binary and adds it to your PATH. ```bash # Windows (Git Bash / MSYS2) curl -fsSL https://cli.archgate.dev/install-unix | sh ``` -------------------------------- ### Install and Initialize Editor Plugin Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/index.mdx Sign up for beta access and authenticate with `archgate login`. Then, initialize the plugin for your editor using `archgate init --install-plugin`. ```bash archgate login archgate init --install-plugin ``` -------------------------------- ### Manual VS Code Extension Installation Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/vscode-plugin.mdx Download and install the Archgate VS Code extension (.vsix file) manually using curl and the 'code' CLI. Replace '' with your actual Archgate token. ```bash curl -H "Authorization: Bearer " https://plugins.archgate.dev/api/vscode -o archgate.vsix code --install-extension archgate.vsix rm archgate.vsix ``` -------------------------------- ### Initialize Archgate Project Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/quick-start.mdx Navigate to your project's root directory and run the 'init' command to set up the .archgate/ directory with example ADR and rules files. ```bash cd my-project archgate init ``` -------------------------------- ### Install Archgate CLI as a dev dependency (pnpm) Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/getting-started/installation.mdx Install Archgate as a dev dependency using pnpm. This is useful for pinning a specific version per project or running checks in CI. ```bash # pnpm pnpm add -D archgate ``` -------------------------------- ### Get review context for staged files Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/cli/review-context.mdx This example shows how to use the `--staged` option to include only git-staged files in the review context computation. ```bash archgate review-context --staged ``` -------------------------------- ### Opt-out directive example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/examples/component-pairing.mdx Use the `// @no-presentational: ` directive at the start of a Connected component file to opt out of the pairing rule when a presentational component is not needed. ```typescript // @no-presentational: this component only redirects, no UI to render import { useNavigate } from "react-router"; // ... ``` -------------------------------- ### Framework-Specific OpenAPI Import Patterns Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt Provides examples of import patterns for different backend frameworks to integrate with OpenAPI validation. Adapt these regex patterns to match your specific framework's setup. ```typescript // For Express with express-openapi-validator /from\s+["']express-openapi-validator["']/ ``` ```typescript // For Fastify with @fastify/swagger /from\s+["']@fastify\/swagger["']/ ``` -------------------------------- ### Initialize Archgate in Project Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/cli/init.mdx Run this command to set up Archgate linting and rules enforcement in your current project. It creates the `.archgate/` directory with example ADR, rules, and linter configuration. ```bash archgate init [options] ``` -------------------------------- ### Initialize Archgate for a developer Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt Configure your user-level marketplace URL after logging in. This is a one-time setup per developer. ```bash archgate login archgate init --editor vscode ``` -------------------------------- ### ADR Do's and Don'ts Section Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/writing-adrs.mdx Example of the 'Do's and Don'ts' section in an ADR, providing concrete examples of correct and incorrect patterns with code references. ```markdown ## Do's and Don'ts ### Do - Export a register*Command function from each command module - Keep commands thin: parse args, call helpers/engine, format output - Use src/commands/.ts for top-level commands ### Don't - Don't put business logic in command files -- move it to src/engine/ or src/helpers/ - Don't use executableDir() for command discovery - Don't call .parse() in command files -- the entry point handles parsing ``` -------------------------------- ### Archgate Quick Start Commands Source: https://github.com/archgate/cli/blob/main/README.md Basic commands to initialize Archgate in a project, document a decision, add rules, and run checks. ```bash # 1. Initialize governance in your project cd my-project archgate init # 2. Edit the generated ADR to document a real decision # .archgate/adrs/ARCH-001-*.md # 3. Add a companion .rules.ts to enforce it automatically # .archgate/adrs/ARCH-001-*.rules.ts # 4. Run checks archgate check ``` -------------------------------- ### Initialize Project with Archgate Plugin Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/claude-code-plugin.mdx Run this command in your project directory to initialize it with the Archgate plugin. It automatically configures the `archgate:developer` agent and skill permissions. ```bash archgate init ``` -------------------------------- ### Initialize Project with Copilot Editor Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/copilot-cli-plugin.mdx Initialize your project and automatically install the Copilot CLI plugin if the 'copilot' CLI is on your PATH. ```bash archgate init --editor copilot ``` -------------------------------- ### ADR Consequences Section Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/adr-schema.mdx Example of the 'Consequences' section in an ADR, documenting trade-offs. ```markdown ## Consequences ### Positive - Consistent error formatting across all commands - Machine-parseable error output when combined with `--json` ### Negative - Requires importing `logError` in every command file - Cannot use built-in error formatting from libraries ``` -------------------------------- ### Initialize opencode Integration Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/opencode-integration.mdx Run this command to configure opencode integration in your project. Beta access may be required. ```bash archgate init --editor opencode ``` -------------------------------- ### Install Lefthook Hook Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/pre-commit-hooks.mdx Run this command in your terminal to install the configured Lefthook pre-commit hook. ```bash lefthook install ``` -------------------------------- ### ADR References Section Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/adr-schema.mdx Example of the 'References' section in an ADR, linking to related documents. ```markdown ## References - [ARCH-001 -- Command Structure](./ARCH-001-command-structure.md) - [Node.js process.exit documentation](https://nodejs.org/api/process.html#processexitcode) ``` -------------------------------- ### Archgate Login - Existing Project Example Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt This output snippet indicates that the project already has Archgate ADRs configured, and suggests running `archgate check`. ```text Run `archgate check` to validate your project against its ADRs. ``` -------------------------------- ### ADR Risks Section Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/adr-schema.mdx Example of the 'Risks' section in an ADR, outlining potential risks and mitigations. ```markdown ### Risks - New contributors may use `console.error()` by habit. Mitigated by the automated rule that scans for direct `console.error()` calls. ``` -------------------------------- ### Correct Dependency Notation in package.json Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/examples/version-catalog.mdx This example demonstrates correct dependency notation using 'catalog:' and 'workspace:' prefixes, ensuring all versions are managed centrally. ```json { "dependencies": { "zod": "catalog:", "hono": "catalog:", "@myorg/shared": "workspace:*" } } ``` -------------------------------- ### Install Archgate standalone script Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt Installs the Archgate CLI using a standalone script. This method does not require Node.js. ```bash curl -fsSL https://cli.archgate.dev/install-unix | sh ``` -------------------------------- ### Archgate Project Structure Example Source: https://github.com/archgate/cli/blob/main/README.md Illustrates the directory structure for Archgate ADRs and their companion rule files. ```bash .archgate/ └── adrs/ ├── ARCH-001-command-structure.md # human-readable decision ├── ARCH-001-command-structure.rules.ts # machine-executable checks ├── ARCH-002-error-handling.md └── ARCH-002-error-handling.rules.ts ``` -------------------------------- ### Incorrect Barrel File Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/examples/no-barrel-files.mdx An example of an index.ts file that only re-exports symbols from other modules, which is considered a barrel file. ```typescript export { logInfo, logError } from "./log"; export { resolvePaths } from "./paths"; export type { PathConfig } from "./paths"; ``` -------------------------------- ### Initialize Project with VS Code Editor Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/vscode-plugin.mdx Initialize your project for Archgate integration, specifying VS Code as the editor. This command sets up the .archgate/ directory, adds the marketplace URL to VS Code user settings, and installs the extension if the 'code' CLI is available. ```bash archgate init --editor vscode ``` -------------------------------- ### Correct package.json with approved dependencies Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/examples/no-unapproved-deps.mdx This example demonstrates a correctly configured `package.json` where all production dependencies ('zod') are approved, and build-time-only libraries ('chalk') are correctly placed in `devDependencies`. ```json { "dependencies": { "zod": "^3.23.0" }, "devDependencies": { "chalk": "^5.3.0" } } ``` -------------------------------- ### ADR Compliance and Enforcement Section Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/adr-schema.mdx Example of the 'Compliance and Enforcement' section in an ADR, detailing automated and manual checks. ```markdown ## Compliance and Enforcement ### Automated Enforcement - **Archgate rule** ARCH-002/no-console-error: Scans command files for `console.error()` calls. Severity: error. ### Manual Enforcement Code reviewers MUST verify: 1. Error messages are actionable and include context 2. Exit codes match the error type (1 for user, 2 for internal) ``` -------------------------------- ### ADR Do's and Don'ts Section Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/reference/adr-schema.mdx Example of the 'Do's and Don'ts' section in an ADR, providing concrete guidance. ```markdown ## Do's and Don'ts ### Do - Use `logError(message, detail?)` for all error output - Include a suggested fix in the detail parameter when possible - Exit with code 1 for user errors, code 2 for internal errors ### Don't - Don't call `console.error()` directly in command files - Don't print stack traces to users - Don't exit without printing an error message first ``` -------------------------------- ### Correct Dependency Notation Source: https://github.com/archgate/cli/blob/main/docs/public/llms-full.txt This example demonstrates correct dependency notation in package.json files. All versions are managed centrally, ensuring consistency. Upgrading a dependency like 'zod' only requires changing the root catalog. ```json { "dependencies": { "zod": "catalog:", "hono": "catalog:", "@myorg/shared": "workspace:*" } } ``` ```json { "catalog": { "zod": "^3.23.0", "hono": "^4.0.0" } } ``` -------------------------------- ### ADR Context Section Example Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/writing-adrs.mdx Example of how to write the 'Context' section of an ADR, explaining the problem, alternatives considered, and constraints. ```markdown ## Context The CLI needs a consistent pattern for defining and registering commands. As the command surface grows (init, check, adr, login, upgrade, clean), the registration mechanism must scale without introducing hidden coupling or making the dependency graph opaque. **Alternatives considered:** - **Auto-discovery via `executableDir()`** -- Commander.js supports automatic command discovery by scanning a directory. This hides the dependency graph and makes dead command detection impossible. - **Single-file command map** -- Simple but creates a monolithic file that grows with every command. ``` -------------------------------- ### Initialize Cursor Integration Source: https://github.com/archgate/cli/blob/main/docs/src/content/docs/guides/cursor-integration.mdx Run this command to set up Archgate integration with Cursor in your project. This command configures the necessary files and settings for the integration. ```bash archgate init --editor cursor ```