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

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
- 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.
- 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.
- 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
- 01
Build
Write the decision as a skill and get
codsy checkto pass. - 02
Operate
People and agents read the same files and make the decision.
- 03
Learn
Real cases become evals. Corrections arrive as pull requests.
- 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- 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.
- 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.
- 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.
codsy check: flags what is incomplete, vague or unsafe05How 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.
whycontext/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.
- ---
- name: lead-qualification
- description: Decide whether an inbound lead should be routed
- to a senior sales rep or kept in marketing nurture.
- metadata:
- owner: sales-ops
- last_reviewed: 2026-11-14
- review_every_days: 90
- schemas:
- - lead
- ---
- ## Purpose
- Qualify inbound leads so a senior sales rep only spends
- time on leads large enough to justify a long sales cycle.
- ## When to use
- Whenever a new lead form submission arrives.
- ## Input
- A lead record matching the `lead` schema.
- ## Decision logic
- Route a lead to `sales` when `company_size` is 50 or
- more employees. Otherwise route it to `nurture`.
- ## Exceptions
- Leads with `has_budget` set to `false` go to `nurture`
- regardless of `company_size`.
- ## Output
- A routing decision: `sales` or `nurture`.
- ## Examples
- 1. `company_size` 120, `has_budget` true → `sales`
- 2. `company_size` 8 → `nurture`
- 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
## Decision logic
Route large customers to `sales` when appropriate.
$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
- 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.
- 01
One decision per file.
Small files are easy to own, review and test.
- 02
Concrete over vague.
"Big customers when appropriate" becomes "annual_revenue_usd above 1,000,000, within 2 hours".
- 03
Exceptions are part of the rule.
Writing "None known" is fine. Leaving it blank is not.
- 04
Every rule has an owner and a review date.
Knowledge without an owner quietly goes stale.
- 05
Form and correctness are different questions.
check reads the file. eval tests the answer.
- 06
Changes are reviewed, not just saved.
Pull requests, approved by whoever owns the area.
- 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.
- 08
Safe by default.
Secrets, prompt injection, unapproved scripts and personal data are errors. A found value is never printed in full, only masked.
- 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.

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.
No install
- 1.Open the starter template on GitHub and click Use this template.
- 2.Edit a file in skills/ with the pencil icon.
- 3.Save it as a pull request.
- 4.Codsy comments on the pull request with what to fix, and how.
- 5.Fix it and merge.
Five minutes
- 1.Create a project from a template.
- 2.Run check and read what it found.
- 3.Use explain to look up any rule code.
- 4.Write a new rule with guided questions.
- 5.Preview eval for free, then run it with a model.
On your team's repository
- 1.
codsy initalready writes .github/workflows/codsy.yml. - 2.On every pull request it runs check and fails on errors.
- 3.It publishes the report as SARIF.
- 4.It keeps a single comment on the pull request, updated on each push.
- 5.It runs eval only if
ANTHROPIC_API_KEYorOPENAI_API_KEYis set.
- 1.
npx @codsy/cli init my-project --template salesor blank, support, financecd my-projectnpx @codsy/cli checklooks for problemsnpx @codsy/cli explain CODSY010explains a problem by its codenpx @codsy/cli new skillwrites a rule with guided questionsnpx @codsy/cli eval --dry-runshows what would be sent, at no costnpx @codsy/cli evaltests the rules with a model (API key)
Requires Node.js 22.12 or newer.
The method
- 01Capture
- 02Structure
- 03Check
- 04Prove
- 05Review
- 06Maintain
Day to day
- Edit the rule
- codsy check
- Add a real case to evals/
- Open a pull request
- Owner review
Start small
- 01Pick one decision: frequent, rule-based and expensive to get wrong.
- 02Write it with its owner, using the wizard or a template.
- 03Make check pass. Every error is a question the business had not answered yet.
- 04Write 10 cases taken from real history.
- 05Turn on the check for pull requests.
- 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.
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-runshows 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.
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
- 01Pick a decision
- 02Write the skill
- 03Check on every change