
Code Assistant
The Code Assistant is part of the FirstSpirit AI Assistant Suite. This AI-based assistant analyzes your HTML code and provides improvement suggestions. You can use the fully functional prompt provided by Crownpeak or modify it to define use case-specific topics considered in the analysis.
In addition to the Code Assistant, the AI Assistant Suite includes the following tools:
Configuration
To use the Code Assistant in Template Development for ContentCreator, you need to configure FirstSpirit AI.
Like the other assistants in the FirstSpirit AI Assistant Suite, you can configure the Code Assistant prompts in the ServerManager. Additionally, with the appropriate permissions, you can edit prompts directly in the ContentCreator.
FirstSpirit offers a preconfigured functional prompt for the Code Assistant. This prompt analyzes your code and provides suggestions for improvement in the following areas:
- Accessibility
- Search Engine Optimization
- Web Development Best Practices
If you need to customize the prompt, we recommend duplicating the preset prompt and adjusting it according to your needs.
Handling
You can analyze templates with the Code Assistant in both full-screen mode and preview. Problem areas in the templates are thus easily visible in the Code Assistant report, and you can access them with a click.
You can use the Code Assistant in the following areas:
- in full-screen view via the Code Assistant icon
- in preview via the Code Assistant icon
To analyze a template with the Code Assistant in full-screen mode or in the preview:
- Open a template in the template development for ContentCreator in full-screen view.
Alternatively: Open a template in the preview. - Click on the Code Assistant icon.
→ The Code Assistant report opens, and the page analysis starts automatically.
→ Entries marked withindicate issues in templates. Each entry describes an improvement opportunity as well as the category assigned to the improvement opportunity.
- Optional: Configure the Code Assistant prompt.
- If there are specific issues with an entry, you can expand the entry using the
.
→ The reference name and line number of the affected template will be displayed. - Click on the reference name to go directly to the affected template and line.
→ If you are in fullscreen view and the affected template is not currently open, a new tab with the affected template will open. If you are in a preview, a new dialog window will open. - Hover the mouse pointer over the
icon next to the affected line.
→ An explanation of the issue regarding the current line will be displayed.
Prompt Configuration in ContentCreator
With the appropriate rights, you can configure the Code Assistant prompt directly in the ContentCreator and tailor it to your individual needs.
- In the Code Assistant report, click on the Edit Prompt icon
.
→ The Edit Operation window will open. Here you can edit the prompt, assign options, add new options, and test the prompt.
Editing prompts
To edit a prompt directly in the ContentCreator:
- In the Edit Operation window, click in the Prompt text field to edit it.
- Optional: Change the name of the operation in the Name text field.
- Save your changes.
You can find more information on operations and options here.
Managing options
To assign an already existing option to the operation:
- In the Edit Operation window, you assign an existing option to the operation by checking the box in the Use column.
- Save your changes.
To add a new option:
- In the window Edit Operation, click on Create New Option.
→ The window Edit Option opens. - In the Name field, specify the display name of the option.
- Click on Create Option Item to add a new option value.
→ The window Edit Option Item opens. - In the Name field, specify the display name of the option value.
- In the Prompt field, specify the prompt of the option value.
- Click on Apply to save the changes.
- Optional: Add more entries.
- Click on Save to save your newly added option.
- Assign your newly added option to the current operation.
To edit an existing option:
- In the Edit Operation window, click on the Edit Option icon
.
→ The Edit Option window opens. - Change the display name of the option as well as the display name and prompt of the option values or add a new option value.
- Save your changes.
Testing prompts
To test your prompt directly in the ContentCreator:
- In the Edit Operation window, click on Test Prompt.
→ The speech bubble Test Prompt opens. - Expand the Test Settings.
- Select a Test Plugin to test your prompt in a specific environment, such as ContentAssistantPromptConfigurationTestPlugin to test your prompt for use in the Content Assistant.
→ The text in the Text Input field changes depending on the selected Test Plugin. - Optional: Edit the text in the Text Input field.
- Optional: Edit your prompt in the Prompt field if the API response was unsatisfactory, and test it again.