Rafael Reis
  • Projects
  • Stack
  • About
  • Notes

Language

  • PortuguêsPT
  • English
  • EspañolES
Contact
  • Projects
  • Stack
  • About
  • Notes
Contact
  • Português
  • English
  • Español

// Let's talk?

Reach out to exchange ideas and share experiences. It'll be a pleasure to talk with you!

Click to copyTap to copy · or open your mail app

Sections

  • Projects
  • Stack
  • About
  • Notes
  • Contact

Elsewhere

  • LinkedIn
  • GitHub
  • WhatsApp

Language

  • Português
  • English
  • Español

Local time · São Paulo

--:--GMT−3

© Rafael Reis·404 page

rReis
Back to projects

// Project

Codsy

A spell checker for a company's know-how: business rules become versioned, reviewed and tested files that people and AI agents can both read.

  • TypeScript
  • Node.js
  • React + Ink
  • Vitest
  • LLM APIs
View live site
Company
Personal project
Role
AI Engineering & UI Design
Team
Solo project
Codsy
  • 200123456789012345678901234567890123456789

    quality rules, each one documented

  • 401234567890123456789

    ready-to-use templates

  • 301234567890123456789

    ways to run evals with an LLM

  • 450123456789012345678901234567890123456789

    test files in the tool itself

// On this page

  1. 01TL;DR
  2. 02Context
  3. 03Problem
  4. 04How we measured success
  5. 05Process
  6. 06Solution
  7. 07Trade-offs
  8. 08Results
  9. 09Learnings
On this page
  1. 01TL;DR
  2. 02Context
  3. 03Problem
  4. 04How we measured success
  5. 05Process
  6. 06Solution
  7. 07Trade-offs
  8. 08Results
  9. 09Learnings
// 01

TL;DR

  • Problem01

    Companies are putting AI agents to work on operational tasks, but the rules those agents follow are vague, ownerless, without history and untested. An agent reading a vague rule guesses, and every run can guess differently.

  • What I did02

    A methodology and an open source CLI that treat operational knowledge as code: rules live in text files, go through a linter with 20 rules, get reviewed in a pull request and are tested against real cases with LLMs.

  • Result03

    @codsy/cli v1.0.0 shipped with 4 templates, evals with any LLM provider, a GitHub Action that comments on the PR and publishes SARIF, and 45 test files.

// 02

Context

Codsy is a personal, open source project (Apache-2.0): a Node.js CLI and a starter repository that help a company write down its operational knowledge in four kinds of file: schemas (what the business is), skills (what it knows), context (why it works this way) and evals (proof that it works).

The idea came from a recent shift: AI agents stopped being demos and started doing real work, like ticket triage, lead qualification and collections. With that, the quality of internal documentation became an operational risk. An outdated wiki misleads one person; an agent follows the same wiki at scale.

At the same time, the open Agent Skills format (SKILL.md) started to settle as the way to hand instructions to agents. What was missing was a tool to make sure those files are good before they reach the agent.

I built the whole product on my own: the methodology, the CLI, the terminal interface, the docs, the brand and the website. The code is on GitHub.

Who uses it

  • CEO / managerWants the company's key decisions explicit and auditable without opening a terminal: everything works in the browser, on GitHub.
  • Process ownerKnows how the decision is made in Sales Ops, support or finance and needs to put it on paper through guided questions.
  • Dev / AI EngineerConnects agents to company knowledge and wants JSON and SARIF output, CI checks and evals.
// 03

Problem

"Large customers go to senior support." That rule works as long as whoever wrote it is around to explain what "large" means. When that person goes on vacation, changes teams or leaves, the rule changes with whoever inherits it.

When rules do get written down, they usually end up in wikis and slides with three flaws: no owner (nobody is responsible for keeping the page right), no history (no way to know who changed the rule, when and why) and no proof (no way to check that the text matches what the business actually does).

With agents, it gets worse. A vague instruction like "prioritize important customers" becomes a different guess on every run. And an API key pasted into a doc ends up in the agent's hands, in the logs and with whoever reads the answer.

A document that looks complete but describes how things worked a year ago is more dangerous than one that's obviously incomplete, because people act on it.

— Codsy methodology
// 04

How we measured success

MetricBaselineTarget
Time to the first valid skillNo format existedUnder 5 min, with init and the wizard
Form errors caught before mergeManual review onlyEvery error blocks the PR
Secrets and personal data in filesNot checkedBlocked by default, with masked output
Accuracy of a rule against real casesImpossible to measureMeasured per skill, with an 80% threshold
Who contributes without a dev's helpDevs onlyManager, process owner and dev
// 05

