Skip to content

Commit 96c3858

Browse files
committed
fix: refactor change js to ts
1 parent a1a3114 commit 96c3858

25 files changed

Lines changed: 1701 additions & 1082 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: CI
33
on:
44
push:
55
branches: [master, main]
6+
tags:
7+
- 'v*'
68
pull_request:
79
branches: [master, main]
810

@@ -25,6 +27,9 @@ jobs:
2527
- name: Install dependencies
2628
run: npm ci
2729

30+
- name: Build TypeScript
31+
run: npm run build
32+
2833
- name: Run tests
2934
run: npm test
3035

@@ -33,3 +38,29 @@ jobs:
3338
chmod +x ./bin/cli.js
3439
node ./bin/cli.js --version
3540
node ./bin/cli.js --help
41+
42+
publish:
43+
needs: test
44+
runs-on: ubuntu-latest
45+
if: startsWith(github.ref, 'refs/tags/v')
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Node.js
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: 20
55+
registry-url: 'https://registry.npmjs.org'
56+
57+
- name: Install dependencies
58+
run: npm ci
59+
60+
- name: Build TypeScript
61+
run: npm run build
62+
63+
- name: Publish to npm
64+
run: npm publish --access public
65+
env:
66+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
node_modules/
2+
dist/
3+
release/
24
.DS_Store
35
*.log
46
.env

CLAUDE.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,23 @@ moicle uninstall # Remove
2424
## Project Structure
2525

2626
```
27-
claude-agents-kit/
28-
├── bin/cli.js # CLI entry point (ES modules)
29-
├── src/
27+
moicle/
28+
├── bin/cli.js # CLI entry point
29+
├── src/ # TypeScript source
30+
│ ├── types.ts # Type definitions
31+
│ ├── index.ts # Exports
3032
│ ├── commands/
31-
│ │ ├── install.js # Interactive install
32-
│ │ ├── uninstall.js # Remove installations
33-
│ │ ├── list.js # List installed items
34-
│ │ ├── enable.js # Enable items
35-
│ │ ├── disable.js # Disable items
36-
│ │ ├── status.js # Show status
37-
│ │ └── postinstall.js # npm postinstall message
33+
│ │ ├── install.ts # Interactive install
34+
│ │ ├── uninstall.ts # Remove installations
35+
│ │ ├── list.ts # List installed items
36+
│ │ ├── enable.ts # Enable items (tabs UI)
37+
│ │ ├── disable.ts # Disable items (tabs UI)
38+
│ │ ├── status.ts # Show status
39+
│ │ └── postinstall.ts # npm postinstall message
3840
│ └── utils/
39-
│ ├── symlink.js # File operations
40-
│ └── config.js # Config management
41+
│ ├── symlink.ts # File operations
42+
│ └── config.ts # Config management
43+
├── dist/ # Compiled JS (gitignored)
4144
├── assets/
4245
│ ├── agents/
4346
│ │ ├── developers/ # 5 stack-specific agents
@@ -118,12 +121,14 @@ Project wizard with 5 stacks - reads architecture files first.
118121
## Development
119122

120123
### Tech Stack
121-
- Node.js >= 18, ES Modules
124+
- Node.js >= 18, TypeScript, ES Modules
122125
- Dependencies: chalk, commander, inquirer, ora
126+
- DevDependencies: typescript, @types/node, @types/inquirer
123127

124-
### Testing Locally
128+
### Build & Test
125129
```bash
126130
bun install
131+
bun run build
127132
bun link
128133
moicle install
129134
```
@@ -132,3 +137,4 @@ moicle install
132137
- Agents MUST read architecture files before coding
133138
- Config stored at `~/.claude/moicle-config.json`
134139
- Disabled items renamed to `.md.disabled`
140+
- Enable/disable commands have interactive tabs UI (Agents, Commands, Skills)

assets/skills/feature-workflow/SKILL.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ description: Complete feature development workflow from start to finish. Use whe
77

88
End-to-end workflow for developing features with feedback loops and quality gates.
99

10+
## Recommended Agents
11+
12+
| Phase | Agent | Purpose |
13+
|-------|-------|---------|
14+
| DESIGN | `@clean-architect` | Design Clean Architecture + MVVM |
15+
| IMPLEMENT | `@react-frontend-dev`, `@go-backend-dev`, `@laravel-backend-dev`, `@flutter-mobile-dev`, `@remix-fullstack-dev` | Stack-specific implementation |
16+
| IMPLEMENT | `@db-designer` | Database schema design |
17+
| IMPLEMENT | `@api-designer` | API design (REST/GraphQL) |
18+
| REVIEW | `@code-reviewer` | Code quality review |
19+
| REVIEW | `@security-audit` | Security vulnerabilities check |
20+
| REVIEW | `@perf-optimizer` | Performance optimization |
21+
| TEST | `@test-writer` | Unit/integration/e2e tests |
22+
| COMPLETE | `@docs-writer` | Documentation (if needed) |
23+
1024
## Workflow Overview
1125

1226
```

assets/skills/hotfix-workflow/SKILL.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ description: Quick bug fix workflow with rollback plan. Use when fixing bugs, ho
77

