Skip to content

Commit d628e3b

Browse files
semsem
authored andcommitted
feat: Add Dart MCP integration with workspace configuration
- Add .dart configuration file support for workspace settings - Add 'claude-hooks dart init' to create workspace config - Add 'claude-hooks dart edit' to modify configuration - Generate CLAUDE.md with project-specific instructions - Update sync-docs-to-dart hook to use .dart configuration - Update validate-dart-task hook for workspace awareness - Add comprehensive documentation and template guide - Integrate Dart setup into project initialization flow This enables seamless integration between local projects and Dart workspaces, with automatic suggestions for task creation and documentation synchronization based on project configuration.
1 parent 98710f5 commit d628e3b

File tree

6 files changed

+721
-1
lines changed

6 files changed

+721
-1
lines changed

.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"workspace": "MCP Forge",
3+
"tasksFolder": "MCP Forge/Tasks",
4+
"docsFolder": "MCP Forge/Docs",
5+
"syncEnabled": true,
6+
"syncRules": {
7+
"include": ["README.md", "docs/**/*.md", "wiki/**/*.md"],
8+
"exclude": [".github/**/*.md", "node_modules/**/*.md", "test/**/*.md"]
9+
}
10+
}

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,32 @@ All notable changes to Claude Hooks Manager will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.1.0] - 2025-07-05
9+
10+
### Added
11+
- Dart MCP integration with `.dart` configuration files
12+
- `claude-hooks dart init` command to set up Dart workspace
13+
- `claude-hooks dart edit` command to modify Dart configuration
14+
- CLAUDE.md generation with comprehensive project instructions
15+
- CLAUDE.md.template guide for customization
16+
- Workspace-aware sync-docs-to-dart hook
17+
- Workspace-aware validate-dart-task hook
18+
- Interactive prompts for workspace configuration
19+
- Documentation sync rules (include/exclude patterns)
20+
- Integration with project init workflow
21+
22+
### Changed
23+
- sync-docs-to-dart hook now uses `.dart` configuration instead of guessing
24+
- validate-dart-task hook suggests project-specific dartboard
25+
- Project init now offers Dart integration setup
26+
- Hooks prompt for configuration when .dart file is missing
27+
28+
### Documentation
29+
- Added comprehensive Dart Integration section to README
30+
- Created CLAUDE.md.template with customization guide
31+
- Added examples of .dart configuration
32+
- Documented how to disable Dart features
33+
834
## [3.0.1] - 2025-07-05
935

1036
### Fixed

