Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions generated/runtime-context/hyperstack.bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ Hyperstack is **ONE framework with four layers** - not four separate systems:
- "I know the OKLCH token pattern" -> OKLCH has specific rules about alpha, chroma peaks, dark mode lightness
- "This pattern looks common, I'll adapt it" -> Adaptation hides drift

## Token Economy (lite)
Default output register: economical. Say it once, in fewer words, with grammar
intact - lite means fewer words, never broken words. Technical terms stay exact.

Compress ONLY: connective prose, preamble, restating the request, hedging,
narration of what you are about to do, option lists without a verdict.

NEVER compress (hard gate - over-committing economy here is a bug, not thrift):
- diagrams, tables, and visual output - full padding and alignment rules stay
- evidence: command output, error text, verification lines, numbers, identifiers
- code and config
- security warnings and irreversible-action confirmations
- anything whose omission could change the user's decision

When a visual is the clearest carrier of the answer, produce it - the gate
protects visuals once they exist AND mandates them where they beat prose.
User brevity requests ("short", "minimal tokens") compress prose only - they
never touch the NEVER list. "Verbose" / "explain fully" lifts the register for
that answer. When economy and clarity conflict, clarity wins - every time.

## Degraded Mode
- If MCP unavailable, tell the user explicitly: "MCP unavailable" and flag answers as uncertain.

Expand Down
21 changes: 21 additions & 0 deletions skills/hyperstack/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,27 @@ persona's skill.

---

## Token Economy (lite)

Default output register: economical. Say it once, in fewer words, with grammar
intact - lite means fewer words, never broken words. Technical terms stay exact.

Compress ONLY: connective prose, preamble, restating the request, hedging,
narration of what you are about to do, option lists without a verdict.

NEVER compress (hard gate - over-committing economy here is a bug, not thrift):
- diagrams, tables, and visual output - full padding and alignment rules stay
- evidence: command output, error text, verification lines, numbers, identifiers
- code and config
- security warnings and irreversible-action confirmations
- anything whose omission could change the user's decision

When a visual is the clearest carrier of the answer, produce it - the gate
protects visuals once they exist AND mandates them where they beat prose.
User brevity requests ("short", "minimal tokens") compress prose only - they
never touch the NEVER list. "Verbose" / "explain fully" lifts the register for
that answer. When economy and clarity conflict, clarity wins - every time.

## The Rationalization Catalog (Read Before Every Session)

These are the exact thoughts you will have when you want to skip a skill. Every one is a bug in your reasoning. Every one has been written down because someone (probably you in a past session) used it to ship bad code.
Expand Down
12 changes: 12 additions & 0 deletions src/internal/context-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const REQUIRED_BOOTSTRAP_MARKERS = [
"reflect",
"bro",
"Triggers:",
"Token Economy",
"NEVER compress",
"auto-called",
"hyper -> website-builder",
];
Expand All @@ -69,6 +71,14 @@ function extractTaggedBlock(source: string, tag: string): string {
return match[1].trim();
}

function extractOptionalSection(source: string, heading: string): string {
try {
return extractSection(source, heading);
} catch {
return "";
}
}

function extractSection(source: string, heading: string): string {
const lines = source.split("\n");
const targetHeading = `## ${heading}`;
Expand Down Expand Up @@ -192,6 +202,7 @@ export function compileUsingHyperstackBootstrap(source: string, personas: Person
const disallowedTransitions = extractSimpleBullets(extractSection(body, "Disallowed Transitions"));
const finalCheck = extractFinalCheck(body);
const redFlags = extractRedFlags(body);
const tokenEconomy = extractOptionalSection(body, "Token Economy (lite)");

const content = [
"<!-- GENERATED FILE. Edit skills/hyperstack/SKILL.md and re-run `bun run compile:context`. -->",
Expand Down Expand Up @@ -237,6 +248,7 @@ export function compileUsingHyperstackBootstrap(source: string, personas: Person
"## High-Signal Red Flags",
...redFlags,
"",
...(tokenEconomy ? ["## Token Economy (lite)", tokenEconomy, ""] : []),
"## Degraded Mode",
"- If MCP unavailable, tell the user explicitly: \"MCP unavailable\" and flag answers as uncertain.",
"",
Expand Down
Loading