ai/skills/aidd-sudolang-syntax/SKILL.md
Quick cheat sheet for SudoLang syntax. Use when writing or reading SudoLang pseudocode, interfaces, constraints, or function definitions.
npx skillsauth add paralleldrive/aidd aidd-sudolang-syntaxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A quick cheat sheet for SudoLang syntax.
DisplayTheme { mode: "light" | "dark" name: String parameters{} // each theme can have different sets of parameters permissions[] }
UserPreferences { displayTheme }
User { id: String displayName preferences }
constraint: can be specified inline or in block form
Constraints { A constraint Another constraint }
Map conditions to results by meaning:
(pattern) => result
e.g.
(logic is deterministic) => CLI tool, compiled Bun bundle
(logic requires judgment) => AI prompt
Patterns mix naturally into Constraints blocks:
// Real SudoLang agent skill constraints:
Constraints {
Prefer natural language in markdown format
(logic is deterministic) => CLI tool, compiled Bun bundle
(logic requires judgment) => AI prompt
}
// You can define an inferred function with the fn or function keywords:
fn foo();
function bar();
// You can also define them with function bodies: fn foo() { Constraints { a constraint }
for each (foo) bar() while (!done) work() }
// Functions with blocks can omit the fn or function keyword: anotherFunction() { require user to be signed in }
function simple():modifier = value
function complex():nestedModifier={key: "value"}
// You can shape function behavior at call time. doSomethingMultiLine():{ // we can freely mix variable assignments and constraints: format = numbered markdown list lineLength = concise this is a constraint this is another constraint }
updateUser({ id: "123", name: "Pup" })
"foo $bar"
foo $bar
Note: Avoid single quotes for strings, because they are used as apostrophes in natural language, and they can break the syntax hightlighting badly.
// nested template strings: ["foo $bar"]
// nested template strings with objects: { name: "Hello, $name" }
// arrays [1, 2, 3]
// nested arrays [ { foo: "bar" }, [123] ]
// a comment
/* a block comment / fn bar(/ a block comment in parameter position /) { // a function-nested comment a constraint / function-nested block comments (not recommended due to token consumption, but available if you really need it) */ "return $template" // end of line comment }
Note: Most operators don't usually get special syntax highlighting, but they are still important to include.
// Logical Operators isAdult = age >= 18 canVote = isAdult && isCitizen canDrink = isAdult || hasParentalConsent uniqueFeature = hasFeatureA xor hasFeatureB isUnavailable = !inStock
// Complex logical expression isEligible = (age >= 21) && (hasValidID) && ((hasCreditCard) || (hasCash)) && !(isBlacklisted)
// Math Operators sum = a + b difference = x - y product = length * width quotient = total / count power = base ^ exponent remainder = 17 % 5
// Complex math expression result = ((10 + 5) * 3 - (20 / 4)) ^ 2 % 7
// Set Operators commonFruits = tropicalFruits intersection localFruits allFruits = tropicalFruits union localFruits
// Note: The cup and cap operators are deprecated in favor of union and intersection due to instability in Claude 3.5.
// Combining different operators finalScore = (baseScore + bonusPoints) * difficultyMultiplier isWinner = (finalScore > highScore) && !isDisqualified
// Assignment with operation counter = 0 counter += 1 // Increment total -= discount // Decrement price *= taxRate // Multiply and assign share /= numberOfPeople // Divide and assign
// Function nesting fn foo() { counter = 0 counter += 1 // Increment total -= discount // Decrement price *= taxRate // Multiply and assign share /= numberOfPeople // Divide and assign }
// Comparison Operators isEqual = a == b isNotEqual = x != y isGreater = score > threshold isLessOrEqual = quantity <= maxLimit
// Ternary if/else access = if (age >= 18 && isMember) "granted" else "denied"
// Pipe operator for function composition processedData = rawData |> normalize |> filter |> sort
Should generate a warning for disallowed keywords.
class Foo extends Bar { constructor() { super() } }
documentation
Top tier author skill for delivering essential truths with the persuasive power to inspire positive change. Use when writing, reviewing, editing, or scoring any content.
development
Guide for crafting high-quality AIDD skills. Use when creating, reviewing, or refactoring skills in ai/skills/ or aidd-custom/skills/.
testing
Reflective Thought Composition. Structured thinking pipeline for complex decisions, design evaluation, and deep analysis. Use when quality of reasoning matters more than speed of response.
tools
Teaches agents how to write correct riteway ai prompt evals (.sudo files) for multi-step flows that involve tool calls. Use when writing prompt evals, creating .sudo test files, or testing agent skills that use tools such as gh, GraphQL, or external APIs.