Skip to content

Commit 39592eb

Browse files
Merge pull request #78 from orkait/feat/rename-hyperstack-and-3-layer-arch
feat: migrate Hyperstack to topology-driven local runtime
2 parents f4a18ed + 454f23c commit 39592eb

119 files changed

Lines changed: 5075 additions & 4819 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ rules:
4444
load and obey when present:
4545

4646
* `~/.gemini/settings.json`, `.cursorrules`, or similar ide-specific project rules
47-
* `./skills/using-hyperstack/SKILL.md`
47+
* `./skills/hyperstack/SKILL.md`
4848
* any task-specific skill doc the user points to
4949
* repo-local agent or steering docs
5050

GEMINI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
Disciplined MCP server + skill system with adversarial enforcement.
33
Core focus: React Flow v12, Motion v12, Lenis, React 19, Echo, Go, Rust, and the Designer pipeline.
44

5-
@./skills/using-hyperstack/SKILL.md
5+
@./skills/hyperstack/SKILL.md
66

README.md

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<p>
88
<img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT" />
99
<img src="https://img.shields.io/badge/TypeScript-5-3178c6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" />
10-
<img src="https://img.shields.io/badge/Docker-ready-2496ED?style=flat-square&logo=docker&logoColor=white" alt="Docker" />
10+
<img src="https://img.shields.io/badge/Local_runtime-default-0f766e?style=flat-square" alt="Local Runtime" />
1111
<img src="https://img.shields.io/badge/MCP-standard-6366f1?style=flat-square" alt="MCP" />
1212
</p>
1313

@@ -25,7 +25,7 @@
2525

2626
**Hyperstack is a disciplined engineering harness for AI coding agents.**
2727

28-
It provides the necessary **Ground Truth** (via 79 specialized MCP tools) and **Adversarial Enforcement** (via 21 rigorous skills) to transform a generic LLM into a high-precision Senior Engineer.
28+
It provides the necessary **Ground Truth** (via 79 specialized tool calls) and **Adversarial Enforcement** (via 21 rigorous skills) to transform a generic LLM into a high-precision Senior Engineer.
2929

3030
Unlike standard "polite" instructions, Hyperstack uses **Iron Laws** and a **SessionStart hook** to force agents to check real documentation, follow precise design specs, and provide binary verification before shipping.
3131

@@ -39,13 +39,13 @@ The fastest way to install Hyperstack is to let your AI agent do it for you. Thi
3939
Fetch and follow the instructions at https://raw.githubusercontent.com/orkait/hyperstack/main/install.md
4040
```
4141

42-
The autopilot will autonomously detect your environment, install the MCP server (Docker or Local), and **automatically link the Skills repository**. This is the only step required.
42+
The autopilot will autonomously detect your environment, configure the local tool runtime, and **automatically link the Skills repository**. This is the only step required.
4343

4444
---
4545

4646
### 2. Manual Configuration (Advanced)
4747

48-
If you aren't using the Autopilot, follow the **Unified Bootstrap** to set up both the MCP server and the Skills:
48+
If you aren't using the Autopilot, follow the **Unified Bootstrap** to set up both the local runtime and the Skills:
4949

5050
1. **Clone & Initialize**:
5151
```bash
@@ -84,7 +84,7 @@ If you aren't using the Autopilot, follow the **Unified Bootstrap** to set up bo
8484

8585
It is not just a library; it is a **disciplined harness** made of three tightly-coupled layers:
8686

