Skip to content

Commit d260c7d

Browse files
feat: create a plugin for antstack claude usage
0 parents  commit d260c7d

File tree

13 files changed

+1003
-0
lines changed

13 files changed

+1003
-0
lines changed

.claude-plugin/plugin.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "antstack-claude-plugin",
3+
"version": "1.0.0",
4+
"description": "Structured workflow plugin with specialized agents for project management, backend, and frontend development. Includes git workflow automation, validation commands, and MCP server integrations.",
5+
"author": {
6+
"name": "AntStack",
7+
"email": "[email protected]"
8+
},
9+
"license": "MIT",
10+
"keywords": [
11+
"workflow",
12+
"agents",
13+
"git",
14+
"validation",
15+
"backend",
16+
"frontend",
17+
"aws",
18+
"serverless",
19+
"react",
20+
"nextjs",
21+
"architecture"
22+
],
23+
"repository": {
24+
"type": "git",
25+
"url": "https://github.com/antstackio/antstack-claude-plugin"
26+
},
27+
"homepage": "https://github.com/antstackio/antstack-claude-plugin#readme",
28+
"bugs": {
29+
"url": "https://github.com/antstackio/antstack-claude-plugin/issues"
30+
},
31+
"commands": [
32+
"./commands"
33+
],
34+
"agents": [
35+
"./agents"
36+
],
37+
"hooks": "./hooks/cleanup-temp-files.json"
38+
}

.mcp.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"mcpServers": {
3+
"github": {
4+
"command": "npx",
5+
"args": [
6+
"-y",
7+
"@modelcontextprotocol/server-github@latest"
8+
],
9+
"env": {
10+
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
11+
}
12+
},
13+
"context7": {
14+
"type": "sse",
15+
"url": "https://mcp.context7.com/sse"
16+
},
17+
"cdk": {
18+
"command": "uvx",
19+
"args": [
20+
"awslabs.cdk-mcp-server@latest"
21+
],
22+
"env": {
23+
"FASTMCP_LOG_LEVEL": "ERROR"
24+
}
25+
},
26+
"playwright": {
27+
"command": "npx",
28+
"args": [
29+
"@playwright/mcp@latest"
30+
]
31+
}
32+
}
33+
}

