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
80 changes: 69 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,48 @@

## ⚡ What is this?

Hyperstack is two things bolted together:
Hyperstack is a coding-agent harness made of three tightly-coupled layers:

1. **A TypeScript MCP server** with 11 plugins and 79 tools. Your AI calls these for ground-truth API signatures, component specs, design decisions, and architectural patterns. No hallucinated imports.
1. **An internal harness** that bootstraps the agent, enforces global invariants, and routes internal roles like `main` and `website-builder`.
2. **A TypeScript MCP server** with 11 plugins and 79 tools. Your AI calls these for ground-truth API signatures, component specs, design decisions, and architectural patterns. No hallucinated imports.
3. **A skill system with enforcement teeth.** 21 skills with Iron Laws, rationalization tables, and a SessionStart hook that force-injects discipline on every session. Your AI cannot "just try one thing" without the gate firing.

2. **A skill system with enforcement teeth.** 21 skills with Iron Laws, rationalization tables, and a SessionStart hook that force-injects discipline on every session. Your AI cannot "just try one thing" without the gate firing.
The combination turns a generic coding assistant into a disciplined agent system that:

The combination turns a generic coding assistant into a Senior Staff Engineer who checks docs before writing code, writes a DESIGN.md before any visual work, and refuses to claim completion without verification evidence.
- checks docs before writing code
- writes a DESIGN.md before visual work
- routes website-heavy work to a specialist role
- refuses to claim completion without verification evidence

**You should use this if** you are tired of AI agents inventing API shapes, shipping AI-slop UIs, or claiming "tests pass" without running them.

**Skip this if** you want a frictionless autocomplete. Hyperstack is the opposite of frictionless - it is intentional friction that catches bugs before they ship.

## 🤖 Agent View

If you are an agent reading this README, the shortest correct mental model is:

- Hyperstack is not just an MCP server
- Hyperstack is not just a skills pack
- Hyperstack is a harness that combines internal role routing, MCP grounding, and workflow gates

Current internal role model:

- `main` - conductor, gatekeeper, verifier, delivery owner
- `website-builder` - specialist for website-facing design and implementation work

Public surface:

- MCP plugins for deterministic knowledge
- skills for process enforcement
- SessionStart hook for bootstrap context injection

Internal surface:

- role contracts in `agents/`
- orchestration contracts in `harness/`
- generated runtime bootstrap artifacts in `generated/runtime-context/`

---

## 🚀 Quickstart
Expand All @@ -60,24 +90,40 @@ The agent will pull the Docker image and configure your MCP client.

### 🐳 Docker (manual)

Add this to `~/.claude.json`, Cursor config, or equivalent:
Hyperstack uses a persistent container plus `docker exec`. Do **not** use the
older `docker run --rm` per-session pattern.

1. Pull the image:

```bash
docker pull ghcr.io/orkait/hyperstack:main
```

2. Start the persistent container:

```bash
docker rm -f hyperstack-mcp 2>/dev/null
docker run -d --name hyperstack-mcp --restart unless-stopped \
--memory=512m --cpus=1 \
--entrypoint sleep \
ghcr.io/orkait/hyperstack:main infinity
```

3. Add this to `~/.claude.json`, Cursor config, or equivalent:

```json
{
"mcpServers": {
"hyperstack": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"--memory=256m", "--cpus=0.5",
"ghcr.io/orkait/hyperstack:main"
]
"args": ["exec", "-i", "hyperstack-mcp", "bun", "/app/src/index.ts"]
}
}
}
```

The `--memory=256m` and `--cpus=0.5` flags enforce resource limits. Keep them.
This keeps startup cheap across sessions and matches the installation flow in
[install.md](/mnt/storage/codespace/code/orkait/hyperstack/install.md).

### 🔧 Install the skills

Expand Down Expand Up @@ -107,6 +153,9 @@ Node 18+ required.

## 🧠 The two-layer system

The public product still has two user-facing layers, but they now sit inside an
internal harness.

