# targetfy

> Convert R script sequences into verified, reproducible {targets} pipelines with automated equivalence checking.

targetfy is a free AI agent skill pack (several skills in one listing) on Agensi by Athos Damiani, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Athos Damiani](https://www.agensi.io/creators/athosdamiani)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 1.0
- Last updated: 2026-11-22
- Security: scan passed (2026-11-22); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/targetfy
- Tags: llm-ops, automation, research, r-stats, reproducible-research, data-science, targets, dag

## About this skill

Managing R scripts for long-running analyses often leads to broken dependencies and redundant re-computation. This skill converts linear R scripts into reproducible `{targets}` pipelines, automating the transition to a formal Directed Acyclic Graph (DAG) architecture.

### What it does
- **Script Conversion** transforms sequential `.R` files into a modular `{targets}` pipeline including `_targets.R` and supporting functions.
- **Equivalence Verification** runs a side-by-side comparison of the original script and the new pipeline in a sandbox to ensure identical output.
- **Dependency Mapping** identifies input files, written outputs, and handoff objects between scripts to define target relationships.
- **Static Analysis** validates pipeline syntax and package requirements without executing the code.
- **Pipeline Visualization** generates interactive dependency graphs using `tar_glimpse` to inspect the workflow structure.

### How it works
1. **Preflight** scans the R environment and script sequence to identify required packages and define generated file names.
2. **Analysis** reads the source code to extract steps, unresolved objects, and file paths.
3. **Synthesis** generates the functions folder and the main pipeline script according to modern `{targets}` patterns.
4. **Validation** performs either an Equivalence Check (execution-based) or a Static Check (parsing-based) to ensure correctness.

### Frameworks & tools
Built for the R ecosystem using `{targets}`, `{tarchetypes}`, `{callr}`, and `{jsonlite}`. It supports standard R scripts and project structures utilizing `renv` or `.Rproj` files.

### Why this beats prompting it yourself
Manual conversion often misses subtle object handoffs or fails to track external file dependencies correctly. This skill uses specialized R scripts to verify that the resulting pipeline produces byte-identical results to your original code.

### Use cases
- Migrating a legacy "run all" R script into a cacheable production pipeline.
- Modularizing monolithic analysis scripts into discrete, testable R functions.
- Setting up parallel execution for independent analysis branches.
- Adding automated file tracking to existing data processing workflows.

### Known limitations
Does not support `.Rmd`, `.qmd`, or `.ipynb` source files yet. It is not suitable for non-linear analyses like Shiny apps or R package source code.

## Requires

- R 4.1+
- targets 1.12+
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the targetfy skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific problem does targetfy solve for R users?

This skill automates the migration of linear R scripts into the {targets} framework, solving the common problem of broken dependencies and redundant re-computations in long-running data analyses.

### How can I be sure the converted pipeline produces the same results as my original script?

Yes, it uses a sandbox environment to run a side-by-side comparison between your original script and the new pipeline, ensuring the final output is byte-identical.

### Can I use targetfy to convert Quarto or R Markdown files?

This skill is designed for standard .R files and R project structures; however, it does not currently support .Rmd, .qmd, or Jupyter Notebook files.

### Does the skill handle package dependencies and environment management during conversion?

The skill performs static analysis to identify all necessary packages and supports environments utilizing renv or .Rproj files for seamless integration.

### What is included in the targetfy skill purchase?

You receive the core conversion engine, a suite of verification tools for equivalence checking, and documentation for integrating the skill into your existing AI agent workflow.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
