Moai Foundation Cc logo

Moai Foundation Cc

OrganizationPopular
modu-ai
moai-foundation-cc

Canonical Claude Code authoring kit covering Skills, sub-agents, plugins, slash commands, hooks, memory, settings, sandboxing, headless mode, and advanced agent patterns. Use when creating Claude Code extensions or configuring Claude Code features.

Overview

Publishermodu-ai
Repositorymoai-adk
Skill namemoai-foundation-cc
Stars
1.2K
Forks
226
Bundled files
25
LicenseApache-2.0
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.

  • 25 bundled files

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

  • Open source

    Published by modu-ai on GitHub. Read the source before you install it.

Installation

Install the Moai Foundation Cc 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.
    https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-foundation-cc
  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/modu-ai/moai-adk.git /tmp/moai-adk
mkdir -p .claude/skills
cp -r /tmp/moai-adk/.claude/skills/moai-foundation-cc .claude/skills/moai-foundation-cc
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Moai Foundation Cc 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 Moai Foundation Cc 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 Moai Foundation Cc 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.

Claude Code Authoring Kit

Comprehensive reference for Claude Code Skills, sub-agents, plugins, slash commands, hooks, memory, settings, sandboxing, headless mode, and advanced agent patterns.

Documentation Index

Core Features:

  • reference/claude-code-skills-official.md - Agent Skills creation and management
  • reference/claude-code-sub-agents-official.md - Sub-agent development and delegation
  • reference/claude-code-plugins-official.md - Plugin architecture and distribution
  • reference/claude-code-custom-slash-commands-official.md - Command creation and orchestration

Configuration:

  • reference/claude-code-settings-official.md - Configuration hierarchy and management
  • reference/claude-code-memory-official.md - Context and knowledge persistence
  • reference/claude-code-hooks-official.md - Event-driven automation
  • reference/claude-code-iam-official.md - Access control and security

Advanced Features:

  • reference/claude-code-sandboxing-official.md - Security isolation
  • reference/claude-code-headless-official.md - Programmatic and CI/CD usage
  • reference/claude-code-devcontainers-official.md - Containerized environments
  • reference/claude-code-cli-reference-official.md - Command-line interface
  • reference/claude-code-statusline-official.md - Custom status display
  • reference/advanced-agent-patterns.md - Engineering best practices

Quick Reference

Skills: Model-invoked extensions in ~/.claude/skills/ (personal) or .claude/skills/ (project). Three-level progressive disclosure. Max 500 lines.

Sub-agents: Specialized assistants via Agent(subagent_type="..."). Context window follows the session model (Sonnet 5 = 1M native on the Anthropic API; Haiku / gateway / older models = 200K — CC 2.1.197). Nesting: by default a subagent CAN spawn subagents of its own, up to three layers below the main conversation; CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH changes the limit and 1 turns nesting off (CC 2.1.217+). At the depth limit Claude Code withholds the Agent tool. To stop one specific subagent from spawning, omit Agent from its tools list or add it to disallowedTools — MoAI retained agents omit Agent with one deliberate carve-out — manager-lead carries it as the sole depth-1 fan-out seam, and every leaf worker it spawns MUST omit Agent (the depth-2 seal, enforced at lint time; sentinel DEPTH_SEAL_VIOLATION) — so nothing re-delegates below that one layer, regardless of the depth setting. To create or manage subagents, ask Claude or edit .claude/agents/ directly — the /agents wizard was removed in CC 2.1.198 (the official sub-agents doc still documented a /agents tabbed interface as of 2026-07-03; doc lag — verify in a live 2.1.198 session).

Plugins: Reusable bundles in .claude-plugin/plugin.json. Include commands, agents, skills, hooks, MCP servers.

Commands: User-invoked via /command. Parameters: $ARGUMENTS, $1, $2. File refs: @file.

Hooks: Events in settings.json. PreToolUse, PostToolUse, SessionStart, SessionEnd, PreCompact, Notification.

