@claudetools/tools 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,7 @@ export declare const PROJECT_SECTION_END = "<!-- CLAUDETOOLS:PROJECT:END -->";
|
|
|
5
5
|
/**
|
|
6
6
|
* Global CLAUDE.md content - added to ~/.claude/CLAUDE.md
|
|
7
7
|
*/
|
|
8
|
-
export declare const GLOBAL_TEMPLATE = "\n<!-- CLAUDETOOLS:START -->\n# ClaudeTools Memory System\n\nYou have access to a persistent memory system via the `claudetools_memory` MCP server. Use it to remember context across sessions.\n\n## Memory Tools\n\n### Searching Memory\n```\nmemory_search(query: \"authentication patterns\")\n```\nSearch for relevant facts, entities, and past context. Use this when:\n- Starting work on a feature to recall past decisions\n- Looking for patterns or conventions used before\n- Finding related code or architectural context\n\n### Storing Facts\n```\nmemory_store_fact(\n entity1: \"UserService\",\n relationship: \"USES\",\n entity2: \"bcrypt\",\n context: \"Password hashing uses bcrypt with 12 rounds\"\n)\n```\nStore important facts as relationships between entities. Use for:\n- Architectural decisions\n- Code patterns and conventions\n- Dependencies and relationships\n- User preferences learned during conversation\n\n### Context Injection\nContext is automatically injected at the start of each session based on the current project. Check `~/.claudetools/session-context.md` for project-specific context.\n\n## Task Management\n\n### Creating Work Plans with Auto-Dispatch\n```\ntask_plan(\n goal: \"Add user authentication\",\n epic_title: \"User Auth System\",\n tasks: [...]\n)\n```\nBreak down complex work into tracked tasks. **Tasks are automatically set to `ready` status.**\n\nAfter `task_plan` completes, you will receive Task tool invocations to spawn parallel agents.\n**Execute ALL Task tool calls in a SINGLE message** to enable parallel execution.\n\n### Parallel Agent Workflow\n1. User describes work needed\n2. Call `task_plan_draft` to present the plan\n3. User says \"go\" to approve\n4. Call `task_plan` - tasks created in `ready` status\n5. Execute the provided Task tool calls in ONE message\n6. Agents work in parallel, each calling `task_complete` when done\n\n### Manual Task Start (Sequential)\n```\ntask_start(task_id: \"task_xxx\")\n```\nClaim a task before working on it. Use for sequential execution.\n\n### Completing Tasks\n```\ntask_complete(task_id: \"task_xxx\", summary: \"Implemented JWT auth with refresh tokens\")\n```\nMark tasks done with a summary of work completed. **Always call this when a task is finished.**\n\n## Codebase Intelligence\n\n### Finding Code\n```\ncodebase_map() # Get overview of project structure\ncodebase_find(\"UserService\") # Find symbols/files\ncodebase_context(\"src/auth.ts\") # Get file dependencies\n```\n\n### Impact Analysis\n```\nanalyze_impact(function_name: \"validateToken\")\n```\nSee what would be affected by changing a function.\n\n## Best Practices\n\n1. **Search before implementing** - Check memory for existing patterns\n2. **Store decisions** - Save architectural choices as facts\n3. **Use task tracking** - Break complex work into tasks\n4. **Complete tasks** - Always mark tasks done with summaries\n<!-- CLAUDETOOLS:END -->\n";
|
|
8
|
+
export declare const GLOBAL_TEMPLATE = "\n<!-- CLAUDETOOLS:START -->\n# ClaudeTools Memory System\n\nYou have access to a persistent memory system via the `claudetools_memory` MCP server. Use it to remember context across sessions.\n\n## Memory Tools\n\n### Searching Memory\n```\nmemory_search(query: \"authentication patterns\")\n```\nSearch for relevant facts, entities, and past context. Use this when:\n- Starting work on a feature to recall past decisions\n- Looking for patterns or conventions used before\n- Finding related code or architectural context\n\n### Storing Facts\n```\nmemory_store_fact(\n entity1: \"UserService\",\n relationship: \"USES\",\n entity2: \"bcrypt\",\n context: \"Password hashing uses bcrypt with 12 rounds\"\n)\n```\nStore important facts as relationships between entities. Use for:\n- Architectural decisions\n- Code patterns and conventions\n- Dependencies and relationships\n- User preferences learned during conversation\n\n### Context Injection\nContext is automatically injected at the start of each session based on the current project. Check `~/.claudetools/session-context.md` for project-specific context.\n\n## Task Management\n\n### Creating Work Plans with Auto-Dispatch\n```\ntask_plan(\n goal: \"Add user authentication\",\n epic_title: \"User Auth System\",\n tasks: [...]\n)\n```\nBreak down complex work into tracked tasks. **Tasks are automatically set to `ready` status.**\n\nAfter `task_plan` completes, you will receive Task tool invocations to spawn parallel agents.\n**Execute ALL Task tool calls in a SINGLE message** to enable parallel execution.\n\n### Parallel Agent Workflow\n1. User describes work needed\n2. Call `task_plan_draft` to present the plan\n3. User says \"go\" to approve\n4. Call `task_plan` - tasks created in `ready` status\n5. Execute the provided Task tool calls in ONE message\n6. Agents work in parallel, each calling `task_complete` when done\n\n### Manual Task Start (Sequential)\n```\ntask_start(task_id: \"task_xxx\")\n```\nClaim a task before working on it. Use for sequential execution.\n\n### Completing Tasks\n```\ntask_complete(task_id: \"task_xxx\", summary: \"Implemented JWT auth with refresh tokens\")\n```\nMark tasks done with a summary of work completed. **Always call this when a task is finished.**\n\n## Codebase Intelligence\n\n### Finding Code\n```\ncodebase_map() # Get overview of project structure\ncodebase_find(\"UserService\") # Find symbols/files\ncodebase_context(\"src/auth.ts\") # Get file dependencies\n```\n\n### Impact Analysis\n```\nanalyze_impact(function_name: \"validateToken\")\n```\nSee what would be affected by changing a function.\n\n## CodeDNA: AI Code Generation (95-99% Token Savings)\n\n**CRITICAL: Use CodeDNA for repetitive code generation to save massive tokens.**\n\n### When to Use CodeDNA\n- Creating REST APIs with CRUD operations\n- Generating database models, controllers, routes\n- Building validation middleware\n- Setting up authentication systems\n- Creating test suites\n\n### Available Generators\n```\ncodedna_generate_api(spec, framework, options)\ncodedna_validate_spec(spec)\ncodedna_list_generators()\n```\n\n### Entity DSL Syntax\n```\nEntityName(field:type:constraint, field:type:constraint, ...)\n\nExamples:\nUser(email:string:unique:required, password:string:hashed, age:integer:min(18))\nPost(title:string:required, content:string, author:ref(User))\nProduct(name:string, price:decimal:min(0), stock:integer:default(0))\n```\n\n### Constraints\n- `unique` - Unique constraint\n- `required` - NOT NULL\n- `hashed` - Bcrypt hashing (for passwords)\n- `min(n)` - Minimum value\n- `max(n)` - Maximum value\n- `default(value)` - Default value\n\n### Token Savings Example\n**Traditional approach:**\n- AI writes 1000 lines of code\n- Tokens: ~30,000 (input + output)\n- Cost: ~$0.30\n- Time: 2-3 minutes\n\n**CodeDNA approach:**\n```\ncodedna_generate_api({\n spec: \"User(email:string:unique, password:string:hashed, role:enum(admin,user))\",\n framework: \"express\",\n options: { auth: true, validation: true, tests: true }\n})\n```\n- Tokens: ~200\n- Cost: ~$0.002\n- Time: 5-10 seconds\n- **Savings: 99.3% cost, 90% time**\n\n### Generated Files (Express)\n1. `models/entity.model.ts` - Sequelize ORM model\n2. `controllers/entity.controller.ts` - CRUD controllers\n3. `routes/entity.routes.ts` - Express routes\n4. `validators/entity.validator.ts` - Input validation (optional)\n5. `middleware/auth.middleware.ts` - JWT auth (optional)\n6. `tests/entity.test.ts` - Jest tests (optional)\n\n### Usage Pattern\n1. User asks: \"Create a User API with authentication\"\n2. **YOU MUST** call `codedna_generate_api` instead of writing code\n3. Receive 6 production-ready files\n4. Save 99% tokens and time\n\n**DO NOT write boilerplate code manually when CodeDNA can generate it.**\n\n## Best Practices\n\n1. **Search before implementing** - Check memory for existing patterns\n2. **Store decisions** - Save architectural choices as facts\n3. **Use task tracking** - Break complex work into tasks\n4. **Complete tasks** - Always mark tasks done with summaries\n5. **Use CodeDNA for APIs** - Save 95-99% tokens on boilerplate generation\n<!-- CLAUDETOOLS:END -->\n";
|
|
9
9
|
/**
|
|
10
10
|
* Project-level CLAUDE.md content - added to .claude/CLAUDE.md
|
|
11
11
|
*/
|
|
@@ -95,12 +95,85 @@ analyze_impact(function_name: "validateToken")
|
|
|
95
95
|
\`\`\`
|
|
96
96
|
See what would be affected by changing a function.
|
|
97
97
|
|
|
98
|
+
## CodeDNA: AI Code Generation (95-99% Token Savings)
|
|
99
|
+
|
|
100
|
+
**CRITICAL: Use CodeDNA for repetitive code generation to save massive tokens.**
|
|
101
|
+
|
|
102
|
+
### When to Use CodeDNA
|
|
103
|
+
- Creating REST APIs with CRUD operations
|
|
104
|
+
- Generating database models, controllers, routes
|
|
105
|
+
- Building validation middleware
|
|
106
|
+
- Setting up authentication systems
|
|
107
|
+
- Creating test suites
|
|
108
|
+
|
|
109
|
+
### Available Generators
|
|
110
|
+
\`\`\`
|
|
111
|
+
codedna_generate_api(spec, framework, options)
|
|
112
|
+
codedna_validate_spec(spec)
|
|
113
|
+
codedna_list_generators()
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
### Entity DSL Syntax
|
|
117
|
+
\`\`\`
|
|
118
|
+
EntityName(field:type:constraint, field:type:constraint, ...)
|
|
119
|
+
|
|
120
|
+
Examples:
|
|
121
|
+
User(email:string:unique:required, password:string:hashed, age:integer:min(18))
|
|
122
|
+
Post(title:string:required, content:string, author:ref(User))
|
|
123
|
+
Product(name:string, price:decimal:min(0), stock:integer:default(0))
|
|
124
|
+
\`\`\`
|
|
125
|
+
|
|
126
|
+
### Constraints
|
|
127
|
+
- \`unique\` - Unique constraint
|
|
128
|
+
- \`required\` - NOT NULL
|
|
129
|
+
- \`hashed\` - Bcrypt hashing (for passwords)
|
|
130
|
+
- \`min(n)\` - Minimum value
|
|
131
|
+
- \`max(n)\` - Maximum value
|
|
132
|
+
- \`default(value)\` - Default value
|
|
133
|
+
|
|
134
|
+
### Token Savings Example
|
|
135
|
+
**Traditional approach:**
|
|
136
|
+
- AI writes 1000 lines of code
|
|
137
|
+
- Tokens: ~30,000 (input + output)
|
|
138
|
+
- Cost: ~$0.30
|
|
139
|
+
- Time: 2-3 minutes
|
|
140
|
+
|
|
141
|
+
**CodeDNA approach:**
|
|
142
|
+
\`\`\`
|
|
143
|
+
codedna_generate_api({
|
|
144
|
+
spec: "User(email:string:unique, password:string:hashed, role:enum(admin,user))",
|
|
145
|
+
framework: "express",
|
|
146
|
+
options: { auth: true, validation: true, tests: true }
|
|
147
|
+
})
|
|
148
|
+
\`\`\`
|
|
149
|
+
- Tokens: ~200
|
|
150
|
+
- Cost: ~$0.002
|
|
151
|
+
- Time: 5-10 seconds
|
|
152
|
+
- **Savings: 99.3% cost, 90% time**
|
|
153
|
+
|
|
154
|
+
### Generated Files (Express)
|
|
155
|
+
1. \`models/entity.model.ts\` - Sequelize ORM model
|
|
156
|
+
2. \`controllers/entity.controller.ts\` - CRUD controllers
|
|
157
|
+
3. \`routes/entity.routes.ts\` - Express routes
|
|
158
|
+
4. \`validators/entity.validator.ts\` - Input validation (optional)
|
|
159
|
+
5. \`middleware/auth.middleware.ts\` - JWT auth (optional)
|
|
160
|
+
6. \`tests/entity.test.ts\` - Jest tests (optional)
|
|
161
|
+
|
|
162
|
+
### Usage Pattern
|
|
163
|
+
1. User asks: "Create a User API with authentication"
|
|
164
|
+
2. **YOU MUST** call \`codedna_generate_api\` instead of writing code
|
|
165
|
+
3. Receive 6 production-ready files
|
|
166
|
+
4. Save 99% tokens and time
|
|
167
|
+
|
|
168
|
+
**DO NOT write boilerplate code manually when CodeDNA can generate it.**
|
|
169
|
+
|
|
98
170
|
## Best Practices
|
|
99
171
|
|
|
100
172
|
1. **Search before implementing** - Check memory for existing patterns
|
|
101
173
|
2. **Store decisions** - Save architectural choices as facts
|
|
102
174
|
3. **Use task tracking** - Break complex work into tasks
|
|
103
175
|
4. **Complete tasks** - Always mark tasks done with summaries
|
|
176
|
+
5. **Use CodeDNA for APIs** - Save 95-99% tokens on boilerplate generation
|
|
104
177
|
${SECTION_END}
|
|
105
178
|
`;
|
|
106
179
|
/**
|