Skip to content

Code as Business

Write down how your company decides, in files people and AI agents can read.

A spell checker for your company's know-how. Codsy flags what is missing, vague or unsafe in each rule, and tests whether it gives the right answer.

Start in five minutes

skills/ · schemas/ · context/ · evals/
~/acme-ops — codsyGitHub
codsy check
skills/lead-qualification/SKILL.md
WARN CODSY030 line 19: vague phrase "when appropriate"
Fix: name a number, unit or field.
0 things to fix, 1 suggestion.

01Context

  • Q.01

    Which lead goes to sales?

  • Q.02

    Which ticket is urgent?

  • Q.03

    Which late invoice gets a reminder, and which gets a call?

Every company runs on decisions that repeat. AI agents already do real operational work: they triage tickets, qualify leads and draft collection emails. And an agent follows what it reads. The quality of written knowledge stopped being a documentation chore and became an operational risk.

02Code as Business

Your business, written in a form an agent can operate on.

Code as Business (CaB) is an operating model: the knowledge that runs a company becomes code. Schemas, skills and context, versioned and reviewed, so people and AI agents can work from day one instead of after months of training.

Three parts, one repository

  1. schemas/01

    Schemas

    What the business is.

    The entities a decision works with, such as a lead, a ticket or an account, defined as JSON Schema that people and agents read the same way.

  2. skills/02

    Skills

    How it decides.

    Expertise and decision logic written as Markdown documents, one decision per file, with an owner, exceptions and worked examples.

  3. context/03

    Context

    Why it works this way.

    The background an expert carries: customers, market, operations and strategy, organized so an agent does not have to guess it.

Codsy adds a fourth folder, evals/: real cases with the expected decision, the proof that a rule gives the right answer.

Knowledge that only lives in people's heads does not scale. Written down, it becomes context an agent can act on.

Today

In someone's head, a stale wiki or a prompt nobody reviews

With CaB

In a versioned file, with an owner, a review date and tests

The loop

  1. 01

    Build

    Write the decision as a skill and get codsy check to pass.

  2. 02

    Operate

    People and agents read the same files and make the decision.

  3. 03

    Learn

    Real cases become evals. Corrections arrive as pull requests.

  4. 04

    Build deeper

    Sharper rules, then the next decision. The base grows.

Each pass makes the knowledge more precise, and the gains add up.

03The problem

Know-how that leaks, docs nobody trusts, and agents that guess.

In someone's head

“Big accounts go to senior support.”

In a file

annual_revenue_usd > 1_000_000 → senior, within 2h
  1. A

    Knowledge that only lives in people's heads

    It works while the person who made the rule is around to explain it. When they change roles or leave, the rule changes with them, and nobody notices.

  2. B

    Documentation you cannot trust

    Wikis and slide decks usually fail in three ways. A document that looks complete but is out of date is more dangerous than an empty one, because people act on it.

    • No ownerNobody is responsible for keeping the rule correct.
    • No historyNobody knows who changed what, when, or why.
    • No proofThere is no way to check the text matches what the company really does.
  3. C

    AI amplifies the problem

    Faced with a vague instruction like "prioritize important customers", an agent guesses. It guesses differently from a person, and sometimes differently from one run to the next.

    If a file has an API key or a customer's phone number pasted in, the agent now has access to it too.

    api_key: sk-live-3f9a CODSY060

04The solution

Software engineering practices, applied to business knowledge.

Source codeSmall text files, one per decision
TypesSchemas: the data each decision uses
Comments and docsContext files: why the rules exist
TestsEvals: inputs and the expected decision
Lintercodsy check: flags what is incomplete, vague or unsafe
Code reviewPull requests approved by the area owner
CIA GitHub Action that checks every change

05How it works

Four folders. Four questions.

Every Codsy project has the same shape. Each folder answers one plain question about a decision.

acme-ops/

  • codsy.config.yaml
  • SKILL.md

    ## Decision logic

    Route to `sales` when

    `company_size` ≥ 50

    skills/

    What do we decide?

    “Who goes to sales?”

  • lead.schema.json

    • company_sizeinteger
    • has_budgetboolean
    • sourceenum
    schemas/

    What information do we use?

    “A lead has a company size and a budget.”

  • context/operations.md

    Senior reps run multi-month cycles.

    They only have time for large accounts.

    why
    context/

    Why do we do it this way?

    “Sales reps only have time for large accounts.”

  • evals/lead-qualification.yaml

    • case-01
    • case-02
    • case-03
    • case-04
    • case-05
    evals/

    How do we know it works?

    “A 120-person company with a budget goes to sales.”

06Anatomy of a skill

One decision. One SKILL.md.