Memory: CLAUDE.md files + .claude/rules/*.md. Enterprise to Project to User hierarchy. @import syntax.

Settings: 6-level hierarchy. Managed to file-managed to CLI to local to shared to user.

Sandboxing: OS-level isolation. Filesystem and network restrictions. Auto-allow safe operations.

Headless: -p flag for non-interactive. --allowedTools, --json-schema, --agents for automation.

Skill Creation

Progressive Disclosure Architecture

Level 1 (Metadata): Name and description loaded at startup, approximately 100 tokens per Skill

Level 2 (Instructions): SKILL.md body loaded when triggered, under 5K tokens recommended

Level 3 (Resources): Additional files loaded on demand, effectively unlimited

Required Format

Create a SKILL.md file with YAML frontmatter containing name in kebab-case and description explaining what it does and when to use it in third person. Maximum 1024 characters for description. After the frontmatter, include a heading with the skill name, a Quick Start section with brief instructions, and a Details section referencing REFERENCE.md for more information.

Best Practices

  • Third person descriptions (does not I do)
  • Include trigger terms users mention
  • Keep under 500 lines
  • One level deep references
  • Test with Haiku, Sonnet, Opus

Sub-agent Creation

Using /agents Command

CC 2.1.198 CHANGELOG delta: The /agents wizard was removed — per the CHANGELOG, "ask Claude to create or manage subagents, or edit .claude/agents/ directly." The official sub-agents doc still documented a /agents tabbed interface as of 2026-07-03 (doc lag, or the removal covers only the creation wizard); verify in a live 2.1.198 session before relying on the flow below.

Type /agents, select Create New Agent, define purpose and tools, press e to edit prompt.

File Format

Create a markdown file with YAML frontmatter containing name, description explaining when to invoke (use PROACTIVELY for auto-delegation), tools as comma-separated list (Read, Write, Bash), and model specification (sonnet). After frontmatter, include the system prompt.

Critical Rules

  • Nesting is allowed by default (three layers below the main conversation); MoAI retained agents omit Agent from tools, so they do not spawn subagents of their own
  • Cannot use AskUserQuestion effectively
  • All user interaction before delegation
  • Context window follows the session model (Sonnet 5 = 1M native on the Anthropic API; Haiku / gateway / older models = 200K — CC 2.1.197)

Plugin Creation

Directory Structure

Create my-plugin directory with .claude-plugin/plugin.json, commands directory, agents directory, skills directory, hooks/hooks.json, and .mcp.json file.

Manifest (plugin.json)

Create a JSON object with name, description explaining plugin purpose, version as 1.0.0, and author object containing name field.

Commands

Use /plugin install owner/repo to install from GitHub. Use /plugin validate . to validate current directory. Use /plugin enable plugin-name to enable a plugin.

Advanced Agent Patterns

Two-Agent Pattern for Long Tasks

Initializer agent: Sets up environment, feature registry, progress docs

Executor agent: Works single features, updates registry, maintains progress

See reference/advanced-agent-patterns.md for details.

Orchestrator-Worker Architecture

Lead agent: Decomposes tasks, spawns workers, synthesizes results

Worker agents: Execute focused tasks, return condensed summaries

Context Engineering Principles

  • Smallest set of high-signal tokens
  • Just-in-time retrieval over upfront loading
  • Context compaction for long sessions
  • External memory files persist outside window

Tool Design Best Practices

  • Consolidate related functions into single tools
  • Return high-signal context-aware responses
  • Clear parameter names (user_id not user)
  • Instructive error messages with examples

Explore/Search Performance Optimization

When using Explore agent or direct exploration tools (Grep, Glob, Read), apply these optimizations to prevent performance bottlenecks with GLM models:

AST-Grep Priority

  • Use structural search (ast-grep) before text-based search (Grep)
  • Run moai ast-grep to scan, moai ast-edit to rewrite matches
  • Example: sg -p 'class $X extends Service' --lang python is faster than grep -r "class.*extends.*Service"

Search Scope Limitation

  • Always use path parameter to limit search scope
  • Example: Grep(pattern="func ", path="internal/core/") instead of Grep(pattern="async def")

File Pattern Specificity

  • Use specific Glob patterns instead of wildcards
  • Example: Glob(pattern="internal/core/*.go") instead of Glob(pattern="src/**/*.py")

Parallel Processing

  • Execute independent searches in parallel (single message, multiple tool calls)
  • Maximum 5 parallel searches to prevent context fragmentation

Workflow: Explore-Plan-Code-Commit

Phase 1 Explore: Read files, understand structure, map dependencies

