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: true |
| #5 | --- |
| #6 | # Scripts Directory Structure Guide |
| #7 | |
| #8 | This project uses an optimized, modular scripts directory structure for better maintainability and clear separation of concerns. |
| #9 | |
| #10 | ## 📁 Directory Structure Overview |
| #11 | |
| #12 | The [scripts/](mdc:scripts) directory is organized into the following modules: |
| #13 | |
| #14 | ### Core Module (`scripts/core/`) |
| #15 | - **[scripts/core/constants.ts](mdc:scripts/core/constants.ts)** - Central configuration and constants |
| #16 | - **[scripts/core/model.ts](mdc:scripts/core/model.ts)** - OpenAI model configuration |
| #17 | |
| #18 | ### Utility Modules (`scripts/utils/`) |
| #19 | - **[scripts/utils/file.ts](mdc:scripts/utils/file.ts)** - File operations (read, write, directory management) |
| #20 | - **[scripts/utils/common.ts](mdc:scripts/utils/common.ts)** - General utility functions (string processing, arrays) |
| #21 | |
| #22 | ### Processing Modules |
| #23 | - **[scripts/parsers/agent-parser.ts](mdc:scripts/parsers/agent-parser.ts)** - Parse Agent configuration files |
| #24 | - **[scripts/processors/category-processor.ts](mdc:scripts/processors/category-processor.ts)** - AI-powered category assignment |
| #25 | - **[scripts/processors/i18n-processor.ts](mdc:scripts/processors/i18n-processor.ts)** - Internationalization and translation |
| #26 | - **[scripts/validators/agent-validator.ts](mdc:scripts/validators/agent-validator.ts)** - Schema validation and formatting |
| #27 | |
| #28 | ### Build System |
| #29 | - **[scripts/builders/agent-builder.ts](mdc:scripts/builders/agent-builder.ts)** - Build all language versions of Agent files |
| #30 | - **[scripts/formatters/agent-formatter.ts](mdc:scripts/formatters/agent-formatter.ts)** - Format and process Agent configurations |
| #31 | |
| #32 | ### Command Line Tools (`scripts/commands/`) |
| #33 | - **[scripts/commands/build.ts](mdc:scripts/commands/build.ts)** - Main build command |
| #34 | - **[scripts/commands/format.ts](mdc:scripts/commands/format.ts)** - Format Agent files |
| #35 | - **[scripts/commands/test.ts](mdc:scripts/commands/test.ts)** - Validation tests |
| #36 | - **[scripts/commands/test-locale.ts](mdc:scripts/commands/test-locale.ts)** - Multi-language validation |
| #37 | - **[scripts/commands/update-awesome.ts](mdc:scripts/commands/update-awesome.ts)** - Update README |
| #38 | - **[scripts/commands/auto-submit.ts](mdc:scripts/commands/auto-submit.ts)** - GitHub automation |
| #39 | |
| #40 | ### Schema Definitions (`scripts/schema/`) |
| #41 | - **[scripts/schema/agentMeta.ts](mdc:scripts/schema/agentMeta.ts)** - Agent metadata schema definitions |
| #42 | - **[scripts/schema/llm.ts](mdc:scripts/schema/llm.ts)** - LLM-related type definitions |
| #43 | |
| #44 | ## 🔄 Common Workflows |
| #45 | |
| #46 | ### Adding New Functionality |
| #47 | 1. **Core logic**: Add to appropriate module in `processors/`, `validators/`, or `builders/` |
| #48 | 2. **Utilities**: Add to `utils/file.ts` or `utils/common.ts` |
| #49 | 3. **CLI commands**: Create new command in `commands/` directory |
| #50 | 4. **Types**: Update schemas in `schema/` directory |
| #51 | |
| #52 | ### Import Patterns |
| #53 | ```typescript |
| #54 | // Core configurations |
| #55 | import { config, agentsDir } from '../core/constants'; |
| #56 | import { model } from '../core/model'; |
| #57 | |
| #58 | // Utilities |
| #59 | import { writeJSON, checkDir } from '../utils/file'; |
| #60 | import { split, findDuplicates } from '../utils/common'; |
| #61 | |
| #62 | // Processing |
| #63 | import { AgentParser } from '../parsers/agent-parser'; |
| #64 | import { addCategory } from '../processors/category-processor'; |
| #65 | import { formatAgentJSON } from '../validators/agent-validator'; |
| #66 | ``` |
| #67 | |
| #68 | ### Running Commands |
| #69 | Use the npm scripts defined in [package.json](mdc:package.json): |
| #70 | - `pnpm run build` - Build all Agent files |
| #71 | - `pnpm run format` - Format Agent configurations |
| #72 | - `pnpm run test` - Run validation tests |
| #73 | - `pnpm run test:locale` - Test multi-language files |
| #74 | |
| #75 | ## 📝 Code Standards |
| #76 | |
| #77 | ### Comments |
| #78 | - All functions have comprehensive Chinese comments |
| #79 | - Parameter types and return values are documented |
| #80 | - Business logic is explained in detail |
| #81 | |
| #82 | ### Module Responsibilities |
| #83 | - **Single Responsibility**: Each module has one clear purpose |
| #84 | - **Dependency Direction**: Commands depend on builders/formatters, which depend on processors/validators |
| #85 | - **Shared Utilities**: Common functions are centralized in utils/ |
| #86 | |
| #87 | ### File Naming |
| #88 | - Use kebab-case for file names |
| #89 | - Include module type in name (e.g., `agent-parser.ts`, `category-processor.ts`) |
| #90 | - Commands are simple action names (e.g., `build.ts`, `format.ts`) |
| #91 | |
| #92 | ## 🚨 Important Notes |
| #93 | |
| #94 | - Always import from the correct module - utilities are split between `utils/file.ts` and `utils/common.ts` |
| #95 | - Constants and configuration should always come from `core/constants.ts` |
| #96 | - Schema definitions are in `schema/` - update these when changing data structures |
| #97 | - All command-line tools are in `commands/` directory and are executable |
| #98 | |
| #99 | |
| #100 |