Rules for AI agents (and humans) changing this repository. Keep them short; extend them when a mistake repeats.
- AEM Content Manager (ACM): Maven multi-module AEM project (
core,ui.apps,ui.config,ui.content,ui.frontend,all, ...), and TypeScript tools intools/(see tools/README.md and DEVELOPMENT.md). - ACM must work the same on AEM 6.5 on-premise, AMS and AEM as a Cloud Service, on Java 8, 11 and 21. Use only Java 8 language features and APIs, and nothing specific to one AEM flavour.
- Build:
sh mvnw clean install(Spotless with Palantir Java Format applies formatting). Local AEM:sh taskw setup, deploy:sh taskw develop:all. - Tools:
npm install, thennpm run build,npm run typecheck,npm run lintandnpm testintools/mcp-serverortools/vscode-extension.
- Make the smallest change that solves the problem; no drive-by refactors or reformatting.
- Follow existing conventions instead of adding overrides or special cases. If a convention does not fit, rename the new thing.
- No dead code, compatibility shims or polyfills. Raise the minimum version (e.g.
engines.vscode) instead of feature-detecting APIs. - Never use deprecated APIs; check the IDE diagnostics for deprecation warnings.
- Comments state only what the code cannot show, in one short line.
- Update the docs (README, tool READMEs, skill, CHANGELOG) in the same change as the behaviour.
- Never bump versions by hand.
sh taskw release:mcp-server -- <version>andsh taskw release:vscode-extension -- <version>bumppackage.json,package-lock.json(andserver.json), then commit, tag and push. Only add the CHANGELOG section for the next version. - Do not commit, push or release unless asked.
- Everything users may need to tune is explicit and documented: OSGi configuration in ACM, settings in the VS Code extension (
package.jsoncontributes.configuration), the config document and environment variables of the MCP server (its README). - No hidden constants for timeouts, intervals or limits. Use sensible defaults and say in the description what the value bounds and what happens when it is exceeded.
- The VS Code extension passes its settings to the bundled MCP server, so both behave the same.
- Secrets never go to settings or logs: VS Code secret storage in the extension (it never writes them to files). The MCP server reads them from its config document — a literal,
{ "env": "NAME" }or{ "file": "path" }per instance — and warns when a file holding literals is readable by others.
- Permissions use ACM features: nodes under
/apps/acm/featurethat users needjcr:readon, granted with repoinit. Never check group membership or user IDs in code. - Feature names follow the enum convention:
CONSOLE_EXECUTE_NOHISTORYis the nodeconsole/execute/nohistoryand the IDconsole.execute.nohistory. Use single-word segments. - Any endpoint that compiles or runs code (
parse,check, describing inputs, running) counts as code execution and authorizes withExecutor.authorizeCode. Stored scripts always run with their content from the repository, never with content sent by the client. - Runs without history require the
console/execute/nohistoryfeature. - Guardrails in tools (read-only instances, confirmations) are conveniences; the real boundary is AEM permissions. Document it that way.
Log only what has value; ACM runs on busy instances and is called by editors and agents.
| Level | Use for |
|---|---|
ERROR |
Real failures needing attention, with the exception. Never for expected outcomes (e.g. compile errors returned to the caller). |
WARN |
Degraded but handled situations (locked, aborted). |
INFO |
Lifecycle events and actions that leave no other trace (e.g. code run without history, see ExecutionAudit). |
DEBUG |
Per-action details that history or responses already show. |
TRACE |
High-frequency calls, e.g. compile checks sent on every edit. |
- Reads, polling and health checks log nothing on success.
- No stack traces for expected errors; one line with the message is enough.
- The audit trail goes to the
dev.vml.es.acm.auditlogger only.
tools/sharedis source, not a package: no dependencies, no Node.js or VS Code APIs, no configuration loading. Tools import it as@acm/sharedand bundle it.- The script API reference is generated by
node tools/shared/codegen.mjsfromcore; commit the regenerated files with the Java change. Never editapi.jsonorapi.mdby hand. - The ACM Groovy scripting skill is the single source of guidance for agents writing scripts. Its
## Essentialssection is sent as MCP server instructions; thetemplates/{target}/*.groovyfiles (manual,automatic,extension,mock,consolefor bare code) are the templates ofACM: New Script, each starting with a documentation header and listed intools/shared/src/skill.ts; every target needs a template andSKILL.mdlinks them. - Stored scripts start with a documentation header: a
/* */block with YAML frontmatter and a Markdown description, followed by a blank line. - Docs describe processes and contracts (command, environment variables, prompts for agents), not other tools' config files, locations or UI; those change and the tools' own agents know them. Link vendor documentation only where no process can be described.
- Identifiers have one source: the extension's command, view, context key, setting and tree item names live in
tools/vscode-extension/src/ids.ts(npm run check:manifestcompares them withpackage.json), setting defaults only inpackage.json, API paths, MCP environment variables and ACM feature IDs intools/shared. Never repeat such a string in code. - Keep UI and logic apart: anything that does not need
vscode(queries, filters, polling, formatting) lives intools/sharedand is used by both tools; the extension only wires it to views, commands and prompts. - Never build query strings or SQL from request values without escaping them; a JCR-SQL2 string literal escapes
'as''(seeExecutionQuery). - The VS Code extension uses native APIs only (settings, secret storage, tree views, output channels, MCP server definition provider) and bundles the MCP server from
tools/mcp-server/src. - Release workflows are triggered by tags (
v*,mcp-server-v*,vscode-extension-v*); npm trusted publishing is bound to the workflow file name, so do not rename release workflows.