Fp learn
Use when asked to assimilate or learn the FP libraries present in a project so enforcement and repair understand their operators and types.From its SKILL.md
npx -y skills add theocarranza/fp-enforcer --skill fp-learnAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
1.9 KB, as published. Nobody here has run it
FP Learn
Detect functional-programming libraries in a project and generate agent-facing knowledge profiles for enforcement and repair.
Run the learn CLI
fp-enforcer learn --dest /path/to/project
The tool inspects pubspec.yaml and package.json for known FP libraries:
- Dart: dartz, fpdart, rxdart
- TypeScript: fp-ts, effect, rxjs
Profiles are written to:
<project>/.fp-enforcer/knowledge/
Review each generated profile before relying on it in repair or code generation.
Review generated profiles
Each profile summarizes:
- Types — core ADTs and their roles (e.g.
Either,Option,Task,IO) - Operators — key combinators (
flatMap,fold,mapLeft, etc.) - Composition idioms — canonical chains for common patterns
- Do/Don't — library-specific constraints aligned with the canonical rules
Use these profiles when interpreting validation reports or rewriting violating code.
Unknown libraries
When a project uses an FP library the tool does not detect, author a profile manually under .fp-enforcer/knowledge/<library>.md with the same sections:
- Types
- Operators
- Composition idioms
- Do/Don't
Keep profiles concise and aligned with the rules in .fp-enforcer/rules/.
Extending pattern packs
When a new library introduces constructs that should be banned or flagged, add entries to the appropriate pattern pack:
<project>/.fp-enforcer/rules/patterns/<language>.json
Each pattern entry requires:
{"id": "unique-id", "regex": "...", "message": "...", "rule": "fp-* N"}
Re-run validate after adding patterns to confirm they match intended constructs and avoid excessive false positives.