Phase 2 Plan: Use think prompts, outline approach, define criteria

Phase 3 Code: Implement iteratively, verify each step, handle edges

Phase 4 Commit: Descriptive messages, logical groupings, clean history

MoAI-ADK Integration

Core Skills

  • moai-foundation-cc: This authoring kit
  • moai-foundation-core: SPEC system and workflows
  • moai-foundation-philosopher: Strategic thinking

Essential Sub-agents

  • manager-spec: EARS specifications
  • manager-develop: DDD execution
  • Agent(general-purpose) with security instructions: Security analysis
  • Agent(general-purpose) with backend instructions: API development
  • Agent(general-purpose) with frontend instructions: UI implementation

Security Features

Sandboxing

  • Filesystem: Write restricted to cwd
  • Network: Domain allowlists via proxy
  • OS-level: bubblewrap (Linux), Seatbelt (macOS)

Dev Containers

  • Security-hardened with firewall
  • Whitelisted outbound only
  • --dangerously-skip-permissions for trusted only

Headless Safety

  • Always use --allowedTools in CI/CD
  • Validate inputs before passing to Claude
  • Handle errors with exit codes

Resources

For detailed patterns and working examples, see the reference directory.

Version History:

  • v5.0.0: Converted to narrative format per CLAUDE.md Documentation Standards
  • v4.0.0: Added plugins, sandboxing, headless, statusline, dev containers, CLI reference, advanced patterns
  • v3.0.0: Added progressive disclosure, sub-agent details, integration patterns
  • v2.0.0: Initial comprehensive release

Common Rationalizations

RationalizationReality
"I will use Bash sed instead of Edit, it is faster"Edit is the preferred tool for accuracy and review. Bash sed errors are silent and hard to trace.
"This hook does not need a timeout, it finishes quickly"Hooks without timeouts can hang the entire session. Always set an explicit timeout.
"I can put all logic in CLAUDE.md, rules are overkill"CLAUDE.md has a 40K character limit. Rules load conditionally and scale without bloating the prompt.
"Settings.json changes are low risk"Incorrect settings.json breaks hooks, permissions, and model routing. Validate the JSON after every edit.
"I will skip progressive disclosure, all content is needed"Loading 5K tokens for every skill wastes 67% of context. Level 1 metadata is sufficient for routing.
"allowed-tools restricts which tools the skill may use"It does the opposite: allowed-tools pre-approves those tools for the turn that invokes the skill, so they run without a permission prompt. The field that removes tools is disallowed-tools. Omitting allowed-tools is not a leak — the standard permission model still applies.

Red Flags

  • CLAUDE.md exceeds 40,000 characters
  • Hook registered in settings.json without a corresponding script file
  • Skill frontmatter grants a broad allowed-tools set when a narrow one would do (the field pre-approves tools, so every entry is a permission prompt waived)
  • Agent definition uses YAML array for tools instead of CSV string
  • settings.json contains hardcoded absolute paths instead of $CLAUDE_PROJECT_DIR
  • Progressive disclosure disabled for a skill that exceeds 3000 tokens

Verification

  • CLAUDE.md character count is under 40,000 (show wc -c output)
  • settings.json is valid JSON (show json validation output)
  • Every hook in settings.json has a matching script file in .claude/hooks/
  • Skill allowed-tools lists only the tools the skill actually runs (space-separated, comma-separated, and YAML-list forms are all accepted)
  • Agent frontmatter uses CSV for tools and YAML array for skills
  • All metadata values in skill frontmatter are quoted strings
  • $CLAUDE_PROJECT_DIR used instead of absolute paths in hook commands

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 Moai Foundation Cc AI skill do?

Canonical Claude Code authoring kit covering Skills, sub-agents, plugins, slash commands, hooks, memory, settings, sandboxing, headless mode, and advanced agent patterns. Use when creating Claude Code extensions or configuring Claude Code features.

Why use Moai Foundation Cc on TypingMind?

Because you install it once and use it with any model. Moai Foundation Cc 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 Moai Foundation Cc in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-foundation-cc. 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 Moai Foundation Cc?

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 Moai Foundation Cc?

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

Is the Moai Foundation Cc AI skill free?

Yes. It is published on GitHub by modu-ai under the Apache-2.0 license. 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 👇