Skip to content
Agentmart
Submit a tool

code-optimization

Minimal, dependency-light, async-first software architecture and code optimization.

Skill by alakbarr

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/alakbarr-code-optimization

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Minimal, dependency-light, async-first software architecture and code optimization.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/code-optimization

What's inside

Skill name
code-optimization
Description
Minimal, dependency-light, async-first software architecture and code optimization.
License
MIT
Instructions
38 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Monika Architecture & Code Optimization Playbook

## 1. Async-First I/O Invariants
- **Non-Blocking Execution**: All database queries, MT5 IPC bridge calls, network scrapers, and external HTTP requests MUST use `async/await`.
- **Prohibited**: Never invoke synchronous `time.sleep()`, synchronous `requests.get()`, or blocking DB calls inside async loops. Use `asyncio.sleep()` or `httpx.AsyncClient`.

## 2. SQLAlchemy 2.0 Modern Standards
- **Use Modern 2.0 Syntax**: Strictly utilize `select(Model).where(...)` syntax. Legacy 1.x `session.query(Model)` is deprecated and prohibited.
- **Transaction Context Managers**: Always encapsulate database mutations within safe transactional boundaries:
  ```python
  from database.safe_ops import safe_commit

  # Preferred pattern
  async with session.begin():
      stmt = select(SystemConfig).where(SystemConfig.key == "example_key")
      result = (await session.execute(stmt)).scalar_one_or_none()
  ```

## 3. EventBus Decoupling Pattern
- Use `EventBus.emit(event_type, payload)` for cross-subsystem communication (e.g. notifying risk guards, updating position trackers) rather than importing concrete stage modules directly.
- Keeps cognitive layers (`analysis/`), fortress layers (`risk/`), and execution layers (`execution/`) cleanly isolated.

## 4. Error Boundary & Tool Handlers Pattern
- All domain tool handlers MUST catch internal exceptions and return structured dictionary responses (`{"error": "...", "status": "failed"}`) rather than raising unhandled exceptions into the LangGraph loop.
- Never catch raw `Exception` silently with `pass`. Log every unexpected error with appropriate context:
  ```python
  try:
      ...
  except Exception as e:
      logger.warning(f"[{module_name}] Operation failed non-fatally: {e}")
      return {"error": str(e), "status": "failed"}
  ```

## 5. Clean Imports & Anti-Bloat
- Avoid circular imports by importing type annotations under `if TYPE_CHECKING:` guards or importing domain handlers lazily inside tool execution methods.
- Standard Library First: Prefer `dataclasses`, `functools`, `typing`, `asyncio`, `re`, `json`, `datetime` over heavy third-party utility packages.

From alakbarr/Monika, MIT.

More from alakbarr/Monika

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 12, 2026 (17 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from alakbarr

Cite this page

code-optimization skill. Agent Mart. https://agentmart.dev/skills/alakbarr-code-optimization (last updated 2026-10-24)