Process

I started with a question: what makes code reliable that doesn't exist in business knowledge? Source files, types, documentation, tests, linters, code review and CI. Each practice got a Codsy equivalent: one decision per file, schemas for the data it reads, context for the why, evals as tests, codsy check as the linter, a pull request approved by the owner and a GitHub Action on every PR.

I studied the Agent Skills standard, so the files would work in compatible agents with no conversion, and linters and terminal-UI CLIs (ESLint, SARIF tooling) to define severity, inline ignores and output formats.

Hypotheses

  1. 01

    If a rule has a fixed structure (purpose, trigger, input, logic, exceptions, output and examples), non-technical people can write rules an agent follows.

  2. 02

    If form and correctness are separate checks, every PR gets instant, free feedback, and LLM cost is spent only when it matters.

  3. 03

    If the whole flow works in the browser and through pull requests, the product reaches managers who would never open a terminal.

Discarded

  • A custom DSL or rules YAMLEasier to validate, but unreadable for a CEO and incompatible with agents. I went with Markdown and JSON Schema, which are open standards.
  • Linting with an LLMSlow, expensive, non-deterministic and network-bound. Linting is 100% local and deterministic.
  • The mascot on every commandAt small sizes the seriema became unreadable. It left check, the codsy mascot command was removed and it stayed on the home screen only.
  • A single quality scoreIt suggested false precision. I replaced it with evidence labels on each rule.
// 06

Solution

A Codsy project is a folder, usually a Git repository, with four parts: schemas/ (what the business is, in JSON Schema), skills/ (what it knows, in SKILL.md), context/ (why it works this way, in Markdown) and evals/ (YAML cases that prove the rule gives the right answer).

The method follows a cycle: capture → structure → check → prove → review → maintain. codsy check handles form, codsy eval handles correctness and the pull request makes sure every change has an owner and a history.

A skill is a file anyone can read

Each skill is a recurring decision written in Markdown, with frontmatter and seven fixed sections: Purpose, When to use, Input, Decision logic, Exceptions, Output and Examples. GitHub renders it, a manager reads it and an Agent Skills-compatible agent loads it with no conversion.

The frontmatter holds what turns text into maintained knowledge: the owner, the last review date, how often it must be reviewed and the schemas the rule reads. "Large" stops being an opinion and becomes company_size of 50 or more.

skills/lead-qualification/SKILL.md· Text
---name: lead-qualificationdescription: Decide whether an inbound lead should be routed to a senior sales rep or kept in marketing nurture, used when a new lead form submission arrives.metadata:  owner: sales-ops  last_reviewed: 2026-11-14  review_every_days: 90  schemas:    - lead---## PurposeQualify inbound leads so a senior sales rep only spends time on leads large enoughto justify a multi-month sales cycle.## When to useUse this skill whenever a new lead form submission arrives from the website.## InputA lead record matching the `lead` schema.## Decision logicRoute a lead to `sales` when `company_size` is 50 or more employees. Route a leadto `nurture` when `company_size` is below 50 employees.## ExceptionsLeads with `has_budget` set to `false` are routed to `nurture` regardless of`company_size`, since a sales rep's time is wasted on a lead with no approvedbudget.## OutputA routing decision of either `sales` or `nurture`.## Examples1. A lead with `company_size` 120 and `has_budget` true routes to `sales`.2. A lead with `company_size` 8 routes to `nurture`, since it is below the   50-employee threshold.3. A lead with `company_size` 200 and `has_budget` false routes to `nurture`,   because of the budget exception.
The lead qualification skill from the sales template, with the logic and the exception highlighted.

Three ways in

Each profile has its own way in, and all three sit side by side on the website and in the README. The manager uses the template on GitHub, edits a file in the browser, opens a pull request and gets Codsy's comment. The process owner creates a project in five minutes and writes rules by answering questions. The dev adds the Action and gets a check on every PR.

Every interactive flow has an equivalent flag, so the same wizard that guides a person runs in scripts and CI. Esc cancels at any step without writing anything.

Get started section of the Codsy website with three columns, Browser, Terminal and CI, each with numbered steps, and a terminal below with the init, check, explain, new skill and eval commands
  1. 1
    UI decisionOne path per profileThe columns aren't difficulty levels: each one is complete and reaches the same result, a checked pull request.
  2. 2
    UI decisionSelf-explaining commandsEvery terminal line has a short comment saying what the command does, so you can copy it without opening the docs.
  3. 3
    UI decisionCost shows up firsteval --dry-run comes before eval: people see what would be sent to the model before spending a single token.

