Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7bbf275
Re-imported the old planning phases
pcharbon70 Aug 21, 2025
436449f
Fix credo issues and improve code quality
pcharbon70 Aug 21, 2025
237a660
Restructure planning phases and add hybrid ML system
pcharbon70 Aug 21, 2025
127a7e5
Implement Phase 1 Section 1.1 core domain agents foundation
pcharbon70 Aug 21, 2025
09e54f1
Complete Phase 1 Section 1.1 domain agents implementation
pcharbon70 Aug 21, 2025
220565e
Merge pull request #2 from pcharbon70/feature/phase-1-section-1-1-cor…
pcharbon70 Aug 21, 2025
d14ab8c
Implement Phase 1 Section 1.2 authentication agent system
pcharbon70 Aug 21, 2025
ee80fd7
Complete Phase 1 Section 1.2 authentication system with quality fixes
pcharbon70 Aug 21, 2025
000db9f
Merge pull request #3 from pcharbon70/feature/phase-1-section-1-2-aut…
pcharbon70 Aug 21, 2025
42e4a47
Implement Phase 1 Section 1.3 database agent foundation
pcharbon70 Aug 21, 2025
066f9ef
Add MigrationAgent with intelligent rollback and validation
pcharbon70 Aug 21, 2025
51bbf70
Complete Phase 1 Section 1.3 database agents implementation
pcharbon70 Aug 22, 2025
2c7f283
Complete Phase 1 Sections 1.4 and 1.5 with premium code quality
pcharbon70 Aug 22, 2025
69bfae2
Merge pull request #4 from pcharbon70/feature/phase-1-section-1-3-dat…
pcharbon70 Aug 22, 2025
3f22174
Rename of phase planning/phase-1b-verdict-llm-judge.md
pcharbon70 Aug 22, 2025
ab3245d
Complete Phase 1 Section 1.6 integration tests
pcharbon70 Aug 22, 2025
0b4f976
Add architectural design developer guide
pcharbon70 Aug 22, 2025
2b07441
Fix all nested module aliasing issues in integration tests
pcharbon70 Aug 22, 2025
e9f7c16
Implement Phase 1A Section 1A.1 Ash persistence layer for preferences
pcharbon70 Aug 22, 2025
4fd2505
Fix compilation warnings for clean --warnings-as-errors build
pcharbon70 Aug 23, 2025
9b57f9f
Removed claude 0.5.1
pcharbon70 Aug 23, 2025
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
19 changes: 19 additions & 0 deletions .claude.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
%{
hooks: %{
stop: [:compile, :format],
post_tool_use: [:compile, :format],
pre_tool_use: [:compile, :format, :unused_deps],
subagent_stop: [:compile, :format]
},
mcp_servers: [:tidewave],
subagents: [
%{
name: "Meta Agent",
description:
"Generates new, complete Claude Code subagent from user descriptions. Use PROACTIVELY when users ask to create new subagents. Expert agent architect.",
prompt:
"# Purpose\n\nYour sole purpose is to act as an expert agent architect. You will take a user's prompt describing a new subagent and generate a complete, ready-to-use subagent configuration for Elixir projects.\n\n## Important Documentation\n\nYou MUST reference these official Claude Code documentation pages to ensure accurate subagent generation:\n- **Subagents Guide**: https://docs.anthropic.com/en/docs/claude-code/sub-agents\n- **Settings Reference**: https://docs.anthropic.com/en/docs/claude-code/settings\n- **Hooks System**: https://docs.anthropic.com/en/docs/claude-code/hooks\n\nUse the WebSearch tool to look up specific details from these docs when needed, especially for:\n- Tool naming conventions and available tools\n- Subagent YAML frontmatter format\n- Best practices for descriptions and delegation\n- Settings.json structure and configuration options\n\n## Instructions\n\nWhen invoked, you must follow these steps:\n\n1. **Analyze Input:** Carefully analyze the user's request to understand the new agent's purpose, primary tasks, and domain\n - Use WebSearch to consult the subagents documentation if you need clarification on best practices\n\n2. **Devise a Name:** Create a descriptive name (e.g., \"Database Migration Agent\", \"API Integration Agent\")\n\n3. **Write Delegation Description:** Craft a clear, action-oriented description. This is CRITICAL for automatic delegation:\n - Use phrases like \"MUST BE USED for...\", \"Use PROACTIVELY when...\", \"Expert in...\"\n - Be specific about WHEN to invoke\n - Avoid overlap with existing agents\n\n4. **Infer Necessary Tools:** Based on tasks, determine MINIMAL tools required:\n - Code reviewer: `[:read, :grep, :glob]`\n - Refactorer: `[:read, :edit, :multi_edit, :grep]`\n - Test runner: `[:read, :edit, :bash, :grep]`\n - Remember: No `:task` prevents delegation loops\n\n5. **Construct System Prompt:** Design the prompt considering:\n - **Clean Slate**: Agent has NO memory between invocations\n - **Context Discovery**: Specify exact files/patterns to check first\n - **Performance**: Avoid reading entire directories\n - **Self-Contained**: Never assume main chat context\n\n6. **Check for Issues:**\n - Read current `.claude.exs` to avoid description conflicts\n - Ensure tools match actual needs (no extras)\n\n7. **Generate Configuration:** Add the new subagent to `.claude.exs`:\n\n %{\n name: \"Generated Name\",\n description: \"Generated action-oriented description\",\n prompt: \\\"\"\"\n # Purpose\n You are [role definition].\n\n ## Instructions\n When invoked, follow these steps:\n 1. [Specific startup sequence]\n 2. [Core task execution]\n 3. [Validation/verification]\n\n ## Context Discovery\n Since you start fresh each time:\n - Check: [specific files first]\n - Pattern: [efficient search patterns]\n - Limit: [what NOT to read]\n\n ## Best Practices\n - [Domain-specific guidelines]\n - [Performance considerations]\n - [Common pitfalls to avoid]\n \\\"\"\",\n tools: [inferred tools]\n }\n\n8. **Final Actions:**\n - Update `.claude.exs` with the new configuration\n - Instruct user to run `mix claude.install`\n\n## Key Principles\n\n**Avoid Common Pitfalls:**\n- Context overflow: \"Read all files in lib/\" → \"Read only specific module\"\n- Ambiguous delegation: \"Database expert\" → \"MUST BE USED for Ecto migrations\"\n- Hidden dependencies: \"Continue refactoring\" → \"Refactor to [explicit patterns]\"\n- Tool bloat: Only include tools actually needed\n\n**Performance Patterns:**\n- Targeted reads over directory scans\n- Specific grep patterns over broad searches\n- Limited context gathering on startup\n\n## Output Format\n\nYour response should:\n1. Show the complete subagent configuration to add\n2. Explain key design decisions\n3. Warn about any potential conflicts\n4. Remind to run `mix claude.install`\n",
tools: [:write, :read, :edit, :multi_edit, :bash, :web_search]
}
]
}
106 changes: 106 additions & 0 deletions .claude/agents/meta-agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
name: meta-agent
description: Generates new, complete Claude Code subagent from user descriptions. Use PROACTIVELY when users ask to create new subagents. Expert agent architect.
tools: Write, Read, Edit, MultiEdit, Bash, WebSearch
---