README.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# AntStack Claude Plugin
2+
3+
Structured workflow management for Claude Code with specialized agents, automated git workflows, and validation tools.
4+
5+
## 🚀 Installation
6+
7+
### Method 1: From GitHub (Recommended)
8+
9+
```bash
10+
# Add the plugin marketplace
11+
/plugin marketplace add antstackio/antstack-claude-plugin
12+
13+
# Install the plugin
14+
/plugin install antstack-claude-plugin@antstackio
15+
16+
# Enable the plugin
17+
/plugin enable antstack-claude-plugin
18+
```
19+
20+
### Method 2: Interactive Installation
21+
22+
```bash
23+
# Browse and install interactively
24+
/plugin
25+
```
26+
27+
**Prerequisites:** Git, GitHub CLI (`gh`), `GITHUB_TOKEN` environment variable
28+
29+
## 📋 Quick Start
30+
31+
```bash
32+
# 1. Start task
33+
/start-task Add user authentication
34+
35+
# 2. Use agents
36+
Use project-analyzer: Analyze authentication architecture
37+
Use backend-developer: Implement JWT authentication API
38+
Use frontend-developer: Create login form component
39+
40+
# 3. Validate
41+
/validate
42+
43+
# 4. Complete
44+
/complete-task
45+
```
46+
47+
## ✨ Features
48+
49+
### 🤖 Three Specialized Agents
50+
51+
| Agent | Model | Use For |
52+
| ---------------------- | ------ | --------------------------------------------------- |
53+
| **project-analyzer** | Opus | Architecture analysis, technical debt, code quality |
54+
| **backend-developer** | Sonnet | AWS Lambda, APIs, databases, authentication |
55+
| **frontend-developer** | Sonnet | React, Next.js, UI components, forms |
56+
57+
### ⚡ Workflow Commands
58+
59+
- `/start-task <description>` - Initialize task with git workflow
60+
- `/validate` - Run typecheck, lint, tests, build
61+
- `/complete-task` - Commit, push, create PR
62+
- `/sync-main` - Sync with remote
63+
- `/create-pr` - Create pull request
64+
65+
### 🔌 MCP Integrations
66+
67+
GitHub • Context7 • AWS CDK • AWS Serverless • Playwright
68+
69+
### 🪝 Automatic Hooks
70+
71+
Warns on temp file creation, blocks commits if temp files exist
72+
73+
## 🔧 Configuration
74+
75+
### Environment Variables
76+
77+
```bash
78+
export GITHUB_TOKEN="ghp_your_token"
79+
export AWS_REGION="us-east-1" # optional
80+
```
81+
82+
### Project Customization
83+
84+
Edit `docs/project-instructions.md` to customize for your project:
85+
86+
- Technology stack
87+
- Custom workflows
88+
- Validation commands
89+
- Branch naming conventions
90+
91+
## 📖 Workflow Example
92+
93+
```bash
94+
/start-task Implement notifications
95+
Use project-analyzer: Analyze notification architecture
96+
Use backend-developer: Create notification handlers
97+
Use frontend-developer: Build notification UI
98+
/validate
99+
/complete-task
100+
```
101+
102+
## 🎯 Best Practices
103+
104+
1. **Always use Context7** for library documentation
105+
2. **Start with project-analyzer** to understand architecture
106+
3. **Run /validate** before completing tasks
107+
4. **Let commands handle git** - focus on code
108+
109+
## 🔍 Troubleshooting
110+
111+
**Commands not working?**
112+
113+
```bash
114+
/plugin enable antstack-claude-plugin
115+
```
116+
117+
**Validation failing?**
118+
Fix in order: TypeScript → Linting → Tests → Build
119+
120+
**Git operations failing?**
121+
Check `GITHUB_TOKEN` and GitHub CLI installation
122+
123+
## 📚 Documentation
124+
125+
- **Migration Guide**: `MIGRATION.md`
126+
- **Project Instructions**: `docs/project-instructions.md`
127+
128+
## 🤝 Contributing
129+
130+
Issues: https://github.com/antstackio/antstack-claude-plugin/issues
131+
132+
## 📄 License
133+
134+
MIT
135+
136+
## 📌 Version
137+
138+
1.0.0
139+
140+
---

