kieranklaassen

Structify — AI skill for Claude Code

AI community

An opinionated Rails DSL for defining extraction schemas for LLM-powered models in Rails and ActiveRecord.

How to install Structify

This entry records only its repository, not the path inside it, so there is no exact command to give. Open kieranklaassen/structify and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Structify does

An opinionated Rails DSL for defining extraction schemas for LLM-powered models in Rails and ActiveRecord.

Alternatives in AI

  • Deepreasoning — A high-performance LLM inference API and Chat UI that integrates DeepSeek R1's CoT reasoning traces with Anthr 5.4k ★
  • Manifest — Real-time cost observability for OpenClaw agents — track tokens, costs, messages, and model usage 4.1k ★
  • Opengap — A framework-agnostic, git-native standard for defining AI agents 2.9k ★

README

Structify

[![Gem Version](https://badge.fury.io/rb/structify.svg)](https://badge.fury.io/rb/structify) [![CI](https://github.com/kieranklaassen/structify/actions/workflows/ci.yml/badge.svg)](https://github.com/kieranklaassen/structify/actions/workflows/ci.yml)

A Ruby gem for extracting structured data from content using LLMs in Rails applications

What is Structify?

Structify helps you extract structured data from unstructured content in your Rails apps:

  • Define extraction schemas directly in your ActiveRecord models
  • Generate JSON schemas to use with OpenAI, Anthropic, or other LLM providers
  • Store and validate extracted data with ActiveRecord validations
  • Access structured data through typed model attributes with full validation support

Use Cases

  • Extract metadata, topics, and sentiment from articles or blog posts
  • Pull structured information from user-generated content
  • Organize unstructured feedback or reviews into categorized data
  • Convert emails or messages into actionable, structured formats
  • Extract entities and relationships from documents
# 1. Define extraction schema in your model
class Article < ApplicationRecord
  include Structify::Model

  schema_definition do
    field :title, :string
    field :summary, :text
    field :category, :string, enum: ["tech", "business", "science"]
    field :topics, :array, items: { type: "string" }
  end
end

# 2. Get schema for your LLM API
schema = Article.json_schema

# 3. Store LLM response in your model
article = Article.find(123)
article.update(llm_response)

# 4. Access extracted data
article.title    # => "AI Advances in 2023"
article.summary  # => "Recent developments in artificial intelligence..."
article.topics   # => ["machine learning", "neural networks", "computer vision"]

Install

# Add to Gemfile
gem 'structify'

Then:

bundle install

Database Setup

Add a JSON column to store extracted data:

add_column :articles,