Pragmatic Functional Programming workflow skill. Use this skill when the user needs A practical, jargon-free guide to fp-ts functional programming - the 80/20 approach that gets results without the academic overhead. Use when writing TypeScript with fp-ts library and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.
Pragmatic Functional Programming workflow skill. Use this skill when the user needs A practical, jargon-free guide to fp-ts functional programming - the 80/20 approach that gets results without the academic overhead. Use when writing TypeScript with fp-ts library 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/skills/fp-ts-pragmatic 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 the external_source block in metadata.json plus ORIGIN.md as the provenance anchor for review.
Pragmatic Functional Programming Read this first. This guide cuts through the academic jargon and shows you what actually matters. No category theory. No abstract nonsense. Just patterns that make your code better.
Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: The 80/20 of FP, Quick Wins: Easy Changes That Improve Code Today, Common Refactors: Before and After, Cheat Sheet, Limitations.
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.
When starting with fp-ts and need practical guidance
When writing TypeScript code that handles nullable values, errors, or async operations
When you want cleaner, more maintainable functional code without the academic overhead
When refactoring imperative code to functional style
TaskEither - Async operations that can fail (replaces Promise + try/catch)
Validation - Collect ALL errors instead of stopping at first
Operating Table
Situation
Start here
Why it matters
First-time use
metadata.json
Confirms repository, branch, commit, and imported path through the external_source block 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.
Imported Workflow Notes
Imported: Summary
Use pipe for 3+ operations
Use Option for nullable chains
Use Either for operations that can fail
Use map to transform wrapped values
Use flatMap to chain operations that might fail
Skip FP when it hurts readability
Keep it simple - if your team can't read it, it's not good code
Imported: The 80/20 of FP
These five patterns give you most of the benefits. Master these before exploring anything else.
1. Pipe: Chain Operations Clearly
Instead of nesting function calls or creating intermediate variables, chain operations in reading order.
import { pipe } from'fp-ts/function'// Before: Hard to read (inside-out)const result = format(validate(parse(input)))
// Before: Too many variablesconst parsed = parse(input)
const validated = validate(parsed)
const result = format(validated)
// After: Clear, linear flowconst result = pipe(
input,
parse,
validate,
format
)
When to use pipe:
3+ transformations on the same data
You find yourself naming throwaway variables
Logic reads better top-to-bottom
When to skip pipe:
Just 1-2 operations (direct call is fine)
The operations don't naturally chain
2. Option: Handle Missing Values Without null Checks
Stop writing if (x !== null && x !== undefined) everywhere.
import * as O from'fp-ts/Option'import { pipe } from'fp-ts/function'// Before: Defensive null checkingfunctiongetUserCity(user: User | null): string {
if (user === null) return'Unknown'if (user.address === null) return'Unknown'if (user.address.city === null) return'Unknown'return user.address.city
}
// After: Chain through potential missing valuesconst getUserCity = (user: User | null): string =>pipe(
O.fromNullable(user),
O.flatMap(u => O.fromNullable(u.address)),
O.flatMap(a => O.fromNullable(a.city)),
O.getOrElse(() =>'Unknown')
)
Plain language translation:
O.fromNullable(x) = "wrap this value, treating null/undefined as 'nothing'"
O.flatMap(fn) = "if we have something, apply this function"
O.getOrElse(() => default) = "unwrap, or use this default if nothing"
3. Either: Make Errors Explicit
Stop throwing exceptions for expected failures. Return errors as values.
import * as E from'fp-ts/Either'import { pipe } from'fp-ts/function'// Before: Hidden failure modefunctionparseAge(input: string): number {
const age = parseInt(input, 10)
if (isNaN(age)) thrownewError('Invalid age')
if (age < 0) thrownewError('Age cannot be negative')
return age
}
// After: Errors are visible in the typefunctionparseAge(input: string): E.Either<string, number> {
const age = parseInt(input, 10)
if (isNaN(age)) return E.left('Invalid age')
if (age < 0) return E.left('Age cannot be negative')
return E.right(age)
}
// Using itconst result = parseAge(userInput)
if (E.isRight(result)) {
console.log(`Age is ${result.right}`)
} else {
console.log(`Error: ${result.left}`)
}
Plain language translation:
E.right(value) = "success with this value"
E.left(error) = "failure with this error"
E.isRight(x) = "did it succeed?"
4. Map: Transform Without Unpacking
Transform values inside containers without extracting them first.
import * as O from'fp-ts/Option'import * as E from'fp-ts/Either'import * as A from'fp-ts/Array'import { pipe } from'fp-ts/function'// Transform inside OptionconstmaybeUser: O.Option<User> = O.some({ name: 'Alice', age: 30 })
constmaybeName: O.Option<string> = pipe(
maybeUser,
O.map(user => user.name)
)
// Transform inside Eitherconstresult: E.Either<Error, number> = E.right(5)
constdoubled: E.Either<Error, number> = pipe(
result,
E.map(n => n * 2)
)
// Transform arrays (same concept!)const numbers = [1, 2, 3]
const doubled = pipe(
numbers,
A.map(n => n * 2)
)
5. FlatMap: Chain Operations That Might Fail
When each step might fail, chain them together.
import * as E from'fp-ts/Either'import { pipe } from'fp-ts/function'const parseJSON = (s: string): E.Either<string, unknown> =>
E.tryCatch(() =>JSON.parse(s), () =>'Invalid JSON')
const extractEmail = (data: unknown): E.Either<string, string> => {
if (typeof data === 'object' && data !== null && 'email'in data) {
return E.right((data as { email: string }).email)
}
return E.left('No email field')
}
const validateEmail = (email: string): E.Either<string, string> =>
email.includes('@') ? E.right(email) : E.left('Invalid email format')
// Chain all steps - if any fails, the whole thing failsconst getValidEmail = (input: string): E.Either<string, string> =>
pipe(
parseJSON(input),
E.flatMap(extractEmail),
E.flatMap(validateEmail)
)
// Success path: Right('user@example.com')// Any failure: Left('specific error message')
Plain language:flatMap means "if this succeeded, try the next thing"
Examples
Example 1: Ask for the upstream workflow directly
Use @fp-ts-pragmatic-v2 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-ts-pragmatic-v2 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-ts-pragmatic-v2 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-ts-pragmatic-v2 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.
Best Practices
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.
If functional programming makes your code harder to read, don't use it.
FP is a tool, not a religion.
Skip it when it doesn't.
--- Before using any FP pattern, ask: "Would a junior developer understand this?" ### Too Clever (Avoid) typescript const result = pipe( data, A.filter(flow(prop('status'), equals('active'))), A.map(flow(prop('value'), multiply(2))), A.reduce(monoid.concat, monoid.empty), O.fromPredicate(gt(threshold)) ) ### Just Right (Prefer) typescript const activeItems = data.filter(item => item.status === 'active') const doubledValues = activeItems.map(item => item.value 2) const total = doubledValues.reduce((sum, val) => sum + val, 0) const result = total > threshold ?
O.some(total) : O.none ### The Middle Ground (Often Best) typescript const result = pipe( data, A.filter(item => item.status === 'active'), A.map(item => item.value 2), A.reduce(0, (sum, val) => sum + val), total => total > threshold ?
O.some(total) : O.none ) `` ---
Keep the imported skill grounded in the upstream repository; do not invent steps that the source material cannot support.
Imported Operating Notes
Imported: The Golden Rule
If functional programming makes your code harder to read, don't use it.
FP is a tool, not a religion. Use it when it helps. Skip it when it doesn't.
Imported: The Readability Rule
Before using any FP pattern, ask: "Would a junior developer understand this?"
const activeItems = data.filter(item => item.status === 'active')
const doubledValues = activeItems.map(item => item.value * 2)
const total = doubledValues.reduce((sum, val) => sum + val, 0)
const result = total > threshold ? O.some(total) : O.none
The Middle Ground (Often Best)
const result = pipe(
data,
A.filter(item => item.status === 'active'),
A.map(item => item.value * 2),
A.reduce(0, (sum, val) => sum + val),
total => total > threshold ? O.some(total) : O.none
)
Troubleshooting
Problem: The operator skipped the imported context and answered too generically
Symptoms: The result ignores the upstream workflow in plugins/antigravity-awesome-skills/skills/fp-ts-pragmatic, 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. Check the external_source block first, 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 - Use when the work is better handled by that native specialization after this imported skill establishes context.
@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 - 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.
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: Quick Wins: Easy Changes That Improve Code Today