CommunityRédaction et éditiongithub.com

mokhtarabadi/cognitive-lead-hq

The centralized Headquarters for the Cognitive Lead AI multi-agent system. Features hallucination-resistant system prompts, MCP servers, and strict Agent Skills.

Qu'est-ce que cognitive-lead-hq ?

cognitive-lead-hq is a Claude Code agent skill that the centralized Headquarters for the Cognitive Lead AI multi-agent system. Features hallucination-resistant system prompts, MCP servers, and strict Agent Skills.

Compatible avec~Claude Code~Codex CLI~Cursor
npx skills add mokhtarabadi/cognitive-lead-hq

Installed? Explore more Rédaction et édition skills: steipete/notion, affaan-m/seo, affaan-m/brand-voice · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Go (Gin) — Best Practices

AI Context & Token Optimization

  1. Explicit Error Handling: Never panic. Always return errors explicitly (%w). This creates a traceable breadcrumb trail for AI debugging tools.
  2. Interface Isolation: Define small interfaces at the consumer level (e.g., UserRepository). This makes AI-driven unit testing and mocking highly reliable.
  3. Flat Handlers: Keep Gin handlers focused strictly on JSON parsing and HTTP codes. Offload all logic to the service layer to keep files small and token-efficient.

Project Structure

project/
├── cmd/                 # Application entry points
│   └── server/
│       └── main.go
├── internal/            # Private application code
│   ├── config/          # Environment loading (viper/godotenv)
│   ├── handlers/        # Gin HTTP handlers/controllers
│   ├── models/          # Domain structs and interfaces
│   ├── repository/      # Database access layer
│   └── service/         # Business logic
├── pkg/                 # Public utility libraries (optional)
├── go.mod
└── go.sum

Naming Conventions

  • Files/Directories: snake_case or lowercase (e.g., user_repository.go)
  • Structs/Interfaces: PascalCase for exported, camelCase for unexported.
  • Functions: PascalCase (e.g., CreateUser).
  • Interfaces: Usually end in -er (e.g., UserReader, DataWriter).

Architectural Patterns

  • Clean Architecture: Handler -> Service -> Repository. Handlers parse JSON and return HTTP codes. Services hold business logic. Repositories handle SQL.
  • Dependency Injection: Pass interfaces into constructors. e.g., func NewUserService(repo models.UserRepository) *UserService.
  • Error Handling: Never panic. Always return error as the last return value. Wrap errors with context (fmt.Errorf("failed to fetch user: %w", err)).
  • Goroutines: Use carefully for background tasks; always pass context.Context down the call chain to handle timeouts and cancellation.

Testing Strategies

  • Framework: Standard testing package + testify for assertions/mocks.
  • Mocking: Generate mocks from interfaces using mockery or gomock for the Repository and Service layers.
  • Table-Driven Tests: Use slice-of-structs to test multiple inputs/outputs in a single test function.

Skills associés

steipete/notion

Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

community

affaan-m/seo

Audit, plan, and implement SEO improvements across technical SEO, on-page optimization, structured data, Core Web Vitals, and content strategy. Use when the user wants better search visibility, SEO remediation, schema markup, sitemap/robots work, or keyword mapping.

community

affaan-m/brand-voice

Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and social workflows. Use when the user wants voice consistency without generic AI writing tropes.

community

affaan-m/crosspost

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

community

affaan-m/x-api

X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.

community

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

community