moai-workflow-design-context

Loads design briefs from .moai/design/ and injects token-capped context into design workflows.

2|Updated May 27, 2026
One-click install
npx skills add https://github.com/yekinya/moai-novel --skill moai-workflow-design-context-yekinya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-workflow-design-context
Source: https://github.com/yekinya/moai-novel/tree/main/moai-novel/.claude/skills/moai-workflow-design-context
Command: npx skills add https://github.com/yekinya/moai-novel --skill moai-workflow-design-context-yekinya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Design workflows often lose access to human-authored briefs because manually attaching research, system, and spec documents to every subagent prompt is repetitive and risks exceeding token budgets. This Skill automatically consolidates those documents into a single context block with priority-based truncation. ## Core Features & Use Cases - Automatic Design Context Loading: Reads spec, system, research, and pencil-plan Markdown files from .moai/design/ and injects them into the /moai design workflow during Phase B2.5. - Token Budget Enforcement: Estimates tokens per file and drops lower-priority documents (pencil-plan first, spec always preserved) or truncates at section boundaries when the budget is exceeded. - Graceful Degradation: Skips TBD-only scaffold files, tolerates missing directories and unreadable files, and supports standalone invocation with a custom directory. - Use Case: A team runs /moai design and the expert-frontend agent automatically receives the project's spec.md and system.md content, trimmed to fit a 20000-token budget, without any manual copy-pasting. ## Quick Start Ask the AI to load the design context from .moai/design/ and inject it into the design workflow prompt.

Frequently Asked Questions about moai-workflow-design-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically attach design documents to an AI design workflow?

Place your spec.md, system.md, research.md, and pencil-plan.md files in .moai/design/ and enable design_docs.auto_load_on_design_command in design.yaml. The context block is then injected automatically during Phase B2.5 of the /moai design workflow.

How does token budget truncation work for design context files?

Each file's tokens are estimated as ceiling(char_count / 4) * 1.10. Files are included in priority order (spec, system, research, pencil-plan); when the budget is exceeded, the lowest-priority file is dropped first, and a single oversized file is truncated at the nearest section heading.

Can I load design briefs from a custom directory instead of .moai/design/?

Yes, invoke the skill standalone with an explicit dir argument such as dir=/path/to/alt-design/. All file reads then target that directory exclusively, and no reads are made against the default .moai/design/ path.

What happens if design files are missing or only contain _TBD_ placeholders?

If the directory is missing, an empty context block with only the header is returned. Files containing only _TBD_ scaffold markers are skipped, and if all files are placeholders, the output contains just the header with a log message.

What happens when one design file cannot be read due to permissions?

The unreadable file's token name is added to a warnings array and processing continues with the remaining files. The output includes the available source sections plus a warnings line listing each unreadable file and its reason.