macros

A set of SQL macros for Sankhya that are translated automatically for Oracle and Microsoft SQL Server. SQL is the language used to query databases.

In plain words
What is it for?
Use it when writing, reviewing, auditing, or porting Sankhya SQL in repositories, metadata XML, native queries, and external query files.
Why use it?
It lets one query work across both database systems instead of maintaining separate versions with different date, text, and null-value syntax.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/snk-devcenter/addon-studio/macros
Any agent
npx skills add snk-devcenter/addon-studio --skill macros
Clone the repo
git clone --depth 1 https://github.com/snk-devcenter/addon-studio

Made for: Claude Code, Codex.

Per session 146 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,989 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00146 $0.02989
Opus 5 $0.00073 $0.01494
Sonnet 5 $0.00029 $0.00598
Haiku 4.5 $0.00015 $0.00299

Measured 2d ago against content hash 7785f4e1773a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

macros 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 2d ago.

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.

plugins/addon-studio/skills/macros/SKILL.md · 188 lines

How it starts

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

Macros SQL Sankhya (MacroTranslator) — Addon Studio 2.0

Macros SQL traduzidas automaticamente entre Oracle e MSSQL pelo framework Sankhya. Permite escrever queries portáveis sem duplicar sintaxe por banco.

Onde aparecem:

  • <expression> em metadata XML (datadictionary/) — quando contem SQL
  • selectQuery em <fieldOptions> (lookup customizado)
  • @Criteria(clause = "...") em @Repository
  • @NativeQuery("...") em @Repository
  • Queries externas em model/src/main/resources/queries/*.sql ou queries/*.xml

Nao confundir com BeanShell: variaveis $col_<COLUNA>, $ctx_usuario_logado, $ctx_dh_atual sao contexto BeanShell em <expression> — nao sao macros SQL. Ver data-dictionary §1.8.


1. Por que usar macros

  • Sintaxe unificada Oracle/MSSQL — escrita uma vez, traduzida automaticamente
  • Centraliza diferencas de banco em um unico ponto
  • Reduz risco de query funcionar em um banco e quebrar no outro
  • Manutencao em um lugar so (sem ramificacoes por banco)

2. Referencia por categoria

2.1 Data e hora

Macro Proposito Exemplo
dbDate() Data/hora atual do banco (SYSDATE/GETDATE()) WHERE DTMOV = dbDate()
onlydate(<data>) Apenas a data (sem hora) onlydate(DATA_VENDA)
truncDate(<data>) Apenas a data (similar a onlydate) truncDate(DATA)
truncWeek(<data>) Inicio da semana truncWeek(DATA)
truncMonth(<data>) Inicio do mes truncMonth(DATA)
truncQarter(<data>) Inicio do trimestre (nome com typo no SDK: Qarter) truncQarter(DATA)
truncYear(<data>) Inicio do ano truncYear(DATA)
getDay(<data>) Dia (1-31) getDay(DATA)
getMonth(<data>) Mes (1-12) getMonth(DATA)
getYear(<data>) Ano (YYYY) getYear(DATA)
monYear(<data>) Mes/ano formato MM/YYYY monYear(DATA)
yearMonth(<data>) Ano+mes formato YYYYMM (numerico) yearMonth(DATA)
addMonths(<data>, <qtd>) Soma N meses a data addMonths(DATA, 3)
endOfCurrentMonth() Ultimo dia do mes atual endOfCurrentMonth()
diffdays(<dt1>, <dt2>) Diferenca em dias (dt1 - dt2) diffdays(DTFIM, DTINI)
diffhour(<dt1>, <dt2>) Diferenca em horas (dt1 - dt2) diffhour(DTFIM, DTINI)
convertPtBrDate(<data>) Data como string DD/MM/YYYY convertPtBrDate(DATA)

Read the full file on GitHub · 188 lines

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. 2d ago First seen · 188 lines · 146 tokens per session scan A 7785f4e1773a

Subscribe to this mod's changes

macros is a skill published in the GitHub repository snk-devcenter/addon-studio (5 stars, last pushed 2d ago), licensed MIT. It adds 146 tokens to every session and 2,989 once invoked, about $0.0007 per session on Opus 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-08-31.

Related

Other skills, from other repositories

zh-output-example

Reviews Chinese skill documentation for publication readiness. Invoke when the user asks in Chinese to review a skill.

bytedance/deer-flow · 24 tokens

i18n-localization

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

vudovn/ag-kit · 27 tokens

seedance-vocab-ja

This skill should be used when the user asks for Japanese Seedance 2.0 prompt wording, Japanese cinematic vocabulary, or translation of camera, lighting, action, VFX, audio, and production terms into Japanese.

Emily2040/seedance-2.0 · 50 tokens

asc-subscription-localization

Bulk-localize subscription, subscription-group, and in-app purchase display names across App Store locales using asc, including API 4.4.1 version-scoped v2 resources. Use when filling or updating subscription/IAP names and descriptions without App Store Connect UI work.

rorkai/app-store-connect-cli-skills · 60 tokens

harden

Improve interface resilience through better error handling, i18n support, text overflow handling, and edge case management. Makes interfaces robust and production-ready.

childrentime/reactuse · 32 tokens

subtitle-translator

Translate subtitle files (SRT, ASS) and video/media with embedded subtitles into any target language with high linguistic quality, sliding context window, timestamp alignment, and formatting preservation. Use when the user asks to translate a subtitle file (.srt, .ass) or video subtitles.

MaKTaiL/gemini-srt-translator · 60 tokens