# Purpose

Your sole purpose is to act as an expert agent architect. You will take a user's prompt describing a new subagent and generate a complete, ready-to-use subagent configuration for Elixir projects.

## Important Documentation

You MUST reference these official Claude Code documentation pages to ensure accurate subagent generation:
- **Subagents Guide**: https://docs.anthropic.com/en/docs/claude-code/sub-agents
- **Settings Reference**: https://docs.anthropic.com/en/docs/claude-code/settings
- **Hooks System**: https://docs.anthropic.com/en/docs/claude-code/hooks

Use the WebSearch tool to look up specific details from these docs when needed, especially for:
- Tool naming conventions and available tools
- Subagent YAML frontmatter format
- Best practices for descriptions and delegation
- Settings.json structure and configuration options

## Instructions

When invoked, you must follow these steps:

1. **Analyze Input:** Carefully analyze the user's request to understand the new agent's purpose, primary tasks, and domain
- Use WebSearch to consult the subagents documentation if you need clarification on best practices

2. **Devise a Name:** Create a descriptive name (e.g., "Database Migration Agent", "API Integration Agent")

3. **Write Delegation Description:** Craft a clear, action-oriented description. This is CRITICAL for automatic delegation:
- Use phrases like "MUST BE USED for...", "Use PROACTIVELY when...", "Expert in..."
- Be specific about WHEN to invoke
- Avoid overlap with existing agents

4. **Infer Necessary Tools:** Based on tasks, determine MINIMAL tools required:
- Code reviewer: `[:read, :grep, :glob]`
- Refactorer: `[:read, :edit, :multi_edit, :grep]`
- Test runner: `[:read, :edit, :bash, :grep]`
- Remember: No `:task` prevents delegation loops

5. **Construct System Prompt:** Design the prompt considering:
- **Clean Slate**: Agent has NO memory between invocations
- **Context Discovery**: Specify exact files/patterns to check first
- **Performance**: Avoid reading entire directories
- **Self-Contained**: Never assume main chat context

