diff --git a/.agents/skills/ZooBot/SKILL.md b/.agents/skills/ZooBot/SKILL.md new file mode 100644 index 0000000..6910679 --- /dev/null +++ b/.agents/skills/ZooBot/SKILL.md @@ -0,0 +1,273 @@ +--- +name: zoobot-conventions +description: Development conventions and patterns for ZooBot. TypeScript project with conventional commits. +--- + +# Zoobot Conventions + +> Generated from [Maliot100X/ZooBot](https://github.com/Maliot100X/ZooBot) on 2026-03-23 + +## Overview + +This skill teaches Claude the development patterns and conventions used in ZooBot. + +## Tech Stack + +- **Primary Language**: TypeScript +- **Architecture**: type-based module organization +- **Test Location**: separate + +## When to Use This Skill + +Activate this skill when: +- Making changes to this repository +- Adding new features following established patterns +- Writing tests that match project conventions +- Creating commits with proper message format + +## Commit Conventions + +Follow these commit message conventions based on 8 analyzed commits. + +### Commit Style: Conventional Commits + +### Prefixes Used + +- `fix` +- `feat` +- `chore` +- `refactor` +- `docs` + +### Message Guidelines + +- Average message length: ~56 characters +- Keep first line concise and descriptive +- Use imperative mood ("Add feature" not "Added feature") + + +*Commit message example* + +```text +docs(agents): move setup and system prompt config to workspace-level AGENTS.md (#253) +``` + +*Commit message example* + +```text +refactor(telegram): migrate from node-telegram-bot-api to grammY (#248) +``` + +*Commit message example* + +```text +fix(api): resolve agent routing at enqueue time (#247) +``` + +*Commit message example* + +```text +chore: update readme +``` + +*Commit message example* + +```text +feat(office): redesign the live office workspace (#212) +``` + +*Commit message example* + +```text +Initial ZooBot commit - Open Source AI Agent Framework with Groq support +``` + +*Commit message example* + +```text +fix(telegram): fix watchdog timer bug that prevented polling restart (#246) +``` + +*Commit message example* + +```text +chore: add bin entry to package.json, update README and office screenshot +``` + +## Architecture + +### Project Structure: Monorepo + +This project uses **type-based** module organization. + +### Configuration Files + +- `.github/workflows/release.yml` +- `package.json` +- `packages/channels/package.json` +- `packages/channels/tsconfig.json` +- `packages/cli/package.json` +- `packages/cli/tsconfig.json` +- `packages/core/package.json` +- `packages/core/tsconfig.json` +- `packages/main/package.json` +- `packages/main/tsconfig.json` +- `packages/server/package.json` +- `packages/server/tsconfig.json` +- `packages/teams/package.json` +- `packages/teams/tsconfig.json` +- `packages/visualizer/package.json` +- `packages/visualizer/tsconfig.json` +- `tinyoffice/package.json` +- `tinyoffice/tsconfig.json` +- `tsconfig.json` + +### Guidelines + +- Group code by type (components, services, utils) +- Keep related functionality in the same type folder +- Avoid circular dependencies between type folders + +## Code Style + +### Language: TypeScript + +### Naming Conventions + +| Element | Convention | +|---------|------------| +| Files | camelCase | +| Functions | camelCase | +| Classes | PascalCase | +| Constants | SCREAMING_SNAKE_CASE | + +### Import Style: Relative Imports + +### Export Style: Named Exports + + +*Preferred import style* + +```typescript +// Use relative imports +import { Button } from '../components/Button' +import { useAuth } from './hooks/useAuth' +``` + +*Preferred export style* + +```typescript +// Use named exports +export function calculateTotal() { ... } +export const TAX_RATE = 0.1 +export interface Order { ... } +``` + +## Error Handling + +### Error Handling Style: Try-Catch Blocks + +A **global error handler** catches unhandled errors. + + +*Standard error handling pattern* + +```typescript +try { + const result = await riskyOperation() + return result +} catch (error) { + console.error('Operation failed:', error) + throw new Error('User-friendly message') +} +``` + +## Common Workflows + +These workflows were detected from analyzing commit patterns. + +### Database Migration + +Database schema changes with migration files + +**Frequency**: ~2 times per month + +**Steps**: +1. Create migration file +2. Update schema definitions +3. Generate/update types + +**Files typically involved**: +- `**/types.ts` + +**Example commit sequence**: +``` +refactor(queue): simplify schema and remove conversation state (#213) +feat(invoke): stream agent execution progress in real-time (#196) +refactor(cli): make tinyagi the primary CLI entrypoint (#234) +``` + +### Feature Development + +Standard feature implementation workflow + +**Frequency**: ~17 times per month + +**Steps**: +1. Add feature implementation +2. Add tests for feature +3. Update documentation + +**Files typically involved**: +- `packages/main/src/*` +- `packages/server/src/*` +- `packages/server/src/routes/*` +- `**/api/**` + +**Example commit sequence**: +``` +feat: add chat rooms and projects to tinyoffice (#199) +fix(telegram): prevent polling from stalling after network reconnect (#200) +feat(office): add organization chart visualization page (#201) +``` + +### Refactoring + +Code refactoring and cleanup workflow + +**Frequency**: ~6 times per month + +**Steps**: +1. Ensure tests pass before refactor +2. Refactor code structure +3. Verify tests still pass + +**Files typically involved**: +- `src/**/*` + +**Example commit sequence**: +``` +refactor(ui): refactor agent and task components into modules (#229) +fix(heartbeat): persist per-agent enabled and interval settings to heartbeat overrides (#230) +chore: bump version to 0.0.14 and add release notes +``` + + +## Best Practices + +Based on analysis of the codebase, follow these practices: + +### Do + +- Use conventional commit format (feat:, fix:, etc.) +- Use camelCase for file names +- Prefer named exports + +### Don't + +- Don't write vague commit messages +- Don't deviate from established patterns without discussion + +--- + +*This skill was auto-generated by [ECC Tools](https://ecc.tools). Review and customize as needed for your team.* diff --git a/.agents/skills/ZooBot/agents/openai.yaml b/.agents/skills/ZooBot/agents/openai.yaml new file mode 100644 index 0000000..99cc60f --- /dev/null +++ b/.agents/skills/ZooBot/agents/openai.yaml @@ -0,0 +1,6 @@ +interface: + display_name: "ZooBot" + short_description: "Repo-specific patterns and workflows for ZooBot" + default_prompt: "Use the ZooBot repo skill to follow existing architecture, testing, and workflow conventions." +policy: + allow_implicit_invocation: true \ No newline at end of file diff --git a/.claude/commands/database-migration.md b/.claude/commands/database-migration.md new file mode 100644 index 0000000..a99ee17 --- /dev/null +++ b/.claude/commands/database-migration.md @@ -0,0 +1,35 @@ +--- +name: database-migration +description: Workflow command scaffold for database-migration in ZooBot. +allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"] +--- + +# /database-migration + +Use this workflow when working on **database-migration** in `ZooBot`. + +## Goal + +Database schema changes with migration files + +## Common Files + +- `**/types.ts` + +## Suggested Sequence + +1. Understand the current state and failure mode before editing. +2. Make the smallest coherent change that satisfies the workflow goal. +3. Run the most relevant verification for touched files. +4. Summarize what changed and what still needs review. + +## Typical Commit Signals + +- Create migration file +- Update schema definitions +- Generate/update types + +## Notes + +- Treat this as a scaffold, not a hard-coded script. +- Update the command if the workflow evolves materially. \ No newline at end of file diff --git a/.claude/commands/feature-development.md b/.claude/commands/feature-development.md new file mode 100644 index 0000000..8eb2640 --- /dev/null +++ b/.claude/commands/feature-development.md @@ -0,0 +1,38 @@ +--- +name: feature-development +description: Workflow command scaffold for feature-development in ZooBot. +allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"] +--- + +# /feature-development + +Use this workflow when working on **feature-development** in `ZooBot`. + +## Goal + +Standard feature implementation workflow + +## Common Files + +- `packages/main/src/*` +- `packages/server/src/*` +- `packages/server/src/routes/*` +- `**/api/**` + +## Suggested Sequence + +1. Understand the current state and failure mode before editing. +2. Make the smallest coherent change that satisfies the workflow goal. +3. Run the most relevant verification for touched files. +4. Summarize what changed and what still needs review. + +## Typical Commit Signals + +- Add feature implementation +- Add tests for feature +- Update documentation + +## Notes + +- Treat this as a scaffold, not a hard-coded script. +- Update the command if the workflow evolves materially. \ No newline at end of file diff --git a/.claude/commands/refactoring.md b/.claude/commands/refactoring.md new file mode 100644 index 0000000..d0403e8 --- /dev/null +++ b/.claude/commands/refactoring.md @@ -0,0 +1,35 @@ +--- +name: refactoring +description: Workflow command scaffold for refactoring in ZooBot. +allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"] +--- + +# /refactoring + +Use this workflow when working on **refactoring** in `ZooBot`. + +## Goal + +Code refactoring and cleanup workflow + +## Common Files + +- `src/**/*` + +## Suggested Sequence + +1. Understand the current state and failure mode before editing. +2. Make the smallest coherent change that satisfies the workflow goal. +3. Run the most relevant verification for touched files. +4. Summarize what changed and what still needs review. + +## Typical Commit Signals + +- Ensure tests pass before refactor +- Refactor code structure +- Verify tests still pass + +## Notes + +- Treat this as a scaffold, not a hard-coded script. +- Update the command if the workflow evolves materially. \ No newline at end of file diff --git a/.claude/ecc-tools.json b/.claude/ecc-tools.json new file mode 100644 index 0000000..f33396a --- /dev/null +++ b/.claude/ecc-tools.json @@ -0,0 +1,240 @@ +{ + "version": "1.3", + "schemaVersion": "1.0", + "generatedBy": "ecc-tools", + "generatedAt": "2026-03-23T23:43:30.999Z", + "repo": "https://github.com/Maliot100X/ZooBot", + "profiles": { + "requested": "standard", + "recommended": "standard", + "effective": "standard", + "requestedAlias": "security", + "recommendedAlias": "security", + "effectiveAlias": "developer" + }, + "requestedProfile": "security", + "profile": "developer", + "recommendedProfile": "security", + "effectiveProfile": "developer", + "tier": "free", + "requestedComponents": [ + "repo-baseline", + "workflow-automation", + "security-audits" + ], + "selectedComponents": [ + "repo-baseline", + "workflow-automation" + ], + "requestedAddComponents": [], + "requestedRemoveComponents": [], + "blockedRemovalComponents": [], + "tierFilteredComponents": [ + "security-audits" + ], + "requestedRootPackages": [ + "runtime-core", + "workflow-pack", + "agentshield-pack" + ], + "selectedRootPackages": [ + "runtime-core", + "workflow-pack" + ], + "requestedPackages": [ + "runtime-core", + "workflow-pack", + "agentshield-pack" + ], + "requestedAddPackages": [], + "requestedRemovePackages": [], + "selectedPackages": [ + "runtime-core", + "workflow-pack" + ], + "packages": [ + "runtime-core", + "workflow-pack" + ], + "blockedRemovalPackages": [], + "tierFilteredRootPackages": [ + "agentshield-pack" + ], + "tierFilteredPackages": [ + "agentshield-pack" + ], + "conflictingPackages": [], + "dependencyGraph": { + "runtime-core": [], + "workflow-pack": [ + "runtime-core" + ] + }, + "resolutionOrder": [ + "runtime-core", + "workflow-pack" + ], + "requestedModules": [ + "runtime-core", + "workflow-pack", + "agentshield-pack" + ], + "selectedModules": [ + "runtime-core", + "workflow-pack" + ], + "modules": [ + "runtime-core", + "workflow-pack" + ], + "managedFiles": [ + ".claude/skills/ZooBot/SKILL.md", + ".agents/skills/ZooBot/SKILL.md", + ".agents/skills/ZooBot/agents/openai.yaml", + ".claude/identity.json", + ".codex/config.toml", + ".codex/AGENTS.md", + ".codex/agents/explorer.toml", + ".codex/agents/reviewer.toml", + ".codex/agents/docs-researcher.toml", + ".claude/homunculus/instincts/inherited/ZooBot-instincts.yaml", + ".claude/commands/database-migration.md", + ".claude/commands/feature-development.md", + ".claude/commands/refactoring.md" + ], + "packageFiles": { + "runtime-core": [ + ".claude/skills/ZooBot/SKILL.md", + ".agents/skills/ZooBot/SKILL.md", + ".agents/skills/ZooBot/agents/openai.yaml", + ".claude/identity.json", + ".codex/config.toml", + ".codex/AGENTS.md", + ".codex/agents/explorer.toml", + ".codex/agents/reviewer.toml", + ".codex/agents/docs-researcher.toml", + ".claude/homunculus/instincts/inherited/ZooBot-instincts.yaml" + ], + "workflow-pack": [ + ".claude/commands/database-migration.md", + ".claude/commands/feature-development.md", + ".claude/commands/refactoring.md" + ] + }, + "moduleFiles": { + "runtime-core": [ + ".claude/skills/ZooBot/SKILL.md", + ".agents/skills/ZooBot/SKILL.md", + ".agents/skills/ZooBot/agents/openai.yaml", + ".claude/identity.json", + ".codex/config.toml", + ".codex/AGENTS.md", + ".codex/agents/explorer.toml", + ".codex/agents/reviewer.toml", + ".codex/agents/docs-researcher.toml", + ".claude/homunculus/instincts/inherited/ZooBot-instincts.yaml" + ], + "workflow-pack": [ + ".claude/commands/database-migration.md", + ".claude/commands/feature-development.md", + ".claude/commands/refactoring.md" + ] + }, + "files": [ + { + "moduleId": "runtime-core", + "path": ".claude/skills/ZooBot/SKILL.md", + "description": "Repository-specific Claude Code skill generated from git history." + }, + { + "moduleId": "runtime-core", + "path": ".agents/skills/ZooBot/SKILL.md", + "description": "Codex-facing copy of the generated repository skill." + }, + { + "moduleId": "runtime-core", + "path": ".agents/skills/ZooBot/agents/openai.yaml", + "description": "Codex skill metadata so the repo skill appears cleanly in the skill interface." + }, + { + "moduleId": "runtime-core", + "path": ".claude/identity.json", + "description": "Suggested identity.json baseline derived from repository conventions." + }, + { + "moduleId": "runtime-core", + "path": ".codex/config.toml", + "description": "Repo-local Codex MCP and multi-agent baseline aligned with ECC defaults." + }, + { + "moduleId": "runtime-core", + "path": ".codex/AGENTS.md", + "description": "Codex usage guide that points at the generated repo skill and workflow bundle." + }, + { + "moduleId": "runtime-core", + "path": ".codex/agents/explorer.toml", + "description": "Read-only explorer role config for Codex multi-agent work." + }, + { + "moduleId": "runtime-core", + "path": ".codex/agents/reviewer.toml", + "description": "Read-only reviewer role config focused on correctness and security." + }, + { + "moduleId": "runtime-core", + "path": ".codex/agents/docs-researcher.toml", + "description": "Read-only docs researcher role config for API verification." + }, + { + "moduleId": "runtime-core", + "path": ".claude/homunculus/instincts/inherited/ZooBot-instincts.yaml", + "description": "Continuous-learning instincts derived from repository patterns." + }, + { + "moduleId": "workflow-pack", + "path": ".claude/commands/database-migration.md", + "description": "Workflow command scaffold for database-migration." + }, + { + "moduleId": "workflow-pack", + "path": ".claude/commands/feature-development.md", + "description": "Workflow command scaffold for feature-development." + }, + { + "moduleId": "workflow-pack", + "path": ".claude/commands/refactoring.md", + "description": "Workflow command scaffold for refactoring." + } + ], + "workflows": [ + { + "command": "database-migration", + "path": ".claude/commands/database-migration.md" + }, + { + "command": "feature-development", + "path": ".claude/commands/feature-development.md" + }, + { + "command": "refactoring", + "path": ".claude/commands/refactoring.md" + } + ], + "adapters": { + "claudeCode": { + "skillPath": ".claude/skills/ZooBot/SKILL.md", + "identityPath": ".claude/identity.json", + "commandPaths": [ + ".claude/commands/database-migration.md", + ".claude/commands/feature-development.md", + ".claude/commands/refactoring.md" + ] + }, + "codex": { + "configPath": ".codex/config.toml", + "agentsGuidePath": ".codex/AGENTS.md", + "skillPath": ".agents/skills/ZooBot/SKILL.md" + } + } +} \ No newline at end of file diff --git a/.claude/homunculus/instincts/inherited/ZooBot-instincts.yaml b/.claude/homunculus/instincts/inherited/ZooBot-instincts.yaml new file mode 100644 index 0000000..a15a9cf --- /dev/null +++ b/.claude/homunculus/instincts/inherited/ZooBot-instincts.yaml @@ -0,0 +1,217 @@ +# Instincts generated from https://github.com/Maliot100X/ZooBot +# Generated: 2026-03-23T23:43:31.669Z +# Version: 2.0 + +--- +id: ZooBot-commit-conventional +trigger: "when writing a commit message" +confidence: 0.85 +domain: git +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Commit Conventional + +## Action + +Use conventional commit format with prefixes: fix, feat, chore, refactor, docs + +## Evidence + +- 170 commits analyzed +- Detected conventional commit pattern +- Examples: docs(agents): move setup and system prompt config to workspace-level AGENTS.md (#253), refactor(telegram): migrate from node-telegram-bot-api to grammY (#248) + +--- +id: ZooBot-commit-length +trigger: "when writing a commit message" +confidence: 0.6 +domain: git +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Commit Length + +## Action + +Write moderate-length commit messages (~50 characters) + +## Evidence + +- Average commit message length: 56 chars +- Based on 170 commits + +--- +id: ZooBot-naming-files +trigger: "when creating a new file" +confidence: 0.8 +domain: code-style +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Naming Files + +## Action + +Use camelCase naming convention + +## Evidence + +- Analyzed file naming patterns in repository +- Dominant pattern: camelCase + +--- +id: ZooBot-import-relative +trigger: "when importing modules" +confidence: 0.75 +domain: code-style +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Import Relative + +## Action + +Use relative imports for project files + +## Evidence + +- Import analysis shows relative import pattern +- Example: import { x } from '../lib/x' + +--- +id: ZooBot-export-style +trigger: "when exporting from a module" +confidence: 0.7 +domain: code-style +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Export Style + +## Action + +Prefer named exports + +## Evidence + +- Export pattern analysis +- Dominant style: named + +--- +id: ZooBot-arch-type-based +trigger: "when adding new code" +confidence: 0.8 +domain: architecture +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Arch Type Based + +## Action + +Place code in the appropriate type folder (components/, services/, utils/, etc.) + +## Evidence + +- Type-based module organization detected +- Folders: + +--- +id: ZooBot-test-separate +trigger: "when writing tests" +confidence: 0.8 +domain: testing +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Test Separate + +## Action + +Place tests in the tests/ or __tests__/ directory, mirroring src structure + +## Evidence + +- Separate test directory pattern detected +- Tests live in dedicated test folders + +--- +id: ZooBot-workflow-database-migration +trigger: "when modifying the database schema or adding tables" +confidence: 0.6 +domain: workflow +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Workflow Database Migration + +## Action + +Follow the database-migration workflow: +1. Create migration file +2. Update schema definitions +3. Generate/update types + +## Evidence + +- Workflow detected from commit patterns +- Frequency: ~2x per month +- Files: **/types.ts + +--- +id: ZooBot-workflow-feature-development +trigger: "when implementing a new feature" +confidence: 0.9 +domain: workflow +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Workflow Feature Development + +## Action + +Follow the feature-development workflow: +1. Add feature implementation +2. Add tests for feature +3. Update documentation + +## Evidence + +- Workflow detected from commit patterns +- Frequency: ~17x per month +- Files: packages/main/src/*, packages/server/src/*, packages/server/src/routes/* + +--- +id: ZooBot-workflow-refactoring +trigger: "when refactoring code" +confidence: 0.8 +domain: workflow +source: repo-analysis +source_repo: https://github.com/Maliot100X/ZooBot +--- + +# ZooBot Workflow Refactoring + +## Action + +Follow the refactoring workflow: +1. Ensure tests pass before refactor +2. Refactor code structure +3. Verify tests still pass + +## Evidence + +- Workflow detected from commit patterns +- Frequency: ~6x per month +- Files: src/**/* + diff --git a/.claude/identity.json b/.claude/identity.json new file mode 100644 index 0000000..a7762df --- /dev/null +++ b/.claude/identity.json @@ -0,0 +1,14 @@ +{ + "version": "2.0", + "technicalLevel": "technical", + "preferredStyle": { + "verbosity": "moderate", + "codeComments": false, + "explanations": false + }, + "domains": [ + "typescript" + ], + "suggestedBy": "ecc-tools-repo-analysis", + "createdAt": "2026-03-23T23:43:31.669Z" +} \ No newline at end of file diff --git a/.claude/skills/ZooBot/SKILL.md b/.claude/skills/ZooBot/SKILL.md new file mode 100644 index 0000000..6910679 --- /dev/null +++ b/.claude/skills/ZooBot/SKILL.md @@ -0,0 +1,273 @@ +--- +name: zoobot-conventions +description: Development conventions and patterns for ZooBot. TypeScript project with conventional commits. +--- + +# Zoobot Conventions + +> Generated from [Maliot100X/ZooBot](https://github.com/Maliot100X/ZooBot) on 2026-03-23 + +## Overview + +This skill teaches Claude the development patterns and conventions used in ZooBot. + +## Tech Stack + +- **Primary Language**: TypeScript +- **Architecture**: type-based module organization +- **Test Location**: separate + +## When to Use This Skill + +Activate this skill when: +- Making changes to this repository +- Adding new features following established patterns +- Writing tests that match project conventions +- Creating commits with proper message format + +## Commit Conventions + +Follow these commit message conventions based on 8 analyzed commits. + +### Commit Style: Conventional Commits + +### Prefixes Used + +- `fix` +- `feat` +- `chore` +- `refactor` +- `docs` + +### Message Guidelines + +- Average message length: ~56 characters +- Keep first line concise and descriptive +- Use imperative mood ("Add feature" not "Added feature") + + +*Commit message example* + +```text +docs(agents): move setup and system prompt config to workspace-level AGENTS.md (#253) +``` + +*Commit message example* + +```text +refactor(telegram): migrate from node-telegram-bot-api to grammY (#248) +``` + +*Commit message example* + +```text +fix(api): resolve agent routing at enqueue time (#247) +``` + +*Commit message example* + +```text +chore: update readme +``` + +*Commit message example* + +```text +feat(office): redesign the live office workspace (#212) +``` + +*Commit message example* + +```text +Initial ZooBot commit - Open Source AI Agent Framework with Groq support +``` + +*Commit message example* + +```text +fix(telegram): fix watchdog timer bug that prevented polling restart (#246) +``` + +*Commit message example* + +```text +chore: add bin entry to package.json, update README and office screenshot +``` + +## Architecture + +### Project Structure: Monorepo + +This project uses **type-based** module organization. + +### Configuration Files + +- `.github/workflows/release.yml` +- `package.json` +- `packages/channels/package.json` +- `packages/channels/tsconfig.json` +- `packages/cli/package.json` +- `packages/cli/tsconfig.json` +- `packages/core/package.json` +- `packages/core/tsconfig.json` +- `packages/main/package.json` +- `packages/main/tsconfig.json` +- `packages/server/package.json` +- `packages/server/tsconfig.json` +- `packages/teams/package.json` +- `packages/teams/tsconfig.json` +- `packages/visualizer/package.json` +- `packages/visualizer/tsconfig.json` +- `tinyoffice/package.json` +- `tinyoffice/tsconfig.json` +- `tsconfig.json` + +### Guidelines + +- Group code by type (components, services, utils) +- Keep related functionality in the same type folder +- Avoid circular dependencies between type folders + +## Code Style + +### Language: TypeScript + +### Naming Conventions + +| Element | Convention | +|---------|------------| +| Files | camelCase | +| Functions | camelCase | +| Classes | PascalCase | +| Constants | SCREAMING_SNAKE_CASE | + +### Import Style: Relative Imports + +### Export Style: Named Exports + + +*Preferred import style* + +```typescript +// Use relative imports +import { Button } from '../components/Button' +import { useAuth } from './hooks/useAuth' +``` + +*Preferred export style* + +```typescript +// Use named exports +export function calculateTotal() { ... } +export const TAX_RATE = 0.1 +export interface Order { ... } +``` + +## Error Handling + +### Error Handling Style: Try-Catch Blocks + +A **global error handler** catches unhandled errors. + + +*Standard error handling pattern* + +```typescript +try { + const result = await riskyOperation() + return result +} catch (error) { + console.error('Operation failed:', error) + throw new Error('User-friendly message') +} +``` + +## Common Workflows + +These workflows were detected from analyzing commit patterns. + +### Database Migration + +Database schema changes with migration files + +**Frequency**: ~2 times per month + +**Steps**: +1. Create migration file +2. Update schema definitions +3. Generate/update types + +**Files typically involved**: +- `**/types.ts` + +**Example commit sequence**: +``` +refactor(queue): simplify schema and remove conversation state (#213) +feat(invoke): stream agent execution progress in real-time (#196) +refactor(cli): make tinyagi the primary CLI entrypoint (#234) +``` + +### Feature Development + +Standard feature implementation workflow + +**Frequency**: ~17 times per month + +**Steps**: +1. Add feature implementation +2. Add tests for feature +3. Update documentation + +**Files typically involved**: +- `packages/main/src/*` +- `packages/server/src/*` +- `packages/server/src/routes/*` +- `**/api/**` + +**Example commit sequence**: +``` +feat: add chat rooms and projects to tinyoffice (#199) +fix(telegram): prevent polling from stalling after network reconnect (#200) +feat(office): add organization chart visualization page (#201) +``` + +### Refactoring + +Code refactoring and cleanup workflow + +**Frequency**: ~6 times per month + +**Steps**: +1. Ensure tests pass before refactor +2. Refactor code structure +3. Verify tests still pass + +**Files typically involved**: +- `src/**/*` + +**Example commit sequence**: +``` +refactor(ui): refactor agent and task components into modules (#229) +fix(heartbeat): persist per-agent enabled and interval settings to heartbeat overrides (#230) +chore: bump version to 0.0.14 and add release notes +``` + + +## Best Practices + +Based on analysis of the codebase, follow these practices: + +### Do + +- Use conventional commit format (feat:, fix:, etc.) +- Use camelCase for file names +- Prefer named exports + +### Don't + +- Don't write vague commit messages +- Don't deviate from established patterns without discussion + +--- + +*This skill was auto-generated by [ECC Tools](https://ecc.tools). Review and customize as needed for your team.* diff --git a/.codex/AGENTS.md b/.codex/AGENTS.md new file mode 100644 index 0000000..159dc96 --- /dev/null +++ b/.codex/AGENTS.md @@ -0,0 +1,28 @@ +# ECC for Codex CLI + +This supplements the root `AGENTS.md` with a repo-local ECC baseline. + +## Repo Skill + +- Repo-generated Codex skill: `.agents/skills/ZooBot/SKILL.md` +- Claude-facing companion skill: `.claude/skills/ZooBot/SKILL.md` +- Keep user-specific credentials and private MCPs in `~/.codex/config.toml`, not in this repo. + +## MCP Baseline + +Treat `.codex/config.toml` as the default ECC-safe baseline for work in this repository. +The generated baseline enables GitHub, Context7, Exa, Memory, Playwright, and Sequential Thinking. + +## Multi-Agent Support + +- Explorer: read-only evidence gathering +- Reviewer: correctness, security, and regression review +- Docs researcher: API and release-note verification + +## Workflow Files + +- `.claude/commands/database-migration.md` +- `.claude/commands/feature-development.md` +- `.claude/commands/refactoring.md` + +Use these workflow files as reusable task scaffolds when the detected repository workflows recur. \ No newline at end of file diff --git a/.codex/agents/docs-researcher.toml b/.codex/agents/docs-researcher.toml new file mode 100644 index 0000000..0daae57 --- /dev/null +++ b/.codex/agents/docs-researcher.toml @@ -0,0 +1,9 @@ +model = "gpt-5.4" +model_reasoning_effort = "medium" +sandbox_mode = "read-only" + +developer_instructions = """ +Verify APIs, framework behavior, and release-note claims against primary documentation before changes land. +Cite the exact docs or file paths that support each claim. +Do not invent undocumented behavior. +""" \ No newline at end of file diff --git a/.codex/agents/explorer.toml b/.codex/agents/explorer.toml new file mode 100644 index 0000000..732df7a --- /dev/null +++ b/.codex/agents/explorer.toml @@ -0,0 +1,9 @@ +model = "gpt-5.4" +model_reasoning_effort = "medium" +sandbox_mode = "read-only" + +developer_instructions = """ +Stay in exploration mode. +Trace the real execution path, cite files and symbols, and avoid proposing fixes unless the parent agent asks for them. +Prefer targeted search and file reads over broad scans. +""" \ No newline at end of file diff --git a/.codex/agents/reviewer.toml b/.codex/agents/reviewer.toml new file mode 100644 index 0000000..b13ed9c --- /dev/null +++ b/.codex/agents/reviewer.toml @@ -0,0 +1,9 @@ +model = "gpt-5.4" +model_reasoning_effort = "high" +sandbox_mode = "read-only" + +developer_instructions = """ +Review like an owner. +Prioritize correctness, security, behavioral regressions, and missing tests. +Lead with concrete findings and avoid style-only feedback unless it hides a real bug. +""" \ No newline at end of file diff --git a/.codex/config.toml b/.codex/config.toml new file mode 100644 index 0000000..bc1ee67 --- /dev/null +++ b/.codex/config.toml @@ -0,0 +1,48 @@ +#:schema https://developers.openai.com/codex/config-schema.json + +# ECC Tools generated Codex baseline +approval_policy = "on-request" +sandbox_mode = "workspace-write" +web_search = "live" + +[mcp_servers.github] +command = "npx" +args = ["-y", "@modelcontextprotocol/server-github"] + +[mcp_servers.context7] +command = "npx" +args = ["-y", "@upstash/context7-mcp@latest"] + +[mcp_servers.exa] +url = "https://mcp.exa.ai/mcp" + +[mcp_servers.memory] +command = "npx" +args = ["-y", "@modelcontextprotocol/server-memory"] + +[mcp_servers.playwright] +command = "npx" +args = ["-y", "@playwright/mcp@latest", "--extension"] + +[mcp_servers.sequential-thinking] +command = "npx" +args = ["-y", "@modelcontextprotocol/server-sequential-thinking"] + +[features] +multi_agent = true + +[agents] +max_threads = 6 +max_depth = 1 + +[agents.explorer] +description = "Read-only codebase explorer for gathering evidence before changes are proposed." +config_file = "agents/explorer.toml" + +[agents.reviewer] +description = "PR reviewer focused on correctness, security, and missing tests." +config_file = "agents/reviewer.toml" + +[agents.docs_researcher] +description = "Documentation specialist that verifies APIs, framework behavior, and release notes." +config_file = "agents/docs-researcher.toml" \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 95b598e..192679f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,4 +1,6 @@ -# TinyAGI โ Multi-team Personal Assistants +# ZooBot ๐ค + +# ZooBot โ Multi-team Personal AI Assistants Running in persistent mode with teams of agents, messaging integration (Telegram, WhatsApp, Discord), and heartbeat monitoring. @@ -104,7 +106,7 @@ No memories yet. Use the **memory** skill to start building your memory. ## Soul -You have a soul file at `.tinyagi/SOUL.md` defining your identity, personality, worldview, and opinions. It starts as a template โ fill it in over time. +You have a soul file at `.zoobot/SOUL.md` defining your identity, personality, worldview, and opinions. It starts as a template โ fill it in over time. - **Be specific**: "I prefer pragmatic solutions over elegant abstractions" is useful. "I'm helpful" is not. - **Own your perspective**: Form opinions based on the domains you work in. @@ -112,17 +114,17 @@ You have a soul file at `.tinyagi/SOUL.md` defining your identity, personality, ## File Exchange -`~/.tinyagi/files` is the shared file directory with the human. +`~/.zoobot/files` is the shared file directory with the human. - **Incoming**: Files arrive as `[file: /path/to/file]` in messages. Supports photos, documents, audio, voice, video, and stickers across Telegram, WhatsApp, and Discord. -- **Outgoing**: Place files in `.tinyagi/files/` and include `[send_file: /absolute/path/to/file]` in your response. The tag is stripped before delivery and the file is sent as an attachment. +- **Outgoing**: Place files in `.zoobot/files/` and include `[send_file: /absolute/path/to/file]` in your response. The tag is stripped before delivery and the file is sent as an attachment. ### Outgoing file format Include all of the following in the same reply: -1. Place the file under `.tinyagi/files/` -2. Reference it: `[send_file: /Users/jliao/.tinyagi/files/report.pdf]` +1. Place the file under `.zoobot/files/` +2. Reference it: `[send_file: /Users/you/.zoobot/files/report.pdf]` 3. Keep the tag in plain text (system strips it before user delivery) Multiple files: include one `[send_file: ...]` tag per file. diff --git a/README.md b/README.md index c23bf54..09f83e1 100644 --- a/README.md +++ b/README.md @@ -1,702 +1,237 @@ -
- Multi-agent, Multi-team, Multi-channel, 24/7 AI assistant
-Run multiple teams of AI agents that collaborate with each other simultaneously with isolated workspaces.
- -
- --model
+ ZooBot โ Your personal AI agent team, running free in the cloud โ๏ธ
+Custom provider details
-
-Custom providers let you use any OpenAI or Anthropic-compatible API endpoint (e.g., OpenRouter, proxy servers, self-hosted models).
-
-**Define a custom provider in `settings.json`:**
+Create `~/.zoobot/settings.json` (or set environment variables):
```json
{
- "custom_providers": {
- "my-proxy": {
- "name": "My Proxy",
- "harness": "claude",
- "base_url": "https://proxy.example.com/v1",
- "api_key": "sk-...",
- "model": "claude-sonnet-4-6"
+ "workspace": {
+ "path": "~/zoo-bot-workspace"
+ },
+ "models": {
+ "provider": "groq",
+ "groq": {
+ "model": "llama-3.3-70b-versatile"
+ }
+ },
+ "GROQ_API_KEY": "your-groq-api-key-here",
+ "agents": {
+ "assistant": {
+ "name": "ZooBot Assistant",
+ "provider": "groq",
+ "model": "llama-3.3-70b-versatile",
+ "working_directory": "~/zoo-bot-workspace/assistant",
+ "system_prompt": "You are a helpful AI assistant."
}
}
}
```
-| Field | Required | Description |
-| ---------- | -------- | ------------------------------------ |
-| `name` | Yes | Human-readable display name |
-| `harness` | Yes | CLI to use: `claude` or `codex` |
-| `base_url` | Yes | API endpoint URL |
-| `api_key` | Yes | API key for authentication |
-| `model` | No | Default model name for CLI |
-
-**Assign a custom provider to an agent:**
+Or use environment variables:
```bash
-tinyagi agent provider coder custom:my-proxy
-tinyagi agent provider coder custom:my-proxy --model gpt-4o
-```
-
-**Auth token storage** โ store API keys for built-in providers so you don't need separate CLI auth:
-
-```bash
-tinyagi provider anthropic --auth-token sk-ant-...
-tinyagi provider openai --auth-token sk-...
-```
-
-Tokens are saved in `settings.json` under `models.Pairing commands
-
-Use sender pairing to control who can message your agents.
-
-| Command | Description | Example |
-| -------------------------------------- | -------------------------------------------------- | ------------------------------------------ |
-| `pairing pending` | Show pending sender approvals (with pairing codes) | `tinyagi pairing pending` |
-| `pairing approved` | Show approved senders | `tinyagi pairing approved` |
-| `pairing list` | Show both pending and approved senders | `tinyagi pairing list` |
-| `pairing approve ` | Move a sender from pending to approved by code | `tinyagi pairing approve ABCD1234` |
-| `pairing unpair Messaging & in-chat commands
+---
-| Command | Description | Example |
-| ---------------- | --------------------------- | -------------------------------- |
-| `send Update commands
+## ๐ Documentation
-| Command | Description | Example |
-| -------- | --------------------------------- | ----------------- |
-| `update` | Update TinyAGI to latest version | `tinyagi update` |
+- [Installation Guide](docs/INSTALL.md)
+- [Agent Configuration](docs/AGENTS.md)
+- [Team Collaboration](docs/TEAMS.md)
+- [Channel Setup (Discord, Telegram, etc.)](docs/PLUGINS.md)
+- [Message Patterns](docs/MESSAGE-PATTERNS.md)
+- [Queue System](docs/QUEUE.md)
+- [Troubleshooting](docs/TROUBLESHOOTING.md)
-> **Note:** If you are on v0.0.1 or v0.0.2, the update script was broken. Please re-install instead:
->
-> ```bash
-> curl -fsSL https://raw.githubusercontent.com/TinyAGI/tinyagi/main/scripts/install.sh | bash
-> ```
->
-> Your settings and user data will be preserved.
+---
-**Auto-detection:** TinyAGI checks for updates on startup (once per hour).
+## ๐ ๏ธ Usage
-**Disable update checks:**
+### Single Agent Mode
```bash
-export TINYAGI_SKIP_UPDATE_CHECK=1
-```
-
-Configuration commands
-
-| Command | Description | Example |
-| ------------------------ | ---------------------------- | -------------------------------- |
-| `reset` | Reset all conversations | `tinyagi reset` |
-| `channels reset Agent configuration
-
-Agents are configured in `.tinyagi/settings.json`:
+### Team Mode
-```json
-{
- "agents": {
- "coder": {
- "name": "Code Assistant",
- "provider": "anthropic",
- "model": "sonnet",
- "working_directory": "/Users/me/tinyagi-workspace/coder"
- },
- "writer": {
- "name": "Technical Writer",
- "provider": "custom:my-proxy",
- "model": "gpt-5.3-codex",
- "working_directory": "/Users/me/tinyagi-workspace/writer"
- }
- }
-}
-```
+```bash
+# Create a team of agents
+zoobot team create dev "coder,reviewer,tester"
-Each agent operates in isolation:
-
-- **Separate workspace directory** - `~/tinyagi-workspace/{agent_id}/`
-- **Own conversation history** - Maintained by CLI
-- **Custom configuration** - `.claude/`, `heartbeat.md` (root), `AGENTS.md`
-- **Independent resets** - Reset individual agent conversations
-
-See [docs/AGENTS.md](docs/AGENTS.md) for full details on architecture, use cases, and advanced features.
-
-Message flow diagram
-
-```text
-โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-โ Message Channels โ
-โ (Discord, Telegram, WhatsApp, Web, API) โ
-โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- โ enqueueMessage()
- โ
-โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-โ ~/.tinyagi/tinyagi.db (SQLite) โ
-โ โ
-โ messages: pending โ processing โ completed / dead โ
-โ responses: pending โ acked โ
-โ โ
-โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- โ Queue Processor
- โ
-โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-โ Parallel Processing by Agent โ
-โ โ
-โ Agent: coder Agent: writer Agent: assistant โ
-โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
-โ โ Message 1โ โ Message 1โ โ Message 1โ โ
-โ โ Message 2โ ... โ Message 2โ ... โ Message 2โ ... โ
-โ โ Message 3โ โ โ โ โ โ
-โ โโโโโโฌโโโโโโ โโโโโโฌโโโโโโ โโโโโโฌโโโโโโ โ
-โ โ โ โ โ
-โโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโ
- โ โ โ
- claude CLI claude CLI claude CLI
- (workspace/coder) (workspace/writer) (workspace/assistant)
+# Send task to team
+zoobot team message dev "Build a REST API for task management"
```
-Settings file reference
-
-Located at `.tinyagi/settings.json`:
+```bash
+# Start Telegram bot
+npm run telegram
-```json
-{
- "channels": {
- "enabled": ["discord", "telegram", "whatsapp"],
- "discord": { "bot_token": "..." },
- "telegram": { "bot_token": "..." },
- "whatsapp": {}
- },
- "workspace": {
- "path": "/Users/me/tinyagi-workspace",
- "name": "tinyagi-workspace"
- },
- "agents": {
- "tinyagi": {
- "name": "TinyAGI Agent",
- "provider": "anthropic",
- "model": "opus",
- "working_directory": "/Users/me/tinyagi-workspace/tinyagi"
- }
- },
- "teams": {
- "dev": {
- "name": "Development Team",
- "agents": ["coder", "reviewer"],
- "leader_agent": "coder"
- }
- },
- "custom_providers": {
- "my-proxy": {
- "name": "My Proxy",
- "harness": "claude",
- "base_url": "https://proxy.example.com/v1",
- "api_key": "sk-...",
- "model": "claude-sonnet-4-6"
- }
- },
- "models": {
- "anthropic": { "auth_token": "sk-ant-..." },
- "openai": { "auth_token": "sk-..." }
- },
- "monitoring": {
- "heartbeat_interval": 3600
- }
-}
+# Start Discord bot
+npm run discord
```
-Heartbeat configuration
-
-Edit agent-specific heartbeat prompts:
+### Web Dashboard (TinyOffice)
```bash
-nano ~/tinyagi-workspace/coder/heartbeat.md
+# Start TinyOffice web interface
+npm run visualizer
```
-Default heartbeat prompt:
-
-```markdown
-Check for:
+---
-1. Pending tasks
-2. Errors
-3. Unread messages
+## ๐งฉ Skills
-Take action if needed.
-```
-
-Directory structure
-
-```text
-tinyagi/
-โโโ packages/ # Monorepo packages
-โ โโโ core/ # Shared types, config, queue, agent invocation
-โ โโโ main/ # Queue processor entry point
-โ โโโ teams/ # Team conversation orchestration
-โ โโโ server/ # API server (REST + SSE)
-โ โโโ channels/ # Channel clients (Discord, Telegram, WhatsApp)
-โ โโโ cli/ # CLI commands (tinyagi.sh helpers)
-โ โโโ visualizer/ # TUI dashboard and chatroom viewer
-โโโ tinyoffice/ # TinyOffice web portal (Next.js)
-โโโ .tinyagi/ # TinyAGI data (created at runtime)
-โ โโโ settings.json # Configuration
-โ โโโ tinyagi.db # SQLite queue database
-โ โโโ logs/ # All logs
-โ โโโ channels/ # Channel state
-โ โโโ files/ # Uploaded files
-โ โโโ pairing.json # Sender allowlist state
-โ โโโ chats/ # Team conversation history
-โ โ โโโ {team_id}/ # Per-team chat logs
-โ โโโ .claude/ # Template for agents
-โ โโโ heartbeat.md # Template for agents
-โ โโโ AGENTS.md # Template for agents
-โโโ ~/tinyagi-workspace/ # Agent workspaces
-โ โโโ tinyagi/ # Default agent
-โ โโโ coder/
-โ โโโ writer/
-โโโ lib/ # Runtime scripts
-โโโ scripts/ # Installation scripts
-โโโ tinyagi.sh # Main script
-```
+ZooBot comes with built-in skills:
-Examples
+## ๐ง API Reference
-### Personal AI Assistant
+### Environment Variables
-```text
-You: "Remind me to call mom"
-Claude: "I'll remind you!"
-[1 hour later via heartbeat]
-Claude: "Don't forget to call mom!"
-```
+| Variable | Description |
+|----------|-------------|
+| `GROQ_API_KEY` | Your Groq API key |
+| `OPENAI_API_KEY` | Your OpenAI API key |
+| `ANTHROPIC_AUTH_TOKEN` | Your Anthropic auth token |
+| `ZOOBOT_HOME` | Config directory (default: `~/.zoobot`) |
+| `ZOOBOT_WORKSPACE` | Workspace directory |
-### Multi-Agent Workflow
+### Programmatic Usage
-```text
-@coder Review and fix bugs in auth.ts
-@writer Document the changes
-@reviewer Check the documentation quality
-```
+```typescript
+import { ZooBot } from '@zoobot/core';
-### Team Collaboration
+const bot = new ZooBot({
+ provider: 'groq',
+ model: 'llama-3.3-70b-versatile',
+ apiKey: process.env.GROQ_API_KEY
+});
-```text
-@dev fix the auth bug
-# โ Routes to team leader (@coder)
-# โ Coder fixes bug, mentions @reviewer in response
-# โ Reviewer automatically invoked, reviews changes
-# โ Combined response sent back to user
+const response = await bot.invoke({
+ agentId: 'assistant',
+ message: 'Hello!'
+});
```
-Teams support sequential chains (single handoff) and parallel fan-out (multiple teammate mentions). See [docs/TEAMS.md](docs/TEAMS.md) for details.
-
-### Cross-Device Access
-
-- WhatsApp on phone, Discord on desktop, Telegram anywhere, CLI for automation
-- All channels share agent conversations!
-
-Quick fixes & common issues
+---
-```bash
-# Reset everything (preserves settings)
-tinyagi stop && rm -rf .tinyagi/queue/* && tinyagi start
+## ๐จ Brand Assets
-# Reset WhatsApp
-tinyagi channels reset whatsapp
+
-# Check status
-tinyagi status
+Logo and brand assets are available in [`docs/assets/`](docs/assets/).
-# View logs
-tinyagi logs all
-```
+---
-**Common issues:**
+## ๐ค Contributing
-- WhatsApp not connecting โ Reset auth: `tinyagi channels reset whatsapp`
-- Messages stuck โ Clear queue: `rm -rf .tinyagi/queue/processing/*`
-- Agent not found โ Check: `tinyagi agent list`
-- Corrupted settings.json โ TinyAGI auto-repairs invalid JSON (trailing commas, comments, BOM) and creates a `.bak` backup
+Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
-