88
Fast-track workflow for fixing bugs with safety rollback plan.
99

10+
## Recommended Agents
11+
12+
| Phase | Agent | Purpose |
13+
|-------|-------|---------|
14+
| FIX | `@react-frontend-dev`, `@go-backend-dev`, `@laravel-backend-dev`, `@flutter-mobile-dev`, `@remix-fullstack-dev` | Stack-specific bug fix |
15+
| FIX | `@security-audit` | Security-related bugs |
16+
| VERIFY | `@test-writer` | Regression test |
17+
| VERIFY | `@code-reviewer` | Quick code review |
18+
| DEPLOY | `@devops` | CI/CD & deployment |
19+
1020
## Workflow Overview
1121

1222
```

bin/cli.js

100644100755
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import { Command } from 'commander';
44
import { createRequire } from 'module';
5-
import { installCommand } from '../src/commands/install.js';
6-
import { uninstallCommand } from '../src/commands/uninstall.js';
7-
import { listCommand } from '../src/commands/list.js';
8-
import { postinstallCommand } from '../src/commands/postinstall.js';
9-
import { enableCommand } from '../src/commands/enable.js';
10-
import { disableCommand } from '../src/commands/disable.js';
11-
import { statusCommand } from '../src/commands/status.js';
5+
import { installCommand } from '../dist/commands/install.js';
6+
import { uninstallCommand } from '../dist/commands/uninstall.js';
7+
import { listCommand } from '../dist/commands/list.js';
8+
import { postinstallCommand } from '../dist/commands/postinstall.js';
9+
import { enableCommand } from '../dist/commands/enable.js';
10+
import { disableCommand } from '../dist/commands/disable.js';
11+
import { statusCommand } from '../dist/commands/status.js';
1212

1313
const require = createRequire(import.meta.url);
1414
const pkg = require('../package.json');
@@ -17,15 +17,16 @@ const program = new Command();
1717

1818
program
1919
.name('moicle')
20-
.description('CLI for managing Claude Code agents, commands, and skills')
20+
.description('CLI for managing AI code editor agents, commands, and skills')
2121
.version(pkg.version);
2222

2323
program
2424
.command('install')
2525
.description('Install agents, commands, and skills')
26-
.option('-g, --global', 'Install globally to ~/.claude/')
27-
.option('-p, --project', 'Install to current project ./.claude/')
26+
.option('-g, --global', 'Install globally')
27+
.option('-p, --project', 'Install to current project')
2828
.option('-a, --all', 'Install both globally and to project')
29+
.option('-t, --target <editor>', 'Target editor (claude, cursor, windsurf, antigravity)')
2930
.option('--no-symlink', 'Copy files instead of creating symlinks')
3031
.action(installCommand);
3132

@@ -51,15 +52,15 @@ program
5152

5253
program
5354
.command('enable [item]')
54-
.description('Enable agents, commands, or skills')
55+
.description('Enable agents, commands, or skills (interactive)')
5556
.option('-g, --global', 'Enable in global ~/.claude/')
5657
.option('-p, --project', 'Enable in current project ./.claude/')
5758
.option('-a, --all', 'Enable all disabled items')
5859
.action(enableCommand);
5960

6061
program
6162
.command('disable [item]')
62-
.description('Disable agents, commands, or skills')
63+
.description('Disable agents, commands, or skills (interactive)')
6364
.option('-g, --global', 'Disable in global ~/.claude/')
6465
.option('-p, --project', 'Disable in current project ./.claude/')
6566
.option('-a, --all', 'Disable all enabled items')

bun.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
"version": "1.0.0",
44
"description": "Reusable AI agents, commands, skills, and architecture references for Claude Code",
55
"type": "module",
6-
"main": "src/index.js",
6+
"main": "dist/index.js",
77
"bin": {
88
"moicle": "./bin/cli.js"
99
},
1010
"scripts": {
11+
"build": "tsc",
12+
"dev": "tsc --watch",
1113
"test": "echo \"No tests yet\" && exit 0",
12-
"lint": "eslint src/",
13-
"postinstall": "node ./bin/cli.js postinstall || true"
14+
"prepublishOnly": "npm run build",
15+
"pack:dist": "rm -rf release && mkdir -p release/moicle && cp -r bin dist assets package.json README.md release/moicle/ && cd release && zip -r moicle.zip moicle && echo 'Created release/moicle.zip'"
1416
},
1517
"keywords": [
1618
"claude",
@@ -36,13 +38,18 @@
3638
},
3739
"files": [
3840
"bin/",
39-
"src/",
41+
"dist/",
4042
"assets/"
4143
],
4244
"dependencies": {
4345
"chalk": "^5.3.0",
4446
"commander": "^12.1.0",
4547
"inquirer": "^9.2.12",
4648
"ora": "^8.0.1"
49+
},
50+
"devDependencies": {
51+
"@types/inquirer": "^9.0.7",
52+
"@types/node": "^20.11.0",
53+
"typescript": "^5.3.3"
4754
}
4855
}

0 commit comments

Comments
 (0)