All skills
jihe520 avatar

/typst-author

@4a360cb
by Sanjinjihe520/mathmodelagent6.2k stars
450

Generate idiomatic Typst (.typ) code, edit and troubleshoot Typst documents and projects, and answer Typst syntax/reference questions. Use when working with .typ files or when the user explicitly asks for Typst document creation, editing, debugging, compilation, formatting, template work, or package usage.

Use this Skill: https://skilld.dev/gh/jihe520/mathmodelagent/typst-author

This session only. Nothing lands on disk.

docsreferencefoundationsbytes.md

≈666 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Bytes

A sequence of bytes.

This is conceptually similar to an array of integers between 0 and 255, but represented much more efficiently. You can iterate over it using a for loop.

You can convert

  • a string or an array of integers to bytes with the bytes constructor
  • bytes to a string with the str constructor, with UTF-8 encoding
  • bytes to an array of integers with the array constructor

When reading data from a file, you can decide whether to load it as a string or as raw bytes.

#bytes((123, 160, 22, 0)) \
#bytes("Hello 😃")

#let data = read(
  "rhino.png",
  encoding: none,
)

// Magic bytes.
#array(data.slice(0, 4)) \
#str(data.slice(1, 4))

Constructor

bytes

Converts a value to bytes.

  • Strings are encoded in UTF-8.
  • Arrays of integers between 0 and 255 are converted directly. The dedicated byte representation is much more efficient than the array representation and thus typically used for large byte buffers (e.g. image data).
#bytes("Hello 😃") \
#bytes((123, 160, 22, 0))
#bytes(
  value
) -> bytes

Parameters

  • value:
    • description: The value that should be converted to bytes.
    • type: str | bytes | array
    • default: None

Methods

bytes.len

The length in bytes.

bytes.at

Returns the byte at the specified index. Returns the default value if the index is out of bounds or fails with an error if no default value was specified.

#bytes.at(
  index,
  default: any
) -> any

Parameters

  • index:
    • description: The index at which to retrieve the byte.
    • type: int
    • default: None
  • default:
    • description: A default value to return if the index is out of bounds.
    • type: any
    • default: None

bytes.slice

Extracts a subslice of the bytes. Fails with an error if the start or end index is out of bounds.

#bytes.slice(
  start,
  end,
  count: int
) -> bytes

Parameters

  • start:
    • description: The start index (inclusive).
    • type: int
    • default: None
  • end:
    • description: The end index (exclusive). If omitted, the whole slice until the end is extracted.
    • type: none | int
    • default: none
  • count:
    • description: The number of items to extract. This is equivalent to passing start + count as the end position. Mutually exclusive with end.
    • type: int
    • default: None

Source: SKILL.md on GitHub

1 alert3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    This skill is a comprehensive Typst authoring assistant that provides a complete local mirror of the Typst documentation (tutorials, guides, and reference). It facilitates the generation, editing, and troubleshooting of Typst documents using standard ecosystem tools such as 'typst' and 'typstyle'. The instructions emphasize accuracy by directing the agent to prioritize local documentation and include safety checkpoints for formatting and editing tasks. No malicious patterns, data exfiltration risks, or other security threats were identified.

  • Socket3mo

    1 alert: obfuscatedFile

  • Snyk3mo

    Risk: LOW · No issues

Signed by skilld at 4a360cb. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 4 months ago

README badge

README badge for jihe520/mathmodelagent/typst-author