Agent skill

New Data Function

by straubt1 in straubt1/tfx

Create a new function in the data/ package following project conventions

MITAuto-check passed

Install New Data Function

skills CLI
$ npx skills add straubt1/tfx --skill new-data-function -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install straubt1/tfx new-data-function --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/straubt1/tfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/new-data-function .claude/skills/new-data-function && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
new-data-function
GitHub stars
110
Token cost
~976 tokens
SKILL.md length
324 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Create a new function in the data/ package following project conventions

  • SKILL.md covers Pagination — Always use…, Function Naming, Function Signature and SDK Gaps — Direct HTTP Calls, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

New Data Function is an agent skill from straubt1/tfx. Create a new function in the data/ package following project conventions

Its SKILL.md is about 980 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: TFx is a standalone CLI for HCP Terraform and Terraform Enterprise. The licence is MIT.

Example prompts

  • “/new-data-function”

What it can do on your machine

Read from SKILL.md and the folder at commit f7494e5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

New Data Function loads about 976 tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 324 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~976

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from straubt1/tfx at commit f7494e5, republished under its MIT licence (© straubt1). 324 words, ~976 tokens.

Download SKILL.mdSave it as .claude/skills/new-data-function/SKILL.md (or your agent's skills folder).
name
new-data-function
description
Create a new function in the data/ package following project conventions

Data Layer 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.

Pagination — Always use client/pagination.go

Use 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():

go
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
    })
}

Function Naming

PatternPurposeExample
Fetch* (plural)Paginated list returning sliceFetchProjects, FetchWorkspaces
Fetch* (singular)Read single item by IDFetchProject, FetchRun
Fetch*ByNameSearch + exact match by nameFetchProjectByName
Get*IDResolve name to IDGetWorkspaceID
Create* / Update* / Delete*State-changing operationsCreateVariable, DeleteVariable
List*List with optional maxItems limitListRegistryModules

Function Signature

  • First parameter is always c *client.TfxClient
  • Return go-tfe types when possible (e.g., []*tfe.Project)
  • When aggregating across multiple API calls, define custom result types in cmd/views/ to avoid import cycles (see cmd/views/run_policy.go:RunPolicyResult, cmd/views/admin_metrics.go:MetricsWorkspace)

SDK Gaps — Direct HTTP Calls

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.

Logging

Use output.Get().Logger() with structured key-value pairs:

  • Debug — function entry/exit with parameters
  • Trace — per-page pagination details
  • Error — failures with full context
  • Info — completion summaries with counts

Error Handling

  • Use github.com/pkg/errors — wrap with context: errors.Wrap(err, "message")
  • Use errors.Errorf() for custom "not found" messages
  • In multi-item loops, log.Error + continue for individual item failures (don't fail the whole batch)

File Organization

  • One file per resource: data/projects.go, data/workspaces.go
  • File names use plural: projects.go, variables.go
  • Integration tests co-located: data/projects_integration_test.go

File Header

go
// Copyright (c) Tom Straub (github.com/straubt1) 2025
// SPDX-License-Identifier: MIT

Reference Implementations

  • List with pagination: data/projects.go — FetchProjects()
  • Single read: data/runs.go — FetchRun()
  • Read by name: data/projects.go — FetchProjectByName()
  • Create/Update/Delete: data/variables.go — CreateVariable(), UpdateVariable(), DeleteVariable()
  • Complex aggregation with custom types: data/policy_checks.go — FetchRunPolicyDetails()
  • Direct HTTP for SDK gaps: data/policy_checks.go — fetchEvaluationOutputs()

Task

Create the data layer function for: $ARGUMENTS

Follow all conventions above. Use data/projects.go as your primary reference.

© straubt1, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/new-data-function of straubt1/tfx.

Open the folder on GitHubat commit f7494e5

Compare with similar skills

New Data Function next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

New Data Function compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
New Data Function this skillstraubt1/tfx110—~976Automated safety check: PassMIT
Form Follows Function As Axiomhashgraph-online/awesome-codex-plugins1.2k—~765Automated safety check: PassApache-2.0
Ecc Conventionsaffaan-m/ECC275k—~2.8kAutomated safety check: PassMIT
Conventional CommitJanDeDobbeleer/oh-my-posh24k—~1.2kAutomated safety check: NotesMIT
Conventional Branchgithub/awesome-copilot40k—~1.1kAutomated safety check: PassMIT
Form Follows Functionhashgraph-online/awesome-codex-plugins1.2k—~3.3kAutomated safety check: PassApache-2.0

Similar skills

  • Form Follows Function As Axiom

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when applying the descriptive form-follows-function interpretation — functional clarity as a source of aesthetic quality.

    1.2k GitHub stars~765 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Ecc Conventions

    affaan-m/ECC

    Development conventions and patterns for ECC. An agent skill from affaan-m/ECC.

    275k GitHub stars~2.8k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Conventional Commit

    JanDeDobbeleer/oh-my-posh

    Workflow for generating conventional commit messages following the Conventional Commits specification.

    24k GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check: notes
  • Conventional Branch

    github/awesome-copilot

    Official

    Create Git branches following the Conventional Branch specification (feature/, bugfix/, hotfix/, release/, chore/).

    40k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Form Follows Function

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when designing the visual or aesthetic layer of a product, deciding between expressive style and functional restraint, evaluating decorative elements, or arguing about…

    1.2k GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Naming Conventions

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing stylesheets, component styles, and responsive behavior related to Use consistent CSS naming conventions.

    74k GitHub stars~481 tokensUpdated yesterday
    Frontend & DesignAuto-check passed

More from straubt1/tfx

  • Go Upgrade

    straubt1/tfx

    Upgrade macOS Go and all module dependencies in TFx via task go:upgrade, then verify build and tests.

    110 GitHub stars~914 tokensUpdated 1 mo ago
    Auto-check: notes
  • Reflection

    straubt1/tfx

    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.

    110 GitHub stars~793 tokensUpdated 1 mo ago
    Auto-check passed
  • Release

    straubt1/tfx

    Prepare and cut TFx semver releases (CHANGELOG, validation, tagging via Taskfile).

    110 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Vhs Tape

    straubt1/tfx

    Create a VHS .tape file for recording terminal GIF/MP4/WebM demos.

    110 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed

Questions about New Data Function

What does New Data Function do?

Create a new function in the data/ package following project conventions. New Data Function is an agent skill from straubt1/tfx.

How do I install New Data Function in Claude Code?

Run `npx skills add straubt1/tfx --skill new-data-function -a claude-code`. Or copy the skill folder (.claude/skills/new-data-function in straubt1/tfx) into .claude/skills/new-data-function in your project. Claude Code loads it when a task matches its description.

How do I install New Data Function in Codex?

Run `npx skills add straubt1/tfx --skill new-data-function -a codex`. Or copy the skill folder (.claude/skills/new-data-function in straubt1/tfx) into .agents/skills/new-data-function in your project. Codex loads it when a task matches its description.

Can I use New Data Function in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add straubt1/tfx --skill new-data-function -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/new-data-function, .gemini/skills/new-data-function, .github/skills/new-data-function and .opencode/skills/new-data-function in your project.

What does New Data Function need to run?

SKILL.md names no scripts, command-line tools or credentials: New Data Function is instructions for the agent only.

Does New Data Function access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is New Data Function safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does New Data Function use?

New Data Function is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does New Data Function use?

About 976 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to New Data Function?

Skills that share tags, products or a category with New Data Function: Form Follows Function As Axiom (hashgraph-online/awesome-codex-plugins, 1.2k stars), Ecc Conventions (affaan-m/ECC, 275k stars), Conventional Commit (JanDeDobbeleer/oh-my-posh, 24k stars) and Conventional Branch (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains New Data Function?

straubt1 (a GitHub user) maintains it in straubt1/tfx, which has 110 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on August 28, 2026.

Source: straubt1/tfx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.