refactor: migrate plugin to use pup CLI#92
Merged
platinummonkey merged 4 commits intomainfrom Feb 10, 2026
Merged
Conversation
…implementation This is a major architectural change that simplifies the plugin by leveraging the existing pup CLI tool instead of maintaining a custom TypeScript/Node.js implementation. ## Changes ### Removed - Removed entire TypeScript/Node.js implementation (src/, dist/, tests/) - Removed TypeScript configuration files (tsconfig.json, eslint.config.mjs, jest.config.js) - Removed npm dependencies for Datadog API client and build tools ### Updated - **package.json**: Simplified to metadata-only, removed all scripts and dependencies - **skills/code-generation/SKILL.md**: Completely rewritten to: - Use pup CLI for immediate execution - Provide code examples using official Datadog API clients (Python, TypeScript, Java, Go, Rust) - Show both CLI usage patterns and code generation patterns - **README.md**: Rewritten to focus on pup integration: - Removed build/install instructions - Updated all examples to use pup commands - Added pup command reference - Simplified architecture section - **AGENTS.md**: Updated architecture and project structure sections to reference pup ### Benefits - **Simpler maintenance**: No custom TypeScript code to maintain - **Faster execution**: Single Go binary instead of Node.js + TypeScript - **Better authentication**: Leverages pup's OAuth2 with OS keychain - **Multiple output formats**: JSON, YAML, and table views - **Consistent with pup project**: Both projects now use the same underlying tool ## Breaking Changes - Users must now have pup CLI built and available at ../pup/pup - No more `node dist/index.js` commands - use `pup` commands instead - Authentication must be configured via pup (pup auth login or DD_API_KEY/DD_APP_KEY) ## Migration Guide 1. Build pup: `cd ../pup && go build -o pup .` 2. Authenticate: `./pup auth login` (or set DD_API_KEY/DD_APP_KEY) 3. Use natural language with Claude - agents now execute pup commands automatically Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
platinummonkey
commented
Feb 10, 2026
Updated all references from './pup' or '../pup/pup' to just 'pup' for consistency. Assumes pup is installed and available in PATH. Changes: - README.md: Removed cd ../pup commands, updated all ./pup to pup - AGENTS.md: Updated architecture and project structure references - skills/code-generation/SKILL.md: Replaced all ../pup/pup with pup - Updated documentation links to point to pup GitHub repository Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
platinummonkey
added a commit
that referenced
this pull request
Feb 10, 2026
This commit completes the cleanup after migrating from TypeScript to pup CLI and adds a new skill for intelligently filing GitHub issues. ## Changes ### Added - file-issue skill: Intelligently routes issues to pup or plugin repos - Decision logic for determining correct repository - Searches for existing issues to avoid duplicates - Provides templates and best practices - Uses gh CLI for seamless issue creation - SIMPLIFICATION_PLAN.md: Comprehensive roadmap for codebase cleanup - NEXT_STEPS.md: Implementation guide with priorities and metrics ### Updated Documentation - CLAUDE.md: Removed TypeScript/Node.js references, emphasize pup CLI - Updated Architecture section to reflect pup CLI - Simplified Multi-Language Support section - Updated example interactions for shell scripts - Focused Related Resources on pup CLI - README.md: Modernized for pup-based architecture - Replaced code generation examples with shell scripts - Updated feature descriptions - Simplified resource links - CHANGELOG.md: Documented all simplification changes ### Removed Obsolete Code - node_modules/: 21 empty TypeScript dependency folders - package-lock.json: No dependencies needed - examples/agent-identification.ts: Outdated TypeScript example - ARCHITECTURE.md: Archived as ARCHITECTURE_LEGACY.md (completely outdated) ### Simplified Configuration - .gitignore: Removed TypeScript-specific entries (dist/, *.tsbuildinfo, etc.) ## Impact - ~90% reduction in repository cruft (removed node_modules, examples) - Documentation now accurately reflects pup CLI architecture - Clearer guidance for users and contributors - New issue filing workflow for better bug triage ## Related Issues Addresses technical debt from pup CLI migration (#92) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
14 tasks
platinummonkey
added a commit
that referenced
this pull request
Feb 10, 2026
* chore: simplify codebase post-pup-migration and add issue filing skill This commit completes the cleanup after migrating from TypeScript to pup CLI and adds a new skill for intelligently filing GitHub issues. ## Changes ### Added - file-issue skill: Intelligently routes issues to pup or plugin repos - Decision logic for determining correct repository - Searches for existing issues to avoid duplicates - Provides templates and best practices - Uses gh CLI for seamless issue creation - SIMPLIFICATION_PLAN.md: Comprehensive roadmap for codebase cleanup - NEXT_STEPS.md: Implementation guide with priorities and metrics ### Updated Documentation - CLAUDE.md: Removed TypeScript/Node.js references, emphasize pup CLI - Updated Architecture section to reflect pup CLI - Simplified Multi-Language Support section - Updated example interactions for shell scripts - Focused Related Resources on pup CLI - README.md: Modernized for pup-based architecture - Replaced code generation examples with shell scripts - Updated feature descriptions - Simplified resource links - CHANGELOG.md: Documented all simplification changes ### Removed Obsolete Code - node_modules/: 21 empty TypeScript dependency folders - package-lock.json: No dependencies needed - examples/agent-identification.ts: Outdated TypeScript example - ARCHITECTURE.md: Archived as ARCHITECTURE_LEGACY.md (completely outdated) ### Simplified Configuration - .gitignore: Removed TypeScript-specific entries (dist/, *.tsbuildinfo, etc.) ## Impact - ~90% reduction in repository cruft (removed node_modules, examples) - Documentation now accurately reflects pup CLI architecture - Clearer guidance for users and contributors - New issue filing workflow for better bug triage ## Related Issues Addresses technical debt from pup CLI migration (#92) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * chore: rename skill from /file-issue to /dd-file-issue - Renamed skill directory: skills/file-issue → skills/dd-file-issue - Updated skill name in frontmatter - Updated all references in plugin.json, CHANGELOG.md, CLAUDE.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat: implement Phase 3 agent template system This commit implements the agent template infrastructure to reduce duplication across 46 agent files and improve maintainability. ## Template System Created 5 reusable templates for common agent sections: 1. **pup-context.md**: CLI tool context and environment variables 2. **time-formats.md**: Time format documentation (--from/--to) 3. **permission-model-read.md**: Read-only operations 4. **permission-model-write.md**: Write operations with confirmation 5. **permission-model-mixed.md**: Both read and write operations ## Proof of Concept **Test case**: logs.md agent - Before: 211 lines - After (with templates): 190 lines - Direct reduction: 21 lines (10%) - Template references: 3 comments **Projected impact** (all 46 agents): - Current: ~33,897 lines - With templates: ~19,090 lines - Reduction: ~14,807 lines (43.7%) ## Documentation Added comprehensive documentation: - **agents/_templates/README.md**: Template usage guide - **agents/_templates/IMPLEMENTATION_NOTES.md**: Implementation strategy and metrics - **agents/_templates/EXAMPLE_logs_refactored.md**: Proof-of-concept refactored agent ## Benefits 1. **Consistency**: Guaranteed identical wording for common sections 2. **Maintainability**: Update 5 template files instead of 46 agents 3. **Clarity**: Agents focus on domain-specific content 4. **Size reduction**: 43.7% projected reduction in agent content ## Next Steps Phase 3B: Validate with 2-3 more agents Phase 3C: Roll out to all 46 agents (future PR) ## Updated Documentation - CHANGELOG.md: Documented template system - SIMPLIFICATION_PLAN.md: Marked Phase 3 as in progress with metrics Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * chore: cleanup SIMPLIFICATION_PLAN.md and remove ARCHITECTURE_LEGACY.md - Removed ARCHITECTURE_LEGACY.md entirely (no longer needed) - Cleaned up SIMPLIFICATION_PLAN.md to focus on remaining work - Moved completed phases (1, 2, 3A) to "Completed Work" section - Removed all completed checkboxes and tasks - Focused document on remaining work (3B, 3C, 4) - Added timeline estimates and implementation strategy - Updated success metrics to show progress Result: Clearer, more actionable planning document Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the Datadog API Claude plugin from a custom TypeScript/Node.js implementation to using the existing
pupCLI tool. This is a major architectural simplification that removes ~19,000 lines of custom code while maintaining all functionality.Motivation
The plugin was maintaining a custom TypeScript implementation that duplicated functionality already provided by the
pupCLI tool. By migrating to use pup, we:Changes
Removed (~19,000 lines)
src/,dist/,tests/)tsconfig.json,eslint.config.mjs,jest.config.js)Updated
✏️ package.json (package.json:4)
✏️ skills/code-generation/SKILL.md (skills/code-generation/SKILL.md:1-552)
pup(not./pupor../pup/pup)✏️ README.md (README.md:1-467)
pup✏️ AGENTS.md (AGENTS.md:689-711, 855-878)
pupPreserved
Breaking Changes
Before:
npm install npm run build node dist/index.js metrics query --query="..."After:
Users must now:
pup auth loginorDD_API_KEY/DD_APP_KEY)Testing
Manual testing performed:
pup, not./pupor../pup/pup)Integration testing requires:
Migration Guide for Users
For Direct Users
If you were using the plugin directly with
node dist/index.js:pup auth loginnode dist/index.js <command>withpup <command>For Claude Users
No changes required - continue using natural language:
Commits
pupfor consistencyChecklist
pupRelated Issues
Addresses the need to simplify maintenance by leveraging existing tooling.
🤖 Generated with Claude Code