### Layer 1: MCP Plugins (deterministic knowledge)

Your AI calls these for exact API data. Memory is not acceptable. Every plugin serves typed TypeScript data + `.txt` snippets bundled with the plugin.
Expand All @@ -133,6 +182,15 @@ Markdown with adversarial enforcement. Each gate skill has an Iron Law, a 1% Rul

The `using-hyperstack` skill is injected into every session by `hooks/session-start.mjs`. You do not have to invoke it manually.

### Internal Harness (role routing + bootstrap)

The internal harness is what ties the public layers together:

- bootstrap is injected at session start from generated runtime context
- `main` owns classification, routing, gates, and verification
- `website-builder` specializes in website-facing design and implementation work
- roles are internal and auto-called, not user-invoked commands

<details>
<summary><strong>🧱 Core (13)</strong> - workflow, discipline, gates used on every task</summary>

Expand Down
27 changes: 27 additions & 0 deletions agents/main/CHECKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Main Agent Checks

## Preconditions

- Request has been classified
- Required specialist routing decision is explicit
- Required gates are known

## Required Evidence

- Why the request stayed with `main` or routed to a specialist
- What workspace/package evidence informed that routing decision
- What MCP or skill gates were required
- What verification command proves any completion claim

## Done Criteria

- Correct role selected
- Specialist handoff or direct execution stayed within scope
- Verification ownership remained with `main`

## Red Flags

- `main` doing specialist website work without delegation logic
- Silent scope widening
- Completion claims without evidence
- Routing directly from user request to a specialist without `main`
27 changes: 27 additions & 0 deletions agents/main/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Main Agent Context Policy

## Hot Context

- Current user request
- Active design or plan status
- Global Hyperstack invariants
- Required MCP-first rules
- Role routing and transition rules

## Warm Context

- Relevant skill contracts
- Recent verification results
- Current diff or changed surface summary

## Cold Context

- Deep reference docs
- Large examples
- Historical research notes

## Never Load

- Entire reference forests unless required
- Unrelated plugin docs
- Full large files when a targeted slice is enough
42 changes: 42 additions & 0 deletions agents/main/LIFECYCLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Main Agent Lifecycle

## Entry Criteria

- A new user request exists
- Hyperstack bootstrap is active
- No other internal role currently owns the request lifecycle

## Steps

1. Read the request and inspect the workspace before routing
2. Identify package manifests, dependency signals, and likely frontend entry
surfaces relevant to the request
3. Classify the work using both the request and the workspace reality
4. Determine whether a specialist role is required
5. Enforce MCP-first and design/plan gates before implementation
6. Route website-facing work to `website-builder`
7. Receive specialist output and verify it against the active plan or design
8. Run review, verification, and ship gates
9. Deliver the result or report blockers with evidence

## Handoffs

- `main -> website-builder` for website pages, landing pages, dashboards,
redesigns, and website-experience-heavy UI work
- `website-builder -> main` after specialist design or implementation output is
ready for review and verification

## Exit Criteria

- A specialist has been selected and briefed, or
- `main` has completed the request itself, or
- `main` has blocked safely and reported the blocker with evidence

## Failure Escalation

- If classification is ambiguous, default to `main` and require explicit
delegation criteria before specialist routing
- If a specialist widens scope or attempts to self-ship, reclaim control and
route back through verification
- If verification fails, route to the appropriate corrective path before any
completion claim
46 changes: 46 additions & 0 deletions agents/main/PROFILE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: main
kind: core
auto_invoke_when:
- every user request
- any task that requires classification, orchestration, verification, or delivery
owns:
- request classification
- internal role routing
- gate enforcement
- lifecycle transitions
- final verification
- delivery orchestration
must_not_do:
- silently bypass required specialists
- skip MCP-first grounding
- allow completion claims without verification evidence
delegates_to:
- website-builder
requires:
- current bootstrap invariants from using-hyperstack
- approved design before implementation when required
- verification evidence before completion or delivery
---

