Adds claude code configuration.

This commit is contained in:
2025-09-28 15:26:31 -07:00
parent 9877d73814
commit 19fd398c6e
5 changed files with 129 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
---
description: Read all agent-context documentation files
allowed_tools: ["Read", "Glob"]
---
Read all markdown files in the docs/agent-context directory structure. This will load all documentation files that provide context about Talos Linux and Wild Cloud systems.
Please use the Glob tool to find all .md files in docs/agent-context/*/* and then use the Read tool to read each file found.

View File

@@ -0,0 +1,52 @@
#!/bin/bash
# Initialize content variable
content=""
# Start with wildcloud directory - README.md first, then other files
content+="=== wildcloud/README.md ===$'\n'"
content+="$(cat docs/agent-context/wildcloud/README.md)"
content+="$'\n'"
for file in docs/agent-context/wildcloud/*.md; do
if [[ "$(basename "$file")" != "README.md" ]]; then
content+="=== wildcloud/$(basename "$file") ===$'\n'"
content+="$(cat "$file")"
content+="$'\n'"
fi
done
# Then other directories - README.md first in each, then other files
for dir in docs/agent-context/*/; do
dirname=$(basename "$dir")
if [[ "$dirname" != "wildcloud" ]]; then
content+="=== $dirname/README.md ===$'\n'"
if [[ -f "$dir/README.md" ]]; then
content+="$(cat "$dir/README.md")"
content+="$'\n'"
fi
for file in "$dir"*.md; do
if [[ "$(basename "$file")" != "README.md" && -f "$file" ]]; then
content+="=== $dirname/$(basename "$file") ===$'\n'"
content+="$(cat "$file")"
content+="$'\n'"
fi
done
fi
done
# Escape content for JSON (replace quotes and newlines)
escaped_content=$(printf '%s' "$content" | sed 's/\\/\\\\/g; s/"/\\"/g; s/$/\\n/' | tr -d '\n' | sed 's/\\n$//')
# Output as JSON structure
cat << EOF
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"suppressOutput": true,
"systemMessage": "Loading AI context.",
"additionalContext": "$escaped_content"
}
}
EOF

15
.claude/settings.json Normal file
View File

@@ -0,0 +1,15 @@
{
// "hooks": {
// "SessionStart": [
// {
// "matcher": "startup|compact",
// "hooks": [
// {
// "type": "command",
// "command": "$CLAUDE_PROJECT_DIR/.claude/scripts/read-ai-context.sh"
// }
// ]
// }
// ]
// }
}

1
.gitignore vendored
View File

@@ -4,7 +4,6 @@ ca
.env
secrets.yaml
CLAUDE.md
**/.claude/settings.local.json

54
CLAUDE.md Normal file
View File

@@ -0,0 +1,54 @@
# CLAUDE.md
## Project Overview
This repository contains "Wild Cloud".
Wild Cloud helps administrators set up and manage a Kubernetes cluster with nodes running Talos linux. It also contains a directory of application (in `apps/`) that can be deployed on clusters.
The scripts in this repository ($WC_ROOT) are intended to be sourced and executed from within a Wild Cloud project directory ($WC_HOME).
Again, this repository ($WC_ROOT) contains the Wild Cloud scripts and applications. The actual Wild Cloud project directory ($WC_HOME), which contains your specific configuration files, is separate.
## Info about Wild Cloud
- @docs/agent-context/wildcloud/README.md
- @docs/agent-context/wildcloud/overview.md
- @docs/agent-context/wildcloud/project-architecture.md
- @docs/agent-context/wildcloud/bin-scripts.md
- @docs/agent-context/wildcloud/configuration-system.md
- @docs/agent-context/wildcloud/setup-process.md
- @docs/agent-context/wildcloud/apps-system.md
## Info about Talos
- @docs/agent-context/talos-v1.11/README.md
- @docs/agent-context/talos-v1.11/architecture-and-components.md
- @docs/agent-context/talos-v1.11/cli-essentials.md
- @docs/agent-context/talos-v1.11/cluster-operations.md
- @docs/agent-context/talos-v1.11/discovery-and-networking.md
- @docs/agent-context/talos-v1.11/etcd-management.md
- @docs/agent-context/talos-v1.11/bare-metal-administration.md
- @docs/agent-context/talos-v1.11/troubleshooting-guide.md
## Code Guidelines
- Wild Cloud projects use infrastructure-as-code principles.
- Scripts that interact with a Wild Cloud project must manage state and infrastructure idempotently and check for existing state.
- Timeouts should be avoided in favor of proper readiness and liveness probes, for example:
- Use `kubectl wait` to ensure resources are ready before proceeding with dependent operations.
- Use `kubectl rollout status` to ensure deployments are successfully rolled out before proceeding.
- Use `kubectl get` with appropriate selectors to check the status of resources.
- All code should be simple and easy to understand.
- Avoid unnecessary complexity.
- Avoid unnecessary dependencies.
- Avoid unnecessary features.
- Avoid unnecessary abstractions.
- Avoid unnecessary comments.
- Avoid unnecessary configuration options.
- Avoid Helm. Use Kustomize.
### Scripts
- Use @scripts/common.sh for common functions and patterns, especially if they will clean up the code.
- Don't define functions in a script that are only used once. Just inline the code.