add claude files [ci skip]

This commit is contained in:
Viktor Barzin 2026-01-18 15:40:43 +00:00
parent 9aa7328b9b
commit c76e84cd77
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
9 changed files with 120 additions and 5 deletions

16
.claude/commands/add-service.md Executable file
View file

@ -0,0 +1,16 @@
# Add New Service
Help create a new Kubernetes service module.
Service name: $ARGUMENTS
Steps:
1. Create directory at modules/kubernetes/<service-name>/
2. Create main.tf with:
- Namespace resource
- Deployment with appropriate container
- Service resource
- Ingress with TLS and standard annotations
3. Use existing patterns from similar services
4. Add module reference in main.tf
5. Update .claude/CLAUDE.md with new service version

16
.claude/commands/kubectl.md Executable file
View file

@ -0,0 +1,16 @@
# Kubectl Command
Run kubectl commands on the cluster via the remote executor.
Use the remote executor relay:
```bash
echo "kubectl $ARGUMENTS" > /System/Volumes/Data/mnt/code/infra/.claude/cmd_input.txt
sleep 2 && cat /System/Volumes/Data/mnt/code/infra/.claude/cmd_status.txt
cat /System/Volumes/Data/mnt/code/infra/.claude/cmd_output.txt
```
Examples:
- `/kubectl get pods -A` - List all pods
- `/kubectl get pods -n immich` - List pods in immich namespace
- `/kubectl logs -n immich deploy/immich-server` - View logs
- `/kubectl describe pod -n monitoring <pod>` - Describe a pod

View file

@ -0,0 +1,11 @@
# List All Services
List all Kubernetes services deployed in this infrastructure.
```bash
ls -1 /System/Volumes/Data/mnt/code/infra/modules/kubernetes/
```
Provide a summary of the services, grouped by category if possible (media, monitoring, productivity, etc.).
Note: This command runs locally since it only reads the filesystem.

View file

@ -0,0 +1,10 @@
# Check Service Version
Find the version of a specific service deployed in this infrastructure.
Search for the service name in modules/kubernetes/ and extract:
1. The image version/tag being used
2. Any version variables defined
3. The Helm chart version if applicable
Service to check: $ARGUMENTS

13
.claude/commands/tf-apply.md Executable file
View file

@ -0,0 +1,13 @@
# Terraform Apply
Run terraform apply to deploy infrastructure changes via the remote executor.
Use the remote executor relay:
```bash
echo "terraform apply -target=module.kubernetes_cluster.module.<service> -auto-approve" > /System/Volumes/Data/mnt/code/infra/.claude/cmd_input.txt
sleep 2 && cat /System/Volumes/Data/mnt/code/infra/.claude/cmd_status.txt
# Wait for done:N status, then read output
cat /System/Volumes/Data/mnt/code/infra/.claude/cmd_output.txt
```
ALWAYS use -target to speed up execution. Monitor the output and report any errors or successful completions.

13
.claude/commands/tf-plan.md Executable file
View file

@ -0,0 +1,13 @@
# Terraform Plan
Run terraform plan to preview infrastructure changes via the remote executor.
Use the remote executor relay:
```bash
echo "terraform plan -target=module.kubernetes_cluster.module.<service>" > /System/Volumes/Data/mnt/code/infra/.claude/cmd_input.txt
sleep 2 && cat /System/Volumes/Data/mnt/code/infra/.claude/cmd_status.txt
# Wait for done:N status, then read output
cat /System/Volumes/Data/mnt/code/infra/.claude/cmd_output.txt
```
ALWAYS use -target to speed up execution. Summarize the planned changes, highlighting any resources being destroyed or recreated.

View file

@ -0,0 +1,12 @@
# Update Knowledge Base
Update the .claude/CLAUDE.md knowledge file with new learnings.
Add or update information based on recent discoveries about:
- Service versions
- Infrastructure patterns
- Important configurations
- Useful commands
- Troubleshooting notes
Context to add: $ARGUMENTS