fp-go-pr-review

Reviews pull requests for fp-go v2 code against functional programming conventions and best practices.

2.0k|83|Updated Jul 5, 2023
One-click install
npx skills add https://github.com/IBM/fp-go --skill fp-go-pr-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fp-go-pr-review
Source: https://github.com/IBM/fp-go/tree/main/gen/v2/data/skills/fp-go-pr-review
Command: npx skills add https://github.com/IBM/fp-go --skill fp-go-pr-review

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reviewing Go pull requests that use the fp-go library requires deep knowledge of functional programming conventions like data-last composition, point-free style, and monad selection. This Skill automates that review by checking changes against 16 concrete fp-go rules and producing a structured, severity-ranked report.

Core Features & Use Cases

  • Convention Validation: Checks v2 import paths, data-last argument order, IO laziness (trailing ()), Result-over-Either usage, lens-based do-notation, Bind vs ApS semantics, and TraverseArray patterns.
  • Severity-Ranked Findings: Classifies issues as Critical, High, Medium, or Low and posts review summaries or inline annotations to GitHub PRs via gh CLI.
  • Use Case: A teammate opens a PR using github.com/IBM/fp-go/v2. Run this Skill to get the diff, verify the branch compiles with go build and go vet, detect a missing IO execution and an inline lambda that should be point-free, then post a structured review comment.

Quick Start

Review the current pull request branch for fp-go v2 best practices and post a severity-ranked summary comment on the GitHub PR.

Frequently Asked Questions about fp-go-pr-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review a pull request that uses fp-go?

Check out the PR branch, run git diff main...HEAD to get changes, then validate against fp-go rules: v2 import paths, data-last composition, point-free style, and proper monad usage. Confirm the branch compiles with go build and go vet before reviewing style.

What is the difference between fp-go v1 and v2 imports?

fp-go v2 uses the import path github.com/IBM/fp-go/v2/... and requires Go 1.24+ for generic type alias support. V1 and v2 are incompatible, so mixing import paths causes compilation errors and is flagged as a Critical issue.

When should I use Result instead of Either in fp-go?

Use Result[A] when the error type is Go's standard error, since Result is defined as Either[error, A] and is more idiomatic. Reserve Either for custom error types like ValidationError where the left side carries domain-specific information.

Why does my fp-go IO code not execute?

IO values in fp-go are lazy functions, so IO[A] is func() A and must be called with trailing parentheses to execute. For ReaderIOResult, you need both the context argument and an extra call: pipeline(ctx)().

When should I use Bind versus ApS in fp-go do-notation?

Use Bind when a step depends on accumulated state from previous steps, and ApS when steps are independent of each other. Using Bind for independent steps obscures intent, while ApS makes the independence explicit.

What are the limitations of automated fp-go PR review?

The review checks stylistic and structural conventions but cannot verify business logic correctness or runtime behavior. It relies on the branch compiling first, and findings still require human judgment for context-specific design decisions.