Conversation
…ggestions Expand prompt suggestions to handle primary Kubernetes resource kinds including StatefulSet, DaemonSet, Job, CronJob, Ingress, ConfigMap, Secret, PersistentVolumeClaim, PersistentVolume, Namespace, and NetworkPolicy. Add route-aware suggestion fallbacks based on pathname when no resource event is present. Fixes headlamp-k8s#1271 Signed-off-by: Aamod007 <aamodkumar2006@gmail.com>
|
@ashu8912, whenever you’re free, could you please review this? I’d really appreciate your feedback. |
illume
left a comment
There was a problem hiding this comment.
Thanks for working on this.
The commit messages could use some tidying up to match our contribution guidelines. We use Linux kernel style — the contributing guide has the details, and git log shows good examples.
Commits that need attention
ai-assistant: Add route-aware and multi-resource contextual prompt suggestions— ContainsFixes #NN; please remove the issue reference from the commit message.
Commit guidelines
- Use atomic commits focused on a single change.
- Use the title format
<area>: <Description of changes>— description must start with a capital letter. - Keep the title under 72 characters (soft requirement).
- Explain the intention and why the change is needed.
- Make commit titles meaningful and describe what changed.
- Do not add code that a later commit rewrites; squash or reorder commits instead.
- Do not include
Fixes #NNin commit messages.
Good examples:
frontend: HomeButton: Fix so it navigates to homebackend: config: Add enable-dynamic-clusters flag
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Specialized prompts are truncated or misclassified, and required resource-name interpolation is missing.
Review effort: Balanced
Findings: 5
Open (5)
What changed in this PR
Extends AI Assistant prompt suggestions for additional Kubernetes resources and route-based contexts.
Changes:
- Adds detail, list, and pathname-aware prompts.
- Adds localization keys across supported locales.
- Expands prompt generator unit tests.
| File | Description |
|---|---|
ai-assistant/src/prompts/promptGenerator.ts |
Adds resource and route-aware prompt generation. |
ai-assistant/src/prompts/promptGenerator.test.ts |
Tests new prompt categories and routes. |
ai-assistant/locales/en/translation.json |
Adds English prompt translations. |
ai-assistant/locales/cs/translation.json |
Adds Czech prompt keys. |
ai-assistant/locales/de/translation.json |
Adds German prompt keys. |
ai-assistant/locales/es/translation.json |
Adds Spanish prompt keys. |
ai-assistant/locales/fr/translation.json |
Adds French prompt keys. |
ai-assistant/locales/hu/translation.json |
Adds Hungarian prompt keys. |
ai-assistant/locales/id/translation.json |
Adds Indonesian prompt keys. |
ai-assistant/locales/it/translation.json |
Adds Italian prompt keys. |
ai-assistant/locales/ja/translation.json |
Adds Japanese prompt keys. |
ai-assistant/locales/ko/translation.json |
Adds Korean prompt keys. |
ai-assistant/locales/nl/translation.json |
Adds Dutch prompt keys. |
ai-assistant/locales/pl/translation.json |
Adds Polish prompt keys. |
ai-assistant/locales/pt-BR/translation.json |
Adds Brazilian Portuguese prompt keys. |
ai-assistant/locales/pt-PT/translation.json |
Adds Portuguese prompt keys. |
ai-assistant/locales/ru/translation.json |
Adds Russian prompt keys. |
ai-assistant/locales/sv/translation.json |
Adds Swedish prompt keys. |
ai-assistant/locales/tr/translation.json |
Adds Turkish prompt keys. |
ai-assistant/locales/zh-Hans/translation.json |
Adds Simplified Chinese prompt keys. |
ai-assistant/locales/zh-Hant/translation.json |
Adds Traditional Chinese prompt keys. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Prioritize kind-specific prompts ahead of generic resource fallbacks so both specialized suggestions are retained within the top-3 limit. Interpolate resource name and namespace into canonical detail prompts while preserving localized display labels. Reorder list-kind prompts before generic list fallbacks, split Job and CronJob suggestions, and restrict route matching to PersistentVolumeClaims. Signed-off-by: Aamod007 <aamodkumar2006@gmail.com>
|
@illume I've updated the prompt suggestions based on the review feedback (prompt prioritization, interpolation, and route filtering) and added a follow-up commit matching the commit guidelines. When you get a chance, could you please take another look? |

Description
This pull request implements route-aware and multi-resource contextual prompt suggestions in the
ai-assistantplugin, resolving issue #1271.Changes
Multi-Resource Kind Support:
generatePromptsinsrc/prompts/promptGenerator.tsto support primary Kubernetes resource kinds:StatefulSet: "Check stateful replica order and PVCs", "Is this StatefulSet rollout healthy?"DaemonSet: "Check daemon rollout across nodes", "Why are daemon pods not scheduling?"Job: "Why did the last job execution fail?", "How can I inspect active job pods?"CronJob: "Check cron schedule and completion history", "Why is this CronJob not triggering?"Ingress: "Explain backend routing rules and TLS certs", "Are ingress paths configured correctly?"ConfigMap: "Show workloads consuming this ConfigMap", "How to mount this ConfigMap in a workload safely"Secret: "Show workloads consuming this Secret", "How to mount this Secret safely without leaking data"PersistentVolumeClaim: "Why is this PVC pending or failing to bind?", "Check storage class provisioner and capacity"PersistentVolume: "Check persistent volume capacity and status", "Show claims bound to this volume"Namespace: "Summarize resources and quotas in this namespace", "Check namespace resource limits"NetworkPolicy: "Explain ingress and egress traffic rules", "Are pods blocked by this network policy?"Expanded List View Categories:
Deployment,StatefulSet,DaemonSet,Job,CronJob,Ingress,Service,ConfigMap,Secret,PersistentVolumeClaim, andNamespace.Route-Aware Fallback:
event.pathname(fromuseLocation().pathname) to offer category-specific suggestions matching the active view.Localization and Unit Testing:
translatePromptusingt(), and updated localization catalogs across all supported locales vianpm run i18n.promptGenerator.test.ts(34/34 passing).Testing Done
npx vitest run src/prompts/promptGenerator.test.ts(34/34 passed).tsc --noEmitpassed with 0 errors.prettier --checkclean across all modified files.Fixes #1271