Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
OpenCode's prompts are verbose and sometimes contradictory, causing:
- Unnecessary token consumption
- Unpredictable LLM outputs
- Difficulty maintaining consistency
Core Solution: Two Complementary Approaches
1. Principle-Based Constraints
Instead of describing behaviors explicitly, reference established design principles from LLM training data:
- UNIX Philosophy (for modular, single-purpose components)
- KISS Principle (for simplicity)
- YAGNI (to avoid over-engineering)
- SOLID (for object-oriented design)
Example:
Instead of: "Make it simple, don't add unnecessary features, focus on one thing..."
Use: "Apply KISS and YAGNI principles."
Benefits:
- Reduces token count by 60-80%
- Eliminates instruction conflicts via internally consistent frameworks
- Leverages LLM's existing knowledge
2. DSL Context Compression
Create structured templates to filter noise in extended conversations:
[CONTEXT_SUMMARY]
CORE_ISSUE:: <main problem>
KEY_POINTS:: <bullet points>
ACTION_ITEMS:: <next steps>
[END_SUMMARY]
Information Theory Rationale:
- Acts as entropy-reducing encoder
- Implements lossy compression preserving semantic essence
- Filters low-information noise
Why This Works
Both methods address root causes:
- Principles compress complex concepts into single references
- DSL templates enforce structure, eliminating ambiguity
- Together they create concise, predictable prompts
Suggested First Steps
- Audit current prompts for most redundant sections
- Replace verbose descriptions with principle references
- Design 2-3 DSL templates for common workflows
- Test with critical paths
This approach transforms prompt engineering from art to science—reducing costs while improving output quality.
Additional Context
The specific principles, paradigms, or conventions mentioned are not exhaustive or exclusive—they are examples of a broader pattern. You can search for and adopt any well-established, widely recognized design principles, methodologies, or standards relevant to your domain (e.g., "separation of concerns," "immutable architecture," "12-factor app"). The key is leveraging consensus-based constraints that exist within the LLM's training corpus. This approach reduces rule conflicts inherent in human language and minimizes token waste caused by over-explanation.
Additionally, custom DSLs can be co-designed with the LLM itself. After several rounds of discussion, you can instruct the LLM to summarize the conversation using a mutually agreed-upon DSL format. This practice effectively filters noise and compresses context, saving tokens for subsequent interactions.
Activity
github-actions commentedon Dec 27, 2025
This issue might be a duplicate of existing issues. Please check:
These issues all address the same root problem: reducing token consumption through prompt optimization and context management. Feel free to ignore if your specific proposal addresses aspects not covered by these.
d0lwl0b commentedon Dec 27, 2025
The following is a custom DSL I developed with an LLM. Typically, after multiple rounds of conversation about frontend UI design, I choose to use the ULD (UI Layout Description) below to have the LLM summarize the UI structural relationships we've designed. This summarized format, when shared with other LLMs, introduces significantly less information pollution, and the UI effects generated by the receiving LLM are noticeably improved. This type of custom DSL effectively acts as a noise filter.
The following is just an example or analogy
UI Layout Description (ULD) Specification
1. Language Overview
Definition
ULD (UI Layout Description) is a Domain Specific Language (DSL) designed to describe the topology and spatial relationships of user interfaces. It serves as a high-level Intermediate Representation (IR) that facilitates the exchange of design intent between stakeholders without coupling to specific implementation technologies like CSS or JavaScript frameworks.
Core Philosophy
The language prioritizes structural layout over visual styling. It enforces a strict separation of concerns where the ULD defines "where" and "what" an element is, while leaving the specific "how" (pixels, colors, fonts) to the implementation phase.
2. Core Syntax Elements
2.1 Container Scopes
[]A container defines a bounded rectangular region within the layout.
[...].[Left [...] ]2.2 Spatial Directives
These keywords define the spatial distribution of child elements within a container. They must be placed immediately preceding the content they control.
Item(Used for single elements without specific alignment).Top,Bottom,Left,Right.Center.Mid1,Mid2,Mid3... (Used for multipart layouts).2.3 Semantic Descriptors
()Descriptors define the functional role or component type of a layout node.
(...).(User Profile Panel)2.4 Orthogonal Layers
Layers describe UI elements that exist outside the primary document flow, such as modals, toast notifications, or overlays.
LayerIdentifier: [ Layout ](goto: LayerIdentifier)2.5 External References
References provide pointers to external visual specifications or existing implementations to augment the structural description.
(link:<URL> Description)3. Detailed Syntax Rules
3.1 Context Free Grammar (Informal)
[SpatialDirectiveChildNode...]Container|Descriptor(Text)3.2 Cardinality and Direction Rules
The choice of Spatial Directives is determined by the number of child nodes in the container.
Condition: Single Child Node
The container should typically use the
Centerdirective (implying the element occupies the central focus) or the genericItemdirective.[ Center(Main Content) ][ Item(Profile Card) ]Condition: Two Child Nodes
The container must use an opposing pair of directives to define the axis.
TopandBottom.LeftandRight.Condition: Three Child Nodes
The container must use a triplet that spans the axis, inclusive of the center.
Top,Center, andBottom.Left,Center, andRight.Condition: Four or More Child Nodes
The container must use indexed
Middirectives to define the space between the extremities.Top,Mid1,Mid2,Bottom.Left,Mid1,Mid2,Mid3,Right.Condition: Arbitrary N Nodes
Any combination is valid provided every child node is prefixed by a unique, spatially logical directive, and the sequence maintains topological order.
3.3 Layer Definition Rules
gotooperator.4. Writing Guidelines
4.1 Hierarchical Indentation
Maintain strict indentation to visually represent the nesting depth of containers. Each nested
[should initiate a new indentation level.4.2 Semantic Abstraction
Descriptions must remain technology-agnostic.
(User Search Input)describes the function.(Blue Rounded Text Box)describes the style.(React Input Component)describes the implementation.4.3 Structural Decomposition
Complex interfaces should be broken down into sub-sections defined as named Layers or clearly commented blocks, rather than a single deeply nested structure.
5. Pattern Examples
5.1 Standard Three-Column Layout
5.2 Dashboard Topology
5.3 Mobile Adaptation Strategy
Describe responsive variations as distinct topology definitions if the structure changes significantly.
6. Anti-Patterns and Corrections
Anti-Pattern: Directive Mismatch
[Top(Header) Bottom(Content) Bottom(Footer)]Bottomis repeated illogically for a 3-element stack.[Top(Header) Center(Content) Bottom(Footer)]Anti-Pattern: Phantom References
(goto: UndefinedModal)UndefinedModal: [...]before referencing it.Anti-Pattern: Stylistic Coupling
(Red Button 20px)(Delete Action Button)7. Tooling Recommendations
7.1 Editor Configuration
7.2 Validation Procedure
[has a closing].(has a closing).[]is a valid Spatial Directive.gototargets are defined.d0lwl0b commentedon Dec 27, 2025
packages/opencode/src/session/prompt/beast.txtandpackages/opencode/src/session/prompt/codex.txtare unnecessarily complex. Similar simplification opportunities exist in other areas.thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.