Check: form, offline and deterministic

Each of the 20 rules is a pure function (project, config) => Diagnostic[]. The loader reads skills, schemas, context and evals; the engine runs the rules; diagnostics come out as formatted text, JSON or SARIF. No network and no LLM: check runs offline, instantly and at no cost, which is why it can run on every PR.

The rules cover structure (frontmatter, required sections, examples), quality (empty exceptions, rules with no owner or an overdue review, vague terms like "when appropriate" with no number, unit or schema field nearby), schemas (meta-schema, descriptions, enums) and security.

In the GitHub Action, the result becomes a single PR comment, updated on every push, plus a SARIF report. Every problem comes with a code (CODSY0xx), a plain-language explanation and how to fix it, and codsy explain details any of them without leaving the terminal.

  1. 01Filesskills · schemas · context · evals
  2. 02Project loaderSKILL.md and config parser
  3. 03Rule engine20 pure functions
  4. 04Diagnosticstext · JSON · SARIF
  5. 05GitHub ActionPR comment
From file to pull request: the loader reads the project, the engine runs the 20 pure rules and diagnostics come out in the terminal, as JSON or as SARIF, reaching the PR through the GitHub Action.

Eval: proof with the model the company uses

A skill can pass every form check and still be wrong. codsy eval answers the other question: does this rule give the right decision? Each case has an input and the expected decision, and is tagged historical (a real past decision) or synthetic (written to cover an edge case), so it's clear where the confidence comes from.

For each case, Codsy builds a deterministic prompt in the order context → schemas → skill → input, with the whole skill and no rewriting: the test checks exactly what the agent will read. The answer must be a single JSON object, and the comparison is a deep equality on the expected keys only, so the model can return a rationale without breaking the test. A skill passes when its accuracy meets the threshold, 80% by default.

The provider is the company's choice: anthropic, openai-compatible (OpenAI, local servers and gateways) or command, any executable that reads the prompt and returns the answer. With it, evals can run on a local model without sending data out. An invalid answer or a provider error becomes a failed case with the error recorded, without stopping the run.

  1. 01Caseinput + expected decision
  2. 02buildPromptcontext → schemas → skill → input
  3. 03Provideranthropic · openai-compatible · command
  4. 04parseAnswerone JSON object
  5. 05Accuracyper skill, 80% threshold
From case to accuracy: Codsy builds the prompt with context, schemas, skill and input, sends it to the chosen provider, extracts the JSON from the answer and compares it with the expected decision.
evals/lead-qualification/cases.yaml· Text
skill: lead-qualificationcases:  - id: exactly-threshold    source: synthetic    input:      company_size: 50      has_budget: true      industry: logistics    expected:      decision: sales
The boundary case: a company with exactly 50 employees must go to sales.

Security guardrails

Knowledge files end up in agents, CI logs and third-party hands. That's why four rules are errors from day one, no --strict needed: CODSY060 (secrets like API keys, tokens and private keys), CODSY061 (text shaped like a prompt injection against the agent that will read the file), CODSY062 (scripts in a skill folder that aren't on an allowlist) and CODSY080 (personal data like emails, phone numbers and ID documents).

When it finds a secret or personal data, Codsy never repeats the value: it shows only the first two and last two characters, with asterisks in between, so the finding doesn't leak into the CI log. A false positive can be silenced in the file itself, but only with a written justification, so the exception goes through review too.

A terminal with an identity

The brand starts from a pixel-art seriema, a bird from the Brazilian cerrado known for being watchful: calm, alert, keeping an eye on what's wrong. The voice follows the same line, with short sentences, simple words and no exclamation marks. In the terminal, the seriema appears only on the home screen, on a 21×19 grid drawn with half blocks (two grid rows per terminal line), with an idle animation that blinks and moves its crest without ever changing the layout height. Below 60 columns it hides, and comes back if the terminal is widened.

The palette is sand #D6C6B9 for text and the mascot, with soft tones for success, warning and error. Codsy never repaints the user's terminal background, and color degrades from truecolor to 256, 16 and no color. The rich Ink interface (panels, lists, a wizard with a step indicator and shortcuts shown with ?) only appears in an interactive TTY; in a pipe, in CI, with --plain, NO_COLOR or --format json|sarif, output is plain, stable text. CODSY_NO_MOTION=1 swaps every animation for a static frame.

