Fix skill frontmatter and simplify distill skill instructions
Replace non-ASCII characters in log and distill-best-practices frontmatter that silently prevented skill loading. Simplify distill skill instructions. Update install.sh for new skills. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Symlink all skills from this repo into ~/.claude/skills/ (personal scope)
|
# Symlink all skills from this repo into the active Claude profile's skills/
|
||||||
# so they're available across all Claude Code projects.
|
# directory so they're available across all Claude Code projects.
|
||||||
|
#
|
||||||
|
# Uses CLAUDE_CONFIG_DIR if set (active profile), otherwise falls back to ~/.claude.
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
||||||
SKILLS_SRC="$REPO_DIR/skills"
|
SKILLS_SRC="$REPO_DIR/skills"
|
||||||
SKILLS_DST="$HOME/.claude/skills"
|
SKILLS_DST="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills"
|
||||||
|
|
||||||
GREEN='\033[0;32m'
|
GREEN='\033[0;32m'
|
||||||
YELLOW='\033[1;33m'
|
YELLOW='\033[1;33m'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ name: distill-best-practices
|
|||||||
description: >
|
description: >
|
||||||
Cross-project best practices distillation. Reads changed memory files from all tracked
|
Cross-project best practices distillation. Reads changed memory files from all tracked
|
||||||
projects and proposes additions, updates, or removals to claude-foundations/best-practices/.
|
projects and proposes additions, updates, or removals to claude-foundations/best-practices/.
|
||||||
Run from any project — always targets claude-foundations as output. Interactive — presents
|
Run from any project -- always targets claude-foundations as output. Interactive -- presents
|
||||||
proposals for approval before making changes.
|
proposals for approval before making changes.
|
||||||
allowed-tools: Read, Edit, Write, Glob, Grep, Bash(git -C *), Bash(git rev-parse *), Bash(ls *), Bash(cat *), Bash(head *), Bash(date *)
|
allowed-tools: Read, Edit, Write, Glob, Grep, Bash(git -C *), Bash(git rev-parse *), Bash(ls *), Bash(cat *), Bash(head *), Bash(date *)
|
||||||
---
|
---
|
||||||
@@ -14,47 +14,30 @@ You are extracting generalisable best practices from project-specific memory fil
|
|||||||
|
|
||||||
## Pre-gathered context
|
## Pre-gathered context
|
||||||
|
|
||||||
### CLAUDE_PROJECT_ROOT
|
### Pre-gathered context (read at runtime)
|
||||||
!`test -n "$CLAUDE_PROJECT_ROOT" && echo "$CLAUDE_PROJECT_ROOT" || echo "NOT_SET"`
|
The following files should be read using the Read tool at the start of execution:
|
||||||
|
- `~/dev/claude/projects/claude-foundations/best-practices/.distill-state.json` — Distill state (if not found, treat as `{}`)
|
||||||
### Distill state
|
- `~/dev/claude/projects/claude-foundations/settings.yaml` — Settings (if not found, use defaults from instructions)
|
||||||
!`cat $CLAUDE_PROJECT_ROOT/projects/claude-foundations/best-practices/.distill-state.json 2>/dev/null || echo "{}"`
|
- `~/dev/claude/projects/claude-foundations/BESTPRACTICES.md` — Current best-practices index
|
||||||
|
- Use Glob to list `~/dev/claude/projects/claude-foundations/best-practices/*.md` for available topic files
|
||||||
### Settings
|
- Use Glob to list `~/dev/claude/projects/*/` for the projects directory listing
|
||||||
!`cat $CLAUDE_PROJECT_ROOT/projects/claude-foundations/settings.yaml 2>/dev/null || echo "Settings not found — CLAUDE_PROJECT_ROOT may not be set"`
|
|
||||||
|
|
||||||
### Current best-practices index
|
|
||||||
!`cat $CLAUDE_PROJECT_ROOT/projects/claude-foundations/BESTPRACTICES.md 2>/dev/null || echo "Index not found"`
|
|
||||||
|
|
||||||
### Available best-practices files
|
|
||||||
!`ls -1 $CLAUDE_PROJECT_ROOT/projects/claude-foundations/best-practices/ 2>/dev/null || echo "No best-practices directory"`
|
|
||||||
|
|
||||||
### Projects directory listing
|
|
||||||
!`ls -1d $CLAUDE_PROJECT_ROOT/projects/*/ 2>/dev/null || echo "No projects directory"`
|
|
||||||
|
|
||||||
## Instructions
|
## Instructions
|
||||||
|
|
||||||
### Step 0: Detect project root
|
|
||||||
|
|
||||||
Check the pre-gathered `CLAUDE_PROJECT_ROOT` value above. If it shows `NOT_SET` or the pre-gathered context is missing:
|
|
||||||
|
|
||||||
1. Walk up from the current working directory to find the **highest** parent directory containing a `CLAUDE.md` file — that is the project root.
|
|
||||||
2. Use that path as `PROJECT_ROOT` for all subsequent steps.
|
|
||||||
|
|
||||||
If `CLAUDE_PROJECT_ROOT` was set, use that value as `PROJECT_ROOT`.
|
|
||||||
|
|
||||||
The key paths derived from the root:
|
|
||||||
- **Settings**: `<PROJECT_ROOT>/projects/claude-foundations/settings.yaml`
|
|
||||||
- **Best practices dir**: `<PROJECT_ROOT>/projects/claude-foundations/best-practices/`
|
|
||||||
- **Best practices index**: `<PROJECT_ROOT>/projects/claude-foundations/BESTPRACTICES.md`
|
|
||||||
- **Distill state**: `<PROJECT_ROOT>/projects/claude-foundations/best-practices/.distill-state.json`
|
|
||||||
|
|
||||||
### Step 1: Discover changes per project
|
### Step 1: Discover changes per project
|
||||||
|
|
||||||
Read `settings.yaml` (pre-gathered above, or read it now if Step 0 detected the root manually).
|
The project root is `~/dev/claude` (hardcoded — change at the top of the `!`command`` blocks if your layout differs).
|
||||||
|
|
||||||
For each project in `distill.projects`, get its path: `<PROJECT_ROOT>/<projects_dir>/<project_name>`.
|
Key paths:
|
||||||
Also process any `distill.extra_projects` entries — these have a `path` field relative to `PROJECT_ROOT`.
|
- **Settings**: `~/dev/claude/projects/claude-foundations/settings.yaml`
|
||||||
|
- **Best practices dir**: `~/dev/claude/projects/claude-foundations/best-practices/`
|
||||||
|
- **Best practices index**: `~/dev/claude/projects/claude-foundations/BESTPRACTICES.md`
|
||||||
|
- **Distill state**: `~/dev/claude/projects/claude-foundations/best-practices/.distill-state.json`
|
||||||
|
|
||||||
|
Read `settings.yaml` (pre-gathered above).
|
||||||
|
|
||||||
|
For each project in `distill.projects`, get its path: `~/dev/claude/<projects_dir>/<project_name>`.
|
||||||
|
Also process any `distill.extra_projects` entries — these have a `path` field relative to `~/dev/claude`.
|
||||||
|
|
||||||
For each project (from both lists):
|
For each project (from both lists):
|
||||||
|
|
||||||
@@ -126,11 +109,11 @@ For each approved proposal:
|
|||||||
|
|
||||||
If a new best-practices topic file is needed:
|
If a new best-practices topic file is needed:
|
||||||
- Create it following the format of existing files (top-level heading, subheadings per entry, 2-6 lines per entry)
|
- Create it following the format of existing files (top-level heading, subheadings per entry, 2-6 lines per entry)
|
||||||
- Add it to `<PROJECT_ROOT>/projects/claude-foundations/BESTPRACTICES.md` with a one-line description
|
- Add it to `~/dev/claude/projects/claude-foundations/BESTPRACTICES.md` with a one-line description
|
||||||
|
|
||||||
### Step 6: Update distill state
|
### Step 6: Update distill state
|
||||||
|
|
||||||
Write `<PROJECT_ROOT>/projects/claude-foundations/best-practices/.distill-state.json`:
|
Write `~/dev/claude/projects/claude-foundations/best-practices/.distill-state.json`:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ name: log
|
|||||||
description: >
|
description: >
|
||||||
End-of-session logging. Captures key decisions, gotchas, open questions, and discussion
|
End-of-session logging. Captures key decisions, gotchas, open questions, and discussion
|
||||||
points into memory/log/ for later reflection. Run before ending a session to preserve
|
points into memory/log/ for later reflection. Run before ending a session to preserve
|
||||||
context. Fast and low-friction — just run /log.
|
context. Fast and low-friction -- just run /log.
|
||||||
allowed-tools: Read, Write, Glob, Bash(date *), Bash(ls *), Bash(cat *), Bash(find *), Bash(rm *), Bash(mkdir *)
|
allowed-tools: Read, Write, Glob, Bash(date *), Bash(ls *), Bash(cat *), Bash(find *), Bash(rm *), Bash(mkdir *)
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ You are capturing key points from the current session into a structured log file
|
|||||||
!`ls -1 memory/log/ 2>/dev/null || echo "No log directory yet"`
|
!`ls -1 memory/log/ 2>/dev/null || echo "No log directory yet"`
|
||||||
|
|
||||||
### Settings
|
### Settings
|
||||||
!`cat settings.yaml 2>/dev/null || cat $CLAUDE_PROJECT_ROOT/projects/claude-foundations/settings.yaml 2>/dev/null || echo "No settings file found — using defaults: retention_days=7, warn_unreflected_days=14"`
|
(Read `~/dev/claude/projects/claude-foundations/settings.yaml` using the Read tool. If not found, use defaults: retention_days=7, warn_unreflected_days=14)
|
||||||
|
|
||||||
### Reflection state (to check what has been reflected)
|
### Reflection state (to check what has been reflected)
|
||||||
!`cat .reflection-state.json 2>/dev/null || echo "No reflection state yet"`
|
!`cat .reflection-state.json 2>/dev/null || echo "No reflection state yet"`
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ You are processing session logs into structured, topic-based memory files.
|
|||||||
!`ls -1 memory/ 2>/dev/null || echo "No memory directory"`
|
!`ls -1 memory/ 2>/dev/null || echo "No memory directory"`
|
||||||
|
|
||||||
### Settings
|
### Settings
|
||||||
!`cat settings.yaml 2>/dev/null || cat $CLAUDE_PROJECT_ROOT/projects/claude-foundations/settings.yaml 2>/dev/null || echo "No settings file found — using defaults: max_logs_per_run=10, retention_days=7, warn_unreflected_days=14"`
|
(Read `~/dev/claude/projects/claude-foundations/settings.yaml` using the Read tool. If not found, use defaults: max_logs_per_run=10, retention_days=7, warn_unreflected_days=14)
|
||||||
|
|
||||||
### Recent git log (for staleness detection)
|
### Recent git log (for staleness detection)
|
||||||
!`git log --oneline -30 2>/dev/null || echo "Not a git repo"`
|
!`git log --oneline -30 2>/dev/null || echo "Not a git repo"`
|
||||||
|
|||||||
Reference in New Issue
Block a user