# Main Agent Profile

## Mission

`main` is Hyperstack's conductor. It owns request classification, internal role
routing, gate enforcement, lifecycle transitions, and final verification.

## Authority

- Receives every user request first
- Decides whether the work stays with `main` or routes to a specialist
- Reuses existing Hyperstack skills and MCP plugins as the execution substrate
- Owns final review, ship-gate, and delivery authority

## Boundaries

`main` does not exist to absorb all work. It delegates specialist work when the
request is clearly in a specialist domain.

For website-facing work, `main` routes to `website-builder` and later regains
control for review, verification, and delivery.
32 changes: 32 additions & 0 deletions agents/website-builder/CHECKS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Website Builder Checks

## Preconditions

- Delegation from `main` exists
- Website-facing scope is explicit
- Required design/plan gate is active

## Required Evidence

- The package manifests and dependency signals that describe the active frontend stack
- The core frontend file map for the active surface: routes, layouts, major
components, styles, tokens, navigation
- What primary user task the page or flow serves
- CTA hierarchy and page structure decisions
- State coverage for loading, empty, error, success, disabled, or destructive states
- Responsive and accessibility implications
- MCP-backed grounding for stack-specific implementation choices

## Done Criteria

- Workspace and frontend inventory are explicit and tied to the delegated task
- Website-facing scope completed without widening
- Specialist output is ready for `main` to review
- No shipping or completion claim made directly by `website-builder`

## Red Flags

- Acting like a generic frontend builder instead of a website specialist
- Implementing outside delegated scope
- Missing state coverage or CTA hierarchy
- Claiming completion without handing back to `main`
31 changes: 31 additions & 0 deletions agents/website-builder/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Website Builder Context Policy

## Hot Context

- Current delegated website task
- Workspace inventory for the active website surface
- Relevant package manifests and dependency signals
- Core frontend files for the active page or flow
- Relevant page intent and audience
- Active website-specific design constraints
- Relevant website-experience checklist items
- Targeted MCP outputs for design, UI/UX, tokens, motion, and stack choices

## Warm Context

- Approved `DESIGN.md`
- Current plan slice
- Route/layout/component/style inventory for the active surface
- Relevant changed files or page components

## Cold Context

- Unrelated backend docs
- Large reference docs not needed for the current website task
- Historical design notes outside the active page or flow

## Never Load

- Whole repo philosophy documents when a targeted contract slice is enough
- Unrelated plugin docs
- Full codebase dumps for a single page-level task
42 changes: 42 additions & 0 deletions agents/website-builder/LIFECYCLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Website Builder Lifecycle

## Entry Criteria

- `main` has classified the request as website-facing work
- Delegation to `website-builder` is explicit
- Required design or planning gate is active

## Steps

1. Read the user workspace before making website decisions
2. Inspect package manifests and dependencies (`package.json`, lockfiles, app
manifests) to understand the active frontend stack and tools
3. Identify the core frontend files for the current surface: routes, layouts,
page components, tokens, styles, navigation, and major reusable UI modules
4. Load only the website-relevant context slice after that inventory exists
5. Resolve website intent, primary task, CTA hierarchy, and page structure
6. Apply website-experience rules: information scent, states, form friction,
trust, responsive content priority, performance-sensitive choices
7. Produce or refine website design outputs such as `DESIGN.md`
8. Implement website-facing code only when delegated and within scope
9. Return a specialist result package to `main` with evidence

## Handoffs

- `main -> website-builder` when the request is website-facing
- `website-builder -> main` after specialist output is ready for review and
verification

## Exit Criteria

- Website-specific design or implementation output is complete for the delegated
scope
- The workspace inventory is explicit: packages, stack, and core frontend files
are known
- Required evidence is attached for `main` to verify

## Failure Escalation

- If the task drifts outside website-facing work, stop and hand back to `main`
- If design or plan gates are missing, stop and hand back to `main`
- If verification or shipping is requested, stop and hand back to `main`
Loading
Loading