sakura
Skill4 starsChanged 24 days agoApache-2.0View on GitHub
Writes, checks, repairs, and tests Sakura Lang programs. Use when working with .sak files, sakura.toml, Sakura effects, typed holes, or Sakura compiler diagnostics.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- momori777/Artemistheir own version, first seen Nov 12, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- momori777/Artemis★ 445same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- compiler/AGENTS.mdAGENTS.md
- skills/sakura/assets/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/sakura/assets/CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 1 is distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Run sakura --version, then start with sakura prompt --budget 3000 before editing.
- Very specific: line 24
Write parameter and return types on top-level functions.
- Very specific: line 28
Import non-prelude names explicitly, from their declaring modules: Http from std/http.
- Very specific: line 31
Use let for a fixed binding and var for rebinding.
- Very specific: line 38
Use fn(x) { ... } for lambdas, match for exhaustive cases, with for local handlers and try/catch for typed failures.
- Very specific: line 43
Retrieve: Run sakura doc std::list::set for a known symbol or sakura doc --search "fn(List<A>) -> Int" for a type shape.
- Very specific: line 47
Set the task boundary: Read the manifest, permissions and independent acceptance tests.
- Very specific: line 51
Check: Run sakura check --json. Parse one JSON object per line by kind.
- Very specific: line 56
Repair: Use sakura explain V3001 (substitute the actual code), then make the smallest change consistent with the task.
- Very specific: line 67
Build and report: Run sakura build for the requested target (js by default).
- Very specific: line 102
Use validate for recoverable external input.
- Distinctive: line 117
Keep the effect in the production function's row and replace its handler in the test.
- Very specific: line 132
Read the repair table on failure or to upgrade v0.1.0 code.
- Very specific: line 140
Read the cookbook for offline projects, the APIs changed since v0.1.0, and sakura audit/sakura verify guidance.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write Sakura with the compiler
Run sakura --version, then start with sakura prompt --budget 3000 before
editing. Retrieve a specific symbol with sakura doc or a diagnostic with
sakura explain as needed. Do not reload guides. The CLI fills the two
sakura-compiler-* fields; if they do not
match sakura --version, trust the installed compiler's prompt, doc and
explain.
Syntax
- Write parameter and return types on top-level functions. Pure functions omit
!; effectful signatures name a row, such as! {Console, Fail<Missing>}. - Calls are positional. No
f<T>(x)and nof(name: value): annotate a binding to guide inference and pass a record when the API takes options. - Import non-prelude names explicitly, from their declaring modules:
Httpfromstd/http;RequestandPayload(a body:Payload.Text(s)) fromstd/request. Query before guessing imports. - Use
letfor a fixed binding andvarfor rebinding. Collections have value semantics:List.setandMap.setreturn a new collection. Assign that result back to thevar. Check index bounds first. PreferListfor dense integer IDs,Mapfor sparse keys. - For a zero-length case, use
if n == 0 { return ... }before computingn - 1or indexing. State the nonnegative-input requirement when needed; an empty-input guard alone does not establish it. Ranges are half-open. - Use
fn(x) { ... }for lambdas,matchfor exhaustive cases,withfor local handlers andtry/catchfor typed failures. A runtime defect is notFail.
The edit loop
- Retrieve. Run
sakura doc std::list::setfor a known symbol orsakura doc --search "fn(List<A>) -> Int"for a type shape. With MCP, callcompiler_infofirst, confirmworkspace_root, then usesymbol_queryordocs_query. Without MCP, the CLI provides the same lookup/check workflow. - Set the task boundary. Read the manifest, permissions and independent
acceptance tests. Write signatures and contracts first; use
?bodywhile exploring. Agree the baseline revision before repair. Do not edit tests or broaden effects, error unions or permissions merely to make a check pass. - Check. Run
sakura check --json. Parse one JSON object per line bykind; inspect diagnostics, holes and the final summary. For repair, add--frozen-specs all --since <baseline>with the actual agreed Git revision. A successful check may contain holes. Read their expected type, allowed effects, locals and candidates instead of treating exit 0 as completion. - Repair. Use
sakura explain V3001(substitute the actual code), then make the smallest change consistent with the task. A localmachine_applicablefix can help; inspect its edits. Anincompletefix still needs work. Review behavior/interface changes; never weaken contracts or widen authority to silence a diagnostic. With MCP, checkinterface_deltaandfrozen_spec_violations, passfrozen_specs: "all"to bothcheck_patchandapply_patch, and apply against the original base snapshot; results are objects, not JSON Lines. - Exercise. Fill all holes, run
sakura fmt, thensakura check --jsonandsakura test --json. Keep independent acceptance tests unchanged. Use fake handlers or committed cassettes for external effects; do not record live requests or spend a provider budget without task authorization. - Build and report. Run
sakura buildfor the requested target (jsby default). Build rejects holes withV2050. Report exact commands, results, remaining limitations and any authorized signature or permission changes.
Four complete examples
Each block is a separate file; check it with sakura check --json <file>, then run
sakura test --json <file>; no test uses a live service.
Recover a typed failure
Catch only the expected tag; other failures must remain in the signature.
error Missing
fn lookup() -> Int ! {Fail<Missing>} { fail Missing }
fn fallback() -> Int { try { lookup() } catch { Missing => 0 } }
test "missing value uses the fallback" { expect_eq(fallback(), 0) }Handle an effect locally
label stays pure because its handler supplies the operation. A local handler
must implement the intended behavior, not discard the task's required effects.
effect Name { fn get() -> String }
fn label() -> String {
with handler Name { fn get() { "Sakura" } } { Name.get() }
}
test "local name" { expect_eq(label(), "Sakura") }Check a refinement at entry
Use validate for recoverable external input. Use from only at a boundary
where violation should be a defect; do not remove the predicate to accept it.
type Percent = Int where it >= 0 && it <= 100
fn checked(n: Int) -> Percent { Percent.from(n) }
test "valid boundary" { expect_eq(checked(100), 100) }
test "invalid entry defects" { expect_defect(fn() { checked(101) }) }
test "external input can be rejected" {
expect(Result.is_err(Percent.validate(101)))
}Replace time with a deterministic fake
Keep the effect in the production function's row and replace its handler in the test. Query other effects' fake or replay handlers before writing a live test.
import std/instant.{Instant}
fn observed_time() -> Instant ! {Clock} { Clock.now() }
test "clock is controlled by the test" {
let at = Instant.from_unix_millis(42)
let seen = with Clock.fixed(at) { observed_time() }
expect_eq(seen, at)
}Repair by diagnostic
Read the repair table on failure or to upgrade
v0.1.0 code; sakura explain CODE has the full explanation.
Completion and deeper lookup
Finish only when no holes remain, independent tests pass, the requested target
builds, and contracts/tests/permissions have not been weakened. Report missing
prerequisites and failing checks; never claim a skipped test passed.
Read the cookbook for offline projects, the APIs
changed since v0.1.0, and sakura audit/sakura verify guidance.
Load references selectively: language, API signatures, and diagnostic codes. Use only bundled templates.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

