with one click
add-sdk-method
// Use when adding a new method, function, or API endpoint to the SDK. Ensures consistent implementation across all SDKs (Python, TypeScript, Java, Rust CLI) with proper types, tests, and naming conventions.
// Use when adding a new method, function, or API endpoint to the SDK. Ensures consistent implementation across all SDKs (Python, TypeScript, Java, Rust CLI) with proper types, tests, and naming conventions.
Use when adding unit or integration tests. Provides test patterns, naming conventions, and fixtures for Python (pytest), TypeScript (vitest), Java (JUnit/Mockito), and Rust.
Use when CI/CD pipeline fails. Provides systematic diagnosis for lint, type, test, and build failures across Python, TypeScript, Java, Rust, and n8n SDKs.
Load ONLY for Python code Use when writing, reviewing, or refactoring Python to ensure adherence to LBYL exception handling patterns, modern type syntax (list[str], str | None), pathlib operations, ABC-based interfaces, absolute imports, and explicit error boundaries at CLI level. Also provides production-tested code smell patterns from Dagster Labs for API design, parameter complexity, and code organization. Essential for maintaining erk's dignified Python standards.
Use when running integration tests against a real Metadata instance. Guides setup of environment variables (AI_SDK_HOST, AI_SDK_TOKEN) and runs tests that make actual API calls.
Use when reviewing or validating documentation. Checks for clarity, completeness, broken links, undefined terms, and ensures beginners can follow guides without prior knowledge of the SDK.
| name | add-sdk-method |
| description | Use when adding a new method, function, or API endpoint to the SDK. Ensures consistent implementation across all SDKs (Python, TypeScript, Java, Rust CLI) with proper types, tests, and naming conventions. |
Adds a new method to all SDKs (Python, TypeScript, Java, Rust CLI) with consistent implementation.
/add-sdk-method <method-name> <description>
Understand the Method
Python SDK (python/src/ai_sdk/)
AgentHandle in _client.py)python/tests/TypeScript SDK (typescript/src/)
AgentHandle class in agent.tsmodels.ts if neededtypescript/tests/Java SDK (java/src/main/java/io/metadata/ai/)
AgentHandle.javamodels/ if neededjava/src/test/Rust CLI (cli/src/)
main.rs or relevant moduleVerify
make lint - all linters passmake test-all - all unit tests passasync def new_method(self, param: str) -> ResponseModel:
"""Short description.
Args:
param: Description of param
Returns:
ResponseModel with the result
"""
response = await self._client._request("POST", f"/path/{param}")
return ResponseModel.model_validate(response)
async newMethod(param: string): Promise<ResponseModel> {
const response = await this.client.request('POST', `/path/${param}`);
return response as ResponseModel;
}
public ResponseModel newMethod(String param) throws AISdkException {
return httpClient.post("/path/" + param, ResponseModel.class);
}