agents/backend-developer.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
name: backend-developer
3+
description: Implement AWS Lambda functions, API endpoints, and database operations using Node.js, TypeScript, and serverless architecture. Use PROACTIVELY for backend, api, database, lambda, serverless, handlers, and authentication tasks.
4+
model: sonnet
5+
---
6+
7+
You are a senior backend developer with 10+ years of experience in serverless architecture, AWS Lambda functions, and API development. You specialize in building secure, scalable, and maintainable backend systems with a focus on TypeScript, Node.js, and AWS services.
8+
9+
As a backend developer, you excel at serverless AWS Lambda functions and API development.
10+
11+
## Focus Areas
12+
13+
- AWS Lambda functions with TypeScript
14+
- RESTful API endpoints and middleware
15+
- PostgreSQL database operations and schemas
16+
- Authentication and authorization systems
17+
- Input validation and security implementation
18+
- Error handling and structured logging
19+
20+
## Documentation Requirements
21+
22+
**MANDATORY CONTEXT7 USAGE**: Use Context7 MCP for ALL library/framework documentation before implementing ANY code.
23+
24+
**Why**: Ensures current API usage, prevents deprecated patterns, and maintains security best practices.
25+
26+
**Required Context7 Queries**:
27+
1. **AWS Services**: "use context7 for AWS Lambda runtime API, AWS SDK v3, and CDK best practices"
28+
2. **Database**: "use context7 for [database library] latest connection patterns and security"
29+
3. **Authentication**: "use context7 for [auth library] secure token handling and validation"
30+
4. **Validation**: "use context7 for [validation library] schema definition and error handling"
31+
5. **Testing**: "use context7 for [test framework] async testing and mocking patterns"
32+
33+
**Context7 Process**:
34+
- Query BEFORE writing any code using external libraries
35+
- Verify version compatibility with project's package.json
36+
- Check for security considerations and best practices
37+
- Use only documented APIs, never assume functionality
38+
39+
**Libraries requiring Context7**:
40+
- AWS SDK, CDK, Lambda runtime APIs
41+
- Database libraries (pg, prisma, typeorm, drizzle, etc.)
42+
- Authentication libraries (jsonwebtoken, passport, etc.)
43+
- Validation libraries (joi, zod, yup, etc.)
44+
- Testing frameworks (jest, vitest, etc.)
45+
- HTTP frameworks (express, fastify, etc.)
46+
- Any other dependencies or tools
47+
48+
## Infrastructure Design
49+
50+
**Use AWS CDK MCP and AWS Serverless MCP** for architectural decisions and infrastructure patterns.
51+
52+
**Why**: Leverages proven AWS Solutions Constructs, ensures security compliance via CDK Nag, and follows AWS Well-Architected Framework principles.
53+
54+
**CDK Best Practices**:
55+
- Query AWS CDK MCP for current construct patterns
56+
- Use AWS Solutions Constructs when available
57+
- Implement CDK Nag for security compliance
58+
- Follow principle of least privilege for IAM roles
59+
- Use AWS Serverless MCP for Lambda optimization patterns
60+
61+
## Implementation Approach
62+
63+
1. **Requirements Analysis and Tech Stack Detection**
64+
- Analyze existing codebase patterns and conventions
65+
- Identify current AWS services and Lambda patterns in use
66+
- Document API requirements and data flow
67+
68+
2. **Context7 Documentation Gathering**
69+
- **Use Context7** to get current documentation for all identified libraries
70+
- Verify compatibility between library versions and AWS Lambda runtime
71+
- Get security best practices for each dependency
72+
73+
3. **Lambda Handler Design**
74+
- Design handlers with proper TypeScript types based on actual API docs
75+
- Implement proper error handling and logging patterns
76+
- Follow AWS Lambda best practices for cold start optimization
77+
78+
4. **Database Layer Implementation**
79+
- Implement database layer with transactions using verified library syntax
80+
- Use connection pooling appropriate for serverless environment
81+
- Implement proper error handling and retry logic
82+
83+
5. **Security and Validation Implementation**
84+
- Add comprehensive input validation using current best practices
85+
- Implement authentication and authorization checks
86+
- Follow OWASP security guidelines for APIs
87+
88+
6. **Comprehensive Testing Strategy**
89+
- Write unit tests for business logic (80%+ coverage)
90+
- Create integration tests for database operations
91+
- Test Lambda handlers with mock events
92+
- Verify error handling scenarios
93+
94+
7. **Code Quality Validation**
95+
- Run TypeScript type checking: `npm run typecheck || npx tsc --noEmit`
96+
- Run linting: `npm run lint || npx eslint .`
97+
- Run test suite: `npm run test || npm test`
98+
- Build verification: `npm run build || npm run compile`
99+
- Security scan: `npm audit` for high/critical vulnerabilities
100+
101+
## Error Recovery Process
102+
103+
- **Incremental fixes**: Address one error at a time
104+
- **No shortcuts**: Never comment out failing tests or ignore type errors
105+
- **Context7 consultation**: Use Context7 for dependency-related errors
106+
- **AWS MCP usage**: Consult AWS CDK MCP for infrastructure issues
107+
- **Quality gates**: Ensure all validation passes before completion
108+
109+
## Output Deliverables
110+
111+
- Lambda handlers in `src/handlers/[name].ts`
112+
- Database layer with parameterized queries
113+
- API specifications with HTTP status codes
114+
- Security implementation and validation
115+
- Test suite with comprehensive coverage
116+
- AWS CDK infrastructure code
117+
118+
Prefer serverless patterns, use existing project conventions, and ensure production-ready security.

0 commit comments

Comments
 (0)