CLAUDE.md.template

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# CLAUDE.md Template Guide
2+
3+
This template is used by Claude Hooks Manager when generating CLAUDE.md files. You can customize it to fit your project's specific needs.
4+
5+
## Template Structure
6+
7+
The CLAUDE.md file generated by `claude-hooks dart init` includes these sections:
8+
9+
### 1. Project Overview
10+
- Brief description of your project
11+
- Automatically populated from user input
12+
13+
### 2. Dart Integration (if enabled)
14+
- Workspace configuration
15+
- Task and documentation folders
16+
- Sync rules and settings
17+
18+
### 3. Task Management Rules
19+
- Dart MCP tool usage guidelines
20+
- Status values (To-do, Doing, Done)
21+
- Priority levels (Critical, High, Medium, Low)
22+
- Workflow rules for task updates
23+
24+
### 4. Git Workflow
25+
- Commit message guidelines
26+
- Restrictions (no co-authored commits, no Claude signatures)
27+
- Conventional commit format
28+
29+
### 5. Documentation Rules
30+
- Markdown file synchronization with Dart
31+
- Folder structure guidelines
32+
- Documentation best practices
33+
34+
### 6. Development Guidelines
35+
- Detail-oriented implementation requirements
36+
- Form and data flow validation
37+
- Testing requirements
38+
- Complete functionality implementation
39+
40+
### 7. Testing Commands
41+
- Test, lint, and type check commands
42+
- Automatically populated from user input
43+
44+
### 8. Project-Specific Context
45+
- Technology stack
46+
- How to run the application
47+
- Custom instructions
48+
49+
## Customizing Your CLAUDE.md
50+
51+
### Method 1: During Setup
52+
When running `claude-hooks dart init`, you'll be prompted for:
53+
- Project description
54+
- Primary language
55+
- Test/lint/typecheck commands
56+
- Technology stack
57+
- Additional instructions (opens editor)
58+
59+
### Method 2: Manual Editing
60+
After generation, edit CLAUDE.md directly to add:
61+
62+
```markdown
63+
## Custom Section Example
64+
65+
### API Guidelines
66+
- Always use RESTful conventions
67+
- Include proper error handling
68+
- Document all endpoints
69+
70+
### Database Rules
71+
- Use migrations for schema changes
72+
- Never modify production data directly
73+
- Always backup before major operations
74+
75+
### Security Requirements
76+
- Sanitize all user inputs
77+
- Use environment variables for secrets
78+
- Follow OWASP guidelines
79+
```
80+
81+
### Method 3: Template Variables
82+
83+
The template uses these variables you can reference:
84+
- `${projectName}` - Your project directory name
85+
- `${projectInfo.description}` - Project description
86+
- `${dartConfig.workspace}` - Dart workspace name
87+
- `${dartConfig.tasksFolder}` - Tasks dartboard path
88+
- `${dartConfig.docsFolder}` - Documentation folder path
89+
- `${projectInfo.testCommand}` - Test command
90+
- `${projectInfo.lintCommand}` - Lint command
91+
- `${projectInfo.typecheckCommand}` - Type check command
92+
- `${projectInfo.runCommand}` - Run command
93+
- `${projectInfo.techStack}` - Technology stack
94+
- `${projectInfo.additionalInstructions}` - Custom instructions
95+
96+
## Common Customizations
97+
98+
### 1. Add Phase-Based Development
99+
```markdown
100+
## Development Phases
101+
- Phase 1: Core Infrastructure ✓
102+
- Phase 2: User Authentication (IN PROGRESS)
103+
- Phase 3: API Development
104+
- Phase 4: Frontend Implementation
105+
- Phase 5: Testing & Documentation
106+
```
107+
108+
### 2. Add Team-Specific Rules
109+
```markdown
110+
## Team Guidelines
111+
- Code reviews required for all PRs
112+
- Daily standup updates in Dart
113+
- Weekly architecture reviews
114+
- Documentation updates with each feature
115+
```
116+
117+
### 3. Add Environment-Specific Instructions
118+
```markdown
119+
## Environment Setup
120+
### Development
121+
- Database: PostgreSQL 14
122+
- Redis: 7.0
123+
- Node.js: 18.x
124+
125+
### Staging
126+
- Mirror production configuration
127+
- Use staging API keys
128+
129+
### Production
130+
- Follow deployment checklist
131+
- Coordinate with DevOps team
132+
```
133+
134+
### 4. Add Performance Guidelines
135+
```markdown
136+
## Performance Requirements
137+
- API response time < 200ms
138+
- Page load time < 3s
139+
- Database queries < 100ms
140+
- Memory usage < 512MB
141+
```
142+
143+
## Re-generating CLAUDE.md
144+
145+
To regenerate your CLAUDE.md with updated information:
146+
147+
1. **Backup existing file**: `cp CLAUDE.md CLAUDE.md.bak`
148+
2. **Run**: `claude-hooks dart init`
149+
3. **Choose**: Overwrite when prompted
150+
4. **Merge**: Copy custom sections from backup
151+
152+
## Best Practices
153+
154+
1. **Keep it concise**: Claude reads this every session
155+
2. **Be specific**: Include exact commands and paths
156+
3. **Update regularly**: Keep in sync with project changes
157+
4. **Version control**: Track changes in git
158+
5. **Team alignment**: Ensure all team members use same instructions
159+
160+
## Example: Complete Custom CLAUDE.md
161+
162+
```markdown
163+
# MyProject Instructions for Claude
164+
165+
## Project Overview
166+
E-commerce platform with AI-powered recommendations
167+
168+
## Dart Integration
169+
[... generated dart config ...]
170+
171+
## Custom Business Rules
172+
### Order Processing
173+
- Validate inventory before confirming orders
174+
- Send email notifications at each step
175+
- Update analytics dashboard in real-time
176+
177+
### Payment Handling
178+
- Use Stripe for all transactions
179+
- Store only tokenized payment data
180+
- Implement 3D Secure for EU customers
181+
182+
### AI Features
183+
- Recommendation engine uses TensorFlow
184+
- Retrain models weekly
185+
- A/B test all algorithm changes
186+
187+
## Development Workflow
188+
### Branch Strategy
189+
- main: Production-ready code
190+
- develop: Integration branch
191+
- feature/*: New features
192+
- hotfix/*: Emergency fixes
193+
194+
### PR Requirements
195+
1. All tests must pass
196+
2. Code coverage > 80%
197+
3. Performance benchmarks met
198+
4. Documentation updated
199+
200+
[... rest of generated content ...]
201+
```
202+
203+
## Getting Help
204+
205+
- Run `claude-hooks dart edit` to modify .dart configuration
206+
- Edit CLAUDE.md directly for project-specific rules
207+
- Use `claude-hooks dart init` to regenerate with new settings
208+
- Keep both .dart and CLAUDE.md in sync for best results

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ claude-hooks --version
156156
157157
# Display help and usage information
158158
claude-hooks --help
159+
160+
# Dart Integration Commands (NEW!)
161+
claude-hooks dart init # Initialize Dart workspace configuration
162+
claude-hooks dart edit # Edit existing .dart configuration
159163
```
160164
161165
### Interactive Menu (NEW!)
@@ -223,6 +227,92 @@ Running Claude Hooks Manager Tests...
223227
✅ All 17 hooks passed tests!
224228
```
225229
230+
## 🎯 Dart Integration
231+
232+
Claude Hooks Manager now includes seamless integration with Dart MCP for project management. This feature enables automatic task tracking and documentation synchronization.
233+
234+
### What is Dart Integration?
235+
236+
Dart integration allows Claude to:
237+
- Automatically suggest creating tasks in your Dart workspace
238+
- Sync documentation between your local project and Dart
239+
- Validate task creation with project-specific rules
240+
- Generate CLAUDE.md files with workspace configuration
241+
242+
### Setting Up Dart Integration
243+
244+
#### Method 1: During Project Init
245+
```bash
246+
claude-hooks init
247+
# When prompted, choose to set up Dart integration
248+
```
249+
250+
#### Method 2: Direct Dart Setup
251+
```bash
252+
claude-hooks dart init
253+
```
254+
255+
This will:
256+
1. Create a `.dart` configuration file in your project root
257+
2. Configure your Dart workspace, tasks folder, and docs folder
258+
3. Optionally create a CLAUDE.md file with project instructions
259+
260+
### The .dart Configuration File
261+
262+
The `.dart` file stores your project's Dart workspace configuration:
263+
264+
```json
265+
{
266+
"workspace": "MCP Forge",
267+
"tasksFolder": "MCP Forge/Tasks",
268+
"docsFolder": "MCP Forge/Docs",
269+
"syncEnabled": true,
270+
"syncRules": {
271+
"include": ["README.md", "docs/**/*.md", "wiki/**/*.md"],
272+
"exclude": [".github/**/*.md", "node_modules/**/*.md", "test/**/*.md"]
273+
}
274+
}
275+
```
276+
277+
### CLAUDE.md - Project Instructions
278+
279+
The `claude-hooks dart init` command can also generate a CLAUDE.md file that provides Claude with:
280+
- Project-specific instructions
281+
- Dart workspace configuration
282+
- Task management rules
283+
- Git workflow guidelines
284+
- Development best practices
285+
286+
### Disabling Dart Features
287+
288+
If you're not using Dart, you can:
289+
290+
1. **Skip during setup**: Choose "No" when asked about Dart integration
291+
2. **Disable sync**: Set `"syncEnabled": false` in your `.dart` file
292+
3. **Remove configuration**: Delete the `.dart` file from your project
293+
4. **Disable hooks**: Run `claude-hooks disable sync-docs-to-dart` and `claude-hooks disable validate-dart-task`
294+
295+
### How It Works
296+
297+
1. **sync-docs-to-dart hook**:
298+
- Triggers when you create/edit markdown files
299+
- Checks for `.dart` configuration
300+
- If no config exists, prompts you to run `claude-hooks dart init`
301+
- If configured, suggests syncing to your Dart docs folder
302+
303+
2. **validate-dart-task hook**:
304+
- Triggers when creating Dart tasks
305+
- Suggests using your project's configured dartboard
306+
- Validates task priorities and statuses
307+
308+
### Customizing CLAUDE.md
309+
310+
See [CLAUDE.md.template](./CLAUDE.md.template) for a complete guide on customizing your project instructions. The template includes:
311+
- Variable references
312+
- Common customizations
313+
- Best practices
314+
- Example configurations
315+
226316
## Hooks Overview
227317

228318
| Hook | Trigger | Purpose |

0 commit comments

Comments
 (0)