

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# Cline Protobuf Development Guide23This guide outlines how to add new gRPC endpoints for communication between the webview (frontend) and the extension host (backend).45## Overview67Cline 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.89## Key Concepts & Best Practices1011- **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.2021---2223## 4-Step Development Workflow2425Here’s how to add a new RPC, using `scrollToSettings` as an example.2627### 1. Define the RPC in a `.proto` File2829Add your service method to the appropriate file in the `proto/` directory.3031**File: `proto/ui.proto`**32```proto33service UiService {34 // ... other RPCs35 // Scrolls to a specific settings section in the settings view36 rpc scrollToSettings(StringRequest) returns (KeyValuePair);37}38```39Here, we use the common `StringRequest` and `KeyValuePair` types.4041### 2. Compile Definitions4243After editing a `.proto` file, regenerate the TypeScript code. From the project root, run:44```bash45npm run protos46```47This command compiles all `.proto` files and outputs the generated code to `src/generated/` and `src/shared/`. Do not edit these generated files manually.4849### 3. Implement the Backend Handler5051Create the RPC implementation in the backend. Handlers are located in `src/core/controller/[service-name]/`.5253**File: `src/core/controller/ui/scrollToSettings.ts`**54```typescript55import { Controller } from ".."56import { StringRequest, KeyValuePair } from "../../../shared/proto/common"5758/**59 * Executes a scroll to settings action60 * @param controller The controller instance61 * @param request The request containing the ID of the settings section to scroll to62 * @returns KeyValuePair with action and value fields for the UI to process63 */64export async function scrollToSettings(controller: Controller, request: StringRequest): Promise<KeyValuePair> {65 return KeyValuePair.create({66 key: "scrollToSettings",67 value: request.value || "",68 })69}70```7172### 4. Call the RPC from the Webview7374Call the new RPC from a React component in `webview-ui/`. The generated client makes this simple.7576**File: `webview-ui/src/components/browser/BrowserSettingsMenu.tsx`** (Example)77```tsx78import { UiServiceClient } from "../../../services/grpc"79import { StringRequest } from "../../../../shared/proto/common"8081// ... inside a React component82const 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
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?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| adsumnetworks/Adsum-IoT-Coder.clinerules/cline-overview.md · 25 | Cline rules | archtypesapi | 54/100 | 14 days ago | |
| adsumnetworks/Adsum-IoT-Coder.clinerules/general.md · 25 | Cline rules | buildtestapiagent-behaviour | 69/100 | 14 days ago | |
| adsumnetworks/Adsum-IoT-Coder.clinerules/network.md · 25 | Cline rules | styletesting-strategydependencies | 54/100 | 14 days ago | |
| adsumnetworks/Adsum-IoT-Coder.clinerules/project-memory.md · 25 | Cline rules | setupteststyleui+2 | 71/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5 | Cline rules | setupbuildtestlint-format+11 | 100/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.clinerules · 32k | Cline rules | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0 | Cline rules | buildstylearchgit+2 | 96/100 | 14 days ago | |
| u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 14 days ago | |
| u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 14 days ago | |
| VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1 | Cline rules | setuparchtypesdo-not | 93/100 | 12 days ago | |
| HerringtonDarkholme/megarepo.clinerules/02-development.md · 17 | Cline rules | setupbuildteststyle+3 | 92/100 | 14 days ago | |
| blendsdk/codeops-mcp.clinerules/project.md · 0 | Cline rules | buildteststylearch+7 | 91/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/adsumnetworks-adsum-iot-coder-clinerules-protobuf-development)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.