RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cline rules/cline/cline

Cline rules

.clinerules/protobuf-development.md
Cline rules

Quality

74/100

Scores the file, not the repository.

Length

450 words

8 headings · 4 code blocks

Repository

66k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
cline/cline/.clinerules/protobuf-development.mdRawGitHub
1# Cline Protobuf Development Guide
2 
3This guide outlines how to add new gRPC endpoints for communication between the webview (frontend) and the extension host (backend).
4 
5## Overview
6 
7Cline uses [Protobuf](https://protobuf.dev/) to define a strongly-typed API, ensuring efficient and type-safe communication. All definitions are in the `/proto` directory. The compiler and plugins are included as project dependencies, so no manual installation is needed.
8 
9## Key Concepts & Best Practices
10 
11- **File Structure**: Each feature domain should have its own `.proto` file (e.g., `account.proto`, `task.proto`).
12- **Message Design**:
13 - For simple, single-value data, use the shared types in `proto/common.proto` (e.g., `StringRequest`, `Empty`, `Int64Request`). This promotes consistency.
14 - For complex data structures, define custom messages within the feature's `.proto` file (see `task.proto` for examples like `NewTaskRequest`).
15- **Naming Conventions**:
16 - Services: `PascalCaseService` (e.g., `AccountService`).
17 - RPCs: `camelCase` (e.g., `accountEmailIdentified`).
18 - Messages: `PascalCase` (e.g., `StringRequest`).
19- **Streaming**: For server-to-client streaming, use the `stream` keyword on the response type. See `subscribeToAuthCallback` in `account.proto` for an example.
20 
21---
22 
23## 4-Step Development Workflow
24 
25Here’s how to add a new RPC, using `scrollToSettings` as an example.
26 
27### 1. Define the RPC in a `.proto` File
28 
29Add your service method to the appropriate file in the `proto/` directory.
30 
31**File: `proto/ui.proto`**
32```proto
33service UiService {
34 // ... other RPCs
35 // Scrolls to a specific settings section in the settings view
36 rpc scrollToSettings(StringRequest) returns (KeyValuePair);
37}
38```
39Here, we use the common `StringRequest` and `KeyValuePair` types.
40 
41### 2. Compile Definitions
42 
43After editing a `.proto` file, regenerate the TypeScript code. From the project root, run:
44```bash
45bun run protos
46```
47This command compiles all `.proto` files and outputs the generated code to `src/generated/` and `src/shared/`. Do not edit these generated files manually.
48 
49### 3. Implement the Backend Handler
50 
51Create the RPC implementation in the backend. Handlers are located in `src/core/controller/[service-name]/`.
52 
53**File: `src/core/controller/ui/scrollToSettings.ts`**
54```typescript
55import { Controller } from ".."
56import { StringRequest, KeyValuePair } from "../../../shared/proto/common"
57 
58/**
59 * Executes a scroll to settings action
60 * @param controller The controller instance
61 * @param request The request containing the ID of the settings section to scroll to
62 * @returns KeyValuePair with action and value fields for the UI to process
63 */
64export async function scrollToSettings(controller: Controller, request: StringRequest): Promise<KeyValuePair> {
65 return KeyValuePair.create({
66 key: "scrollToSettings",
67 value: request.value || "",
68 })
69}
70```
71 
72### 4. Call the RPC from the Webview
73 
74Call the new RPC from a React component in `webview-ui/`. The generated client makes this simple.
75 
76**File: `webview-ui/src/components/browser/BrowserSettingsMenu.tsx`** (Example)
77```tsx
78import { UiServiceClient } from "../../../services/grpc"
79import { StringRequest } from "../../../../shared/proto/common"
80 
81// ... inside a React component
82const handleMenuClick = async () => {
83 try {
84 await UiServiceClient.scrollToSettings(StringRequest.create({ value: "browser" }))
85 } catch (error) {
86 console.error("Error scrolling to browser settings:", error)
87 }
88}
89```
90 

Commands it names

  • bun run protos
  • task.proto

Sections

  • Cline Protobuf Development Guide
  • Overview
  • Key Concepts & Best Practices
  • 4-Step Development Workflow
  • 1. Define the RPC in a `.proto` File
  • 2. Compile Definitions
  • 3. Implement the Backend Handler
  • 4. Call the RPC from the Webview

What it covers

buildcode-stylearchitectureapiagent-behaviour

Stack — with the evidence

typescript

(1.00)

node

(1.00)

vitest

(1.00)

bun

(0.85)

react

(0.70)

nextjs

(0.70)

tailwind

(0.70)

vite

(0.70)

eslint

(0.70)

vercel

(0.70)

desktop-app

(0.70)

javascript

(0.60)

biome

(0.60)

github-actions

(0.60)

Format

Cline rules

A single file or a folder of files, all always-on. The folder form is the simplest way any format here lets you split rules into topics without also learning an activation model.

What the corpus says about it

Repository

Owner
cline
Language
—
License
—
Archived
no

All configs in this repo

Also in cline/cline

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
cline/cline.clinerules/bun-and-node.md · 66kCline rulestypescriptnode+12setuptestmonorepodo-not74/1003 days ago
cline/cline.clinerules/cline-overview.md · 66kCline rulestypescriptnode+12archtypesapi54/1003 days ago
cline/cline.clinerules/debug-harness.md · 66kCline rulestypescriptnode+12buildtesttesting-strategysecurity+185/1003 days ago
cline/cline.clinerules/general.md · 66kCline rulestypescriptnode+12setupbuildstylearch+286/1003 days ago
cline/cline.clinerules/network.md · 66kCline rulestypescriptnode+12styletesting-strategydependencies54/1003 days ago
cline/cline.clinerules/sdk-migration.md · 66kCline rulestypescriptnode+12style59/1003 days ago
cline/cline.clinerules/storage.md · 66kCline rulestypescriptnode+12stylearchdatabasedo-not65/1003 days ago
cline/cline.github/copilot-instructions.md · 66kCopilot instructionstypescriptnode+12buildteststyleapi+175/1003 days ago
cline/clineAGENTS.md · 66kAGENTS.mdtypescriptnode+13buildtestlint-formatstyle+283/1003 days ago
cline/clinesdk/AGENTS.md · 66kAGENTS.mdtypescriptnode+12setupbuildteststyle+589/1003 days ago
cline/clinesdk/packages/llms/AGENTS.md · 66kAGENTS.mdtypescriptnode+12no sections45/1003 days ago
Diff against .clinerules/bun-and-node.md Diff against .clinerules/cline-overview.md Diff against .clinerules/debug-harness.md Diff against .clinerules/general.md Diff against .clinerules/network.md Diff against .clinerules/sdk-migration.md Diff against .clinerules/storage.md Diff against .github/copilot-instructions.md Diff against AGENTS.md Diff against sdk/AGENTS.md Diff against sdk/packages/llms/AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5Cline rulestypescriptnode+8setupbuildtestlint-format+11100/1003 days ago
JCodesMore/ai-website-cloner-template.clinerules · 31kCline rulestypescriptnode+7buildlint-formatstylearch+397/1002 days ago
BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0Cline rulesjavascripttailwind+5buildstylearchgit+296/1003 days ago
u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1Cline rulestypescriptvite+4setuparchtypesdo-not93/100yesterday
HerringtonDarkholme/megarepo.clinerules/02-development.md · 17Cline rulesnodejavascriptsetupbuildteststyle+392/1003 days ago
blendsdk/codeops-mcp.clinerules/project.md · 0Cline rulestypescriptvitest+3buildteststylearch+791/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack