Practical Data Transformations workflow skill. Use this skill when the user needs Everyday data transformations using functional patterns - arrays, objects, grouping, aggregation, and null-safe access and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Practical Data Transformations workflow skill. Use this skill when the user needs Everyday data transformations using functional patterns - arrays, objects, grouping, aggregation, and null-safe access and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.
This public intake copy packages plugins/antigravity-awesome-skills-claude/skills/fp-data-transforms from https://github.com/sickn33/antigravity-awesome-skills into the native Omni Skills editorial shape without hiding its origin.
Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.
This intake keeps the copied upstream files intact and uses metadata.json plus ORIGIN.md as the provenance anchor for review.
Practical Data Transformations This skill covers the data transformations you do every day: working with arrays, reshaping objects, normalizing API responses, grouping data, and safely accessing nested values. Each section shows the imperative approach first, then the functional equivalent, with honest assessments of when each approach shines.
Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Table of Contents, 1. Array Operations, 2. Object Transformations, 3. Data Normalization, 4. Grouping and Aggregation, 5. Null-Safe Access.
When to Use This Skill
Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.
You need to transform arrays, objects, grouped data, or nested values in TypeScript.
The task involves reshaping API responses, null-safe access, aggregation, or normalization.
You want practical functional patterns for everyday data work instead of low-level loops.
Simple transformations: .map(), .filter(), .reduce() are perfectly good
No composition needed: You're doing a one-off transformation
Team familiarity: Everyone knows native methods
Operating Table
Situation
Start here
Why it matters
First-time use
metadata.json
Confirms repository, branch, commit, and imported path before touching the copied workflow
Provenance review
ORIGIN.md
Gives reviewers a plain-language audit trail for the imported source
Workflow execution
SKILL.md
Starts with the smallest copied file that materially changes execution
Supporting context
SKILL.md
Adds the next most relevant copied source file without loading the entire package
Handoff decision
## Related Skills
Helps the operator switch to a stronger native skill when the task drifts
Workflow
This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.
Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.
Read the overview and provenance files before loading any copied upstream support files.
Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.
Execute the upstream workflow while keeping provenance and source boundaries explicit in the working notes.
Validate the result against the upstream expectations and the evidence you can point to in the copied files.
Escalate or hand off to a related skill when the work moves out of this imported workflow's center of gravity.
Before merge or closure, record what was used, what changed, and what the reviewer still needs to verify.
Use @fp-data-transforms to handle <task>. Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.
Explanation: This is the safest starting point when the operator needs the imported workflow, but not the entire repository.
Example 2: Ask for a provenance-grounded review
Review @fp-data-transforms against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.
Explanation: Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.
Example 3: Narrow the copied support files before execution
Use @fp-data-transforms for <task>. Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.
Explanation: This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.
Example 4: Build a reviewer packet
Review @fp-data-transforms using the copied upstream files plus provenance, then summarize any gaps before merge.
Explanation: This is useful when the PR is waiting for human review and you want a repeatable audit packet.
Imported Usage Notes
Imported: 6. Real-World Examples
Example 1: Transform API Response to UI-Ready Data
Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution.
Keep the imported skill grounded in the upstream repository; do not invent steps that the source material cannot support.
Prefer the smallest useful set of support files so the workflow stays auditable and fast to review.
Keep provenance, source commit, and imported file paths visible in notes and PR descriptions.
Point directly at the copied upstream files that justify the workflow instead of relying on generic review boilerplate.
Treat generated examples as scaffolding; adapt them to the concrete task before execution.
Route to a stronger native skill when architecture, debugging, design, or security concerns become dominant.
Troubleshooting
Problem: The operator skipped the imported context and answered too generically
Symptoms: The result ignores the upstream workflow in plugins/antigravity-awesome-skills-claude/skills/fp-data-transforms, fails to mention provenance, or does not use any copied source files at all.
Solution: Re-open metadata.json, ORIGIN.md, and the most relevant copied upstream files. Load only the files that materially change the answer, then restate the provenance before continuing.
Problem: The imported workflow feels incomplete during review
Symptoms: Reviewers can see the generated SKILL.md, but they cannot quickly tell which references, examples, or scripts matter for the current task.
Solution: Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it.
Problem: The task drifted into a different specialization
Symptoms: The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better.
Solution: Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind.
Related Skills
@00-andruia-consultant-v2 - Use when the work is better handled by that native specialization after this imported skill establishes context.
@10-andruia-skill-smith-v2 - Use when the work is better handled by that native specialization after this imported skill establishes context.
@20-andruia-niche-intelligence-v2 - Use when the work is better handled by that native specialization after this imported skill establishes context.
@2d-games - Use when the work is better handled by that native specialization after this imported skill establishes context.
Additional Resources
Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding.
Resource family
What it gives the reviewer
Example path
references
copied reference notes, guides, or background material from upstream
references/n/a
examples
worked examples or reusable prompts copied from upstream
examples/n/a
scripts
upstream helper scripts that change execution or validation
scripts/n/a
agents
routing or delegation notes that are genuinely part of the imported package
agents/n/a
assets
supporting assets or schemas copied from the source package
assets/n/a
Imported Reference Notes
Imported: 1. Array Operations
Array operations are the bread and butter of data transformation. Let's replace verbose loops with expressive, chainable operations.
Map: Transform Every Element
The Task: Convert an array of prices from cents to dollars.
Why functional is better here: The intent is immediately clear. map says "transform each element." The transformation logic (toDollars) is named and reusable. No index management, no manual array building.
Filter: Keep What Matches
The Task: Get all active users from a list.
Imperative Approach
interfaceUser {
id: string;
name: string;
isActive: boolean;
}
functiongetActiveUsers(users: User[]): User[] {
constresult: User[] = [];
for (const user of users) {
if (user.isActive) {
result.push(user);
}
}
return result;
}
Why functional is better here: The predicate (isActive) is separated from the iteration logic. You can reuse, test, and compose predicates independently.
Reduce: Accumulate Into Something New
The Task: Calculate the total price of items in a cart.
Imperative Approach
interfaceCartItem {
name: string;
price: number;
quantity: number;
}
functioncalculateTotal(items: CartItem[]): number {
let total = 0;
for (const item of items) {
total += item.price * item.quantity;
}
return total;
}
Functional Approach
const calculateTotal = (items: CartItem[]): number =>
items.reduce(
(total, item) => total + item.price * item.quantity,
0
);
// Or break out the line total calculationconst lineTotal = (item: CartItem): number => item.price * item.quantity;
const calculateTotal = (items: CartItem[]): number =>
items.map(lineTotal).reduce((a, b) => a + b, 0);
Honest assessment: For simple sums, the imperative loop is actually quite readable. The functional version shines when you need to compose the accumulation with other transformations, or when the reduction logic is complex enough to benefit from being named.
Chaining: Combine Operations
The Task: Get the names of all active premium users, sorted alphabetically.
Imperative Approach
interfaceUser {
id: string;
name: string;
isActive: boolean;
tier: 'free' | 'premium';
}
functiongetActivePremiumNames(users: User[]): string[] {
constresult: string[] = [];
for (const user of users) {
if (user.isActive && user.tier === 'premium') {
result.push(user.name);
}
}
result.sort((a, b) => a.localeCompare(b));
return result;
}
Why functional is better here: Each step in the chain has a single responsibility. You can read the transformation as a series of steps: "filter active, filter premium, get names, sort." Adding or removing a step is trivial.
Using fp-ts Array Module
fp-ts provides additional array utilities with better composition support:
import * as A from'fp-ts/Array';
import * as O from'fp-ts/Option';
import { pipe } from'fp-ts/function';
// Safe head (first element)const first = pipe(
[1, 2, 3],
A.head
); // Some(1)const firstOfEmpty = pipe(
[] asnumber[],
A.head
); // None// Safe lookup by indexconst third = pipe(
['a', 'b', 'c', 'd'],
A.lookup(2)
); // Some('c')// Find with predicateconst found = pipe(
users,
A.findFirst(user => user.id === 'abc123')
); // Option<User>// Partition into two groupsconst [inactive, active] = pipe(
users,
A.partition(user => user.isActive)
);
// Take first N elementsconst topThree = pipe(
sortedScores,
A.takeLeft(3)
);
// Unique valuesconst uniqueTags = pipe(
allTags,
A.uniq({ equals: (a, b) => a === b })
);
Imported: 2. Object Transformations
Objects need reshaping constantly: picking fields, omitting sensitive data, merging settings, and updating nested values.
Pick: Select Specific Fields
The Task: Extract only the public fields from a user object.
Honest assessment: For one-off omits, destructuring (the imperative approach) is perfectly fine and very readable. The functional omit utility pays off when you have many such transformations or need to compose them.
Why functional is better here: Spread syntax is concise and handles any number of keys. Later spreads override earlier ones, giving you natural "defaults with overrides" behavior.
Honest assessment: The spread nesting is verbose but explicit. For deeply nested updates, consider using a library like immer or fp-ts lenses. The verbosity of the functional approach is the price of immutability.
Imported: 3. Data Normalization
API responses rarely match the shape your app needs. Normalization transforms nested, denormalized data into flat, indexed structures.
API Response to App State
The Task: Transform a nested API response into a normalized state.
Why functional is better here: Each extraction is independent and testable. The createNormalizedCollection helper is reusable. Adding a new entity type means adding one new extraction function.
Transform API Response to UI-Ready Data
The Task: Convert API data to what your components need.
// API gives you thisinterfaceApiUser {
user_id: string;
first_name: string;
last_name: string;
email_address: string;
created_at: string; // ISO stringavatar_url: string | null;
}
// Components need thisinterfaceDisplayUser {
id: string;
fullName: string;
email: string;
memberSince: string; // "Jan 2024"avatarUrl: string; // With fallback
}
Honest assessment: For simple access patterns, optional chaining (?.) is perfect. It's built into the language and very readable. Use fp-ts Option when you need to compose operations on potentially missing values.
When to Use Option Instead
Use fp-ts Option when:
You need to chain multiple operations on potentially missing values
You want to distinguish "missing" from other falsy values
You're building a pipeline of transformations
import * as O from'fp-ts/Option';
import { pipe } from'fp-ts/function';
// Safe property access that returns Optionconst prop = <T, K extends keyof T>(key: K) =>
(obj: T | null | undefined): O.Option<T[K]> =>
obj != null && key in obj
? O.some(obj[key] as T[K])
: O.none;
// Chain accesses with flatMapconst getDatabaseHost = (config: Config): O.Option<string> =>
pipe(
O.some(config),
O.flatMap(prop('database')),
O.flatMap(prop('connection')),
O.flatMap(prop('host'))
);
// Extract with defaultconst host = pipe(
getDatabaseHost(config),
O.getOrElse(() =>'localhost')
);
Safe Array Access
import * as A from'fp-ts/Array';
import * as O from'fp-ts/Option';
import { pipe } from'fp-ts/function';
// Imperative: throws if array is emptyconst first = items[0]; // Could be undefined!// Safe: returns Optionconst first = A.head(items); // Option<Item>// Get first item's name, or defaultconst firstName = pipe(
items,
A.head,
O.map(item => item.name),
O.getOrElse(() =>'No items')
);
// Safe lookup by indexconst third = pipe(
items,
A.lookup(2),
O.map(item => item.name),
O.getOrElse(() =>'Not found')
);
Safe Record/Dictionary Access
import * as R from'fp-ts/Record';
import * as O from'fp-ts/Option';
import { pipe } from'fp-ts/function';
constusers: Record<string, User> = {
'user-1': { name: 'Alice', email: 'alice@example.com' },
'user-2': { name: 'Bob', email: 'bob@example.com' },
};
// Imperative: could be undefinedconst user = users['user-3']; // User | undefined// Safe: returns Optionconst user = R.lookup('user-3')(users); // Option<User>// Get user email or defaultconst email = pipe(
users,
R.lookup('user-3'),
O.map(u => u.email),
O.getOrElse(() =>'unknown@example.com')
);
Combining Multiple Optional Values
The Task: Get a user's display name, which requires both first and last name.
interfaceProfile {
firstName?: string;
lastName?: string;
nickname?: string;
}
// ImperativefunctiongetDisplayName(profile: Profile): string {
if (profile.firstName && profile.lastName) {
return`${profile.firstName}${profile.lastName}`;
}
if (profile.nickname) {
return profile.nickname;
}
return'Anonymous';
}
// Functional with Optionimport * as O from'fp-ts/Option';
import { pipe } from'fp-ts/function';
const getDisplayName = (profile: Profile): string =>pipe(
// Try full name first
O.Do,
O.bind('first', () => O.fromNullable(profile.firstName)),
O.bind('last', () => O.fromNullable(profile.lastName)),
O.map(({ first, last }) =>`${first}${last}`),
// Fall back to nickname
O.alt(() => O.fromNullable(profile.nickname)),
// Finally, default to Anonymous
O.getOrElse(() =>'Anonymous')
);
Imported: Limitations
Use this skill only when the task clearly matches the scope described above.
Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.