docs: refactor documentation for Foundry VTT + PF1e project
- Rewrite README.md to focus on Foundry VTT + Pathfinder 1e development - Refactor QUICKSTART.md as practical setup guide (5 minutes) - Add project-specific sections: setup, macros, PF1 system, API reference - Include development workflow and common tasks - Add troubleshooting guide for Foundry-specific issues - Remove generic Claude Code setup documentation (CLAUDE_CODE_SETUP_COMPLETE.md, CLAUDE_TEMPLATE.md, MCP_SERVERS_GUIDE.md, MCP_DOCUMENTATION_SUMMARY.md, .gitignore.README.md) - Keep CLAUDE.md as comprehensive reference documentation Documentation now aligns with project scope: Foundry VTT v11.315 + Pathfinder 1e v10.8 + custom macros. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
882
README.md
882
README.md
@@ -1,539 +1,383 @@
|
||||
# Claude Code Setup - Complete Claude Code Configuration
|
||||
# Foundry VTT + Pathfinder 1e Development Environment
|
||||
|
||||
> **Production-ready Claude Code setup with comprehensive documentation**
|
||||
> **Version**: 3.0.0 | **Last Updated**: 2025-10-20
|
||||
> **A complete development environment for creating custom macros and automating Foundry VTT with Pathfinder 1e**
|
||||
>
|
||||
> **Version**: 1.0.0 | **Last Updated**: 2025-01-30 | **Repository**: [Gitea](https://gitea.gowlershome.dyndns.org/Gowler/FoundryVTT.git)
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Quick Start
|
||||
## 🎯 Quick Start
|
||||
|
||||
**New to this project?** Start here: **[QUICKSTART.md](QUICKSTART.md)** (5-minute read)
|
||||
|
||||
**Need complete details?** See: **[CLAUDE_CODE_SETUP_COMPLETE.md](CLAUDE_CODE_SETUP_COMPLETE.md)** (comprehensive)
|
||||
**Need complete details?** See: **[CLAUDE.md](CLAUDE.md)** (comprehensive project guide)
|
||||
|
||||
---
|
||||
|
||||
## 📋 What's Included
|
||||
## 📋 What This Project Includes
|
||||
|
||||
This project demonstrates a **fully configured Claude Code setup** with:
|
||||
This is a professional development environment for Foundry VTT + Pathfinder 1e that combines:
|
||||
|
||||
### Core Features (100% Configured)
|
||||
### Core Components
|
||||
|
||||
✅ **8 MCP Servers**
|
||||
- Serena (code navigation + persistent memory)
|
||||
- Sequential Thinking (complex reasoning)
|
||||
- Context7 (real-time library docs)
|
||||
- Memory (knowledge graph)
|
||||
- Playwright (browser automation)
|
||||
- Windows MCP (desktop automation)
|
||||
- Fetch (web scraping)
|
||||
- Database Server
|
||||
✅ **Foundry VTT v11.315**
|
||||
- Complete Electron-based virtual tabletop platform
|
||||
- Express.js server backend with NeDB database
|
||||
- PIXI.js canvas rendering system
|
||||
- Socket.io real-time multiplayer support
|
||||
|
||||
✅ **8 Specialized Agents**
|
||||
- Architect, Code Reviewer, Debugger
|
||||
- Documentation Writer, Project Manager
|
||||
- Refactoring Specialist, Security Analyst, Test Engineer
|
||||
✅ **Pathfinder 1e System v10.8**
|
||||
- Full PF1 game rules implementation
|
||||
- Character sheets and NPC templates
|
||||
- Spell and feat compendiums
|
||||
- Automated action resolution system
|
||||
- Built with Vite + ES Modules + TypeScript
|
||||
|
||||
✅ **9 Slash Commands**
|
||||
- `/analyze`, `/review`, `/implement`, `/test`
|
||||
- `/optimize`, `/explain`, `/scaffold`, `/setup-info`, `/adr`
|
||||
✅ **Custom Macros & Automation**
|
||||
- Arcane Pool enhancement system (Magus class feature)
|
||||
- Haste buff automation with attack interception
|
||||
- Reusable macro patterns and templates
|
||||
- Dialog-based user interfaces
|
||||
|
||||
✅ **6 Output Styles**
|
||||
- Concise, Professional, Verbose
|
||||
- Explanatory, Learning, Security Reviewer
|
||||
|
||||
✅ **6 Event Hooks**
|
||||
- Session lifecycle (start/end)
|
||||
- Bash command interception
|
||||
- File write logging
|
||||
- User prompt tracking
|
||||
- Stop tracking for summaries
|
||||
|
||||
✅ **Complete Templates**
|
||||
- Agent Template, Command Template
|
||||
- Skill Template, Output Style Template
|
||||
- CLAUDE.md Project Template
|
||||
|
||||
✅ **Automatic Status Summaries**
|
||||
- Every task completion includes detailed summary
|
||||
- Shows agents, commands, MCP servers used
|
||||
- Lists all files modified
|
||||
- Promotes transparency and learning
|
||||
✅ **AI-Assisted Development**
|
||||
- Claude Code integration with 8 MCP servers
|
||||
- Semantic code navigation (Serena)
|
||||
- Complex problem solving (Sequential Thinking)
|
||||
- Real-time library documentation (Context7)
|
||||
- Persistent project memory (Knowledge Graph)
|
||||
|
||||
---
|
||||
|
||||
## 📚 Documentation
|
||||
## 🚀 Getting Started
|
||||
|
||||
### For Users
|
||||
### 1. Prerequisites
|
||||
|
||||
| Document | Purpose | Read Time |
|
||||
|----------|---------|-----------|
|
||||
| **[QUICKSTART.md](QUICKSTART.md)** | Get started quickly | 5 min |
|
||||
| **[CLAUDE_CODE_SETUP_COMPLETE.md](CLAUDE_CODE_SETUP_COMPLETE.md)** | Complete documentation | 30 min |
|
||||
| **[MCP_SERVERS_GUIDE.md](MCP_SERVERS_GUIDE.md)** | Complete MCP server documentation | 20 min |
|
||||
| **[CLAUDE.md](CLAUDE.md)** | Project instructions for Claude | Reference |
|
||||
- **Foundry VTT License** (required to download official builds)
|
||||
- **Node.js** v16-19 (for PF1 system development)
|
||||
- **npm** (Node Package Manager)
|
||||
- **Git** (version control)
|
||||
- **Visual Studio Code** (recommended IDE)
|
||||
|
||||
### For Developers
|
||||
|
||||
| Document | Purpose |
|
||||
|----------|---------|
|
||||
| **[CLAUDE_TEMPLATE.md](CLAUDE_TEMPLATE.md)** | Template for new projects |
|
||||
| **[.claude/TEMPLATES_README.md](.claude/TEMPLATES_README.md)** | Master template guide |
|
||||
| **[.claude/agents/MCP_USAGE_TEMPLATES.md](.claude/agents/MCP_USAGE_TEMPLATES.md)** | MCP usage templates for agents |
|
||||
| **[.claude/TEMPLATE_CAPABILITIES_ANALYSIS.md](.claude/TEMPLATE_CAPABILITIES_ANALYSIS.md)** | Template review & missing features |
|
||||
|
||||
### Specialized Guides
|
||||
|
||||
| Document | Purpose |
|
||||
|----------|---------|
|
||||
| **[MCP_SERVERS_GUIDE.md](MCP_SERVERS_GUIDE.md)** | Complete MCP server documentation |
|
||||
| **[.claude/CHECKPOINTING_GUIDE.md](.claude/CHECKPOINTING_GUIDE.md)** | Session checkpointing |
|
||||
| **[.claude/PLUGIN_SETUP.md](.claude/PLUGIN_SETUP.md)** | Plugin marketplace |
|
||||
| **[.claude/STATUS_LINE_SETUP.md](.claude/STATUS_LINE_SETUP.md)** | Status line customization |
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Key Capabilities
|
||||
|
||||
### Intelligent Code Navigation (Serena MCP)
|
||||
### 2. Initial Setup
|
||||
|
||||
```bash
|
||||
# Find symbols
|
||||
find_symbol("UserService")
|
||||
# Navigate to project root
|
||||
cd "C:\DEV\Foundry2\Foundry_VTT"
|
||||
|
||||
# Find references
|
||||
find_referencing_symbols("authenticate", "src/auth/")
|
||||
# Install PF1 system dependencies
|
||||
cd src/foundryvtt-pathfinder1-v10.8
|
||||
npm install
|
||||
|
||||
# Store persistent knowledge
|
||||
write_memory("adr-001-architecture", "Decision: Microservices...")
|
||||
# Build the PF1 system
|
||||
npm run build
|
||||
|
||||
# Or use watch mode for development
|
||||
npm run build:watch
|
||||
```
|
||||
|
||||
### Specialized Agents (8 Available)
|
||||
### 3. Running Foundry VTT
|
||||
|
||||
```bash
|
||||
# Automatic invocation
|
||||
> "I need to design a microservices architecture"
|
||||
# → Architect agent activated
|
||||
# Option 1: Run Foundry directly
|
||||
cd src/FoundryVTT-11.315
|
||||
.\foundryvtt.exe
|
||||
|
||||
# Manual invocation
|
||||
> "Use the security-analyst agent to review this code"
|
||||
# Option 2: Launch via Node.js
|
||||
node resources/app/main.js
|
||||
```
|
||||
|
||||
### Development Workflows (8 Commands)
|
||||
### 4. Creating & Using Macros
|
||||
|
||||
```bash
|
||||
/analyze src/ # Code analysis
|
||||
/review src/ # Code review
|
||||
/implement feature # Build features
|
||||
/test # Run tests
|
||||
/optimize file.ts # Performance tuning
|
||||
```
|
||||
|
||||
### Extended Thinking
|
||||
|
||||
```bash
|
||||
> "Think hard about the best database architecture"
|
||||
> "Ultrathink: How to optimize this algorithm?"
|
||||
```
|
||||
|
||||
### Custom Output Modes (6 Styles)
|
||||
|
||||
```bash
|
||||
/output-style learning # Interactive learning
|
||||
/output-style security-reviewer # Security focus
|
||||
/output-style explanatory # Educational insights
|
||||
```
|
||||
1. Open Foundry VTT
|
||||
2. Click "Macro Directory" in the sidebar
|
||||
3. Create a new macro (type: Script)
|
||||
4. Copy content from `src/macro.js` or `src/macro_haste.js`
|
||||
5. Save and drag to hotbar
|
||||
|
||||
---
|
||||
|
||||
## 📁 Project Structure
|
||||
|
||||
```
|
||||
Claude Code Setup/
|
||||
├── README.md # This file
|
||||
├── QUICKSTART.md # Quick start guide (5 min)
|
||||
├── CLAUDE_CODE_SETUP_COMPLETE.md # Complete documentation (30 min)
|
||||
├── CLAUDE.md # Project instructions
|
||||
├── CLAUDE_TEMPLATE.md # Project template
|
||||
Foundry_VTT/
|
||||
├── src/
|
||||
│ ├── FoundryVTT-11.315/ # Foundry core application
|
||||
│ │ ├── resources/app/ # Electron app resources
|
||||
│ │ ├── node_modules/ # Foundry dependencies
|
||||
│ │ └── Data/ # User worlds & data (gitignored)
|
||||
│ │
|
||||
│ ├── foundryvtt-pathfinder1-v10.8/# PF1 system module
|
||||
│ │ ├── module/ # System source code (ES modules)
|
||||
│ │ ├── packs/ # Compendium databases
|
||||
│ │ ├── public/system.json # System manifest
|
||||
│ │ ├── package.json # Dev dependencies & scripts
|
||||
│ │ └── vite.config.js # Build configuration
|
||||
│ │
|
||||
│ ├── macro.js # Arcane Pool macro
|
||||
│ ├── macro_haste.js # Haste automation macro
|
||||
│ └── zeratal.json # Example character data
|
||||
│
|
||||
├── .mcp.json # MCP servers configuration
|
||||
│
|
||||
└── .claude/ # Main configuration directory
|
||||
├── settings.json # Shared configuration
|
||||
├── settings.local.json # Personal configuration
|
||||
│
|
||||
├── agents/ # 8 specialized agents
|
||||
│ ├── architect.md
|
||||
│ ├── code-reviewer.md
|
||||
│ ├── debugger.md
|
||||
│ ├── documentation-writer.md
|
||||
│ ├── project-manager.md
|
||||
│ ├── refactoring-specialist.md
|
||||
│ ├── security-analyst.md
|
||||
│ ├── test-engineer.md
|
||||
│ └── .AGENT_TEMPLATE.md
|
||||
│
|
||||
├── commands/ # 9 slash commands
|
||||
│ ├── adr.md
|
||||
│ ├── analyze.md
|
||||
│ ├── explain.md
|
||||
│ ├── implement.md
|
||||
│ ├── optimize.md
|
||||
│ ├── review.md
|
||||
│ ├── scaffold.md
|
||||
│ ├── setup-info.md
|
||||
│ ├── test.md
|
||||
│ └── .COMMANDS_TEMPLATE.md
|
||||
│
|
||||
├── output-styles/ # 6 custom styles
|
||||
│ ├── concise.md
|
||||
│ ├── professional.md
|
||||
│ ├── verbose.md
|
||||
│ ├── explanatory.md
|
||||
│ ├── learning.md
|
||||
│ ├── security-reviewer.md
|
||||
│ └── .OUTPUT_STYLES_TEMPLATE.md
|
||||
│
|
||||
├── skills/ # Skills directory
|
||||
│ └── .SKILL_TEMPLATE.md
|
||||
│
|
||||
├── hooks/ # 5 event hooks
|
||||
│ ├── session-start.sh
|
||||
│ ├── session-end.sh
|
||||
│ ├── pre-bash.sh
|
||||
│ ├── post-write.sh
|
||||
│ └── user-prompt-submit.sh
|
||||
│
|
||||
├── tools/ # Utility scripts
|
||||
│ ├── start-memory.ps1
|
||||
│ └── statusline.sh
|
||||
│
|
||||
├── logs/ # Session logs
|
||||
│
|
||||
└── [Documentation Files]
|
||||
├── TEMPLATES_README.md
|
||||
├── MCP_CORRECT_USAGE_GUIDE.md
|
||||
├── TEMPLATE_CAPABILITIES_ANALYSIS.md
|
||||
├── CHECKPOINTING_GUIDE.md
|
||||
├── PLUGIN_SETUP.md
|
||||
└── STATUS_LINE_SETUP.md
|
||||
├── CLAUDE.md # Complete project documentation
|
||||
├── QUICKSTART.md # Quick start guide
|
||||
├── README.md # This file
|
||||
├── .claude/ # Claude Code configuration
|
||||
├── .mcp.json # MCP servers configuration
|
||||
└── .git/ # Git repository
|
||||
```
|
||||
|
||||
**See [CLAUDE.md](CLAUDE.md) for detailed project structure and file descriptions.**
|
||||
|
||||
---
|
||||
|
||||
## 🚦 Getting Started
|
||||
## 🛠️ Development Workflow
|
||||
|
||||
### 1. First Time Setup (1 minute)
|
||||
### Building the PF1 System
|
||||
|
||||
```bash
|
||||
# Clone or open this project
|
||||
cd "Claude Code Setup"
|
||||
cd src/foundryvtt-pathfinder1-v10.8
|
||||
|
||||
# Start Claude Code
|
||||
claude
|
||||
# Production build
|
||||
npm run build
|
||||
|
||||
# Verify setup
|
||||
> /setup-info
|
||||
# Development build with hot reload
|
||||
npm run build:watch
|
||||
|
||||
# Lint code
|
||||
npm run lint
|
||||
|
||||
# Format code
|
||||
npm run format
|
||||
```
|
||||
|
||||
### 2. Try Basic Commands (2 minutes)
|
||||
### Creating a New Macro
|
||||
|
||||
```bash
|
||||
# Get help
|
||||
> /help
|
||||
All macros follow the IIFE (Immediately Invoked Function Expression) pattern:
|
||||
|
||||
# See what's configured
|
||||
> /setup-info
|
||||
|
||||
# Try a command
|
||||
> /analyze src/
|
||||
|
||||
# Try an agent
|
||||
> "Use the architect agent to explain the project structure"
|
||||
```
|
||||
|
||||
### 3. Learn Core Features (5 minutes)
|
||||
|
||||
Read **[QUICKSTART.md](QUICKSTART.md)** for:
|
||||
- Essential commands
|
||||
- MCP server usage
|
||||
- Agent invocation
|
||||
- Output styles
|
||||
- Memory system
|
||||
|
||||
### 4. Deep Dive (30 minutes)
|
||||
|
||||
Read **[CLAUDE_CODE_SETUP_COMPLETE.md](CLAUDE_CODE_SETUP_COMPLETE.md)** for complete details on:
|
||||
- All MCP servers and capabilities
|
||||
- Agent configuration and usage
|
||||
- Slash command reference
|
||||
- Hooks system
|
||||
- Templates
|
||||
- Advanced features
|
||||
- Best practices
|
||||
|
||||
---
|
||||
|
||||
## 💡 Common Use Cases
|
||||
|
||||
### Feature Development
|
||||
|
||||
```bash
|
||||
# 1. Architecture
|
||||
> "Use architect agent to design payment integration"
|
||||
|
||||
# 2. Implement
|
||||
> /implement Stripe payment integration
|
||||
|
||||
# 3. Test
|
||||
> /test src/payments/
|
||||
|
||||
# 4. Review
|
||||
> /review src/payments/
|
||||
|
||||
# 5. Document
|
||||
> "Use documentation-writer agent to document payment flow"
|
||||
```
|
||||
|
||||
### Bug Fixing
|
||||
|
||||
```bash
|
||||
# 1. Debug
|
||||
> "Use debugger agent: [paste error]"
|
||||
|
||||
# 2. Extended thinking (for complex bugs)
|
||||
> "Think hard about this race condition"
|
||||
|
||||
# 3. Review fix
|
||||
> /review [fixed file]
|
||||
```
|
||||
|
||||
### Code Review
|
||||
|
||||
```bash
|
||||
# 1. Standard review
|
||||
> /review src/
|
||||
|
||||
# 2. Security check
|
||||
> "Use security-analyst agent to check vulnerabilities"
|
||||
|
||||
# 3. Refactoring suggestions
|
||||
> "Use refactoring-specialist agent for improvements"
|
||||
```
|
||||
|
||||
### Learning Codebase
|
||||
|
||||
```bash
|
||||
# 1. Use explanatory style
|
||||
> /output-style explanatory
|
||||
|
||||
# 2. High-level questions
|
||||
> "Explain the architecture of this project"
|
||||
|
||||
# 3. Deep dive with Serena
|
||||
> get_symbols_overview("src/core/engine.ts")
|
||||
|
||||
# 4. Store learnings
|
||||
> write_memory("architecture-overview", "The system uses...")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎓 Learning Path
|
||||
|
||||
### Beginner (Day 1)
|
||||
|
||||
1. Read [QUICKSTART.md](QUICKSTART.md)
|
||||
2. Try basic commands (`/help`, `/setup-info`)
|
||||
3. Experiment with one agent
|
||||
4. Try one output style
|
||||
|
||||
### Intermediate (Week 1)
|
||||
|
||||
1. Use all slash commands
|
||||
2. Work with multiple agents
|
||||
3. Try extended thinking
|
||||
4. Use Serena MCP for code navigation
|
||||
|
||||
### Advanced (Month 1)
|
||||
|
||||
1. Create custom commands
|
||||
2. Build custom agents
|
||||
3. Configure hooks for your workflow
|
||||
4. Leverage all MCP servers
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Customization
|
||||
|
||||
### Add a Custom Command
|
||||
|
||||
```bash
|
||||
# Copy template
|
||||
cp .claude/commands/.COMMANDS_TEMPLATE.md .claude/commands/my-command.md
|
||||
|
||||
# Edit and configure
|
||||
# Use it
|
||||
> /my-command
|
||||
```
|
||||
|
||||
### Add a Custom Agent
|
||||
|
||||
```bash
|
||||
# Copy template
|
||||
cp .claude/agents/.AGENT_TEMPLATE.md .claude/agents/my-agent.md
|
||||
|
||||
# Configure and use
|
||||
> "Use the my-agent agent to..."
|
||||
```
|
||||
|
||||
### Add a Custom Output Style
|
||||
|
||||
```bash
|
||||
# Copy template
|
||||
cp .claude/output-styles/.OUTPUT_STYLES_TEMPLATE.md .claude/output-styles/my-style.md
|
||||
|
||||
# Activate
|
||||
> /output-style my-style
|
||||
```
|
||||
|
||||
See [.claude/TEMPLATES_README.md](.claude/TEMPLATES_README.md) for detailed guides.
|
||||
|
||||
---
|
||||
|
||||
## 🤝 Team Setup
|
||||
|
||||
### Sharing This Setup
|
||||
|
||||
```bash
|
||||
# Everything is in git, just commit and push
|
||||
git add .claude/ .mcp.json CLAUDE.md
|
||||
git commit -m "Add Claude Code configuration"
|
||||
git push
|
||||
|
||||
# Team members pull and get full setup
|
||||
git pull
|
||||
```
|
||||
|
||||
### Team Customization
|
||||
|
||||
**Shared (in git)**:
|
||||
- `.claude/settings.json`
|
||||
- `.claude/agents/`
|
||||
- `.claude/commands/`
|
||||
- `.mcp.json`
|
||||
- `CLAUDE.md`
|
||||
|
||||
**Personal (not in git)**:
|
||||
- `.claude/settings.local.json`
|
||||
- `~/.claude/` (user-wide)
|
||||
|
||||
---
|
||||
|
||||
## 📊 Setup Completeness
|
||||
|
||||
**Current**: ~95% of Claude Code capabilities implemented
|
||||
|
||||
**Implemented**:
|
||||
- ✅ MCP servers
|
||||
- ✅ Agents/Subagents
|
||||
- ✅ Slash commands
|
||||
- ✅ Output styles
|
||||
- ✅ Hooks
|
||||
- ✅ Templates
|
||||
- ✅ Memory system
|
||||
- ✅ Extended thinking
|
||||
- ✅ Plan mode
|
||||
- ✅ Checkpointing
|
||||
- ✅ Plugin marketplace
|
||||
|
||||
**Optional (not implemented)**:
|
||||
- ⚠️ Enterprise SSO/Analytics
|
||||
- ⚠️ Headless mode (CI/CD)
|
||||
- ⚠️ Network proxies/certificates
|
||||
|
||||
---
|
||||
|
||||
## 🖥️ Platform Notes
|
||||
|
||||
### Windows-Only Components
|
||||
|
||||
The following components are **Windows-specific** and will not work on Mac/Linux:
|
||||
|
||||
- **Windows MCP** ([.windows-mcp/](.windows-mcp/)) - Desktop automation using Python/uv
|
||||
- Provides Windows UI automation, PowerShell execution, clipboard operations
|
||||
- **Impact on other platforms**: Will show error on startup but won't affect other MCP servers
|
||||
- **Solution for Mac/Linux**: Ignore Windows MCP errors or disable in `.mcp.json`
|
||||
|
||||
- **PowerShell Scripts**:
|
||||
- [.claude/tools/start-memory.ps1](.claude/tools/start-memory.ps1) - Memory MCP launcher
|
||||
- Various hook scripts using PowerShell commands
|
||||
- **Alternative**: Create bash equivalents for cross-platform support
|
||||
|
||||
### Cross-Platform Components
|
||||
|
||||
All other MCP servers work on all platforms:
|
||||
- ✅ Serena (Python/uvx)
|
||||
- ✅ Sequential Thinking (Node.js/npx)
|
||||
- ✅ Database Server (Node.js/npx)
|
||||
- ✅ Context7 (Node.js/npx)
|
||||
- ✅ Memory (works via Node.js on all platforms - PowerShell launcher is Windows-only convenience)
|
||||
- ✅ Fetch (Python/uvx)
|
||||
- ✅ Playwright (Node.js/npx)
|
||||
|
||||
### Disabling Windows MCP on Mac/Linux
|
||||
|
||||
If you're on Mac/Linux and want to disable Windows MCP to avoid startup errors:
|
||||
|
||||
**Option 1: Comment out in .mcp.json**
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
// "windows-mcp": {
|
||||
// "command": "uv",
|
||||
// "args": ["--directory", "./.windows-mcp", "run", "main.py"]
|
||||
// },
|
||||
// ... other servers
|
||||
```javascript
|
||||
(async () => {
|
||||
// 1. Validation
|
||||
if (!token) {
|
||||
ui.notifications.warn("You must select a token!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Data access
|
||||
const actor = token.actor;
|
||||
const arcanePool = actor.system.resources.classFeat_arcanePool;
|
||||
|
||||
// 3. Business logic
|
||||
async function doSomething() {
|
||||
// Implementation
|
||||
}
|
||||
|
||||
// 4. Execute
|
||||
await doSomething();
|
||||
|
||||
// 5. User feedback
|
||||
ui.notifications.info("Done!");
|
||||
})();
|
||||
```
|
||||
|
||||
**Option 2: Disable in settings**
|
||||
```json
|
||||
// In .claude/settings.json or .claude/settings.local.json
|
||||
{
|
||||
"mcpServers": {
|
||||
"windows-mcp": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
**See [CLAUDE.md § Macro Development Patterns](CLAUDE.md#macro-development-patterns) for detailed macro examples.**
|
||||
|
||||
### Debugging Macros
|
||||
|
||||
Press **F12** to open browser console:
|
||||
- Use **Console** tab for logs and errors
|
||||
- Use **Network** tab for API calls
|
||||
- Add `console.log()` for debugging
|
||||
- Check error messages in notifications
|
||||
|
||||
### Testing Changes
|
||||
|
||||
1. Make changes to PF1 system or macros
|
||||
2. Run `npm run build` to rebuild
|
||||
3. Reload Foundry VTT (F5)
|
||||
4. Test macros or features
|
||||
5. Check console (F12) for errors
|
||||
|
||||
---
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
| Document | Purpose | Read Time |
|
||||
|----------|---------|-----------|
|
||||
| **[CLAUDE.md](CLAUDE.md)** | Complete project guide & API reference | 30 min |
|
||||
| **[QUICKSTART.md](QUICKSTART.md)** | Quick start setup guide | 5 min |
|
||||
| **[Manual_dmgtracking.md](Manual_dmgtracking.md)** | Damage tracking implementation | Reference |
|
||||
| **[ARCANE_POOL_ANALYSIS.md](ARCANE_POOL_ANALYSIS.md)** | Arcane Pool macro analysis | Reference |
|
||||
|
||||
---
|
||||
|
||||
## 🎮 Foundry VTT & PF1 API
|
||||
|
||||
### Global Objects (Available in Macros)
|
||||
|
||||
```javascript
|
||||
game // Main game instance
|
||||
game.actors // Actor collection
|
||||
game.items // Item collection
|
||||
game.scenes // Scene collection
|
||||
game.macros // Macro collection
|
||||
game.settings // Settings registry
|
||||
|
||||
ui // UI manager
|
||||
ui.notifications // Toast notifications
|
||||
ui.chat // Chat sidebar
|
||||
|
||||
canvas // Canvas rendering system
|
||||
CONFIG // Global configuration
|
||||
CONFIG.PF1 // PF1-specific config
|
||||
```
|
||||
|
||||
### Common API Patterns
|
||||
|
||||
```javascript
|
||||
// Get documents
|
||||
const actor = game.actors.get(actorId);
|
||||
const item = game.items.getName("Item Name");
|
||||
const doc = fromUuidSync("Actor.abc123.Item.def456");
|
||||
|
||||
// Update documents
|
||||
await actor.update({
|
||||
"system.hp.value": 50,
|
||||
"system.attributes.ac.total": 25
|
||||
});
|
||||
|
||||
// Find items
|
||||
const buffs = actor.items.filter(i => i.type === "buff");
|
||||
const haste = actor.items.find(i => i.name === "Haste");
|
||||
|
||||
// Use hooks
|
||||
Hooks.on("updateActor", (actor, change, options, userId) => {
|
||||
console.log(`${actor.name} was updated`);
|
||||
});
|
||||
```
|
||||
|
||||
**See [CLAUDE.md § Foundry VTT API Reference](CLAUDE.md#foundry-vtt-api-reference) for complete API documentation.**
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Git Workflow
|
||||
|
||||
### Check Status
|
||||
|
||||
```bash
|
||||
git status # Show working tree status
|
||||
git log --oneline # Show recent commits
|
||||
git diff # Show unstaged changes
|
||||
```
|
||||
|
||||
### Make Changes
|
||||
|
||||
```bash
|
||||
# Create feature branch
|
||||
git checkout -b feature/my-feature
|
||||
|
||||
# Make changes...
|
||||
|
||||
# Commit
|
||||
git add src/
|
||||
git commit -m "feat(macro): add new feature"
|
||||
|
||||
# Push
|
||||
git push -u origin feature/my-feature
|
||||
```
|
||||
|
||||
### Commit Message Format
|
||||
|
||||
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
|
||||
<body>
|
||||
|
||||
<footer>
|
||||
```
|
||||
|
||||
**Types**: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `style`
|
||||
**Scopes**: `macro`, `system`, `core`, `config`, `docs`
|
||||
|
||||
**Examples**:
|
||||
```bash
|
||||
feat(macro): add arcane pool enhancement UI
|
||||
fix(system): correct haste buff duration
|
||||
docs(readme): update setup instructions
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
Quick fixes:
|
||||
### Foundry Won't Start
|
||||
|
||||
```bash
|
||||
# Agent not working?
|
||||
> "Use the [agent-name] agent to..." # Manual invocation
|
||||
# Check logs in Data/Logs/
|
||||
cat "src/FoundryVTT-11.315/Data/Logs/foundry.log"
|
||||
|
||||
# Command not found?
|
||||
> /help # List available commands
|
||||
|
||||
# MCP server failed?
|
||||
cat .mcp.json | jq '.mcpServers' # Check configuration
|
||||
|
||||
# Permission denied?
|
||||
cat .claude/settings.json | jq '.permissions' # Check permissions
|
||||
|
||||
# Windows MCP error on Mac/Linux?
|
||||
# This is normal - see Platform Notes above
|
||||
# Try running directly
|
||||
cd src/FoundryVTT-11.315
|
||||
node resources/app/main.js
|
||||
```
|
||||
|
||||
See [CLAUDE_CODE_SETUP_COMPLETE.md](CLAUDE_CODE_SETUP_COMPLETE.md#troubleshooting) for detailed troubleshooting.
|
||||
### Macro Not Working
|
||||
|
||||
1. **Check token selection**: Click a token on the canvas
|
||||
2. **Check console (F12)**: Look for error messages
|
||||
3. **Verify actor exists**: `console.log(token.actor)`
|
||||
4. **Check syntax**: Paste into browser console
|
||||
5. **Clear cache**: Hard refresh (Ctrl+Shift+R)
|
||||
|
||||
### Build Failures
|
||||
|
||||
```bash
|
||||
cd src/foundryvtt-pathfinder1-v10.8
|
||||
|
||||
# Clean and rebuild
|
||||
rm -r dist node_modules
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Git Issues
|
||||
|
||||
```bash
|
||||
# Reset to last commit (discard changes)
|
||||
git reset --hard HEAD
|
||||
|
||||
# Pull latest changes
|
||||
git pull origin main
|
||||
|
||||
# Check remote
|
||||
git remote -v
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Common Tasks
|
||||
|
||||
### Add a New Macro
|
||||
|
||||
1. Create `src/macro_myfeature.js`
|
||||
2. Follow IIFE pattern (see examples)
|
||||
3. Test in Foundry VTT
|
||||
4. Commit: `git add src/macro_myfeature.js && git commit -m "feat(macro): add myfeature"`
|
||||
|
||||
### Modify PF1 System
|
||||
|
||||
1. Edit files in `src/foundryvtt-pathfinder1-v10.8/module/`
|
||||
2. Run `npm run build:watch`
|
||||
3. Reload Foundry VTT (F5)
|
||||
4. Test changes
|
||||
5. Commit: `git add src/foundryvtt-pathfinder1-v10.8/ && git commit -m "feat(system): describe change"`
|
||||
|
||||
### Add Compendium Content
|
||||
|
||||
1. Extract packs: `npm run packs:extract`
|
||||
2. Edit JSON files
|
||||
3. Compile packs: `npm run packs:compile`
|
||||
4. Commit changes
|
||||
|
||||
---
|
||||
|
||||
@@ -541,50 +385,102 @@ See [CLAUDE_CODE_SETUP_COMPLETE.md](CLAUDE_CODE_SETUP_COMPLETE.md#troubleshootin
|
||||
|
||||
### Official Documentation
|
||||
|
||||
- **Claude Code Docs**: https://docs.claude.com/en/docs/claude-code/
|
||||
- **GitHub Issues**: https://github.com/anthropics/claude-code/issues
|
||||
- **Foundry VTT API v11**: https://foundryvtt.com/api/v11/
|
||||
- **Foundry VTT Docs**: https://foundryvtt.com/kb/
|
||||
- **PF1 System GitHub**: https://github.com/Furyspark/foundryvtt-pathfinder1
|
||||
|
||||
### This Project
|
||||
### Project Documentation
|
||||
|
||||
- **Quick Start**: [QUICKSTART.md](QUICKSTART.md)
|
||||
- **Complete Guide**: [CLAUDE_CODE_SETUP_COMPLETE.md](CLAUDE_CODE_SETUP_COMPLETE.md)
|
||||
- **MCP Servers**: [MCP_SERVERS_GUIDE.md](MCP_SERVERS_GUIDE.md)
|
||||
- **Templates**: [.claude/TEMPLATES_README.md](.claude/TEMPLATES_README.md)
|
||||
- **MCP Templates**: [.claude/agents/MCP_USAGE_TEMPLATES.md](.claude/agents/MCP_USAGE_TEMPLATES.md)
|
||||
- **[CLAUDE.md](CLAUDE.md)** - Complete project guide (technology stack, API reference, configuration)
|
||||
- **[QUICKSTART.md](QUICKSTART.md)** - Setup and first steps
|
||||
- **[ARCANE_POOL_ANALYSIS.md](ARCANE_POOL_ANALYSIS.md)** - Arcane Pool macro implementation
|
||||
- **[Manual_dmgtracking.md](Manual_dmgtracking.md)** - Damage tracking system
|
||||
|
||||
### Community
|
||||
|
||||
- **Foundry VTT Discord**: https://discord.gg/foundryvtt
|
||||
- **Foundry VTT Reddit**: https://reddit.com/r/FoundryVTT
|
||||
- **PF1 System Issues**: https://github.com/Furyspark/foundryvtt-pathfinder1/issues
|
||||
|
||||
---
|
||||
|
||||
## 🎉 Success Checklist
|
||||
## 🤝 Contributing
|
||||
|
||||
After setup, you should be able to:
|
||||
### Code Style
|
||||
|
||||
- [x] Run `/setup-info` and see full configuration
|
||||
- [x] Use slash commands like `/analyze`, `/review`, `/test`
|
||||
- [x] Invoke agents automatically or manually
|
||||
- [x] Change output styles with `/output-style`
|
||||
- [x] Use Serena MCP for code navigation
|
||||
- [x] Store persistent memories
|
||||
- [x] Use extended thinking for complex problems
|
||||
- [x] Access checkpoints with ESC ESC
|
||||
- Use `camelCase` for variables and functions
|
||||
- Use `PascalCase` for classes
|
||||
- Use `UPPER_SNAKE_CASE` for constants
|
||||
- Follow ESLint rules: `npm run lint`
|
||||
- Format code: `npm run format`
|
||||
|
||||
**Ready?** Start with [QUICKSTART.md](QUICKSTART.md)!
|
||||
### Before Committing
|
||||
|
||||
```bash
|
||||
# Lint and format
|
||||
npm run lint
|
||||
npm run format
|
||||
|
||||
# Build to check for errors
|
||||
npm run build
|
||||
|
||||
# Commit
|
||||
git add .
|
||||
git commit -m "feat(...): description"
|
||||
git push
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📊 Project Statistics
|
||||
|
||||
- **Foundry VTT Version**: v11.315
|
||||
- **PF1 System Version**: v10.8
|
||||
- **Runtime**: Node.js v16-19 (Electron)
|
||||
- **Languages**: JavaScript (ES6+), TypeScript definitions
|
||||
- **Repository**: https://gitea.gowlershome.dyndns.org/Gowler/FoundryVTT.git
|
||||
|
||||
---
|
||||
|
||||
## 📝 Version History
|
||||
|
||||
- **v3.0.0** (2025-10-20): Complete documentation overhaul, consolidated docs, added /adr command
|
||||
- **v2.0.0** (2025-10-17): Added output styles, plugins, status line
|
||||
- **v1.0.0**: Initial comprehensive setup
|
||||
- **v1.0.0** (2025-01-30) - Initial project setup with Foundry VTT v11.315 and PF1e v10.8
|
||||
|
||||
---
|
||||
|
||||
## 📄 License
|
||||
## 🎓 Learning Path
|
||||
|
||||
This configuration setup is provided as-is for educational and development purposes. Feel free to use, modify, and share.
|
||||
### Day 1: Setup
|
||||
1. Read [QUICKSTART.md](QUICKSTART.md)
|
||||
2. Install dependencies
|
||||
3. Build PF1 system
|
||||
4. Launch Foundry VTT
|
||||
|
||||
### Week 1: Basics
|
||||
1. Create a simple macro
|
||||
2. Test macro in game
|
||||
3. Understand actor/item API
|
||||
4. Explore Foundry console (F12)
|
||||
|
||||
### Month 1: Advanced
|
||||
1. Build complex macros with dialogs
|
||||
2. Modify PF1 system code
|
||||
3. Add compendium content
|
||||
4. Integrate Claude Code for automation
|
||||
|
||||
---
|
||||
|
||||
**Questions?** Check the documentation files or see [troubleshooting](#troubleshooting)
|
||||
## 💬 Questions?
|
||||
|
||||
- Check [CLAUDE.md](CLAUDE.md) for detailed documentation
|
||||
- See [QUICKSTART.md](QUICKSTART.md) for setup help
|
||||
- Review macro examples: `src/macro.js`, `src/macro_haste.js`
|
||||
- Check browser console (F12) for errors
|
||||
|
||||
---
|
||||
|
||||
**Ready to start?** → **[QUICKSTART.md](QUICKSTART.md)**
|
||||
|
||||
**Need details?** → **[CLAUDE.md](CLAUDE.md)**
|
||||
|
||||
**Have questions?** Check the troubleshooting section above.
|
||||
|
||||
Reference in New Issue
Block a user