Skip to content

Latest commit

 

History

History
39 lines (33 loc) · 1.45 KB

File metadata and controls

39 lines (33 loc) · 1.45 KB

AGENTS.md

Purpose

Legacy text randomizer and ad generator project with two runtimes:

  • WordPress plugin mode.
  • Standalone CLI mode.

Repository Role

  • Category: legacy utility / WordPress plugin.
  • Main plugin entrypoint: ad-generator.php.
  • Main CLI entrypoint: ad-generator-cli.php.

WordPress Plugin Mode

  • Plugin shortcode: [ad_generator].
  • Core randomization engine: includes/Randomizer.php (+ includes/Node.php).
  • Plugin metadata indicates legacy compatibility (Requires WP 3.8, Tested up to 5.6, Requires PHP 5.4).
  • Localization files are in languages/.

CLI Mode

  • Usage example: php ad-generator-cli.php -n 300 -f template.txt -o result.txt.
  • Required argument: template file via -f / --file.
  • Optional arguments:
    • -n / -N number of variants (default 300).
    • -o / --out output file (default result-N.txt).
    • -h / --help help.

Syntax Contract

  • Alternatives: {a|b|c}.
  • Optional block: {|text}.
  • Permutations: [a|b|c].
  • Permutations with delimiter: [+,+a|b|c].
  • Random digit: %rand%.
  • Escaping: \{, \}, \|, \[, \], \+, \\.

AI Working Notes

  • Treat this repository as legacy: avoid broad refactors unless explicitly requested.
  • Keep randomization syntax backward-compatible (plugin and CLI share same engine).
  • Keep shortcode name [ad_generator] unchanged for existing WP pages.
  • Preserve CLI argument compatibility and output defaults to avoid breaking existing scripts.