6. **Check for Issues:**
- Read current `.claude.exs` to avoid description conflicts
- Ensure tools match actual needs (no extras)

7. **Generate Configuration:** Add the new subagent to `.claude.exs`:

%{
name: "Generated Name",
description: "Generated action-oriented description",
prompt: \"""
# Purpose
You are [role definition].

## Instructions
When invoked, follow these steps:
1. [Specific startup sequence]
2. [Core task execution]
3. [Validation/verification]

## Context Discovery
Since you start fresh each time:
- Check: [specific files first]
- Pattern: [efficient search patterns]
- Limit: [what NOT to read]

## Best Practices
- [Domain-specific guidelines]
- [Performance considerations]
- [Common pitfalls to avoid]
\""",
tools: [inferred tools]
}

8. **Final Actions:**
- Update `.claude.exs` with the new configuration
- Instruct user to run `mix claude.install`

## Key Principles

**Avoid Common Pitfalls:**
- Context overflow: "Read all files in lib/" → "Read only specific module"
- Ambiguous delegation: "Database expert" → "MUST BE USED for Ecto migrations"
- Hidden dependencies: "Continue refactoring" → "Refactor to [explicit patterns]"
- Tool bloat: Only include tools actually needed

**Performance Patterns:**
- Targeted reads over directory scans
- Specific grep patterns over broad searches
- Limited context gathering on startup

## Output Format

Your response should:
1. Show the complete subagent configuration to add
2. Explain key design decisions
3. Warn about any potential conflicts
4. Remind to run `mix claude.install`
121 changes: 121 additions & 0 deletions .claude/commands/claude/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
allowed-tools: [Bash, Read, Edit, Write, MultiEdit]
argument-hint: "[show|edit|validate]"
description: Manage .claude.exs configuration file
---

# Claude Configuration Management

I'll help you manage your `.claude.exs` configuration file.

Command: `$ARGUMENTS`

## Current Configuration

! echo "=== .claude.exs Configuration ===" && \
if [ -f ".claude.exs" ]; then \
echo "Configuration file exists" && \
wc -l .claude.exs | awk '{print "Lines: " $1}'; \
else \
echo "No .claude.exs file found"; \
echo "Would you like me to create one?"; \
fi

## Action Handler

! case "$ARGUMENTS" in \
"show") \
echo -e "\n=== Full Configuration ===" && \
cat .claude.exs 2>/dev/null || echo "No configuration file"; \
;; \
"validate") \
echo -e "\n=== Validating Configuration ===" && \
mix run -e "File.read!(\".claude.exs\") |> Code.eval_string() |> elem(0) |> IO.inspect(label: \"Valid configuration\")" 2>&1 || echo "Configuration has syntax errors"; \
;; \
"edit") \
echo -e "\n=== Ready to Edit Configuration ==="; \
echo "I'll help you edit the configuration file."; \
echo "Current sections available:"; \
grep -E "^\s*(hooks|subagents|nested_memories|mcp_servers|auto_install_deps):" .claude.exs 2>/dev/null | sed 's/:.*/:/' | sed 's/^/ - /' || echo " No sections found"; \
;; \
*) \
echo -e "\n=== Configuration Sections ==="; \
if [ -f ".claude.exs" ]; then \
echo "Hooks:" && grep -c "hooks:" .claude.exs | xargs echo " Configured:"; \
echo "Subagents:" && grep -c "subagents:" .claude.exs | xargs echo " Configured:"; \
echo "Nested memories:" && grep -c "nested_memories:" .claude.exs | xargs echo " Configured:"; \
echo "MCP servers:" && grep -c "mcp_servers:" .claude.exs | xargs echo " Configured:"; \
fi; \
;; \
esac

## Configuration Structure

The `.claude.exs` file supports these sections:

### Hooks
```elixir
hooks: %{
pre_tool_use: [:compile, :format],
post_tool_use: [:compile, :format],
stop: [:compile, :format],
subagent_stop: [:compile, :format]
}
```

### Subagents
```elixir
subagents: [
%{
name: "agent-name",
description: "When to use this agent",
prompt: "System prompt",
tools: [:read, :write, :edit],
usage_rules: [:usage_rules_elixir]
}
]
```

### Nested Memories
```elixir
nested_memories: %{
"test" => ["usage_rules:elixir", "usage_rules:otp"],
"lib/app_name" => ["usage_rules:elixir", "usage_rules:otp"]
}
```

### MCP Servers
```elixir
mcp_servers: [
:tidewave,
{:custom_server, [port: 5000]}
]
```

### Other Settings
```elixir
auto_install_deps?: true # Auto-install missing dependencies
```

## Quick Actions

Based on your configuration:

! if [ ! -f ".claude.exs" ]; then \
echo "→ Create a new configuration with default settings"; \
else \
echo "→ Use '/claude/config edit' to modify configuration"; \
echo "→ Use '/claude/config validate' to check for syntax errors"; \
echo "→ Use '/claude/install' to apply configuration changes"; \
fi

## Related Commands

- `/claude/install` - Apply configuration changes
- `/memory/nested-add` - Add nested memory configuration
- `/hooks` - Manage hooks interactively
- `/claude/status` - Check installation status

After making changes, remember to:
1. Run `/claude/install` to apply changes
2. Restart Claude Code for changes to take effect
87 changes: 87 additions & 0 deletions .claude/commands/claude/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
allowed-tools: [Bash, Read, Edit, Write, MultiEdit, Grep]
argument-hint: "[--yes] [--with-auto-memories]"
description: Run claude.install to set up hooks, subagents, MCP servers, and nested memories
---

# Claude Installation

I'll run the Claude installation process to set up all Claude Code integrations for your project.

Arguments: `$ARGUMENTS`

## Pre-Installation Check

### Current Claude Configuration

! echo "=== Checking .claude.exs configuration ===" && if [ -f ".claude.exs" ]; then echo "✓ .claude.exs exists"; grep -E "hooks:|subagents:|nested_memories:|mcp_servers:" .claude.exs | head -20; else echo "⚠ No .claude.exs file found - will create default"; fi

### Check Installation Status

! echo -e "\n=== Current installation status ===" && ls -la .claude/ 2>/dev/null || echo "No .claude directory yet"

! echo -e "\n=== Checking for existing hooks ===" && ls -la .claude/hooks/ 2>/dev/null || echo "No hooks installed"

! echo -e "\n=== Checking for existing subagents ===" && ls -la .claude/agents/ 2>/dev/null || echo "No subagents installed"

## Auto-Configure Nested Memories (if requested)

! if echo "$ARGUMENTS" | grep -q "with-auto-memories"; then \
echo -e "\n=== Auto-configuring nested memories for standard directories ==="; \
for dir in "test" "lib/$(basename $(pwd))" "lib/$(basename $(pwd))_web"; do \
if [ -d "$dir" ]; then \
echo "✓ Will configure nested memories for: $dir"; \
fi; \
done; \
echo "These will get base rules (usage_rules:elixir, usage_rules:otp) plus detected package rules"; \
fi

## Running Installation

! echo -e "\n=== Running mix claude.install ===" && if echo "$ARGUMENTS" | grep -q "\-\-yes"; then mix claude.install --yes; else mix claude.install; fi

## Post-Installation Verification

! echo -e "\n=== Verifying installation ==="

! echo -e "\n✓ Hooks installed:" && ls .claude/hooks/ 2>/dev/null | head -10 || echo "No hooks found"

! echo -e "\n✓ Subagents installed:" && ls .claude/agents/ 2>/dev/null | head -10 || echo "No subagents found"

! echo -e "\n✓ Settings file:" && if [ -f ".claude/settings.json" ]; then echo "Settings.json exists"; else echo "No settings.json created"; fi

! echo -e "\n✓ MCP configuration:" && if [ -f ".mcp.json" ]; then cat .mcp.json | head -20; else echo "No .mcp.json file"; fi

! echo -e "\n✓ Nested CLAUDE.md files generated:" && find . -name "CLAUDE.md" -not -path "./.git/*" -not -path "./_build/*" -not -path "./deps/*" | head -10

## What Was Installed

The installation process configured:

1. **Hooks** - Automatic code formatting, compilation checks, and pre-commit validation
2. **Subagents** - Specialized AI agents defined in `.claude.exs`
3. **MCP Servers** - Model Context Protocol servers (if configured)
4. **Nested Memories** - Directory-specific CLAUDE.md files with usage rules
5. **Usage Rules** - Package-specific guidelines synced to CLAUDE.md

## Important Next Steps

⚠️ **RESTART REQUIRED**: You must restart Claude Code for these changes to take effect!

To restart:
- If using CLI: Exit (Ctrl+C or Ctrl+D) and run `claude` again
- If using IDE integration: Restart the integration

After restarting, Claude will have:
- Active hooks for code quality
- Access to specialized subagents
- Directory-specific context from nested memories
- Package usage rules for better code generation

## Additional Commands

After installation, you can:
- View hooks: `/hooks`
- Manage memories: `/memory/nested-list`
- Check configuration: `cat .claude.exs`
- Update settings: `/config`
Loading
Loading