Synthèse automatique
Cette compétence définit les principes fondamentaux du développement assisté par IA, incluant les garde-fous de qualité TRUST 5, le workflow TDD orienté spécification, les patrons de délégation, l'optimisation des tokens et l'architecture modulaire.
Points forts
- Fournit un système d'assurance qualité complet avec des barrières automatisées
- impose un développement piloté par les tests et des workflows structurés
- inclut une gestion du budget de tokens pour l'efficacité
- favorise une organisation modulaire et évolutive du code.
Limites
- Nécessite une configuration initiale importante et l'adhésion de l'équipe
- peut introduire une surcharge pour les projets petits ou simples
- étroitement intégré à l'écosystème MoAI-ADK.
À utiliser lors de la construction de systèmes de développement complexes assistés par IA qui exigent une haute qualité, traçabilité et utilisation efficace des ressources.
À éviter pour les prototypes rapides ou les scripts simples où les processus formels ralentiraient le développement sans bénéfice proportionnel.
Analyse de sécurité
SûrThe skill is a declarative guide with no executable payloads, no obfuscated code, and no instructions to perform destructive or exfiltrating actions. The allowed tools are all read-only and safe.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
Run TRUST 5 quality gates on my current codebase and report any failures.Set up a SPEC-First TDD workflow for the new feature I'm about to implement.Analyze my current development session and optimize token usage to stay within the 200K budget.name: "moai-foundation-core" description: "MoAI-ADK's foundational principles - TRUST 5, SPEC-First TDD, delegation patterns, token optimization, progressive disclosure, modular architecture, agent catalog, command reference, and execution rules for building AI-powered development workflows" version: 2.4.0 category: "foundation" modularized: true user-invocable: false tags: ['foundation', 'core', 'orchestration', 'agents', 'commands', 'trust-5', 'spec-first-tdd'] updated: 2026-01-11 status: "active" allowed-tools:
- Read
- Grep
- Glob
- mcp__context7__resolve-library-id
- mcp__context7__get-library-docs
MoAI Foundation Core
Foundational principles and architectural patterns that power MoAI-ADK's AI-driven development workflow.
Core Philosophy: Quality-first, test-driven, modular, and efficient AI development through proven patterns and automated workflows.
Quick Reference
What is MoAI Foundation Core?
Six essential principles that ensure quality, efficiency, and scalability in AI-powered development:
- TRUST 5 Framework - Quality gate system (Test-first, Readable, Unified, Secured, Trackable)
- SPEC-First TDD - Specification-driven test-driven development workflow
- Delegation Patterns - Task orchestration via specialized agents (never direct execution)
- Token Optimization - 200K budget management and context efficiency
- Progressive Disclosure - Three-tier knowledge delivery (Quick, Implementation, Advanced)
- Modular System - File splitting and reference architecture for scalability
Quick Access:
- Quality standards in modules/trust-5-framework.md
- Development workflow in modules/spec-first-tdd.md
- Agent coordination in modules/delegation-patterns.md
- Budget management in modules/token-optimization.md
- Content structure in modules/progressive-disclosure.md
- File organization in modules/modular-system.md
- Agent catalog in modules/agents-reference.md
- Command reference in modules/commands-reference.md
- Security and constraints in modules/execution-rules.md
Use Cases:
- New agent creation with quality standards
- New skill development with structural guidelines
- Complex workflow orchestration
- Token budget planning and optimization
- Documentation architecture design
- Quality gate configuration
Implementation Guide
1. TRUST 5 Framework - Quality Assurance System
Purpose: Automated quality gates ensuring code quality, security, and maintainability.
Five Pillars:
Test-first Pillar: Maintain test coverage at or above 85 percent. Execute pytest with coverage reporting. Block merge and generate missing tests on failure. High coverage ensures code reliability and reduces production defects. Catches bugs early and reduces debugging time by 60-70 percent.
Readable Pillar: Use clear and descriptive naming conventions. Execute ruff linter checks. Issue warning and suggest refactoring improvements on failure. Clear naming improves code comprehension and team collaboration. Reduces onboarding time by 40 percent and improves maintenance velocity.
Unified Pillar: Apply consistent formatting and import patterns. Execute black formatter and isort checks. Auto-format code or issue warning on failure. Consistency eliminates style debates and merge conflicts. Reduces code review time by 30 percent and improves readability.
Secured Pillar: Comply with OWASP security standards. Execute security-expert agent analysis. Block merge and require security review on failure. Security vulnerabilities create critical business and legal risks. Prevents 95+ percent of common security vulnerabilities.
Trackable Pillar: Write clear and structured commit messages. Match Git commit message regex patterns. Suggest proper commit message format on failure. Clear history enables debugging, auditing, and collaboration. Reduces issue investigation time by 50 percent.
Integration Points: Pre-commit hooks for automated validation, CI/CD pipelines for quality gate enforcement, Agent workflows for core-quality validation, Documentation for quality metrics.
Detailed Reference: modules/trust-5-framework.md
2. SPEC-First TDD - Development Workflow
Purpose: Specification-driven development ensuring clear requirements before implementation.
Three-Phase Workflow:
Phase 1 SPEC (/moai:1-plan): workflow-spec generates EARS format. Output is .moai/specs/SPEC-XXX/spec.md. Execute /clear to save 45-50K tokens.
Phase 2 TDD (/moai:2-run): RED for failing tests, GREEN for passing code, REFACTOR for optimization. Validate with at least 85% coverage.
Phase 3 Docs (/moai:3-sync): API documentation, architecture diagrams, project reports.
EARS Format: Ubiquitous for system-wide always active requirements. Event-driven for trigger-based when X do Y requirements. State-driven for conditional while X do Y requirements. Unwanted for prohibited shall not do X requirements. Optional for nice-to-have where possible do X requirements.
Token Budget: SPEC takes 30K, TDD takes 180K, Docs takes 40K, Total is 250K.
Key Practice: Execute /clear after Phase 1 to initialize context.
Detailed Reference: modules/spec-first-tdd.md
3. Delegation Patterns - Agent Orchestration
Purpose: Task delegation to specialized agents, avoiding direct execution.
Core Principle: Alfred must delegate all work through Task() to specialized agents. Direct execution bypasses specialization, quality gates, and token optimization. Proper delegation improves task success rate by 40 percent and enables parallel execution.
Delegation Syntax: Call Task with subagent_type parameter for specialized agent, prompt parameter for clear specific task, and context parameter with relevant data dictionary.
Three Patterns:
Sequential for dependencies: Call Task to api-designer for design, then Task to backend-expert for implementation with design context.
Parallel for independent work: Call Promise.all with Task to backend-expert and Task to frontend-expert simultaneously.
Conditional for analysis-based: Call Task to debug-helper for analysis, then based on analysis.type, call Task to security-expert or other appropriate agent.
Agent Selection: Simple tasks with 1 file use 1-2 agents sequential. Medium tasks with 3-5 files use 2-3 agents sequential. Complex tasks with 10+ files use 5+ agents mixed.
Detailed Reference: modules/delegation-patterns.md
4. Token Optimization - Budget Management
Purpose: Efficient 200K token budget through strategic context management.
Budget Allocation:
SPEC Phase takes 30K tokens. Strategy is to load requirements only and execute /clear after completion. Specification phase requires minimal context for requirement analysis. Saves 45-50K tokens for implementation phase.
TDD Phase takes 180K tokens. Strategy is selective file loading, load only implementation-relevant files. Implementation requires deep context but not full codebase. Enables 70 percent larger implementations within budget.
Docs Phase takes 40K tokens. Strategy is result caching and template reuse. Documentation builds on completed work artifacts. Reduces redundant file reads by 60 percent.
Total Budget is 250K tokens across all phases. Phase separation with context reset between phases provides clean context boundaries and prevents token bloat. Enables 2-3x larger projects within same budget.
Token Saving Strategies:
Phase Separation: Execute /clear between phases, after /moai:1-plan to save 45-50K, when context exceeds 150K, after 50+ messages.
Selective Loading: Load only necessary files.
Context Optimization: Target 20-30K tokens.
Model Selection: Sonnet for quality, Haiku for speed and cost with 70% cheaper rates for 60-70% total savings.
Detailed Reference: modules/token-optimization.md
5. Progressive Disclosure - Content Architecture
Purpose: Three-tier knowledge delivery balancing value with depth.
Three Levels:
Quick Reference Level: 30 seconds time investment, core principles and essential concepts, approximately 1,000 tokens. Rapid value delivery for time-constrained users. Users gain 80 percent understanding in 5 percent of time.
Implementation Level: 5 minutes time investment, workflows, practical examples, integration patterns, approximately 3,000 tokens. Bridges concept to execution with actionable guidance. Enables immediate productive work without deep expertise.
Advanced Level: 10+ minutes time investment, deep technical dives, edge cases, optimization techniques, approximately 5,000 tokens. Provides mastery-level knowledge for complex scenarios. Reduces escalations by 70 percent through comprehensive coverage.
SKILL.md Structure (maximum 500 lines): Quick Reference section, Implementation Guide section, Advanced Patterns section, Works Well With section.
Module Architecture: SKILL.md as entry point with cross-references, modules directory for deep dives with unlimited size, examples.md for working samples, reference.md for external links.
File Splitting when exceeding 500 lines: SKILL.md contains Quick at 80-120 lines, Implementation at 180-250 lines, Advanced at 80-140 lines, References at 10-20 lines. Overflow content goes to modules/topic.md.
Detailed Reference: modules/progressive-disclosure.md
6. Modular System - File Organization
Purpose: Scalable file structure enabling unlimited content.
Standard Structure: Create .claude/skills/skill-name/ directory containing SKILL.md as core file under 500 lines, modules directory for extended content with unlimited size including patterns.md, examples.md for working samples, reference.md for external links, scripts directory for utilities (optional), templates directory (optional).
File Principles: SKILL.md stays under 500 lines with progressive disclosure and cross-references. modules directory is topic-focused with no limits and self-contained content. examples.md is copy-paste ready with comments. reference.md contains API docs and resources.
Cross-Reference Syntax: Reference modules as Details in modules/patterns.md, reference examples as Examples in examples.md#auth, reference external docs as External in reference.md#api.
Discovery Flow: SKILL.md to Topic to modules/topic.md to Deep dive.
Detailed Reference: modules/modular-system.md
Advanced Implementation
Advanced patterns including cross-module integration, quality validation, and error handling are available in the detailed module references.
Key Advanced Topics:
- Cross-Module Integration: Combining TRUST 5 + SPEC-First TDD
- Token-Optimized Delegation: Parallel execution with context reset
- Progressive Agent Workflows: Escalation patterns
- Quality Validation: Pre/Post execution validation
- Error Handling: Delegation failure recovery
Detailed Reference: examples.md for working code samples
Works Well With
Agents: agent-factory for creating agents with foundation principles, skill-factory for generating skills with modular architecture, core-quality for automated TRUST 5 validation, workflow-spec for EARS format specification, workflow-tdd for RED-GREEN-REFACTOR execution, workflow-docs for documentation with progressive disclosure.
Skills: moai-cc-claude-md for CLAUDE.md with foundation patterns, moai-cc-configuration for config with TRUST 5, moai-cc-memory for token optimization, moai-context7-integration for MCP integration.
Tools: AskUserQuestion for direct user interaction and clarification needs.
Commands: /moai:1-plan for SPEC-First Phase 1, /moai:2-run for TDD Phase 2, /moai:3-sync for Documentation Phase 3, /moai:9-feedback for continuous improvement, /clear for token management.
Foundation Modules (Extended Documentation): modules/agents-reference.md for 26-agent catalog with 7-tier hierarchy, modules/commands-reference.md for 6 core commands workflow, modules/execution-rules.md for security, Git strategy, and compliance.
Quick Decision Guide
New Agent: Primary principle is TRUST 5 and Delegation. Supporting principles are Token Optimization and Modular.
New Skill: Primary principle is Progressive and Modular. Supporting principles are TRUST 5 and Token Optimization.
Workflow: Primary principle is Delegation Patterns. Supporting principles are SPEC-First and Token Optimization.
Quality: Primary principle is TRUST 5 Framework. Supporting principle is SPEC-First TDD.
Budget: Primary principle is Token Optimization. Supporting principles are Progressive and Modular.
Docs: Primary principle is Progressive and Modular. Supporting principle is Token Optimization.
Module Deep Dives: modules/trust-5-framework.md, modules/spec-first-tdd.md, modules/delegation-patterns.md, modules/token-optimization.md, modules/progressive-disclosure.md, modules/modular-system.md, modules/agents-reference.md, modules/commands-reference.md, modules/execution-rules.md.
Full Examples: examples.md External Resources: reference.md
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/moai-foundation-core-principles-mm5t8ady/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/moai-foundation-core-principles-mm5t8ady' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/moai-foundation-core-principles-mm5t8ady/download' --output '.skill-downloads/moai-foundation-core-principles-mm5t8ady/SKILL.md.part' && mv '.skill-downloads/moai-foundation-core-principles-mm5t8ady/SKILL.md.part' '.skill-downloads/moai-foundation-core-principles-mm5t8ady/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Extrait original : Quick Reference
What is MoAI Foundation Core?
Six essential principles that ensure quality, efficiency, and scalability in AI-powered development:
- TRUST 5 Framework - Quality gate system (Test-first, Readable, Unified, Secured, Trackable)
- SPEC-First TDD - Specification-driven test-driven development workflow
- Delegation Patterns - Task orchestration via specialized agents (never direct execution)
- Token Optimization - 200K budget management and context efficiency
- Progressive Disclosure - Three-tier knowledge delivery (Quick, Implementation, Advanced)
- Modular System - File splitting and reference architecture for scalability
Quick Access:
- Quality standards in modules/trust-5-framework.md
- Development workflow in modules/spec-first-tdd.md
- Agent coordination in modules/delegation-patterns.md
- Budget management in modules/token-optimization.md
- Content structure in modules/progressive-disclosure.md
- File organization in modules/modular-system.md
- Agent catalog in modules/agents-reference.md
- Command reference in modules/commands-reference.md
- Security and constraints in modules/execution-rules.md
Use Cases:
- New agent creation with quality standards
- New skill development with structural guidelines
- Complex workflow orchestration
- Token budget planning and optimization
- Documentation architecture design
- Quality gate configuration
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/moai-foundation-core-principles-mm5t8ady/SKILL.md' && test -s '.skill-downloads/moai-foundation-core-principles-mm5t8ady/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/moai-foundation-core' && cp -R '.skill-downloads/moai-foundation-core-principles-mm5t8ady' '.claude/skills/moai-foundation-core'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/moai-foundation-core-principles-mm5t8ady'openskills read 'moai-foundation-core-principles-mm5t8ady'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/moai-foundation-core-principles-mm5t8ady/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.