Generic prompts get generic Joomla answers: code written for Joomla 3, options that don't exist, advice for WordPress with "Joomla" pasted in. The prompts below are the ones we actually use for Joomla work. Each comes with the reason it's phrased the way it is. The pattern behind all of them: pin the Joomla version, paste the real input, constrain the output, and give the model a way to say "I don't know".
A preamble for every Joomla code task
Models have seen far more Joomla 3 code than Joomla 5/6 code, and default to it. We start every code request with this:
Context: Joomla 6.2, PHP 8.3. Write code the way Joomla 6 core does:
- namespaced classes under src/, a services/provider.php, no J* class names (JFactory, JText…)
- plugins implement Joomla\Event\SubscriberInterface and receive event objects
- database via $this->getDatabase() / DatabaseAwareTrait and $db->createQuery() with bind()/whereIn()
- no Factory::getUser()/getDbo()/getDocument(); use $app->getIdentity(), injected services
- assets via the Web Asset Manager, never $doc->addScript()
If you are not sure an API, class, option or event exists in Joomla 6, say so explicitly instead of guessing.
The last line does the most work. Without it, a missing piece gets filled with a plausible invention.
1. Triage the deprecation log
Below is administrator/logs/deprecated.php from a Joomla 6.2 site (grouped and counted).
For each distinct message:
1. which extension or file it comes from (from the path),
2. what the Joomla 7-safe replacement is,
3. effort: trivial / small / needs refactor.
Output a table sorted by extension, then a short list of what to fix first.
Do not invent replacements; if the message doesn't name one and you are unsure, write "check Joomla docs".
[paste: grep -v '^#' deprecated.php | cut -f4- | sort | uniq -c | sort -rn | head -100]
Why it works: the log already contains file paths and Joomla's own replacement hints. The model's job is sorting and grouping, which it does well, not remembering APIs. More on the log in Joomla 7 breaking changes.
2. Review a template override after an update
Joomla updated a core layout that my template overrides.
File: components/com_content/tmpl/article/default.php
Below: (A) the new core layout, (B) my override.
List every functional difference: new variables, removed variables, changed HTML structure, new events/escaping.
Then tell me which core changes my override is missing that matter (security, accessibility, new features).
Do not rewrite the file; I will apply the changes.
(A) [paste core file]
(B) [paste override]
Why it works: diffing two versions of a layout is tedious for people and easy for models. "Do not rewrite" keeps your customisations from being silently dropped.
3. Write a small plugin
[preamble above]
Write a Joomla 6 content plugin "plg_content_readingtime":
- on onContentPrepare for context com_content.article only, add $item->readingTime (words/220, rounded up)
- no output, no assets; the template will print it
Give me: the manifest XML, services/provider.php, src/Extension/ReadingTime.php, the language .ini files.
Namespace: Example\Plugin\Content\ReadingTime.
Why it works: naming every file you expect stops the model from collapsing a plugin into one legacy file, and the namespace is the part it most often gets wrong. Test the result on a real site. Generated manifests often miss <namespace> or the services folder.
4. Write SQL for an audit, read-only
MySQL 8, Joomla 6 database, table prefix jos_.
Write ONE read-only SELECT query (no UPDATE/DELETE) that lists published articles (#__content state=1) with:
id, title, category title, CHAR_LENGTH(metadesc), whether image_intro is set (images is JSON),
number of links to other pages of the same site in introtext+fulltext (href starting with "/" or the domain example.com).
Sort by the missing/short descriptions first.
Why it works: "ONE read-only SELECT" is a constraint you can verify at a glance before running it. Telling the model that images is JSON avoids string matching on it.
5. Translate a language file without breaking it
Translate the values of this Joomla language .ini file from English to German.
Rules: keep every KEY exactly as is; keep placeholders (%s, %d, %1$s, {name}) and HTML tags unchanged;
keep the file format KEY="value" with double quotes, escape inner double quotes as \";
do not add or remove lines. Output only the file.
[paste en-GB.mod_example.ini]
Why it works: the failure modes of translated .ini files are always the same: changed keys, broken placeholders, unescaped quotes that make Joomla skip the rest of the file. Listing them prevents most of them. Still diff the key list afterwards.
6. Explain unfamiliar or suspicious code
This PHP file was found in images/ on a Joomla site. Do not execute anything.
Explain step by step what it does, decode any encoded strings, and say whether it is a backdoor,
what it allows an attacker to do, and what other files or database entries such code typically creates.
[paste file content]
7. Meta descriptions from the real page
Write a meta description for this page. 140–158 characters, plain text, no quotes or emoji,
no marketing words ("discover", "unlock", "ultimate", "comprehensive"). Say concretely what the reader gets,
using the page's own terms. Answer with the description only.
Title: [title]
Page text: [first ~6000 characters of the article, tags stripped]
We run this in batch with a review step. The command is in auto-generating meta descriptions.
8. A content draft that sounds like you
Write a draft blog post for [site], a [what the business does].
Audience: [who, what they already know].
Our experience to use (facts, don't embellish): [3–6 bullet points of what you actually did/saw]
Sources to rely on: [links or pasted notes]. Don't add facts beyond these; mark anything you'd want to add as [CHECK: …].
Structure: short intro, H2 sections, one table or code block if it helps, no conclusion section that repeats the intro.
Output clean HTML (p, h2, ul, table, pre/code), no inline styles.
Why it works: "our experience, don't embellish" plus "[CHECK: …]" markers turns invented details into visible to-dos for the editor. The draft goes into Joomla unpublished. See Claude writes, Joomla publishes.
Habits that matter more than the prompt
- Paste the real thing: the file, the log, the error. Never describe it from memory.
- State the Joomla and PHP version every time.
- Ask for a plan before code on anything bigger than one file.
- Verify option names and menu paths in a real back end before you publish or ship.
- Never paste secrets:
configuration.php, API tokens, customer data.