repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | description: |
| #3 | globs: |
| #4 | alwaysApply: false |
| #5 | --- |
| #6 | # Scripts Directory Architecture Guide |
| #7 | |
| #8 | This project uses a modular scripts directory structure for maintainability and clear separation of concerns. |
| #9 | |
| #10 | ## 📁 Directory Structure |
| #11 | |
| #12 | ### Core Module (`scripts/core/`) |
| #13 | - **[scripts/core/constants.ts](mdc:scripts/core/constants.ts)** - Central configuration, paths, and constants |
| #14 | - **[scripts/core/model.ts](mdc:scripts/core/model.ts)** - OpenAI model configuration and API calls |
| #15 | |
| #16 | ### Utility Modules (`scripts/utils/`) |
| #17 | - **[scripts/utils/file.ts](mdc:scripts/utils/file.ts)** - File operations (read, write, directory management) |
| #18 | - **[scripts/utils/common.ts](mdc:scripts/utils/common.ts)** - General utility functions (string processing, arrays) |
| #19 | - **[scripts/utils/logger.ts](mdc:scripts/utils/logger.ts)** - Custom logging system with structured output |
| #20 | |
| #21 | ### Processing Modules |
| #22 | - **[scripts/parsers/agent-parser.ts](mdc:scripts/parsers/agent-parser.ts)** - Parse Agent configuration files |
| #23 | - **[scripts/processors/category-processor.ts](mdc:scripts/processors/category-processor.ts)** - AI-powered category assignment |
| #24 | - **[scripts/processors/i18n-processor.ts](mdc:scripts/processors/i18n-processor.ts)** - Translation and internationalization |
| #25 | |
| #26 | ### Validation Modules |
| #27 | - **[scripts/validators/agent-validator.ts](mdc:scripts/validators/agent-validator.ts)** - Schema validation and formatting |
| #28 | - **[scripts/validators/language-validator.ts](mdc:scripts/validators/language-validator.ts)** - Language detection and validation using @yutengjing/eld |
| #29 | |
| #30 | ### Build System |
| #31 | - **[scripts/builders/agent-builder.ts](mdc:scripts/builders/agent-builder.ts)** - Build all language versions of Agent files |
| #32 | - **[scripts/formatters/agent-formatter.ts](mdc:scripts/formatters/agent-formatter.ts)** - Format and process Agent configurations |
| #33 | |
| #34 | ### Command Line Tools (`scripts/commands/`) |
| #35 | - **[scripts/commands/build.ts](mdc:scripts/commands/build.ts)** - Main build command |
| #36 | - **[scripts/commands/format.ts](mdc:scripts/commands/format.ts)** - Format Agent files |
| #37 | - **[scripts/commands/test.ts](mdc:scripts/commands/test.ts)** - Validation tests |
| #38 | - **[scripts/commands/test-locale.ts](mdc:scripts/commands/test-locale.ts)** - Multi-language validation |
| #39 | - **[scripts/commands/update-awesome.ts](mdc:scripts/commands/update-awesome.ts)** - Update README |
| #40 | - **[scripts/commands/auto-submit.ts](mdc:scripts/commands/auto-submit.ts)** - GitHub automation |
| #41 | - **[scripts/commands/validate-language.ts](mdc:scripts/commands/validate-language.ts)** - Language validation command |
| #42 | |
| #43 | ### Schema Definitions (`scripts/schema/`) |
| #44 | - **[scripts/schema/agentMeta.ts](mdc:scripts/schema/agentMeta.ts)** - Agent metadata schema definitions |
| #45 | - **[scripts/schema/llm.ts](mdc:scripts/schema/llm.ts)** - LLM-related type definitions |
| #46 | |
| #47 | ## 🔄 Import Patterns |
| #48 | |
| #49 | ```typescript |
| #50 | // Core configurations - Always import from constants first |
| #51 | import { config, agentsDir } from '../core/constants'; |
| #52 | import { model } from '../core/model'; |
| #53 | |
| #54 | // Utilities - File operations and common functions |
| #55 | import { writeJSON, checkDir } from '../utils/file'; |
| #56 | import { split, findDuplicates } from '../utils/common'; |
| #57 | import { Logger } from '../utils/logger'; |
| #58 | |
| #59 | // Processing modules |
| #60 | import { AgentParser } from '../parsers/agent-parser'; |
| #61 | import { addCategory } from '../processors/category-processor'; |
| #62 | import { translateJSON } from '../processors/i18n-processor'; |
| #63 | import { formatAgentJSON } from '../validators/agent-validator'; |
| #64 | ``` |
| #65 | |
| #66 | ## 📝 Architectural Principles |
| #67 | |
| #68 | ### Single Responsibility |
| #69 | - Each module has one clear purpose and responsibility |
| #70 | - Commands depend on builders/formatters, which depend on processors/validators |
| #71 | - Shared utilities are centralized in `utils/` |
| #72 | |
| #73 | ### Dependency Direction |
| #74 | - Commands → Builders/Formatters → Processors/Validators → Utils → Core |
| #75 | - Never import upwards in the dependency chain |
| #76 | - Core modules should have minimal dependencies |
| #77 | |
| #78 | ### File Naming Conventions |
| #79 | - Use kebab-case for file names |
| #80 | - Include module type in name (e.g., `agent-parser.ts`, `category-processor.ts`) |
| #81 | - Commands are simple action names (e.g., `build.ts`, `format.ts`) |
| #82 | |
| #83 | |
| #84 | |
| #85 |