87-
1. **The Harness**: Bootstraps the agent, routes internal specialist roles (`hyper`, `website-builder`), and enforces global development invariants.
87+
1. **The Harness**: Bootstraps the agent, routes internal specialist roles (`hyper`, `frontend-builder`), and enforces global development invariants.
8888
2. **The MCP Ground Truth**: 12 TypeScript plugins (80 tools) that provide deterministic data. No hallucinated imports or invented component specs.
8989
3. **The Adversarial Gates**: 21 skills with **"Enforcement Teeth"**. These aren't suggestions; they are Iron Laws supported by rationalization tables that counter every excuse an agent uses to skip quality gates.
9090
@@ -127,41 +127,25 @@ graph TD
127127
If you are an agent reading this, your mental model must be: **Process is Priority.** You are operating within a system that requires deterministic grounding and formal design before implementation.
128128
129129
- **Conductance**: `hyper` owners classification and gate verification.
130-
- **Specialization**: `website-builder` handles visual and frontend implementation.
130+
- **Specialization**: `frontend-builder` handles visual and frontend implementation.
131131
- **Persistence**: You run in a stable Docker container with a persistent lifecycle.
132132
133133
---
134134
135135
## 🚀 Quickstart
136136
137-
### 🐳 Docker (Default)
137+
### 💻 Local Runtime (Default)
138138
139-
Hyperstack uses a persistent container plus `docker exec`. This keeps startup cheap across sessions and ensures 100% environment stability.
139+
Hyperstack now defaults to a local tool runtime backed by topology manifests and corpus navigation. Docker is no longer required for the standard setup path.
140140
141-
1. Pull the image:
142-
143-
```bash
144-
docker pull ghcr.io/orkait/hyperstack:main
145-
```
146-
147-
2. Start the persistent container:
148-
149-
```bash
150-
docker rm -f hyperstack-mcp 2>/dev/null
151-
docker run -d --name hyperstack-mcp --restart unless-stopped \
152-
--memory=512m --cpus=1 \
153-
--entrypoint sleep \
154-
ghcr.io/orkait/hyperstack:main infinity
155-
```
156-
157-
3. Add this to your MCP settings (`~/.claude.json`, Cursor, Windsurf, etc.):
141+
Add this to your MCP or tool settings (`~/.claude.json`, Cursor, Windsurf, etc.):
158142
159143
```json
160144
{
161145
"mcpServers": {
162146
"hyperstack": {
163-
"command": "docker",
164-
"args": ["exec", "-i", "hyperstack-mcp", "bun", "/app/src/index.ts"]
147+
"command": "node",
148+
"args": ["/path/to/hyperstack/bin/hyperstack.mjs"]
165149
}
166150
}
167151
}
@@ -174,19 +158,19 @@ If you are using Claude Code, Cursor, Windsurf, Roo Code, or Gemini, you can use
174158
```text
175159
Fetch and follow the instructions at https://raw.githubusercontent.com/orkait/hyperstack/main/install.md
176160
```
177-
The autopilot will detect your environment and propose the correct Docker-based configuration block.
161+
The autopilot will detect your environment and propose the correct local-runtime configuration block.
178162
179163
180164
181165
### 🔧 Install the skills
182166
183-
The MCP server gives you tools. The skills give you discipline. Install both:
167+
The local runtime gives you tools. The skills give you discipline. Install both:
184168
185169
```bash
186170
git clone https://github.com/orkait/hyperstack.git ~/.claude/skills/hyperstack
187171
```
188172
189-
After installing, the SessionStart hook (at `hooks/session-start.mjs`) will auto-inject the `using-hyperstack` skill into every session. No manual activation needed.
173+
After installing, the SessionStart hook (at `hooks/session-start.mjs`) will auto-inject the `hyperstack` skill into every session. No manual activation needed.
190174
191175
### 💻 From source
192176
@@ -204,9 +188,9 @@ Node 18+ required.
204188
205189
---
206190
207-
## 🧠 The Two-Layer System
191+
## 🧠 The Three-Layer System
208192
209-
Hyperstack's strength comes from the friction between **Ground Truth** (MCP) and **Enforcement** (Skills).
193+
Hyperstack's strength comes from the friction between **Ground Truth** (MCP), **Enforcement** (Skills), and **Orchestration** (Agents).
210194

211195
### Layer 1: MCP Plugins (Ground Truth)
212196

@@ -236,13 +220,13 @@ Markdown with adversarial enforcement. Each skill contains an **Iron Law** that
236220

237221
These laws are backed by **Rationalization Tables**-pre-written counters to every excuse an AI agent uses to skip quality gates.
238222

239-
### Internal Harness (role routing + bootstrap)
223+
### Layer 3: Agents (Orchestration & Routing)
240224

241-
The internal harness is what ties the public layers together:
225+
The internal harness is what ties the public layers together by managing process and domains:
242226

243227
- bootstrap is injected at session start from generated runtime context
244228
- `hyper` owns classification, routing, gates, and verification
245-
- `website-builder` specializes in website-facing design and implementation work
229+
- `frontend-builder` specializes in frontend-facing design and implementation work
246230
- roles are internal and auto-called, not user-invoked commands
247231

248232
<details>
@@ -285,7 +269,7 @@ The internal harness is what ties the public layers together:
285269

286270
| Skill | Role |
287271
|---|---|
288-
| `using-hyperstack` | Force-injected at session start via hook - the enforcement payload |
272+
| `hyperstack` | Force-injected at session start via hook - the enforcement payload |
289273
| `testing-skills` | RED-GREEN-REFACTOR pressure testing for skills using subagents |
290274

291275
</details>
@@ -309,17 +293,17 @@ Ordinary skill markdown is a polite suggestion. Polite suggestion fails when an
309293

310294
When you say, **“build me a SaaS dashboard”**:
311295

312-
1. **SessionStart** already puts in `using-hyperstack`, so AI know system is there.
313-
2. **Blueprint skill** sees visual job and sends it to `hyperstack:designer`.
314-
3. **Designer skill** runs `designer_resolve_intent(product)` to guess industry, personality, style, density, and mode.
296+
1. **SessionStart** already puts in `hyperstack`, so AI know system is there.
297+
2. **Blueprint skill** builds workspace understanding first and classifies the change.
298+
3. If the route says a design contract is required, **Designer skill** runs `designer_resolve_intent(product)` to guess industry, personality, style, density, and mode.
315299
4. Designer asks **3 questions** in base mode, or **12 questions** in advanced mode.
316-
5. Like **Q11b** will ask what component library to use: shadcn, raw Tailwind, MUI, Mantine, Chakra, Ant Design, or custom.
317-
6. Designer makes a **DESIGN.md** contract with 10 parts: theme, colors, type, spacing, components, motion, elevation, do/don’ts, responsive rules, and anti-patterns.
318-
7. User approves the **DESIGN.md**.
319-
8. **Forge-plan** reads it and makes one task for each section. If user picked shadcn, it calls `shadcn_get_component`. If not, it builds from the DESIGN.md spec.
300+
5. Q11b asks what component library to use: shadcn, raw Tailwind, MUI, Mantine, Chakra, Ant Design, or custom.
301+
6. Only when needed, Designer makes a conditional **DESIGN.md / design contract** with theme, colors, type, spacing, components, motion, elevation, do/don’ts, responsive rules, and anti-patterns.
302+
7. User approves the design contract when the route requires it.
303+
8. **Forge-plan** reads the routed artifacts and makes one task for each required area. Existing-project frontend logic work can stay workspace-first without forcing a design contract.
320304
9. Build tasks run with MCP tools as ground truth.
321-
10. **designer_verify_implementation** checks build against **DESIGN.md**.
322-
11. **Ship-gate** blocks final completion unless build passes the **DESIGN.md** rules.
305+
10. **designer_verify_implementation** checks build against the design contract when present.
306+
11. **Ship-gate** blocks final completion unless build passes the required proof rules.
323307

324308
AI cannot jump ahead. Every step has hard gate. Excuses already blocked by rationalization tables.
325309

SKILL.md

Lines changed: 4 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >-
66
React Flow, Motion, Echo, Go, Rust, and UI/UX design systems.
77
metadata:
88
author: orkait
9-
version: "3.0.0"
9+
version: "3.1.0"
1010
license: MIT
1111
triggers:
1212
- build feature
@@ -31,142 +31,8 @@ activation:
3131
priority: high
3232
---
3333

34-
# 🧠 The Hyperstack Engine
34+
# Hyperstack
3535

36-
<div align="center">
37-
<strong>You are an autonomous Senior Staff Engineer. You are not an autocomplete engine.</strong>
38-
<br/>
39-
<em>Speed without correctness is failure. Preservation of invariants is the only success.</em>
40-
</div>
36+
See the canonical skill definition: `skills/hyperstack/SKILL.md`
4137

42-
---
43-
44-
## ⚖️ The Iron Laws
45-
46-
```
47-
1. NO CODE WITHOUT MCP GROUND-TRUTH DATA
48-
2. NO VISUAL CODE WITHOUT AN APPROVED DESIGN.md
49-
3. NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
50-
4. NO REFACTOR WITHOUT A FAILING TEST FIRST
51-
5. NO PATTERN WITHOUT A NAMED FORCE
52-
```
53-
54-
**Violating the letter of these laws is violating the spirit of these laws.**
55-
56-
<EXTREMELY-IMPORTANT>
57-
Before writing any code, proposing any fix, or starting any architecture, you MUST:
58-
59-
1. **Stop Rationalizing:** Do not skip steps to "be helpful." Thoroughness is the highest form of help. Skipping is laziness, not speed.
60-
2. **Verify the Stack:** Consult the relevant MCP plugins below for 100% accurate API syntax. Memory is not acceptable. Pattern-matching is not acceptable. Only MCP output is acceptable.
61-
3. **Load the Discipline:** Read `skills/engineering-discipline/SKILL.md` for architectural gates.
62-
4. **Adopt Negative Doubt:** List 5 failure modes for your plan before you type a single line of code.
63-
64-
**The 1% Rule:** If there is even a 1% chance a system rule applies to your task, you MUST read the corresponding file in the `skills/` directory BEFORE acting. You do not have a choice. You cannot rationalize your way out of this.
65-
</EXTREMELY-IMPORTANT>
66-
67-
---
68-
69-
## 🚦 Operational Phases
70-
71-
Follow this state machine for every non-trivial task. Do not skip phases.
72-
73-
### Phase 1: Discovery (The Inventory)
74-
- **Actions:** Map state variables, data flows, and dependencies.
75-
- **Skill:** Use `skills/behaviour-analysis/SKILL.md` for UI/UX or state-heavy tasks.
76-
- **MCP:** Query `[plugin]_list_apis` and `[plugin]_search_docs` to find exact ground-truth data.
77-
78-
### Phase 2: Reasoning (The Architecture)
79-
- **Actions:** Define invariants, module boundaries, and public APIs.
80-
- **Skill:** Use `skills/engineering-discipline/SKILL.md`. Reason in order: Responsibilities -> Invariants -> Dependency Direction -> Syntax.
81-
- **Visual work:** If the task changes how something looks, feels, moves, or is interacted with, use `skills/designer/SKILL.md` FIRST to produce a DESIGN.md contract before any visual code. The DESIGN.md becomes the input spec for `forge-plan`.
82-
- **Constraint:** Never start at syntax. If you do, you are building slop.
83-
84-
### Phase 3: Execution (The Implementation)
85-
- **Actions:** Apply surgical changes. Use real commands from MCP patterns.
86-
- **Skill:** Use `skills/design-patterns-skill/SKILL.md` to select the correct abstraction (Factory, Strategy, etc.).
87-
- **Debugging:** If you encounter a failure during implementation, invoke `skills/debug-discipline/SKILL.md` before attempting any fix.
88-
- **Rules:** No `rAF`. No redundant comments. No speculative code.
89-
90-
### Phase 4: Verification (The Audit)
91-
- **Actions:** Self-verify against failure modes.
92-
- **Skill:** Use `skills/security-review/SKILL.md` for API/Infrastructure logic.
93-
- **Completion gate:** Invoke `skills/ship-gate/SKILL.md` before claiming any phase or task is done.
94-
- **Output:** Use `skills/readme-writer/SKILL.md` to document the outcome with evidence.
95-
96-
---
97-
98-
## 🧩 Part 1: MCP Data Plugins (The Body)
99-
100-
Use these tools for **100% accurate** API details, props, code examples, and patterns.
101-
102-
### ⚛️ Frontend Libraries
103-
- **React Flow v12** (`reactflow_*`): 56 APIs, Enterprise patterns (Zustand, Auto-layout, SSR).
104-
- **Motion for React v12** (`motion_*`): 33 APIs, Transitions reference, Layout animations.
105-
- **Lenis Scroll** (`lenis_*`): Smooth scroll setups, GSAP/Motion integration.
106-
- **React 19 & Next.js** (`react_*`): RSC patterns, State hierarchy, Data fetching rules.
107-
108-
### 🐹 Backend & Systems
109-
- **Echo (Go)** (`echo_*`): 19 recipes, Middleware chain, JWT auth, WebSocket.
110-
- **Golang Practices** (`golang_*`): 18 best practices, 10 idiomatic design patterns.
111-
- **Rust Practices** (`rust_*`): Borrowing rules, Error handling (anyhow/thiserror), Performance.
112-
113-
### 💅 Design Systems
114-
- **Designer** (`designer_*`): Decision layer - 17 tools. 6 personality clusters, 15 industry rules, 11 cognitive laws, 13 page templates, 9 code-ready presets (Linear/Stripe/Vercel/Apple/Carbon/shadcn/Notion/Supabase/Figma), 21 font pairings, 50+ anti-patterns. Call `designer_resolve_intent` first for any visual task.
115-
- **Design Tokens** (`design_tokens_*`): Tailwind v4 + OKLCH templates, Color ramp math.
116-
- **UI/UX Principles** (`ui_ux_*`): WCAG contrast, Typography scales, 4px grid rules.
117-
118-
---
119-
120-
## 🧠 Part 2: Engineering Skills (The Brain)
121-
122-
These are static guidelines in the `skills/` directory. Read them using file tools.
123-
124-
### Workflow Skills (process gates -- follow in order)
125-
- **Blueprint** (`skills/blueprint/SKILL.md`): MCP-surveyed design with hard gate before any code.
126-
- **Forge Plan** (`skills/forge-plan/SKILL.md`): MCP-verified implementation plan after design approval.
127-
- **Run Plan** (`skills/run-plan/SKILL.md`): Validate and execute an existing plan or spec.
128-
- **Debug Discipline** (`skills/debug-discipline/SKILL.md`): Root cause first. MCP-informed. 3-strike escalation.
129-
- **Ship Gate** (`skills/ship-gate/SKILL.md`): Evidence required before any completion claim.
130-
- **Deliver** (`skills/deliver/SKILL.md`): Final verification and delivery -- terminal state of every workflow.
131-
132-
### Execution Skills (used during implementation)
133-
- **Autonomous Mode** (`skills/autonomous-mode/SKILL.md`): Full end-to-end execution, no human pauses, stops only on failure.
134-
- **Subagent Ops** (`skills/subagent-ops/SKILL.md`): Fresh agent per task, two-stage review (spec + quality).
135-
- **Test First** (`skills/test-first/SKILL.md`): Red-green-refactor discipline before any implementation code.
136-
- **Worktree Isolation** (`skills/worktree-isolation/SKILL.md`): Clean workspace isolation before feature work.
137-
- **Code Review** (`skills/code-review/SKILL.md`): Dispatch reviewer subagent, handle feedback technically.
138-
- **Parallel Dispatch** (`skills/parallel-dispatch/SKILL.md`): Concurrent agent dispatch for independent tasks.
139-
140-
### Domain Skills (execution guidance)
141-
- **Engineering Discipline** (`skills/engineering-discipline/SKILL.md`): The Senior SDE phase-gate framework.
142-
- **Designer** (`skills/designer/SKILL.md`): Intention gate for visual/UX work. Produces DESIGN.md contract before any visual code. Auto-resolves industry/personality/style, routes to cognitive laws, enforces anti-slop rules. Use for: landing pages, dashboards, component libraries, redesigns, any new visual direction.
143-
- **Behaviour Analysis** (`skills/behaviour-analysis/SKILL.md`): State audits & Nielsen heuristics.
144-
- **Design Patterns** (`skills/design-patterns-skill/SKILL.md`): Clean Code & Pragmatic patterns.
145-
- **Security Review** (`skills/security-review/SKILL.md`): OWASP audits & vulnerability checklists.
146-
- **Readme Writer** (`skills/readme-writer/SKILL.md`): Evidence-based documentation standards.
147-
148-
---
149-
150-
## 🚩 Red Flags (STOP and Re-read)
151-
152-
These are the rationalizations you will have when you want to skip Hyperstack. Every one is wrong. Every one has been used before to ship bugs, wrong APIs, and AI slop.
153-
154-
| Thought | Why it is wrong |
155-
|---|---|
156-
| "The issue is simple, I don't need to check the docs" | Simple issues are where wrong assumptions hide. Call the MCP tool. |
157-
| "I'll write the tests after I confirm it works" | "Confirm it works" by running a failing test first. Then pass it. That is the order. |
158-
| "This pattern looks common, I'll just adapt it from memory" | Memory drifts. Common patterns have version-specific differences. Call the tool. |
159-
| "I'll just add one quick fix now and investigate the root cause later" | Later never comes. Investigate first. |
160-
| "The user is impatient, I'll skip the gates" | User impatience is not permission to ship slop. Gates exist because shortcuts fail. |
161-
| "I know this API from memory" | Memory is v11 of the API. MCP has v12. Call the tool. |
162-
| "This is a minor refactor, tests are overkill" | Minor refactors without tests are random code edits. Tests first. |
163-
| "The skill takes too long" | Skills take minutes. Fixing wrong code takes days. Use the skill. |
164-
| "I'll verify after I push" | After you push it is in CI and your partner's context. Verify BEFORE. |
165-
| "Just this once" | There is no "just this once." No exceptions. |
166-
| "I already checked this earlier in the conversation" | State drifts. Check again. |
167-
| "The skill doesn't quite match this situation" | Invoke it anyway. If it truly doesn't apply, you lose 10 seconds. |
168-
| "I can reason about this without MCP" | No you cannot. MCP exists because reasoning without it produced the bugs that made the MCP necessary. |
169-
| "I'm tired and want to finish" | Stop. Rest. Do not ship unverified work. |
170-
| "Different wording, so the rule doesn't apply" | The letter of the rule IS the spirit of the rule. |
171-
172-
**STOP. Return to Phase 1. Load the ground-truth data from MCP.**
38+
This file provides Cursor trigger metadata only. All operational rules, Iron Laws, MCP tool references, and skill condition table are in the canonical file above.

0 commit comments

Comments
 (0)