{
  "markdown": "# delphi-dev — Claude Code Plugin\n\n> A Claude Code plugin that turns the assistant into a senior Delphi expert.\n> 🇧🇷 [Leia em Português](README.pt-BR.md)\n\n---\n\n## What is it\n\n**delphi-dev** activates automatically whenever Claude Code detects Delphi-related content — `.pas`, `.dpr`, `.dfm`, `.dpk`, `.dproj` files, or any mention of Object Pascal, FireMonkey, VCL, FireDAC, or RAD Studio. Once active, Claude applies the full Delphi Style Guide, Clean Code principles, and SOLID patterns without being asked.\n\n---\n\n## Features\n\n| Command | Description |\n|---|---|\n| **Auto Delphi Mode** | Opening any `.pas`, `.dpr` or `.dfm` file activates the full coding standards context automatically |\n| **`/audit`** | Generates a complete professional technical audit with per-dimension scoring and a prioritized modernization roadmap |\n| **`/review`** | Quick code review — detects violations and provides corrected examples |\n| **`/write`** | Writes new code with all standards applied from the start |\n| **`/new-project`** | Scaffolds a new project with standardized layered folder structure |\n| **`/spec`** | Analyzes the current project source code and auto-generates a complete `SPEC.md` |\n| **`/tdd`** | Generates a complete DUnitX unit test suite for the project |\n| **`/e2e`** | Runs end-to-end scenarios against a running Delphi desktop app — builds it, opens the `.exe`, drives the screens and reports a verdict per scenario |\n| **`/contribute-kb`** | Packages local learnings captured by the hooks and opens a PR to the community knowledge base *(needs hooks, currently disabled — see Installation)* |\n| **`/dashboard`** | Displays GitHub repository metrics — stars, forks, issues, PRs, commits, releases, contributors |\n| **`/about`** | Displays plugin info, version, and available commands |\n\n---\n\n## End-to-end testing with `/e2e` <sub>new in 3.2.0</sub>\n\nThink of it as **Playwright for Delphi desktop apps**. You describe test scenarios in plain\nlanguage; the plugin builds the project, opens the `.exe`, drives the real screens, and returns\na **verdict per scenario** — correlated with your app's log.\n\n```\n/e2e login: blank password, wrong password, correct password\n```\n\nWithout arguments, `/e2e` derives an \"opens without error\" scenario for each screen of the\nmain menu.\n\n### Four verdicts, not two\n\nThe distinction is what separates a useful report from noise:\n\n| Verdict | Meaning |\n|---|---|\n| ✅ PASS | Ran and matched the expectation |\n| ❌ FAIL | Ran and diverged — **the app is wrong** |\n| ⛔ BLOCKED | Couldn't run — **I don't know whether the app is wrong** |\n| ⏭️ SKIPPED | Writes data and wasn't authorized at the gate |\n\nA report that blames a bug where there was only state contamination is worse than no report.\nSo when a scenario can't be returned to its starting point, it comes back **⛔ BLOCKED, never\n❌ FAIL**.\n\n### It never steals focus\n\nClicks go through `PostMessage`, text through `WM_CHAR`, screenshots through `PrintWindow` —\nso the plugin **never grabs your keyboard and never moves your cursor**. Screenshots work even\nwith the window fully covered, and `WM_CHAR` is immune to the dead-key problem of ABNT\nkeyboards that breaks `SendKeys`.\n\nBy default the app runs in the foreground so you can watch. Pass `--background` and it runs\nbehind your other windows without interrupting you.\n\n### It stops and asks before touching your data\n\nBefore the first click, `/e2e` presents the scenarios it intends to run, **which ones write\ndata and what they write**, and waits. It never writes on its own initiative — it explores,\ncaptures, and leaves through Cancel/Back.\n\n### It reads your app's log\n\nDelivery is not effect: a message can reach the window and still do nothing if the control\nisn't in the expected state. That's why `/e2e` reads your log in parallel — it's the difference\nbetween ⛔ BLOCKED and ❌ FAIL. If your app has no log, the plugin **offers** (never imposes)\neither a minimal logging unit or a headless `--selftest` mode, and generates it following the\nplugin's own coding standards.\n\n> **Requirements:** Windows, and RAD Studio for the build step. FireMonkey is validated;\n> VCL is a declared fallback. Android is out of scope by design.\n\n---\n\n## Installation\n\n```bash\nnpx delphi-dev\n```\n\nThis single command:\n- Installs the Claude Code plugin\n- Downloads the RAG knowledge base\n- Installs the VS Code extension (if VS Code is detected)\n- Removes any stale automation hooks left by older versions\n\n**Requirements:** Node.js 18+, Claude Code CLI, git\n\n> **Automation hooks are disabled since v2.2.2.** They depended on native modules\n> that broke clean installs on Windows. The knowledge base still ships and the\n> skills, commands and agents all work — what is currently off is the automatic\n> per-prompt knowledge injection and session capture. They return with the local\n> MCP server. **Do not register them by hand:** on v3.0.0 and earlier the capture\n> path writes session noise into the index tagged as authoritative.\n\n> **Nothing to do about the knowledge base right now.** The curated corpus ships as\n> `rag.db` on each release and `npx delphi-dev` downloads it for you. It is currently\n> **read by nothing**, because the only consumer is the per-prompt injection hook, which\n> is off — so an install without it behaves identically. When the local MCP server lands,\n> `npx delphi-dev update` will bring both the corpus and the code that reads it.\n\n### Update\n\n```bash\nnpx delphi-dev update\n```\n\n### Verify installation\n\n```bash\nnpx delphi-dev verify\n```\n\n### Clean reinstall (upgrading from v1.x)\n\nIf you already had an old version (v1.x) installed and want to move to the new version from scratch, **first remove the old installation inside Claude Code**, then reinstall.\n\n**1. Remove the old version** — commands run inside Claude Code:\n\n```text\n/plugin list                            # see what is installed\n/plugin uninstall delphi-dev@delphi-dev # uninstall the plugin\n/plugin marketplace remove delphi-dev   # remove the old marketplace\n```\n\n> Removing the marketplace also uninstalls plugins that came from it. Short forms `/plugin market` and `rm` are accepted.\n\n**2. (Optional) clear the plugin cache** if anything gets stuck:\n\n```bash\nrm -rf ~/.claude/plugins/cache\n```\n\n**3. Clean install** — in the terminal:\n\n```bash\nnpx delphi-dev\n```\n\n**4. Reload** — restart Claude Code or run `/reload-plugins` to load the new version.\n\n#### Local install (development / testing)\n\nTo test from a local checkout of the repository — useful when developing the plugin itself:\n\n```text\n/plugin marketplace add <checkout-path>\n/plugin install delphi-dev@delphi-dev\n```\n\nChanges to `.md` / `.json` files only take effect after reinstalling. To repeat the test cycle from a clean state, uninstall and re-add:\n\n```text\n/plugin uninstall delphi-dev@delphi-dev\n/plugin marketplace remove delphi-dev\n/plugin marketplace add <checkout-path>\n/plugin install delphi-dev@delphi-dev\n```\n\n---\n\n## Output Language\n\n**delphi-dev** supports both **pt-BR** (default) and **en-US** for everything it shows you — audit reports, SPEC documents, code reviews, prompts, and notifications.\n\nThe plugin auto-detects the language of your **first message** in a session and responds in that language. You can switch any time with an explicit override:\n\n- `respond in English` / `in English please` / `switch to English` → en-US\n- `responda em português` / `em português por favor` → pt-BR\n\nWhat changes with the language selection:\n\n- **Report templates** — `/audit` loads `estrutura-laudo.en.md` for English, `estrutura-laudo.md` for Portuguese; `/spec` does the same with `spec-template[.en].md`.\n- **Severity / classification labels** — e.g. `🟢 GOOD / 🟡 FAIR / 🟠 CRITICAL / 🔴 NOT VIABLE` (en-US) vs. `🟢 BOM / 🟡 REGULAR / 🟠 CRÍTICO / 🔴 INVIÁVEL` (pt-BR).\n- **Notifications** — e.g. `✅ Tests created in TestePedidoService.pas — 7 test cases` vs. the pt-BR equivalent.\n- **All explanatory prose** in `/review`, `/write`, `/new-project`, `/tdd`, and `/about`.\n\nWhat does **not** change with language:\n\n- **Delphi identifiers in example code** (`FNome`, `ACliente`, `BuscarPorCodigo`) — these illustrate the naming convention itself.\n- **Code prefixes** (`F`, `A`, `L`, `C_`, `T`, `I`, `E`).\n- **Test method names** (`Test_<Method>_<Scenario>`).\n- **Requirement IDs in SPECs** (`RF-001`, `RNF-001`, `RN-001`, `UC-001`).\n\n---\n\n## Standards Applied Automatically\n\n### Prefixes\n- `F` — fields (private attributes)\n- `A` — method parameters\n- `L` — local variables\n- `C_` — constants (+ UPPER_CASE body)\n- `T` — classes and types\n- `I` — interfaces\n- `E` — exceptions\n\n### Formatting\n- ✅ 2-space indentation (no tabs)\n- ✅ 120-character line limit\n- ✅ `begin` and `else` on their own lines\n- ✅ One variable per line\n- ✅ One unit per line in `uses` clause (RTL → VCL/FMX → FireDAC → Third-party → Project)\n\n### Prohibited Commands\n- ❌ `with` — causes ambiguity and debugging issues\n- ❌ `Break` / `Continue` — use loop conditions instead\n- ❌ `Real` — use `Double` or `Currency`\n- ⚠️ `Exit` — allowed only as guard clauses at the top of a method\n\n### Safety Rules\n- ✅ One resource per `try..finally` block\n- ✅ No empty `except` blocks\n- ✅ SQL always parameterized (no string concatenation)\n- ✅ `const` never applied to interface parameters (ARC compatibility)\n- ✅ No global variables — use `class var` instead\n\n### Component Prefixes (VCL / FMX)\n`btn`, `edt`, `lbl`, `mmo`, `cbx`, `grd`, `qry`, `cnn`, `dts`, `pnl`, `tmr`, and more — see [`skills/delphi-standards/references/component-prefixes.md`](skills/delphi-standards/references/component-prefixes.md)\n\n---\n\n## Included Skills\n\n| Skill | Activation |\n|---|---|\n| `delphi-standards` | Auto-activated on Delphi file/code detection |\n| `delphi-write` | Activated when writing new Delphi code |\n| `delphi-laudo` | Activated by the `/audit` command |\n| `delphi-spec` | Activated by the `/spec` command |\n| `delphi-tests` | Activated by the `/tdd` command or automatically after `delphi-write` |\n| `delphi-claudeignore` | Auto-activated on Delphi project detection to optimize token usage |\n| `delphi-encoding` | Auto-activated on encoding/BOM/mojibake issues in Delphi files |\n| `delphi-fmx` | Auto-activated for FireMonkey and Android/iOS mobile development |\n| `delphi-firedac` | Auto-activated for FireDAC data-access code |\n| `delphi-acbr` | Auto-activated for ACBr fiscal components (NFe/NFCe/boleto) |\n| `delphi-async` | Auto-activated for async/threading (TTask, TThread, Synchronize) |\n| `delphi-build` | Auto-activated for command-line build/compilation and build errors |\n| `delphi-spring4d` | Auto-activated for Spring4D DI container and collections |\n| `delphi-legacy` | Auto-activated for legacy code modernization/migration |\n| `delphi-e2e` | Activated by the `/e2e` command — Windows only |\n\n---\n\n## Included Agents\n\n| Agent | Purpose |\n|---|---|\n| `delphi-auditor` | Deep technical audit — 8 dimensions, scoring, 17-section report |\n| `delphi-writer` | Writes complete, production-ready Delphi code following all standards |\n| `delphi-spec-writer` | Generates the SPEC document from source code analysis |\n| `delphi-tester` | Creates DUnitX unit test suites for Delphi classes |\n\n---\n\n## Roadmap\n\nSee [ROADMAP.md](ROADMAP.md) for what is planned and how to influence priorities. Phases under discussion include automatic encoding handling (UTF-8/BOM), mobile FMX scaffolding, Spring4D dependency injection, and a build/validation pipeline that lets Claude actually compile and verify the code it generates.\n\n---\n\n## Based on\n\n- *Delphi Coding Standards v4.0.1* — Adriano Santos\n- *Clean Code and Best Practices in Delphi* — Adriano Santos\n- *Clean Code* — Robert C. Martin\n- *Delphi Style Guide* — Embarcadero\n\n---\n\n## License\n\nMIT © 2026 Adriano Santos\n\n---\n\n## Privacy Policy\n\n[View Privacy Policy](privacy-policy.md)\n",
  "bytes": 11812,
  "sha": "afef26dbdc34acccaab0843612940ca6476fb91758456566bd72d8bd5978ffa5",
  "repo_slug": "adrianosantostreina/delphi-dev",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_adrianosantostreina_delphi_dev_delphi_de_f2fc475f/readme"
}