Agent Skills Architecture
Scannednpx machina-cli add skill hoangnguyen0403/agent-skills-standard/agent-skills-architecture --openclawAgent Skills Architecture Standard
Priority: P0 (CRITICAL)
The primary goal is Maximum Information Density and Automated Precision.
🏗️ Core Architectural Pillars
1. Separation by Package (Granularity)
- Rule: Separate skills based on specific library/framework dependencies.
- Goal: Avoid context pollution. Don't load "Riverpod" instructions into a "BLoC" project.
- Example:
flutter/bloc-state-managementvsflutter/riverpod-state-management.
2. Presence = Active (Simplified Configuration)
- Logic: If a skill is listed in
.skillsrc, it is considered active. - Standard: Remove legacy
enabledflags. Control activation via inclusion/exclusion lists.
3. CLI Detection & Dynamic Exclusion
- Mechanism: The CLI (
ags) mapspackage.json/pubspec.yamldependencies to skill IDs. - Exclusion: Irrelevant sub-skills are automatically added to the
excludelist during initialization if their corresponding packages are missing.
4. Progressive Disclosure (Three-Level Loading)
- Level 1 (Metadata): Triggers activation via high-precision keywords/files.
- Level 2 (SKILL.md Body): Core imperative logic (<100 lines). No conversational fluff.
- Level 3 (References): Detailed examples, complex patterns, scripts. Lazy-loaded on-demand.
📦 ID & Naming Standards
- Category: Lowercase letters (e.g.,
flutter,nestjs). - Skill ID: Kebab-case, must match the directory name.
- Registry ID: Must match the Skill ID for automated CLI detection/exclusion.
📋 High-Density Writing Style
- Imperative Mood: Use "Use X", "Avoid Y". No "Please" or "You should".
- Token Compression: Skip articles ("the", "a") where possible. Use bullet points > paragraphs.
- Anti-Patterns: Avoid conversational intros ("In this skill, we see...").
🔗 Internal References
- Skill Creator Standard - Detailed authoring rules.
- Resource Organization - Folder structure best practices.
Source
git clone https://github.com/hoangnguyen0403/agent-skills-standard/blob/develop/.github/skills/common/agent-skills-architecture/SKILL.mdView on GitHub Overview
Defines a token-optimized, high-density standard for organizing agent skills and CLI-based automated activation. Emphasizes modular separation by package, presence-based activation via .skillsrc, and progressive loading to maximize information density and automated precision.
How This Skill Works
Split skills by package to avoid context pollution. Activation controlled by presence in .skillsrc; remove legacy enabled flags. CLI detects dependencies (package.json/pubspec.yaml) and maps them to skill IDs, auto-excluding irrelevant sub-skills. Loading follows three levels: Level 1 metadata triggers activation, Level 2 core SKILL.md (≤100 lines) with no fluff, Level 3 references (detailed examples, scripts) lazy-loaded on demand.
When to Use It
- Designing a modular skill library where different libraries/frameworks must remain isolated (e.g., flutter/bloc-state-management vs flutter/riverpod-state-management).
- Projects want simple activation control via .skillsrc instead of legacy enabled flags.
- Codebases rely on the CLI to map dependencies to skill IDs and auto-exclude missing sub-skills.
- Need strict, compact Level 2 SKILL.md logic (≤100 lines) with on-demand Level 3 references.
- Enforcing kebab-case Skill IDs that exactly match directory names for automated detection.
Quick Start
- Step 1: Organize skills into package-based directories (e.g., flutter/bloc-state-management).
- Step 2: Activate skills by listing them in .skillsrc; remove legacy enabled flags and rely on include/exclude lists.
- Step 3: Implement Level 2 core logic (<100 lines) and add Level 3 references to be lazy-loaded on demand.
Best Practices
- Structure skills by package/granularity to avoid cross-contamination.
- Declare Skill IDs in a directory that matches the registry ID for automated detection.
- Use Presence = Active: rely on .skillsrc rather than legacy enabled flags.
- Leverage CLI detection to dynamically exclude irrelevant sub-skills when dependencies are missing.
- Keep Level 2 SKILL.md concise (<100 lines) and lazy-load Level 3 references as needed.
Example Use Cases
- Flutter: separate flutter/bloc-state-management vs flutter/riverpod-state-management to prevent context pollution.
- Activation controlled via .skillsrc in a mono/multi-repo setup, replacing old enabled flags.
- CLI-driven ags maps package.json/pubspec.yaml dependencies to skill IDs and auto-excludes others.
- Level 2 core logic implemented in under 100 lines; Level 3 references loaded on-demand for complex patterns.
- Directory naming uses kebab-case Skill IDs that exactly match the directory name for automated CLI detection.