Skip to content

feat: add ConfigMap generation and apply Makefile targets (#6) - #13

Merged
pavelanni merged 7 commits into
mainfrom
feature/skill-to-configmap
Apr 10, 2026
Merged

pavelanni merged 7 commits into
mainfrom
feature/skill-to-configmap

Conversation

@pavelanni

@pavelanni pavelanni commented Apr 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add make configmap-gen target to generate Kubernetes ConfigMap YAML files from an agent config directory
  • Add make configmap-apply target to generate and apply ConfigMaps directly to a cluster (idempotent via create --dry-run=client | apply)
  • Add deploy/generated/ to .gitignore

Two ConfigMaps are generated per agent config directory:

  • <name>-config — agent config files (system-prompt.txt, agent-card.json, agent-config.yaml, prompts.json)
  • <name>-skills — all SKILL.md files (only if skills/ directory exists)

Usage:

make configmap-gen CONFIG_DIR=testdata/standalone
make configmap-gen CONFIG_DIR=testdata/standalone NAME=my-agent
make configmap-apply CONFIG_DIR=testdata/standalone NAMESPACE=docsclaw
make configmap-apply CONFIG_DIR=testdata/standalone KUBECTL=kubectl

Closes #6

Test plan

  • make configmap-gen CONFIG_DIR=testdata/standalone generates config.yaml and skills.yaml
  • make configmap-gen CONFIG_DIR=testdata/standalone NAME=my-agent uses custom ConfigMap name prefix
  • make configmap-gen CONFIG_DIR=testdata/summarizer-hr skips skills ConfigMap (no skills/ dir)
  • make configmap-gen CONFIG_DIR=testdata/nonexistent fails with clear error
  • make configmap-apply CONFIG_DIR=testdata/standalone dry-run parses correctly
  • Generated files are excluded by .gitignore

Summary by CodeRabbit

  • New Features

    • Added configmap-gen and configmap-apply Make targets to generate and deploy Kubernetes ConfigMaps from agent configuration directories.
    • Planned support for docsclaw chat CLI subcommand for interactive terminal-based chat with agents.
  • Chores

    • Updated .gitignore to exclude generated ConfigMap files.
    • Added implementation and design documentation for upcoming features.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
…ent (#6, #11)

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Add configmap-gen target to generate Kubernetes ConfigMaps from
agent config directories. The target creates two YAML files:
- config.yaml: ConfigMap with agent config files (system-prompt.txt,
  agent-card.json, agent-config.yaml, prompts.json)
- skills.yaml: ConfigMap with skill SKILL.md files

Usage:
  make configmap-gen CONFIG_DIR=testdata/standalone
  make configmap-gen CONFIG_DIR=testdata/standalone NAME=my-agent

Generated files are written to deploy/generated/<name>/ directory.
Uses kubectl/oc --dry-run=client for offline generation.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
The configmap-apply target provides idempotent ConfigMap deployment
directly to the cluster using the create --dry-run=client -o yaml | apply -f -
pattern. This complements configmap-gen by allowing direct application
without generating intermediate YAML files.

Usage: make configmap-apply CONFIG_DIR=testdata/standalone

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 10, 2026 •

Copy link
Copy Markdown

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds infrastructure for converting local agent configurations and skills directories into Kubernetes ConfigMaps via Makefile targets. It includes new configmap-gen and configmap-apply targets that validate configuration directories, generate ConfigMap YAML from agent config files and optional skills, and optionally apply them to a cluster. Supporting documentation and gitignore updates are included.

Changes

Cohort / File(s) Summary
Build Configuration
.gitignore
Added ignore pattern for deploy/generated/ directory containing generated ConfigMap YAML files.
Makefile Targets
Makefile
Added configurable variables (CONFIG_DIR, NAME, OUTDIR, NAMESPACE, KUBECTL) and two new targets: configmap-gen validates configuration directory, generates ConfigMap YAML for core config and optional skills; configmap-apply performs the same generation and applies ConfigMaps directly to cluster via kubectl/oc.
Documentation
docs/dev/2026-04-10-skill-to-configmap-plan.md, docs/dev/2026-04-10-skill-to-configmap-design.md, docs/dev/2026-04-10-cli-chat-client-plan.md, docs/dev/2026-04-10-cli-chat-client-design.md
Added design and implementation documentation for ConfigMap generation tooling (system-prompt.txt, optional agent-card.json, agent-config.yaml, prompts.json, and skills/) and separate documentation for planned CLI chat client feature.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes design/plan documentation and CLI chat client work (4 docs) beyond the configmap tooling scope defined in issue #6. Remove or move docs/dev/2026-04-10-cli-chat-client-*.md files as they are unrelated to the ConfigMap tooling objective.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding Makefile targets for ConfigMap generation and application, which is the core focus of this PR.
Linked Issues check ✅ Passed The PR implements all coding requirements from issue #6: Makefile targets for ConfigMap generation/application, kubectl and oc compatibility, and skip-on-missing-skills logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/skill-to-configmap

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 73-74: The SKILL_FILES key naming emits keys like
"$$skill_name.SKILL.md" which diverges from the documented
"<skill-name>/SKILL.md"; update the logic that builds SKILL_FILES (the lines
that append to SKILL_FILES using $$skill_name.SKILL.md and $$skill_dir/SKILL.md)
to instead produce keys in the "<skill-name>/SKILL.md" form (e.g.,
"$$skill_name/SKILL.md" or construct the key by joining $$skill_name and
"SKILL.md" with a slash) so generated filenames/paths match the docs and the
behavior is consistent across the occurrences (lines that reference SKILL_FILES
around the current code and the similar block at lines 108-109).
- Around line 68-82: The makefile currently builds SKILL_FILES but still calls
$(KUBECTL) create configmap $(NAME)-skills $$SKILL_FILES even when no SKILL.md
files were found; modify the target that handles CONFIG_DIR/skills so after the
loop you check whether SKILL_FILES is empty (test [ -z "$$SKILL_FILES" ]) and if
so echo a message like "No SKILL.md files found, skipping skills ConfigMap" and
skip the create configmap/invocation that writes $(OUTDIR)/skills.yaml,
otherwise proceed to call $(KUBECTL) create configmap ... >
$(OUTDIR)/skills.yaml; apply the same guard to the other skills block referenced
around lines 103-117.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b6f9927c-9ff5-488e-9df6-b1f75aacfbd8

📥 Commits

Reviewing files that changed from the base of the PR and between c367185 and 750b444.

📒 Files selected for processing (6)
  • .gitignore
  • Makefile
  • docs/dev/2026-04-10-cli-chat-client-design.md
  • docs/dev/2026-04-10-cli-chat-client-plan.md
  • docs/dev/2026-04-10-skill-to-configmap-design.md
  • docs/dev/2026-04-10-skill-to-configmap-plan.md

Comment thread Makefile Resolved
Comment thread Makefile
Comment on lines +73 to +74
SKILL_FILES="$$SKILL_FILES --from-file=$$skill_name.SKILL.md=$$skill_dir/SKILL.md"; \
done; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Unify skills key naming with documented behavior.

Line 73 and Line 108 emit keys as $$skill_name.SKILL.md, while the design/plan docs in this PR describe <skill-name>/SKILL.md. This mismatch creates a user-facing contract drift (generated filenames/paths differ from docs). Align either implementation or docs to one format.

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

Also applies to: 108-109

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 73 - 74, The SKILL_FILES key naming emits keys like
"$$skill_name.SKILL.md" which diverges from the documented
"<skill-name>/SKILL.md"; update the logic that builds SKILL_FILES (the lines
that append to SKILL_FILES using $$skill_name.SKILL.md and $$skill_dir/SKILL.md)
to instead produce keys in the "<skill-name>/SKILL.md" form (e.g.,
"$$skill_name/SKILL.md" or construct the key by joining $$skill_name and
"SKILL.md" with a slash) so generated filenames/paths match the docs and the
behavior is consistent across the occurrences (lines that reference SKILL_FILES
around the current code and the similar block at lines 108-109).

Skip skills ConfigMap creation when skills/ directory exists but
contains no SKILL.md files, preventing kubectl failure. Also update
design doc to use dot separator in key naming (slashes are invalid
in ConfigMap keys).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@pavelanni

Copy link
Copy Markdown
Collaborator Author

@coderabbitai ignore

@coderabbitai

coderabbitai Bot commented Apr 10, 2026

Copy link
Copy Markdown
✅ Actions performed

Reviews paused.

@pavelanni
pavelanni merged commit b24fb4b into main Apr 10, 2026
2 checks passed
@pavelanni
pavelanni deleted the feature/skill-to-configmap branch April 10, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skill-to-ConfigMap conversion tooling

1 participant