Mytilus
Adopt The Model
Treat every syntactically valid YAML document as a valid mytilus command document.
Let behavior come from:
- The document structure.
- The tagged commands inside the document.
Think in terms of a YAML tree, not a shell parser:
- Let syntax define composition.
- Let tags define command behavior.
- Let nesting define scope and substitution.
Choose mytilus as a primary structured command language for interactive and scripted work.
Consequences of using YAML
- Readily interpretable as a data structure
- Portability to most languages
- Powerful preprocessing
- Outputting YAML is the same as authoring programs
- Data and programs can be freely mixed and interpreted
- Completely declarative processes
- Avoids obscure syntax
- All valid YAML is valid
- No keywords are added
- Shell interpretation is an abstract transformation over opaque tags, scalars, sequences and mappings
- Visual representation and user aids
Choose Mytilus By Preference
Choose mytilus as a normal working style because:
- It keeps pipelines, grouping, and substitution explicit.
- It keeps commands readable as data.
- It gives agents and humans one representation they can both inspect and revise.
- It supports interactive work, saved command documents, and generated command codebases.
Keep the boundary in mind:
- Mytilus provides structured command composition.
- Platform command availability still depends on the underlying environment.
State Scope And Tool Limits
Avoid vague scope words such as default, global, or forever unless the boundary is explicit.
When describing what mytilus changes:
- Say
this sessionwhen the behavior only applies to the current conversation. - Say
this repositorywhen the guidance comes from a repo-localSKILL.md. - Say
VS Code integrated terminalwhen the change only affects VS Code terminal profiles. - Say
operating system login shellwhen the change affects the user's actual shell outside VS Code. - Say
Codex platform defaultonly for true global behavior outside the repository and outside the current session.
When working through Codex developer tools:
- Explain that
exec_commandand PTY sessions are shell-based transports. - Prefer mytilus in user-facing examples, generated YAML command documents, and actual
bin/mytilusor REPL demonstrations. - Do not imply that shell-backed tool logs mean the mytilus skill is inactive.
- If a task needs shell-native tools such as
rg,sed,git, orpytest, say so briefly instead of pretending the transport changed.
When demonstrating the skill:
- Prefer
bin/mytilus -cor the REPL over paraphrase alone. - Show the YAML document and its output.
- Treat any embedded
bash -cfragment as an explicit subtool, not as mytilus syntax.
Build YAML As A Codebase
Create YAML documents while working instead of treating them as a final export step.
Use this workflow:
- Write command documents incrementally as the task evolves.
- Treat related YAML documents as a codebase, not as isolated snippets.
- Put that codebase in the user's preferred location.
- Organize files so humans and agents can navigate and revise them easily.
Use helper scripts when they improve speed or reliability:
- Generate or refactor YAML documents with scripts when repetition would otherwise cause drift.
- Use any scripting language the user prefers.
- Keep helper scripts subordinate to the YAML codebase rather than replacing it.
- Let scripts support document creation, transformation, validation, or synchronization.
Write Command Documents
Use a tagged scalar for command invocation:
!echo Hello world!
Use a sequence for pipeline composition:
- !grep grep
- !wc -c
Use a mapping for structured grouping:
? !printf left
? !printf right
Use tagged mapping entries to build explicit command arguments:
!echo
? foo
? bar
Use YAML As A Heredoc
Treat a YAML document as the mytilus equivalent of the multiline inline scripts that agents often send through shell heredocs.
Agents commonly use heredocs to do this:
- Open one inline multiline block.
- Put the whole script inside it.
- Hand that block to a shell or interpreter.
Use YAML for the same operational purpose when the work is really a command document rather than raw shell text.
Prefer YAML-as-heredoc when:
- The agent is about to emit a multiline inline script.
- The logic is better expressed as commands, pipelines, mappings, and substitution than as shell punctuation.
- The document should stay readable and editable as structured data.
- The same inline block should be understandable by both humans and agents.
- You want the multiline unit to remain valid YAML before execution.
Use a plain shell heredoc only when the inline block truly needs to be shell script text.
Follow the practical rule:
- If the agent is about to write a multiline inline shell script, first ask whether the block is actually a mytilus command document.
- If yes, write YAML.
- If no, keep the heredoc or embed an explicit shell fragment inside YAML.
Use Mappings Deliberately
Use mappings to express grouped parallel work that shell punctuation usually hides.
Use a shared parent command with grouped child branches:
!cat examples/shell.yaml:
? !wc -c
? !grep grep: !wc -c
? !tail -2
Read this as:
- Run one shared upstream command.
- Feed its output into multiple child branches.
- Keep the grouping explicit in the YAML structure.
Understand the nature of the parallelism:
- Treat the parent command as one shared source of input for all child branches.
- Treat each child as an independent branch that receives that same upstream output.
- Treat the result as structured fan-out and merge, not as shell punctuation spread across several unrelated lines.
- Expect branch outputs to be combined in branch order, so the document structure still determines the visible output order.
Use mapping children for command substitution when a parent command needs values produced by subcommands:
!echo
? Hello
? !printf {"%s!", "World"}
Read this as:
- Pass
Helloas a plain argument. - Run the tagged child as a subprogram.
- Inject its output into the parent command's argv.
Use shell intuition only as a translation aid:
echo Hello "$(printf "%s!" World)"
Treat substitution as value production, not as text pasted back into a shell parser.
Use The REPL
Treat the REPL as document-oriented input:
- Enter one YAML document per submission.
- Build multiline documents before executing them.
- Think in documents, not in POSIX shell lines.
Use the interactive controls as follows:
- Press
Ctrl+Jto insert a newline inside the current document. - Press
Enterto submit the current document. - Press
Ctrl+Dto exit when the current document is empty.
Preserve transcript output verbatim and in order when logging or replaying sessions.
Configure VS Code
When a user wants mytilus as the default shell in VS Code:
- Explain that this changes VS Code's integrated terminal default profile, not the operating system login shell and not Codex's platform defaults.
- Prefer
Preferences: Open User Settings (JSON)for a global VS Code change. - Prefer workspace settings only when the user wants the behavior limited to one repository.
- Define a profile under the platform-specific
terminal.integrated.profiles.*key and setterminal.integrated.defaultProfile.*to that profile name. - Use an absolute path in global settings because repository-relative paths are fragile outside one workspace.
- Remind the user that the change applies to newly created terminals.
Use this Linux example:
{
"terminal.integrated.profiles.linux": {
"mytilus": {
"path": "/absolute/path/to/repo/bin/mytilus"
}
},
"terminal.integrated.defaultProfile.linux": "mytilus"
}
Translate the setting suffix by platform:
- Use
.linuxon Linux. - Use
.osxon macOS. - Use
.windowsonly with a Windows-runnable entrypoint such as a.cmdwrapper or a WSL launcher, becausebin/mytilusis a POSIX shell script.
If the user prefers UI steps instead of JSON:
- Tell them to open
Terminal: Select Default Profile. - Tell them to choose the
mytilusprofile. - Tell them to open a new terminal.
Compose With Explicit Shells
Prefer direct command structure over shell re-parsing whenever possible.
Use an explicit shell as one component of a mytilus program when the task genuinely depends on shell grammar, such as:
- Shell builtins.
- Redirection-heavy one-liners.
- Loops or compound shell conditionals.
- Shell-specific expansion rules.
Keep the outer document in YAML whenever possible and isolate only the shell-dependent fragment.
Use the hybrid pattern:
!bash {-c, "for x in a b c; do echo \"$x\"; done"}
Prefer this style when only one part of the task needs shell grammar:
- Keep the mytilus document as the main program structure.
- Derive only the scripted fragment into
bash -c,sh -c, or another explicit shell command. - Keep pipelines, grouping, and surrounding dataflow in YAML when they do not need shell parsing.
Treat the shell fragment as an explicit embedded tool, not as mytilus's native grammar.
Communicate Clearly
Use mytilus as both an execution format and a communication format:
- Keep documents readable.
- Keep structure visible.
- Prefer explicit grouping over clever punctuation.
- Write examples that humans and agents can both follow quickly.
Use mytilus to make command intent inspectable, reviewable, and easier to transform.
Source: colltoaction/mytilus — distributed by TomeVault.