cratis-arc-storage-typescript

cratis-arc-storage-typescript is a skill for Claude Code, Codex from Cratis/AI. It costs 47 tokens per session (1,357 once invoked), scanned A, original, MIT.

A TypeScript storage integration for Arc Node.js read models, using MongoDB documents or SQL tables through Drizzle. It selects storage from the resolved tenant and uses fields declared in the model.

In plain words
What is it for?
Use it to read MongoDB documents or observe their changes, or to store and read model data in SQL databases through Drizzle.
Why use it?
It avoids connecting Arc read models to MongoDB or PostgreSQL, MySQL, or SQLite tables by hand. It keeps storage selection separate from query method design.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to read MongoDB documents or observe their changes, or to store and read model data in SQL databases through Drizzle.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cratis/ai/cratis-arc-storage-typescript
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Cratis/AI --skill cratis-arc-storage-typescript
Clone the repo
git clone --depth 1 https://github.com/Cratis/AI

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cratis-arc-storage-typescript

README.md
[![agentmods](https://agentmods.dev/badge/skills/cratis/ai/cratis-arc-storage-typescript/github.svg)](https://agentmods.dev/skills/cratis/ai/cratis-arc-storage-typescript)
Your own site
<a href="https://agentmods.dev/skills/cratis/ai/cratis-arc-storage-typescript"><img src="https://agentmods.dev/badge/skills/cratis/ai/cratis-arc-storage-typescript/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cratis-arc-storage-typescript

Your own site · 80×15
<a href="https://agentmods.dev/skills/cratis/ai/cratis-arc-storage-typescript"><img src="https://agentmods.dev/badge/skills/cratis/ai/cratis-arc-storage-typescript.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,357 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00047 $0.01357
Opus 5.5 $0.00019 $0.00543
Sonnet 5.5 $0.00009 $0.00271
Haiku 4.5 $0.00005 $0.00136

Measured today against content hash 8ccffcd4a61f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cratis-arc-storage-typescript scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cratis/ai/skills/cratis-arc-storage-typescript/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MongoDB and SQL storage for an Arc Node.js server

Two optional packages connect read models to a database. Importing the package adds its method to the builder. Both pick the database from the resolved tenant (see cratis-arc-tenancy-typescript), never from a query argument, and both need the model's @field declarations.

Package Builder method Peer Use for
@cratis/arc.mongodb withMongoDB mongodb@^6.21.0 documents, change-stream observation
@cratis/arc.drizzle withDrizzle drizzle-orm ^0.45.0, rxjs PostgreSQL, MySQL, SQLite tables

For query methods and argument binding, use cratis-arc-expose-query.

Query the existing store

Use MongoDB for a document read model. Choose SQL with Drizzle when the model lives in a SQL table.

This excerpt assumes an Arc application builder, a MongoDB client, and a tenancy setup that supplies a tenant. Use default for the base database.

import { field, Guid } from '@cratis/fundamentals';
import { query, queryOptions, readModel, service, type QueryOptions } from '@cratis/arc.core';
import { mongoCollection, type MongoCollection } from '@cratis/arc.mongodb';

export class TaskRecord {
    @field(Guid) id!: Guid;
    @field(String) title!: string;
}
const tasks = mongoCollection(TaskRecord);

@readModel()
export class TaskQueries {
    @query(service(tasks), queryOptions())
    static page(items: MongoCollection<TaskRecord>, options: QueryOptions) {
        return items.queryPage({}, options);
    }
}
builder.add(TaskQueries).withMongoDB({ client, database: 'tasks', readModels: [TaskRecord] });
  • @key() marks the field stored as _id; without it a field named id is used (or _id). Multiple explicit keys are rejected. With conventions enabled a key is required and only @field properties are mapped. Use ignoreConventions only when deliberately opting out of BSON mapping.
  • List every injected model in readModels. mongoCollection(Type) resolves to the collection in the current tenant's database.
  • Options: client or server (URI), database (default; other tenants use <database>+<tenantId>), databaseNameResolver(tenant, context), serverResolver, namingPolicy, collectionName(model), ignoreConventions, maxObservableItems (1000), maxPageSize (100, at most 10 000). withMongoDB also reads Cratis:MongoDB:{Server,Database}.
  • Build owner filters from the verified principal (items.find({ owner: principal.id })), never from a caller-supplied filter.
  • Naming. defaultMongoNamingPolicy keeps declared property names and pluralizes the class name (TaskRecords); camelCaseMongoNamingPolicy camel-cases both. To read documents a .NET service wrote with the default policy, spell fields as .NET does (Title).
  • Storage format. Guid is standard UUID binary (subtype 4); a concept is its underlying value; Date a BSON date; DateOnly a date at 12:00 UTC; TimeOnly a date on 1970-01-01 UTC; TimeSpan a string; nested decorated models embed; @derivedType('id') adds _derivedTypeId. No global BSON conventions or class maps are installed.
  • Geospatial. Declare @field(Point) (also LineString, Polygon) from @cratis/fundamentals/geospatial; longitude comes first. Stored as GeoJSON; creating 2dsphere indexes and $near filters is the application's job.
  • Paging. queryPage(filter, options) pushes count, sort, skip and limit into MongoDB. Only declared fields may sort (an unknown field, including $where, answers 400); an _id tiebreaker keeps order stable.
  • Observing. observe(filter?) emits full lists, observeById(id) one document or null, observeIterable(filter?) an async iterable without RxJS. All use change streams, which need a replica set or sharded cluster; a standalone server fails before the initial read.
  • Watcher and joins. Resolve mongoDBWatcher in the same scope as the collections: watcher.changes(books) streams change events; watcher.observe(books, filter).join(authors, filter).select((a, b) => ...) recomputes a combined result when either changes. Join only collections from the same scope. A non-resumable error terminates subscribers; resubscribe, because the watcher never silently skips an interval. It is not a durable event consumer.

Read the full file on GitHub · 104 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · -47 lines · -4 tokens per session 8ccffcd4a61f
  2. 23d ago First seen · 151 lines · 51 tokens per session scan A bbb6765fcc3c

Subscribe to this mod's changes

cratis-arc-storage-typescript is a skill published in the GitHub repository Cratis/AI (4 stars, last pushed today), licensed MIT. It adds 47 tokens to every session and 1,357 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-07.

Related

cratis-arc-storage-typescript compared with skills from other repositories

cratis-arc-storage-typescript next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cratis-arc-storage-typescriptCratis/AISkill4todayMITA47Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14ktodayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code