From a39bbafe25c0f709e7ae655aa8ac26e924ff2c57 Mon Sep 17 00:00:00 2001 From: Atreya Kamat Date: Sun, 8 Mar 2026 15:01:49 +0530 Subject: [PATCH 1/6] Add Gemini CLI platform integration with skills generation --- AGENTS.md | 276 +++++++++++++++++++++++++++++++++++++++++++++++++++ bin/cli.js | 218 ++++++++++++++++++++++++++++++++++++++-- package.json | 3 + 3 files changed, 486 insertions(+), 11 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..b29cc8b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,276 @@ +# AGENTS.md - Agent Coding Guidelines for SAM + +This file provides guidelines for agentic coding agents operating in this repository. + +--- + +## Project Overview + +SAM (Smart Agent Manager) is an autonomous TDD agent system that generates agent configurations for Claude Code, Cursor IDE, and Antigravity. The project consists of: +- **CLI** (`bin/cli.js`) - Node.js CLI tool that installs agent configurations +- **Templates** (`templates/`) - Agent definitions in markdown format +- **Shared configs** (`_sam/`) - Agent definitions used across all platforms + +--- + +## Build / Lint / Test Commands + +### Testing the CLI + +```bash +# Test CLI locally (interactive mode) +node bin/cli.js + +# Test CLI with specific platform +node bin/cli.js --platform claude ./test-project +node bin/cli.js --platform cursor ./test-project +node bin/cli.js --platform antigravity ./test-project +node bin cli.js --platform all ./test-project + +# Test with target directory +node bin/cli.js ./my-project +node bin/cli.js --platform cursor ./my-project +``` + +### Running a Single Test + +There are no formal test suites in this project. Manual testing is done by: +1. Creating a test directory: `mkdir test-project` +2. Running the CLI: `node bin/cli.js --platform ./test-project` +3. Verifying output files: + ```bash + ls -la ./test-project/_sam + ls -la ./test-project/.claude/commands/sam # for Claude Code + ls -la ./test-project/.cursor/rules/ # for Cursor + ls -la ./test-project/.agent/skills/ # for Antigravity + ``` + +### Publishing + +```bash +# Publish to npm (requires authentication) +npm publish --access public --provenance +``` + +--- + +## Code Style Guidelines + +### JavaScript (CLI) + +Follow these conventions in `bin/cli.js`: + +1. **Formatting** + - 2-space indentation + - No semicolons at line endings + - Single quotes for strings + - Trailing commas in multi-line objects/arrays + +2. **Naming Conventions** + - `camelCase` for functions and variables + - `UPPER_SNAKE_CASE` for constants (e.g., `PLATFORMS`) + - Descriptive names: `copyRecursive`, `generateCursorRules` + +3. **Functions** + - Keep functions under 50 lines + - Single responsibility: `install()`, `promptPlatform()`, `showHelp()` + - Use async/await for Promises + +4. **Error Handling** + - Use `process.exit(1)` for fatal errors + - Log errors with color codes: `log('Error: ...', RED)` + - Validate inputs early with clear error messages + +5. **Colors/Output** + - Use ANSI escape codes for colored output + - Constants defined at top: `CYAN`, `GREEN`, `YELLOW`, `RED`, `RESET`, `BOLD`, `DIM` + +### Markdown Files (Agent Definitions) + +Agent files use YAML frontmatter and follow this structure: + +```markdown +--- +name: +displayName: +title: +icon: "" +--- + +# - + +**Role:** + +**Identity:** + +--- + +## Core Responsibilities + +1. **Responsibility 1** - Description +2. **Responsibility 2** - Description + +--- + +## Communication Style + +