A header with name, description, owner, review cadence and the schemas it uses. Then seven required sections, always in this order.

skills/lead-qualification/SKILL.md
  1. ---
  2. name: lead-qualification
  3. description: Decide whether an inbound lead should be routed
  4. to a senior sales rep or kept in marketing nurture.
  5. metadata:
  6. owner: sales-ops
  7. last_reviewed: 2026-11-14
  8. review_every_days: 90
  9. schemas:
  10. - lead
  11. ---
  12. ## Purpose
  13. Qualify inbound leads so a senior sales rep only spends
  14. time on leads large enough to justify a long sales cycle.
  15. ## When to use
  16. Whenever a new lead form submission arrives.
  17. ## Input
  18. A lead record matching the `lead` schema.
  19. ## Decision logic
  20. Route a lead to `sales` when `company_size` is 50 or
  21. more employees. Otherwise route it to `nurture`.
  22. ## Exceptions
  23. Leads with `has_budget` set to `false` go to `nurture`
  24. regardless of `company_size`.
  25. ## Output
  26. A routing decision: `sales` or `nurture`.
  27. ## Examples
  28. 1. `company_size` 120, `has_budget` true → `sales`
  29. 2. `company_size` 8 → `nurture`
  30. 3. `company_size` 200, `has_budget` false → `nurture`

The format follows the open Agent Skills convention. Compatible agents load the files without any conversion.

07The core idea

Form and correctness are different questions.

Codsy runs two separate checks. Mixing them up is how a well-written but wrong rule reaches production.

A Form

codsy check

Is the file complete, specific, consistent and free of secrets?

  • Offline
  • Instant
  • Free
skills/lead-qualification/SKILL.md

## Decision logic

Route large customers to `sales` when appropriate.

codsy check

$codsy check

skills/lead-qualification/SKILL.md

WARN CODSY030 line 19: vague phrase “when appropriate” without a number, unit or concrete reference

Fix: Replace it with a concrete rule.

0 things to fix, 1 suggestion.

$codsy check

Everything checks out.

B Correctness

codsy eval

With this rule in hand, does an AI model reach the expected decision?

  • Any provider
  • Threshold 80%
  • --dry-run first
codsy eval lead-qualification

$ codsy eval lead-qualification

  • case-01size 120 · budget→ sales
  • case-02size 8→ nurture
  • case-03size 200 · no budget→ nurture
  • case-04size 50 · budget→ sales
  • case-05size 49 · budget→ nurture
  • case-06size 310 · budget→ sales
  • case-07size 64 · budget unknown→ sales
  • case-08size 12 · budget→ nurture
  • case-09size 75 · no budget→ nurture
  • case-10size 140 · budget→ sales

FAIL case-07 expected “sales”, actual “nurture”

lead-qualification 90%threshold 80%

Every skill meets the 80% threshold.

Eval is the only way to catch a rule that is well written but wrong.

08How we think

Nine principles.

  1. 01

    One decision per file.

    Small files are easy to own, review and test.

  2. 02

    Concrete over vague.

    "Big customers when appropriate" becomes "annual_revenue_usd above 1,000,000, within 2 hours".

  3. 03

    Exceptions are part of the rule.

    Writing "None known" is fine. Leaving it blank is not.

  4. 04

    Every rule has an owner and a review date.

    Knowledge without an owner quietly goes stale.

  5. 05

    Form and correctness are different questions.

    check reads the file. eval tests the answer.

  6. 06

    Changes are reviewed, not just saved.

    Pull requests, approved by whoever owns the area.

  7. 07

    Honest about its own limits.

    Every check has an evidence label: strong, weak or heuristic. A false alarm can be silenced, but only with a written reason.

  8. 08

    Safe by default.

    Secrets, prompt injection, unapproved scripts and personal data are errors. A found value is never printed in full, only masked.

  9. 09

    Usable without a terminal.

    Everything works in the browser through pull requests, and every interactive flow can also run with flags only.

09Choose your path

Built for the people who own the decisions.

Leadership

CEO / manager

What you get
One place for the business rules, each with an owner and a review date.
What you do
Edit the files on GitHub, in the browser, and read the automatic comment.
Terminal?No
01 / 03

10What changes

Decisions that stay the same when people change.

  • Consistency

    Two people, or a person and an agent, make the same call on the same case.

  • Less key-person risk

    Know-how survives vacations, role changes and departures.

  • Full audit trail

    Who changed which rule, when and why, with the option to undo.

  • More predictable agents

    Not because they get smarter, but because they read instructions without ambiguity.

  • Less risk

    Secrets and personal data are stopped before they reach agents, logs or third parties.

  • Ambiguity surfaces early

    Writing the schema turns "large" into a number, and hidden disagreements come out.

  • Knowledge that does not decay

    With the check on every pull request, no change can quietly make the rules worse.

  • Measured confidence

    Evals show how often each skill gets it right. The default threshold is 80%, and you can tune it.