The website takes the same identity to the browser: the seriema in the cerrado drawn in dots, mono type for labels and the same palette, explaining the product to people who haven't opened the terminal yet.

What changes section of the Codsy website: the heading Decisions that stay the same when people change and eight cards, such as Consistency, Less key-person risk and Measured confidence, each with a pixel-art icon
What changes for the company, in cards with pixel-art icons.
Codsy website footer with product, docs and project links above the word CODSY in pixel blocks and a cerrado landscape with two seriemas
The footer: the name in pixel blocks over the cerrado.

Confidence shown, not assumed

Linters tend to present every finding with the same authority, which causes alert fatigue. In Codsy, every rule declares an evidence label: strong means every finding is a real problem; weak is pattern detection with known false positives; heuristic is an invitation to look closer, not a verdict. Each rule's page documents what it catches and what it doesn't.

The product also never presents a clean check as proof that a rule is right: form and correctness are different questions, and only eval answers the second. And everything works without AI: eval is the only part that uses an LLM, it's optional and it has --dry-run to show what would be sent before spending any token.

// 07

Trade-offs

  • Dilemma

    A single command that validates everything with AI feels more magical, but it's slow, expensive, non-deterministic and needs a network.

    Options
    • Linting with an LLM
    • Static linting only
    • Two commands with separate jobs
    Choice
    Two commands with separate jobs
    Why
    Check handles form: offline, deterministic and free, it runs on every PR. Eval measures correctness with real cases, and since that has a cost, it stays under the user's control.
  • Dilemma

    A custom format would be easier to validate, but would create lock-in. Open standards are harder to check.

    Options
    • Custom DSL
    • Structured YAML
    • Markdown + JSON Schema + Agent Skills
    Choice
    Markdown + JSON Schema + Agent Skills
    Why
    The CEO reads it, GitHub renders it, agents load it with no conversion and the company isn't locked into Codsy. The cost was a more careful parser and rules, including detecting vague terms with no number, unit or schema field nearby.
  • Dilemma

    A rich UI delights in the terminal but breaks CI, scripts and screen readers. A UI that's too plain pushes non-technical people away.

    Options
    • Plain CLI only
    • TUI only
    • Layers
    Choice
    Layers
    Why
    Rich TUI only in an interactive TTY, text, JSON or SARIF everywhere else, flags for every flow and a full path through the browser. The same tool serves the manager, the process owner and the dev, and none of them needs to know the other modes exist.
  • Dilemma

    A single severity causes alert fatigue, and an aggregate score suggests false precision.

    Options
    • Single severity
    • Aggregate score
    • Evidence label per rule
    Choice
    Evidence label per rule
    Why
    The team knows what to fix first and where to use judgment. The tool holds itself to the same standard it sets for skills: be concrete and honest about its own limits.
// 08

Results

v1.0.0 shipped with the documented method, the CLI, the GitHub Action, the starter repository and the website in English, Portuguese and Spanish.

MetricResult
Quality rules, each with its own docs page20
Ready-to-use templates: sales, support, finance and blank4
LLM providers for evalAnthropic, OpenAI-compatible and local command
Output formatsText, JSON and SARIF + GitHub Action
Tests for the tool itself45 files, including template e2e
// 09

Learnings

What I'd do differently

  • Validate with non-technical users earlier. I designed the three paths from assumptions; I'd have put the wizard in front of a real manager before polishing the TUI.
  • Start with evals. The part that tells you whether a rule is right is the one that creates the most value, and I'd have prototyped it before the linter.
  • Cut what doesn't work visually sooner. The small mascot took time before I accepted it only works on the home screen.

What I took with me

  • In AI products, determinism is a feature. Separating what needs an LLM from what doesn't makes the product faster, cheaper and more reliable.
  • Trust is built by showing your limits: evidence labels, --dry-run and masked output.
  • CLI design is product design. Tone of voice, graceful degradation, motion accessibility and restoring the terminal on Ctrl+C matter as much as a pretty screen.
  • Designing for three audiences forces clarity. If non-technical people can't understand the terminal text, it isn't good enough for devs either.
// Next projects

Next projects

  • Banco Neon

    Banco Neon
    View project
  • Grupo Size

    at Insany
    Grupo Size
    View project
See all projects
// Contact

Have a similar project in mind?

Tell me what you're building: an idea, a defined scope or just a rough draft.

Or find me on
  • LinkedIn
  • GitHub
  • WhatsApp
Back to top