NenjoNenjo Docs
Primitives

Context Blocks

Reusable prompt-context assets referenced by stable template names and shared across agents, abilities, and domains.

Context blocks are reusable prompt-context assets referenced by stable template names. They let you define a common prompt pattern once and reuse it everywhere instead of duplicating guidance across agents.

A context block is referenced, never pasted: include its selector in a system or developer prompt and the runtime compiles its current content into the static instruction prefix.

What to use them for

  • System instructions shared across agent types
  • Standard output formats and response conventions
  • Reusable tool-use guidance and operating discipline
  • Any guidance snippet that should stay consistent across many resources

References

A context block resolves to a dotted key derived from its path and name (slashes in the path become dots):

{{ coding.git_worktree }}                              {# path "coding", name "git_worktree" #}
{{ methodology }}                                      {# no path, name "methodology" #}
{{ pkg.nenjo_ai.packages.context.tools.tool_usage }}   {# package-installed block #}
  • Workspace-authored blocks resolve at <path>.<name>, or just <name> when they have no path.
  • Package-installed blocks resolve under pkg.* because their path is namespaced under the package. The pkg.* namespace is only for package-installed context blocks and package knowledge — see Packages.

Every block also gets a convenience context.<name> alias (the name only, no path):

{{ context.git_worktree }}
{{ context.methodology }}

The context.<name> alias is name-only, so it is unambiguous only when that name is unique across your blocks. When two blocks share a name, reference them by their full path-dotted key instead.

Choosing context blocks vs. neighbors

Use a context block when…Otherwise…
Guidance is static and reused across resourcesUse memory for learned, evolving context
You want one source of truth for prompt patternsUse knowledge graphs for source material to search and cite
The content shapes stable behaviorLet runtime prompt context carry live execution state

Context blocks may compose other static blocks and use declared package arguments. They cannot reference agent identity or live chat, task, project, routine, gate, Git, clock, memory, or artifact data.

On this page