11Get started

Three ways in. Pick the one that fits.

  1. 01 · Browser

    No install

    1. 1.Open the starter template on GitHub and click Use this template.
    2. 2.Edit a file in skills/ with the pencil icon.
    3. 3.Save it as a pull request.
    4. 4.Codsy comments on the pull request with what to fix, and how.
    5. 5.Fix it and merge.
  2. 02 · Terminal

    Five minutes

    1. 1.Create a project from a template.
    2. 2.Run check and read what it found.
    3. 3.Use explain to look up any rule code.
    4. 4.Write a new rule with guided questions.
    5. 5.Preview eval for free, then run it with a model.
  3. 03 · CI

    On your team's repository

    1. 1.codsy init already writes .github/workflows/codsy.yml.
    2. 2.On every pull request it runs check and fails on errors.
    3. 3.It publishes the report as SARIF.
    4. 4.It keeps a single comment on the pull request, updated on each push.
    5. 5.It runs eval only if ANTHROPIC_API_KEY or OPENAI_API_KEY is set.
~ — zsh
  • npx @codsy/cli init my-project --template salesor blank, support, finance
  • cd my-project
  • npx @codsy/cli checklooks for problems
  • npx @codsy/cli explain CODSY010explains a problem by its code
  • npx @codsy/cli new skillwrites a rule with guided questions
  • npx @codsy/cli eval --dry-runshows what would be sent, at no cost
  • npx @codsy/cli evaltests the rules with a model (API key)

Requires Node.js 22.12 or newer.

The method

  1. 01Capture
  2. 02Structure
  3. 03Check
  4. 04Prove
  5. 05Review
  6. 06Maintain

Day to day

  1. Edit the rule
  2. codsy check
  3. Add a real case to evals/
  4. Open a pull request
  5. Owner review

Start small

  1. 01Pick one decision: frequent, rule-based and expensive to get wrong.
  2. 02Write it with its owner, using the wizard or a template.
  3. 03Make check pass. Every error is a question the business had not answered yet.
  4. 04Write 10 cases taken from real history.
  5. 05Turn on the check for pull requests.
  6. 06Move to the next decision.

12Templates

Start from a working example.

Every template ships with AGENTS.md, CODEOWNERS, six context files (company, customers, industry, operations, products, strategy) and the CI workflow. Sample data is fictional and marked as such.

13The checks

Twenty rules. Each one clear about what it can and cannot detect.

Every rule has its own page and can be read in the terminal with codsy explain. Hover a tile to see what it checks. Click to copy the command.

Full rule catalog

Skill structure07

Quality and upkeep03

Schemas06

Security04

strong
Checks a verifiable fact.
weak
A real signal, with known false positives.
heuristic
A rough signal. A reason to look closer.

Severities error, warn and off are set in codsy.config.yaml. A single case can be silenced with a written reason:

<!-- codsy-ignore CODSY030: legal wording -->

14Security and privacy

Your rules stay yours.

  • 01

    Offline by default

    Every command runs 100% offline, except eval.

  • 02

    You see what leaves

    eval sends the skill, schemas, context and cases to the provider you configure. --dry-run shows exactly what would be sent, before anything is sent.

  • 03

    Read-only in CI

    The GitHub Action never writes to your files. It only reads, comments on the pull request and publishes SARIF.

  • 04

    No lock-in

    Everything is Markdown, YAML and JSON Schema in your own repository.

15Honest limits

What Codsy is not.

When not to use it

  • 01Tasks that happen only once.
  • 02Exact calculations, like taxes or unit conversion. That belongs in code.
  • 03Facts that change all the time, like price and stock. That belongs in a database.

What it does not do

  • It does not make AI smarter.
  • It does not guarantee your rules are right.
  • It does not run agents.
  • It does not replace the wiki for everything.

16FAQ

Frequently asked questions.

Read the docs
  • An operating model that makes a business machine-readable. The knowledge that runs the company is written as schemas (what the business is), skills (how it judges) and context (why it works that way), kept in a versioned repository so people and AI agents can operate on it from day one.

17Start with one decision

Write it once. Check it on every change.

Pick the decision your team gets wrong most often. Write it down today.

v1.0.0 · Apache-2.0 · Node ≥ 22.12

~/acme-ops — first decision
npx @codsy/cli init acme-ops
npx @codsy/cli new skill
npx @codsy/cli check
skills/lead-qualification/SKILL.md
0 things to fix.
  1. 01Pick a decision
  2. 02Write the skill
  3. 03Check on every change