원클릭으로
new-data-function
Create a new function in the data/ package following project conventions
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Create a new function in the data/ package following project conventions
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Prepare and cut TFx semver releases (CHANGELOG, validation, tagging via Taskfile). Use when the user asks to prepare a release, update CHANGELOG for a new version, cut vX.Y.Z, run release:patch/minor/major, or avoid post-merge release failures.
Upgrade macOS Go and all module dependencies in TFx via task go:upgrade, then verify build and tests. Use when the user asks to upgrade Go, update dependencies, bump go.mod, or refresh packages.
Create a VHS .tape file for recording terminal GIF/MP4/WebM demos. Use when the user wants to create a .tape file for VHS terminal recordings.
This skill should be used when the user says "reflection", "reflect on the changes", "reflect on this session", or asks to capture lessons learned from the current conversation.
SOC 직업 분류 기준
| name | new-data-function |
| description | Create a new function in the data/ package following project conventions |
The data/ package is the sole boundary between TFx and the go-tfe SDK. All TFE/HCP Terraform API calls happen exclusively here. No other package should import go-tfe for API calls. This isolation makes the codebase easier to test and maintain.
client/pagination.goUse client.FetchAll[T]() for all paginated list operations. Never write manual pagination loops. Use client.NewPaginationFromTFE() to convert go-tfe pagination. PageSize should always be 100.
Canonical example — data/projects.go:FetchProjects():
func FetchThings(c *client.TfxClient, orgName string) ([]*tfe.Thing, error) {
return client.FetchAll(c.Context, func(pageNumber int) ([]*tfe.Thing, *client.Pagination, error) {
opts := &tfe.ThingListOptions{
ListOptions: tfe.ListOptions{PageNumber: pageNumber, PageSize: 100},
}
result, err := c.Client.Things.List(c.Context, orgName, opts)
if err != nil {
return nil, nil, err
}
return result.Items, client.NewPaginationFromTFE(result.Pagination), nil
})
}
| Pattern | Purpose | Example |
|---|---|---|
Fetch* (plural) | Paginated list returning slice | FetchProjects, FetchWorkspaces |
Fetch* (singular) | Read single item by ID | FetchProject, FetchRun |
Fetch*ByName | Search + exact match by name | FetchProjectByName |
Get*ID | Resolve name to ID | GetWorkspaceID |
Create* / Update* / Delete* | State-changing operations | CreateVariable, DeleteVariable |
List* | List with optional maxItems limit | ListRegistryModules |
c *client.TfxClient[]*tfe.Project)cmd/views/ to avoid import cycles (see cmd/views/run_policy.go:RunPolicyResult, cmd/views/admin_metrics.go:MetricsWorkspace)When go-tfe doesn't expose a needed field, use a direct HTTP call via c.Hostname and c.Token. See fetchEvaluationOutputs() in data/policy_checks.go for the pattern. Always add a comment explaining why the raw call is necessary.
Use output.Get().Logger() with structured key-value pairs:
Debug — function entry/exit with parametersTrace — per-page pagination detailsError — failures with full contextInfo — completion summaries with countsgithub.com/pkg/errors — wrap with context: errors.Wrap(err, "message")errors.Errorf() for custom "not found" messageslog.Error + continue for individual item failures (don't fail the whole batch)data/projects.go, data/workspaces.goprojects.go, variables.godata/projects_integration_test.go// Copyright (c) Tom Straub (github.com/straubt1) 2025
// SPDX-License-Identifier: MIT
data/projects.go — FetchProjects()data/runs.go — FetchRun()data/projects.go — FetchProjectByName()data/variables.go — CreateVariable(), UpdateVariable(), DeleteVariable()data/policy_checks.go — FetchRunPolicyDetails()data/policy_checks.go — fetchEvaluationOutputs()Create the data layer function for: $ARGUMENTS
Follow all conventions above. Use data/projects.go as your primary reference.