Hai Architecture logo

Hai Architecture

Community
hylarucoder
hai-architecture

Investigates architecture and software change complexity, from whole-repository runtime paths to a bounded module/design decision. Use for 系统太绕、复杂度审计、调用链/配置太散、架构审查、模块边界、拆分合并, or why a repo is hard to change. Select global investigation or bounded design mode; return traced evidence, the complexity center, alternatives, and a first proof. Use hai-debug for an unexplained malfunction and code-review-and-quality for reviewing a change or local code smells.

Overview

Publisherhylarucoder
Repositoryhai-stack
Skill namehai-architecture
Stars
284
Forks
15
Bundled files
12
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 12 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by hylarucoder on GitHub. Read the source before you install it.

Installation

Install the Hai Architecture AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/hylarucoder/hai-stack.git /tmp/hai-stack
mkdir -p .claude/skills
cp -r /tmp/hai-stack/skills/hai-architecture .claude/skills/hai-architecture
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Hai Architecture in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Hai Architecture on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Hai Architecture is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Hai Architecture

For Chinese readers, see SKILL.zh_CN.md. The English SKILL.md is the execution source of truth.

Purpose

Review existing architecture or guide one design decision through the lens of managing complexity. Find the boundary where change amplification, cognitive load, or unknown unknowns concentrate, then recommend the smallest structural move that makes the system easier to understand and change.

Select the work mode

  • Global investigation: the cause or boundary of change friction is unclear, or the request spans a repository/large subsystem. Read references/global-audit.md and follow its entrypoint, call-chain, state/config, and test tracing procedure. Converge on important paths after mapping the entrypoint families; do not substitute a local smell review.
  • Bounded review/design: a module, package boundary, or design choice is already identified. Follow the workflow below, inspecting its direct callers, contracts, and tests.
  • A request can move from global investigation into a bounded decision. Reuse collected evidence; do not rerun two full reviews or ask the user to choose an internal mode.

Evidence gate

Before making an architecture claim:

  1. Read every cited file in this session and cite real file:line locations.
  2. Trace callers and implementations before asserting a call chain or blast radius; name the search.
  3. Read ADRs, dependency rules, architecture tests, and public contracts that declare intended boundaries.
  4. Compare a module's public surface with the complexity it actually hides before calling it deep or shallow.
  5. Label inference as unverified instead of presenting it as evidence.

A fabricated finding costs more trust than several missed findings. Prefer one verified painful center over a checklist of plausible smells.

Core judgments

Find the painful center

Start with the boundary or call chain under review. Ask where a common change crosses owners, requires several layers of knowledge, mixes lifecycle/persistence/execution concerns, or makes it unclear what else must change. Local naming or style issues matter only when they reveal that deeper force.

Prefer deep modules

A useful module hides significant, related complexity behind a small, stable interface. Do not split because a file is long or merge because files are adjacent. Split when the new boundary hides information; merge when separate pieces share hidden knowledge and must be understood together.

For each layer or new shape, ask:

  • Does the caller know less?
  • Does this layer own a rule or invariant?
  • Does it make illegal states harder to express?
  • Can downstream change stop here?
  • Does a conversion add meaning, constraints, or ownership?

If every answer is no, the layer is probably a pass-through tax. Do not create a new shape merely because data crossed a function.

Compare real alternatives

For a nontrivial decision, compare at least two materially different options. Explain why the current design, a further split, a merge, or a generic abstraction is rejected when each is plausible. For key recommendations, include a concise red-team misuse, blue-team defense, and residual risk.

Read references/principles.md when the decision needs the full lens catalog, error-boundary guidance, complexity vocabulary, or adversarial-review detail.

Workflow

Review existing code

  1. State the reviewed boundary and the request's scale.
  2. Pass the evidence gate: read implementation, callers, contracts, tests, and relevant decisions.
  3. Draw a simple current map of actors/modules, dependency or state flow, and the intended hiding boundary.
  4. Locate the highest-leverage complexity center.
  5. Select only the relevant lenses from references/principles.md; do not score every lens by default.
  6. Apply the deep-module and layer-cost tests.
  7. Check relevant red flags in references/red-flags.md; use references/worked-example.md when calibrating a difficult finding or false positive.
  8. Write a proportional report with evidence-backed findings ordered by impact.

Guide a design decision

  1. Clarify the goal, boundary, current constraints, and contracts that must survive.
  2. Map the current chain before proposing changes.
  3. Design at least two fundamentally different options.
  4. Compare business fit, boundary clarity, module depth, migration cost, operational risk, and rejected alternatives.
  5. Recommend one option, state residual risk, and name the first proof point.

Scale

  • Quick: one bounded question. Return the map, conclusion, evidence, main tradeoff, and next step.
  • Standard: one package or call chain. Use the full markdown template.
  • Full: multiple boundaries explicitly requested by the user. Map broadly, then converge on the painful center; increase evidence breadth without multiplying boilerplate.

The evidence gate applies at every scale. Do not make a quick question perform a full audit, and do not call a repository-wide sweep complete after reading one attractive file.

Output

Match the user's language and keep code identifiers unchanged. For standard/full Markdown reviews, fill references/output-template.md in bounded mode; use references/global-output-template.md in global mode; for a quick answer, preserve its decision fields without emitting empty sections. When the user explicitly asks for HTML, also read references/html-report.md. Language-specific guidance is available in references/go-patterns.md and references/typescript-patterns.md.

Use a different skill when

  • An unexplained malfunction needing reproduction and causal evidence → hai-debug.
  • One React component's API, data flow, effects, or rerenders → react-component-diagnosis.
  • Local naming, duplication, function, or style smells → code-review-and-quality or hai-naming.
  • Product requirements rather than technical design → hai-prd.

Not this skill

Do not use it as a formatter, feature-completeness audit, generic test advisor, or performance review unless performance architecture is the explicit decision. Keep the focus on design quality as it affects complexity.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Hai Architecture AI skill do?

Investigates architecture and software change complexity, from whole-repository runtime paths to a bounded module/design decision. Use for 系统太绕、复杂度审计、调用链/配置太散、架构审查、模块边界、拆分合并, or why a repo is hard to change. Select global investigation or bounded design mode; return traced evidence, the complexity center, alternatives, and a first proof. Use hai-debug for an unexplained malfunction and code-review-and-quality for reviewing a change or local code smells.

Why use Hai Architecture on TypingMind?

Because you install it once and use it with any model. Hai Architecture is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Hai Architecture in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/hylarucoder/hai-stack/tree/main/skills/hai-architecture. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Hai Architecture?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Hai Architecture?

As many as you like. As long as a model supports skills, you can use Hai Architecture with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Hai Architecture AI skill free?

It is published on GitHub by hylarucoder. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