Skip to content

feat: add text, seo, and translate tools - #852

Merged
avoidwork merged 7 commits into
mainfrom
scan-issue-784-add-text-processing-and-content-generation-tools
Aug 23, 2026
Merged

feat: add text, seo, and translate tools#852
avoidwork merged 7 commits into
mainfrom
scan-issue-784-add-text-processing-and-content-generation-tools

Conversation

@avoidwork

@avoidwork avoidwork commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Description

Add three new text processing tools to the madz harness:

  • text: Copywriting and editing operations — summarize, rewrite, tone adjustment, grammar correction, shorten, expand. Uses the existing LLM integration via ChatOpenAI.
  • seo: SEO analysis operations — keyword density (local string matching), meta description generation, SERP analysis, content optimization. Uses the existing LLM integration.
  • translate: Multi-language translation and language detection using google-translate-api. Includes tiny-lru caching (24h TTL) and rate limiting (10 req/s).

All tools follow the existing pattern: zod schema, impl function, registration in index.js. Structured JSON output from all tools for reliable agent parsing. Input validation enforces a 10,000 character limit across all tools.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • CI / build / tooling

Testing

  • Unit tests written for all three tools (text.test.js, seo.test.js, translate.test.js)
  • Tests cover validation, each action type, edge cases (empty input, oversized input, missing API keys)
  • keyword-density action tested with local computation (no LLM needed)
  • Caching behavior tested for translate tool
  • All 1192 tests pass (no regressions)

Coverage

  • Line coverage maintained

Checklist

  • npm run lint passes
  • Tests pass with maintained line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

Closes #784

Add proposal, design, specs, and tasks for three new tools:
- text (copywriting, editing, summarization, rewriting)
- seo (keyword density, meta descriptions)
- translate (translation, language detection with caching)
@avoidwork avoidwork self-assigned this Aug 23, 2026
Add three new text processing tools:
- text: summarize, rewrite, tone adjustment, grammar correction, shorten/expand
- seo: keyword density, meta description, SERP analysis, content optimization
- translate: multi-language translation with language detection, caching, rate limiting

Each tool follows the existing pattern: zod schema, impl function, registration.
Translation uses google-translate-api with env var GOOGLE_TRANSLATE_API_KEY.
Text and SEO tools use the existing LLM integration via ChatOpenAI.
Input validation enforces 10,000 character limit across all tools.
Translation includes tiny-lru caching (24h TTL) and rate limiting (10 req/s).

Closes #784
Archive the completed change and sync spec deltas for:
- text-processing: copywriting/editing operations
- seo-analysis: SEO analysis operations
- translation: translation and language detection
@avoidwork avoidwork changed the title docs: add OpenSpec proposal for text processing tools feat: add text, seo, and translate tools Aug 23, 2026
Replace google-translate-api dependency with ChatOpenAI-based
translation, consistent with text and seo tools. Removes external
API key requirement — translate now uses the same OpenAI LLM
as the other text processing tools.

Closes #784
Replace \-\- with \-\- to properly escape double dashes
in shell commands, preventing premature parsing by the shell
command parser.

Closes #784
Replace 3 tool-based implementations (text, seo, translate) with
3 dedicated subagents that use the same LLM infrastructure:

- textEditor (Hannibal's precision): summarize, rewrite, tone,
  grammar, shorten, expand
- seoAnalyst (Martin's curiosity): keyword-density, meta-description,
  SERP-analysis, optimize
- translator (Hannibal's cultural sophistication): translate, detect

Each subagent has its own system prompt in prompts/, a definition
in src/agent/definitions/, and is registered in getAllAgents().
Temperatures configured in config.yaml: 0.4, 0.3, 0.3 respectively.

Removed: src/tools/text.js, seo.js, translate.js and their tests.
Updated: README.md subagent tables, config.yaml temperatures,
agentDefinitions.test.js for 12 agents.

Closes #784
Rewrite all 3 spec files to describe the subagent-based approach:
- text-processing: textEditor subagent (summarize, rewrite, tone, grammar, shorten, expand)
- seo-analysis: seoAnalyst subagent (keyword-density, meta-description, SERP-analysis, optimize)
- translation: translator subagent (translate, detect)

Also mark all verification tasks as complete in the archive tasks.md.

Closes #784
@avoidwork
avoidwork merged commit c3077d7 into main Aug 23, 2026
2 checks passed
@avoidwork
avoidwork deleted the scan-issue-784-add-text-processing-and-content-generation-tools branch August 23, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add text processing and content generation tools

1 participant