moai-alfred-rules
npx skills add https://github.com/ajbcoding/claude-skill-eval --skill moai-alfred-rules
Agent 安装分布
Skill 文档
Skill ê°ì
moai-alfred-rulesë Alfred SuperAgentì ìì¬ê²°ì ê³¼ ì¤íì ì ì´íë íµì¬ íë ììí¬ì ëë¤.
| í목 | ê° |
|---|---|
| ë²ì | 4.0.0 (November 2025 enterprise) |
| í°ì´ | Alfred (ìì ê³ì¸µ) |
| ìë ë¡ë | ê·ì¹ ê²ì¦, íì§ ê²ì´í¸, ìí¤í ì² ê·ì¹ íì ì |
| ìí¤í ì² í¨ë¬ë¤ì | Agent-First (Command â Agent â Skill â Hook) |
| ìí¬íë¡ì° ëª¨ë¸ | 4-Step ADAP Workflow |
무ìì íëê°?
íµì¬ ì± ì
- 3-Layer Architecture ì ì: Commands â Agents â Skills ê³ì¸µ ë¶ë¦¬
- 4-Step Workflow ê·ì¹: ADAP (Analyze, Design, Assure, Produce) + Intent
- Agent-First Paradigm: 모ë ì¤í ìì ì agentsì ìì
- Skill í¸ì¶ ê·ì¹: 10+ mandatory patterns, invocation syntax
- AskUserQuestion í¨í´: 5ê°ì§ íì ì¬ì© ìë리ì¤
- TRUST 5 Quality Gates: T/R/U/S/T ê°ê°ì ê²ì¦ 기ì¤
- TAG Chain Integrity: SPECâTESTâCODEâDOC ì¶ì
- Commit Message Standards: TDD cycle message formats
ì¸ì ì¬ì©íëê°?
íì ìëë¦¬ì¤ (MUST use)
| ìí© | ì¬ì© ì¬ë¶ |
|---|---|
| â Skill() í¸ì¶ ê·ì¹ ê²ì¦ | íì |
| â Command vs Agent ìí ë¶ë¦¬ | íì |
| â AskUserQuestion ì¬ì© íë¨ | íì |
| â TRUST 5 ì¤ì íì¸ | íì |
| â TAG ì²´ì¸ ë¬´ê²°ì± ê²ì¦ | íì |
| â ì»¤ë° ë©ìì§ íì íì¸ | íì |
| â ìí¬íë¡ì° compliance ê²ì¦ | íì |
| â Agent delegation ì¬ë°ë¥¸ì§ íì¸ | íì |
| â íì§ ê²ì´í¸(quality gate) íµê³¼ | íì |
| â ìí¤í ì² ê·ì¹ ìë° ê°ì§ | íì |
Rule 1: 3-Layer Architecture (November 2025 Standard)
ê³ì¸µ 구조
âââââââââââââââââââââââââââââââââââââââ
â Commands (Orchestration Only) â â User-facing entry points
â /alfred:0-project, /alfred:1-plan â No direct execution
â /alfred:2-run, /alfred:3-sync â
ââââââââââââ¬âââââââââââââââââââââââââââ
â Task(subagent_type="...")
â
âââââââââââââââââââââââââââââââââââââââ
â Agents (Domain Expertise) â â Deep reasoning
â spec-builder, tdd-implementer â Complex decisions
â test-engineer, doc-syncer â Plan â Execute
â git-manager, qa-validator â
ââââââââââââ¬âââââââââââââââââââââââââââ
â Skill("skill-name")
â
âââââââââââââââââââââââââââââââââââââââ
â Skills (Knowledge Capsules) â â Reusable patterns
â 55 specialized Skills â Playbooks
â < 1000 lines each â Best practices
âââââââââââââââââââââââââââââââââââââââ
ê·ì¹ 1.1: Commands – Orchestration ONLY
ê¸ì§ ì¬í (â):
# â WRONG: ì§ì ìì
ì¤í
echo "Building application..."
python setup.py build
git commit -m "Build"
# â WRONG: Skill ì§ì í¸ì¶
Skill("moai-alfred-rules") # Commandsìì ê¸ì§!
# â WRONG: ë³µì¡í ë¡ì§ 구í
if feature_type == "backend":
# ë³µì¡í ë¹ì¦ëì¤ ë¡ì§...
íì ì¬í (â ):
# â
CORRECT: Agentì ìì
Task(
subagent_type="tdd-implementer",
description="Build and test application",
prompt="Implement feature with RED-GREEN-REFACTOR cycle"
)
# â
CORRECT: ìì¬ê²°ì ë§ íê³ ìì
if user_approval_needed:
AskUserQuestion(...) # ì¬ì©ì íì¸ í ìì
Task(subagent_type="implementation-planner", ...)
ê·ì¹ 1.2: Agents – Domain Expertise Ownership
agentì ì± ì:
- â ë³µì¡í ë¶ì & ì¶ë¡ (deep reasoning)
- â ê³í ì립 (planning)
- â ìì¬ê²°ì (decision-making)
- â Skill í¸ì¶ ë° ì¡°ì¨ (orchestration within domain)
- â ìì ì¤í (execution)
ìì: tdd-implementer Agent:
Agent receives: "Implement user authentication"
â
1. Analyze: SPEC ê²í , ì구ì¬í ë¶ì
2. Design: ìí¤í
ì² ì¤ê³
3. RED: test-engineer Skill í¸ì¶ â í
ì¤í¸ ìì±
4. GREEN: ì½ë 구í
5. REFACTOR: ìµì í
6. Commit: git-manager í¸ì¶ â commit
â
Returns: Fully tested, documented, committed code
ê·ì¹ 1.3: Skills – Knowledge Capsules (Stateless)
Skill í¹ì±:
- â ìíê° ìì (stateless)
- â ì¬ì¬ì© ê°ë¥ (reusable)
- â Agentì ìí´ í¸ì¶ë¨ (called by agents)
- â 1000ì¤ ì´í (< 1000 lines)
- â ë¨ì¼ 주ì (single topic)
ê¸ì§ (â):
# â WRONG: Skillì´ ë¤ë¥¸ Skill í¸ì¶
Skill("moai-foundation-git") # â Skillsìì ê¸ì§!
# â WRONG: Skillì´ Task() ì¤í
Task(subagent_type="...") # â Skillsìì ê¸ì§!
# â WRONG: Skillì´ ìí ì ì§
state = {"counter": 0} # â Stateless ìë°
Rule 2: 4-Step Agent-Based Workflow (November 2025)
Phase Overview
Phase 0: INTENT Phase 1: ANALYZE
ââââââââââââââââââââ ââââââââââââââââââââ
â User Request â âclarity?ââ â WebSearch â
â Ambiguous? â NO â WebFetch â
â â
YES: clarify â YES â Research â
â â
NO: continue ââââââââââââââ â Best practices â
ââââââââââââââââââââ ââââââââââââââââââââ
â
Phase 3: ASSURE Phase 2: DESIGN
ââââââââââââââââââââ ââââââââââââââââââââ
â Quality Gate ââââââââââââââââââ Architecture â
â TRUST 5 â â Latest info â
â TAG integrity â â Version specs â
â Compliance â â Design patterns â
ââââââââââââââââââââ ââââââââââââââââââââ
â
Phase 4: PRODUCE
ââââââââââââââââââââ
â Skill invocation â
â File generation â
â Commit â
ââââââââââââââââââââ
Phase 0: Intent (ì¬ì©ì ìë íì )
ê·ì¹ 0.1: Intentê° ëª¨í¸íë©´ AskUserQuestion ì¬ì©
ìí©: "ë°ì´í° ì²ë¦¬ 모ë ë§ë¤ì´ì¤"
Step 1: Intent íê°
ââ Clarity: LOW (ì´ë¤ ë°ì´í°? ì´ë¤ ì²ë¦¬?)
ââ Action: AskUserQuestion ì¬ì©
Step 2: ëª
íí
AskUserQuestion({
question: "ì´ë¤ ë°ì´í°ë¥¼ ì²ë¦¬íëì?",
options: [
"CSV íì¼",
"ë°ì´í°ë² ì´ì¤",
"API ìëµ"
]
})
Step 3: ëª
íí ì구ì¬í íë³´ í ë¤ì phaseë¡
Phase 1: Analyze (ì ë³´ ìì§ & ì°êµ¬)
ë구: WebSearch, WebFetch
Task 1: Research latest information
ââ Search: "[framework] [version] best practices 2025"
ââ Fetch: Official documentation URLs
ââ Validate: Cross-check multiple sources
Task 2: Collect best practices
ââ Official docs
ââ Industry standards
ââ Current patterns (2025)
Task 3: Identify version-specific guidance
ââ Current stable version
ââ Breaking changes
ââ Deprecation warnings
Phase 2: Design (ìí¤í ì² ì¤ê³)
ì ë ¥: Phase 1ì ì°êµ¬ ê²°ê³¼ ì¶ë ¥: November 2025 ìµì ì 보를 기ë°í ì¤ê³
Design Activities:
ââ ìµì ì ë³´ ê¸°ë° ì´ë¦ ì§ì
ââ íì¬ ë²ì ëª
ì
ââ ìµì í¨í´ í¬í¨
ââ ê³µì 문ì ë§í¬
ââ ë§ì§ë§ ì
ë°ì´í¸ ë ì§ í¬í¨
Phase 3: Assure (íì§ ê²ì¦)
TRUST 5 Quality Gates:
| Gate | ê²ì¦ ê¸°ì¤ |
|---|---|
| Test | 85%+ coverage, 모ë ê²½ë¡ í ì¤í¸ |
| Readable | Clean code, SOLID ìì¹, 주ì í¬í¨ |
| Unified | ì¼ê´ë í¨í´, ì¤ë³µ ì ê±°, ë¤ì´ë° íì¤ |
| Secured | OWASP Top 10 íì¸, ë¹ë°ì ë³´ ì ê±° |
Phase 4: Produce (ìì± & ë°°í¬)
ì± ì: Skill í¸ì¶ (ì: moai-skill-factory)
Actions:
ââ í
í릿 ì ì©
ââ íì¼ ìì±
ââ ë©íë°ì´í° ì¶ê°
ââ ìµì ì ë³´ embedded
ââ ê³µì 문ì ë§í¬ í¬í¨
ââ Version date í기
Rule 3: Agent-First Paradigm (Critical Enforcement)
ê¸ì§ë ìì (â ABSOLUTELY FORBIDDEN)
Alfred (ëë Command)ê° ì§ì ì¤ííë©´ ì ë ì ë©ëë¤:
-
ì§ì bash ëª ë ¹ ì¤í â
# â WRONG bash("git commit -m 'message'") os.system("python build.py") # â CORRECT Task(subagent_type="git-manager", prompt="Commit changes") -
íì¼ ì½ê¸°/ì°ê¸° â
# â WRONG with open("file.py", "w") as f: f.write(code) # â CORRECT Task(subagent_type="file-manager", prompt="Create file") -
Git ì§ì ì¡°ì â
# â WRONG subprocess.run(["git", "push", "origin", "main"]) # â CORRECT Task(subagent_type="git-manager", prompt="Push changes") -
ì½ë ë¶ì ì§ì ì¤í â
# â WRONG lines = len(open("file.py").readlines()) # â CORRECT Task(subagent_type="code-analyzer", prompt="Analyze code") -
í ì¤í¸ ì§ì ì¤í â
# â WRONG subprocess.run(["pytest", "tests/"]) # â CORRECT Task(subagent_type="test-engineer", prompt="Run tests")
ì무 ìì (â MANDATORY DELEGATION)
| ìì | ìì ëì | í¨í´ |
|---|---|---|
| ê³í ì립 | plan-agent | Task(subagent_type="plan-agent", ...) |
| ì½ë ê°ë° | tdd-implementer | Task(subagent_type="tdd-implementer", ...) |
| í ì¤í¸ ìì± | test-engineer | Task(subagent_type="test-engineer", ...) |
| 문ìí | doc-syncer | Task(subagent_type="doc-syncer", ...) |
| Git ìì | git-manager | Task(subagent_type="git-manager", ...) |
| íì§ ê²ì¦ | qa-validator | Task(subagent_type="qa-validator", ...) |
| ì¬ì©ì ì§ë¬¸ | ask-user-questions | AskUserQuestion(...) |
Rule 4: 10 Mandatory Skill Invocations
ê·ì¹ 4.1: Skill Invocation Pattern
Syntax:
Skill("skill-name") # Explicit invocation only
10ê°ì§ íì Skill
| # | Skill | ì©ë | Invocation |
|---|---|---|---|
| 1 | moai-foundation-trust | TRUST 5 ê²ì¦ | Skill("moai-foundation-trust") |
| 2 | moai-foundation-tags | TAG ê²ì¦ & ì¶ì | Skill("moai-foundation-tags") |
| 3 | moai-foundation-specs | SPEC ìì± & ê²ì¦ | Skill("moai-foundation-specs") |
| 4 | moai-foundation-ears | EARS ì구ì¬í íì | Skill("moai-foundation-ears") |
| 5 | moai-foundation-git | Git ìí¬íë¡ì° | Skill("moai-foundation-git") |
| 6 | moai-foundation-langs | ì¸ì´ & ì¤í ê°ì§ | Skill("moai-foundation-langs") |
| 7 | moai-essentials-debug | ëë²ê¹ & ìë¬ ë¶ì | Skill("moai-essentials-debug") |
| 8 | moai-essentials-refactor | 리í©í ë§ & ê°ì | Skill("moai-essentials-refactor") |
| 9 | moai-essentials-perf | ì±ë¥ ìµì í | Skill("moai-essentials-perf") |
| 10 | moai-essentials-review | ì½ë 리뷰 & íì§ | Skill("moai-essentials-review") |
ê·ì¹ 4.2: Skill Invocation ìì
# Context 1: TRUST 5 ê²ì¦ íì
if validation_required:
Skill("moai-foundation-trust")
# â ë°í: TRUST score, violations, recommendations
# Context 2: TAG ì²´ì¸ ê²ì¦
if tag_integrity_check:
Skill("moai-foundation-tags")
# â ë°í: ê³ ì TAG, ê¹¨ì§ ì²´ì¸, ì ì
# Context 3: SPEC ìì±
if spec_needed:
Skill("moai-foundation-specs")
# â ë°í: SPEC template, validation results
# Context 4: Git ìí¬íë¡ì°
if git_decision_needed:
Skill("moai-foundation-git")
# â ë°í: branch strategy, commit format, merge rules
Rule 5: AskUserQuestion Patterns (5ê°ì§ íì ìë리ì¤)
ê·ì¹ 5.1: MANDATORY Scenarios
Scenario 1: 기ì ì¤í 모í¸
ìí©: "Python ì¹ íë ììí¬ ì¶ì²í´ì¤ë?"
AskUserQuestion({
question: "ì´ë¤ ì íì ì í리ì¼ì´ì
?",
header: "Application Type",
options: [
{ label: "REST API", description: "High performance APIs" },
{ label: "Web Application", description: "Traditional MVC" },
{ label: "Microservice", description: "Event-driven" }
]
})
Scenario 2: ìí¤í ì² ê²°ì
ìí©: "ë°ì´í°ë² ì´ì¤ 모ë¸ì ì´ë»ê² ì¤ê³?"
AskUserQuestion({
question: "ì´ë¤ ë°ì´í° í¹ì±?",
header: "Data Model",
options: [
{ label: "Relational", description: "Structured, ACID" },
{ label: "Document", description: "Flexible schema" },
{ label: "Graph", description: "Relationships" }
]
})
Scenario 3: ìë 모í¸
ìí©: "ì½ë ê°ì í´ì¤ë?"
AskUserQuestion({
question: "ì´ë¤ 측면ì ê°ì ?",
header: "Improvement Focus",
options: [
{ label: "Performance", description: "Speed & efficiency" },
{ label: "Readability", description: "Code clarity" },
{ label: "Security", description: "Vulnerability fixes" }
],
multiSelect: true # ë³µì ì í íì©
})
Scenario 4: 기존 ì»´í¬ëí¸ ìí¥
ìí©: "í¨í¤ì§ ì
ê·¸ë ì´ëíë ¤ëë° í¸íì±?"
AskUserQuestion({
question: "기존 ì½ë í¸íì± ì ì§ íì?",
header: "Compatibility",
options: [
{ label: "Full compatibility", description: "Maintain all APIs" },
{ label: "Deprecation path", description: "Gradual migration" },
{ label: "Breaking OK", description: "Version bump allowed" }
]
})
Scenario 5: ìì ì ì½
ìí©: "ìì¤í
리í©í ë§ ê³í ì립"
AskUserQuestion({
question: "ìì ê°ë° 기ê°?",
header: "Timeline",
options: [
{ label: "1 week", description: "Focused scope" },
{ label: "2-4 weeks", description: "Medium refactor" },
{ label: "1+ months", description: "Comprehensive" }
]
})
ê·ì¹ 5.2: ì¬ë°ë¥¸ ì¬ì©ë²
â WRONG (í문 ì§ë¬¸):
ì¬ì©ì: "ë ì í¸í´?"
ìëµ: "ì... ìê°í´ë´¤ëë° ìë§ë..."
â CORRECT (AskUserQuestion):
AskUserQuestion({
question: "ì´ë¤ ì ê·¼ì ì í¸íìëì?",
header: "Approach",
multiSelect: false,
options: [
{ label: "Option A", description: "Benefit A, Cost B" },
{ label: "Option B", description: "Benefit C, Cost D" }
]
})
Rule 6: TRUST 5 Quality Gates (November 2025 Enterprise)
ê° Gateì ê²ì¦ 기ì¤
T: Test First (85%+ Coverage)
requirements:
coverage: "⥠85%"
coverage_tools: ["pytest-cov", "coverage.py"]
test_types:
- unit_tests: "ê° í¨ì/ë©ìë"
- integration_tests: "모ë ê° ìí¸ìì©"
- edge_cases: "ê²½ê³ê°, ìë¬ ì²ë¦¬"
validation:
- All code paths executed
- Error conditions tested
- Mock external dependencies
- No skipped tests (Ãskip, Ãxfail)
R: Readable (Clean Code)
requirements:
code_standards:
- SOLID ìì¹ ì¤ì
- DRY (Don't Repeat Yourself)
- KISS (Keep It Simple, Stupid)
documentation:
- Function docstrings
- Complex logic comments
- Type hints (Python 3.10+)
naming:
- Descriptive variable names
- Consistent conventions
- No single-letter vars (except i, j, k in loops)
U: Unified (Consistent Patterns)
requirements:
consistency:
- Same patterns across codebase
- No duplicate logic
- Shared utilities for common tasks
conventions:
- Consistent indentation (4 spaces)
- Consistent naming (snake_case, PascalCase)
- Consistent import order
validation:
- Linting (flake8, black, isort)
- Static analysis (pylint, mypy)
- No code duplication (DRY violations)
S: Secured (OWASP Top 10)
requirements:
security_checks:
- No hardcoded credentials
- No SQL injection vectors
- No XXE vulnerabilities
- Input validation
- Output encoding
tools:
- bandit (Python security linter)
- safety (dependency vulnerabilities)
- SAST scanning
validation:
- No secrets committed
- Dependencies scanned
- Known CVEs checked
requirements:
tag_chain:
- Complete history traceability
documentation:
validation:
- Bidirectional references
Rule 7: TAG Chain Integrity Rules
ê·ì¹ 7.1: TAG Naming Convention
Format: @<DOMAIN>-<###>
Examples:
ê·ì¹ 7.2: TAG Lifecycle
ââ Example: test_auth.py - test_auth_success()
ââ Example: auth.py - authenticate_user()
ââ Example: CHANGELOG.md
ê·ì¹ 7.3: TAG Validation Rules
â ìë°:
# 1. Orphan TAG (TEST/CODE ìì)
# 2. ê¹¨ì§ ì²´ì¸ (missing step)
# 3. ë¶ì¼ì¹ (ë¤ë¥¸ ë²í¸)
â ì í:
# Complete chain
Rule 8: Commit Message Standards (TDD Cycle)
ê·ì¹ 8.1: Commit Format
Format:
<type>(<tag>): <subject>
<body>
<footer>
ê·ì¹ 8.2: TDD Cycle Commits
RED Commit (í ì¤í¸ ìì±):
- test_successful_login()
- test_invalid_credentials()
- test_expired_token()
Status: RED (Tests fail as expected)
GREEN Commit (구í):
- Implement authenticate_user() function
- Add token generation
- Add error handling
Status: GREEN (All tests pass)
REFACTOR Commit (ìµì í):
- Extract token validation to separate function
- Add caching for user lookups
- Improve error messages
Status: PASSING (Tests still pass, code improved)
ê·ì¹ 8.3: Commit íì (Conventional Commits)
| íì | ì¤ëª | ìì |
|---|---|---|
| chore | ë¹ë/ì¤ì | chore: Update dependencies |
Rule 9: Workflow Compliance Validation
ê·ì¹ 9.1: Compliance Checklist
Before Commit:
- í ì¤í¸ íµê³¼ (85%+ coverage)
- Linting íµê³¼ (black, flake8)
- Security scan íµê³¼ (bandit, safety)
- ë¹ë°ì ë³´ ì ê±° (no secrets)
- ì»¤ë° ë©ìì§ íì ë§ì
Before Merge:
- TAG ì²´ì¸ ìì
- TRUST 5 íµê³¼
- Code review ìë£
- CI/CD íµê³¼
- PR ì¤ëª í¬í¨
ê·ì¹ 9.2: Violation Response
Violation Detected:
1. ìë íì§ (hook)
2. ì¬ì©ììê² ì림
3. ìì ìì²
4. ì¬ê²ì¦
5. Pass/Fail ê²°ì
3-Level Progressive Disclosure
Level 1: ë¹ ë¥¸ ìì (Beginner – 10ë¶)
ë¹ì ì´ ììì¼ í ê²:
- Command = ì¡°ì¨ë§, Agent = ì¤í
- Skill = ì 문 ë구
- ê·ì¹ ìë° â ìë¬
Level 2: ì¤ë¬´ í¨í´ (Intermediate – 30ë¶)
ë¹ì ì´ í´ì¼ í ê²:
- AskUserQuestion ì¬ì© ìì íë¨
- TRUST 5 ê²ì¦
- TAG ì²´ì¸ ì ì§
- ì»¤ë° ë©ìì§ íì
Level 3: ì¬í (Advanced – 1ìê°)
ë¹ì ì´ ìµì íí ê²:
- Agent delegation ì ëµ
- Skill ì¡°í© íì©
- Workflow ìëí
- ê·ì¹ ìì¸ ê´ë¦¬
ê³µì ìë£ & ì°¸ê³ ë§í¬
Architecture References
- Command-Agent-Skill í¨í´: Internal moai-adk documentation
- ADAP Workflow: Internal workflow definition
Quality Standards
- TRUST 5 Framework: Skill(“moai-foundation-trust”)
- TAG System: Skill(“moai-foundation-tags”)
- Commit Standards: Skill(“moai-foundation-git”)
Enterprise Standards (November 2025)
- Agent-First Architecture: InfoQ (agentic-ai-architecture-framework)
- TDD Best Practices: Official pytest documentation
- Code Quality: OWASP Top 10, SOLID principles
ë²ì : 4.0.0 (November 2025 Enterprise Standard) ìµì¢ ì ë°ì´í¸: 2025-11-12 ì ì§ë³´ìì: GoosLab (Alfred SuperAgent Framework)