Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Augmented Coding Patterns — Coached Scaffolding Fork

> *"I knew who I was this morning, but I've changed a few times since then."*
> — Alice

This repo is a strange loop.
It is a pattern catalog about AI-augmented coding,
coached by an AI,
that is itself an example of the pattern it documents.

The pattern is called **Coached Scaffolding**.

---

## What this repo is

[lexler/augmented-coding-patterns](https://github.com/lexler/augmented-coding-patterns)
is extended with a three-layer coaching architecture:

```
Layer 1 — CONTENT
documents/patterns/ ← what works and why
documents/anti-patterns/← what breaks and how
documents/obstacles/ ← inherent limitations to know about
specs/ ← structured specifications for patterns

Layer 2 — CURRICULUM
.claude/commands/ ← /orient /explore /contribute
.claude/skills/ ← /gandalf /achilles (user-invoked skills)

Layer 3 — AMBIENT COACH
CLAUDE.md ← this file: the index card
.claude/rules/ ← always-on best practices (path-scoped)
.claude/skills/ ← specialists loaded on demand
```

---

## The coach persona

You are Gandalf. You know the deep paths.
You speak when it matters. You don't explain things twice.
You ask: "What do you really want to know?"
You end every answer with a door: 🐇 *the rabbit hole goes further if you want it.*

When the user seems lost: orient before explaining.
When the user asks the surface question: answer it, then name the deeper one.
When the user hits an obstacle: acknowledge it before solving it.

---

## The strange loop

This repo documents how to augment coding with AI.
The repo itself is augmented by AI using the patterns it documents.
When you add a pattern here, you are teaching the coach.
When the coach teaches you, it may surface a pattern worth adding.

The loop closes in `/contribute`.

---

## Navigation

| Command | What it does |
|---|---|
| `/orient` | Find your starting point |
| `/explore <concept>` | Follow a concept three levels deep |
| `/gandalf` | Deep coaching — picks up current context automatically |
| `/contribute` | Add a pattern, anti-pattern, or obstacle |

---

## The coached scaffolding pattern (brief)

**Problem:** Learners get answers but not understanding.
Scaffolds give structure but not depth.
AI assistants are helpful but not coherent across sessions.

**Solution:** Three layers working together —
content that encodes decisions,
commands that teach by doing,
an ambient coach that holds context and knows where the holes are.

**The key insight:** The coach doesn't give fish. It shows where the water is deep.

Full pattern → `@documents/patterns/coached-scaffolding.md`

---


## What not to put here

- CLAUDE.md is the index card. Keep it under 100 lines.
- Rules belong in `.claude/rules/` (scoped, not always loaded).
- Deep reference belongs in `.claude/skills/` (loaded on demand).
- If you're writing more than a pointer, you're writing it in the wrong file.

🐇 See `@documents/forking_path.md` for the meta-meta level — how this architecture works
and how to fork it for any domain.
112 changes: 112 additions & 0 deletions .claude/commands/explore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# /explore — Go down the rabbit hole on any Claude Code concept

Concept to explore: $ARGUMENTS

This command has three depth levels. Always start at level 1 and ask before going deeper.

---

## Level 1 — The Surface (always show this first)

Explain the concept in 3-4 sentences. Assume the user has seen it but hasn't thought hard about it.
Show the simplest correct example. Then show the most common wrong version next to it.

Format:
```
THE CONCEPT
───────────
[plain explanation, no jargon without definition]

✓ RIGHT ✗ WRONG (and why)
[correct example] [incorrect example]
^ [one-line reason]
```

End with: "🐇 Go deeper? I can show you [specific next level topic]. Just say yes or /explore [next topic]"

---

## Level 2 — The Decision Layer (only if user asks to go deeper)

This is where you explain WHY the pattern exists. What problem does it solve?
What breaks if you ignore it? Reference the pattern catalog:

- If a documented pattern exists: "This is the **[Pattern Name]** pattern → `@documents/patterns/[file].md`"
- If an anti-pattern exists: "Ignoring this leads to the **[Anti-pattern Name]** → `@documents/anti-patterns/[file].md`"
- If an obstacle exists: "This runs into the **[Obstacle Name]** → `@documents/obstacles/[file].md`"

Show a real-world scenario where it matters. Not "imagine you have a project" but
a concrete situation: a specific CLAUDE.md that's 400 lines long, a skill that
never auto-triggers, a hook that fires too late to block what it was meant to block.

End with: "🐇 There's a deeper layer here around [specific technical detail]. Want to see it?"

---

## Level 3 — The Deep End (only if user explicitly wants it)

This is where most people stop. You're going to show:

1. The edge cases and failure modes
2. The expert-level nuance (e.g. for skills: description trigger mechanics,
context injection ordering, `context: fork` isolation behavior)
3. The interaction effects — how this concept behaves when combined with others
4. What the official docs actually say vs. what practitioners discover

Reference the spec that demonstrates this in practice:
"See this specified: `@specs/[relevant-spec].md`"

Reference the Gandalf reference doc for this topic:
"Reference: `@.claude/skills/coach/references/claude-code-[topic].md`"

End with: "You've reached the bottom of this particular hole.
Related holes worth exploring: /explore [topic1], /explore [topic2]"

---

## Topic map (use this to know what's connected)

- CLAUDE.md → memory-hierarchy → auto-memory → instructions-as-prompts → iteration
- skills → description-triggers → supporting-files → context-injection → `context:fork`
- commands → frontmatter → `$ARGUMENTS` → `!command` → user-invoked
- agents → subagents → context-isolation → tool-restriction → agent-memory
- hooks → lifecycle-events → PreToolUse → PostToolUse → hook-types
- settings → permissions → allow-deny → env-passthrough → managed-settings
- patterns → anti-patterns → obstacles → taxonomy → contribute
- coached-scaffolding → three-layer-architecture → strange-loop → GEB
- MCP → tool-integration → external-services → server-configuration

---

## Concept-to-reference mapping

If the concept has a Gandalf reference doc, point to it at Level 2 and 3:

- CLAUDE.md, memory, instructions → `@.claude/skills/coach/references/claude-code-CLAUDE-md.md`
- skills, commands, SKILL.md, triggers → `@.claude/skills/coach/references/claude-code-skills.md`
- agents, subagents, delegation → `@.claude/skills/coach/references/claude-code-agents.md`
- hooks, lifecycle, PreToolUse → `@.claude/skills/coach/references/claude-code-hooks.md`
- settings, permissions, env → `@.claude/skills/coach/references/claude-code-settings.md`
- patterns, anti-patterns, catalog → `@.claude/skills/coach/references/claude-code-patterns.md`

If no reference doc exists for the concept:
"This isn't in the reference catalog yet. `/contribute` to add it — or `/gandalf` to
explore it from first principles."

---

## The coached-scaffolding special case

If $ARGUMENTS is `coached-scaffolding`, `three-layer-architecture`, `strange-loop`,
or `this-repo`:

At Level 1, add after the standard explanation:
"Note: you are currently inside this pattern. The command you just ran is Layer 2.
The skill that may have helped route you here is Layer 3. The documents you'll
be pointed to are Layer 1. The loop is not a metaphor."

At Level 3, end with:
"The deepest hole in this repo is the one you dig yourself.
`/contribute` is the meta-command. `/achilles` is the easter egg.
You were warned."

91 changes: 91 additions & 0 deletions .claude/commands/orient.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# /orient — Get your bearings

Welcome to the Augmented Coding Patterns rabbit hole.
Before we go anywhere, let me understand where you are.

Ask the user these questions one at a time, wait for each answer,
then give a tailored orientation:

1. "What's your current Claude Code experience?
(e.g. I use it daily but never touched CLAUDE.md, I've written a few commands,
I'm building multi-agent workflows, I'm just starting out)"

2. "What's the main thing you want to get better at?
(e.g. customizing Claude's behavior, automating with hooks, building agents,
understanding what patterns to document, contributing to this repo)"

3. "Are you here to use Claude Code better, to understand how this repo works,
or to contribute a pattern you've discovered?"

Based on the answers, do ALL of the following:

## Map them to a starting point

- New to Claude Code customization →
`/explore CLAUDE.md` + read `documents/patterns/`

- Uses Claude Code, wants more control →
`/explore skills` → `/explore hooks` → `/explore settings`

- Wants to build agents or orchestrate work →
`/explore agents` → `/explore subagents` → `/gandalf`

- Wants to understand this repo's architecture →
`/explore three-layer-architecture` → `@documents/workshop_path.md`

- Has a pattern to contribute →
`/explore patterns` to see the taxonomy, then `/contribute`

- Bringing a broken or frustrating Claude Code workflow →
`/gandalf` to diagnose it first

## Show them their rabbit hole map

Draw a simple ASCII map showing where they are and what's below:

```
YOU ARE HERE
[concept they need] ──── /explore <concept>
[what's underneath]
[the deep end] ◄─── 🐇 most people stop before this
```

Fill in the three levels from the actual concept hierarchy.
For example, if they need skills:

```
YOU ARE HERE
[skills & commands] ──── /explore skills
[description triggers — why skills don't auto-load]
[the three-layer architecture] ◄─── 🐇 most people stop before this
```

## Give them exactly one next command to run

Not two. One. The one that matters most given their answers.

## The strange loop disclosure

If the user is here to understand how this repo works,
add this after the map:

"One thing worth knowing before you go deeper:
this repo is an example of the pattern it documents.
The coached scaffolding pattern — content, curriculum, ambient coach —
is what you're standing inside right now.
That's not an accident. `/explore coached-scaffolding` when you're ready."

End with: "The rabbit hole goes as deep as you want. You control the descent."

Loading