一键导入
implement-verified-lightdash-api-client
Implement verified Lightdash API clients with documentation research and live schema verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implement verified Lightdash API clients with documentation research and live schema verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Accountability for identifying deprecated Lightdash API usage in the provider by comparing code patterns against the official OpenAPI specification. Use when tasked to audit the codebase for technical debt or outdated API dependencies.
Guide the execution of Lightdash Terraform provider acceptance tests, ensuring correct environment setup and targeted test execution.
Run formatting, linters, unit tests, and build checks, then fix violations.
Research and investigate Lightdash API endpoints to understand request/response schemas and behavior.
Implement Terraform Resources and Data Sources in `internal/provider` with comprehensive testing.
Comprehensive security review of the Terraform provider codebase using gosec, trunk, osv-scanner, and trivy.
基于 SOC 职业分类
| name | implement-verified-lightdash-api-client |
| description | Implement verified Lightdash API clients with documentation research and live schema verification. |
This skill implements a new Lightdash API operation in the internal/lightdash/api directory, along with necessary models in internal/lightdash/models. It relies on the research-lightdash-api skill for researching and verifying the API schema before implementation.
The user should provide:
/api/v1/projects/:projectUuid/spaces)GetSpaceV1, CreateDashboardV1)LIGHTDASH_API_KEY is available).internal/lightdash/models for existing structs that match the resource.internal/lightdash/models/<resource>.go.
json tags.internal/lightdash/api/<verb>_<resource>_v1.go (snake_case).Client struct: func (c *Client) <FunctionName>(...) (*<ReturnType>, error).http.NewRequest.fmt.Sprintf and c.HostUrl.c.doRequest(req).Results field if the API wraps the response in a Results envelope.internal/lightdash/api/<verb>_<resource>_v1_test.go to test unmarshaling logic with sample JSON.Ref: internal/lightdash/api/get_space_v1.go
package api
import (
"encoding/json"
"fmt"
"net/http"
"strings"
"github.com/ubie-oss/terraform-provider-lightdash/internal/lightdash/models"
)
type GetResourceV1Response struct {
Results models.Resource `json:"results"`
Status string `json:"status"`
}
func (c *Client) GetResourceV1(id string) (*models.Resource, error) {
if len(strings.TrimSpace(id)) == 0 {
return nil, fmt.Errorf("id is empty")
}
path := fmt.Sprintf("%s/api/v1/resource/%s", c.HostUrl, id)
req, err := http.NewRequest("GET", path, nil)
if err != nil {
return nil, fmt.Errorf("error creating request: %w", err)
}
body, err := c.doRequest(req)
if err != nil {
return nil, fmt.Errorf("error performing request: %w", err)
}
var response GetResourceV1Response
if err := json.Unmarshal(body, &response); err != nil {
return nil, fmt.Errorf("error unmarshaling response: %w", err)
}
return &response.Results, nil
}