worclaude 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +278 -0
- package/package.json +62 -0
- package/src/commands/backup.js +55 -0
- package/src/commands/diff.js +76 -0
- package/src/commands/init.js +628 -0
- package/src/commands/restore.js +95 -0
- package/src/commands/status.js +141 -0
- package/src/commands/upgrade.js +208 -0
- package/src/core/backup.js +94 -0
- package/src/core/config.js +54 -0
- package/src/core/detector.js +43 -0
- package/src/core/file-categorizer.js +177 -0
- package/src/core/merger.js +413 -0
- package/src/core/scaffolder.js +60 -0
- package/src/data/agents.js +164 -0
- package/src/index.js +51 -0
- package/src/prompts/agent-selection.js +99 -0
- package/src/prompts/claude-md-merge.js +153 -0
- package/src/prompts/conflict-resolution.js +24 -0
- package/src/prompts/project-type.js +75 -0
- package/src/prompts/tech-stack.js +35 -0
- package/src/utils/display.js +41 -0
- package/src/utils/file.js +70 -0
- package/src/utils/hash.js +13 -0
- package/src/utils/time.js +22 -0
- package/templates/agents/optional/backend/api-designer.md +61 -0
- package/templates/agents/optional/backend/auth-auditor.md +63 -0
- package/templates/agents/optional/backend/database-analyst.md +61 -0
- package/templates/agents/optional/data/data-pipeline-reviewer.md +68 -0
- package/templates/agents/optional/data/ml-experiment-tracker.md +67 -0
- package/templates/agents/optional/data/prompt-engineer.md +75 -0
- package/templates/agents/optional/devops/ci-fixer.md +64 -0
- package/templates/agents/optional/devops/dependency-manager.md +55 -0
- package/templates/agents/optional/devops/deploy-validator.md +68 -0
- package/templates/agents/optional/devops/docker-helper.md +63 -0
- package/templates/agents/optional/docs/changelog-generator.md +69 -0
- package/templates/agents/optional/docs/doc-writer.md +60 -0
- package/templates/agents/optional/frontend/style-enforcer.md +47 -0
- package/templates/agents/optional/frontend/ui-reviewer.md +51 -0
- package/templates/agents/optional/quality/bug-fixer.md +54 -0
- package/templates/agents/optional/quality/performance-auditor.md +65 -0
- package/templates/agents/optional/quality/refactorer.md +61 -0
- package/templates/agents/optional/quality/security-reviewer.md +74 -0
- package/templates/agents/universal/build-validator.md +15 -0
- package/templates/agents/universal/code-simplifier.md +17 -0
- package/templates/agents/universal/plan-reviewer.md +20 -0
- package/templates/agents/universal/test-writer.md +17 -0
- package/templates/agents/universal/verify-app.md +16 -0
- package/templates/claude-md.md +40 -0
- package/templates/commands/commit-push-pr.md +9 -0
- package/templates/commands/compact-safe.md +8 -0
- package/templates/commands/end.md +9 -0
- package/templates/commands/review-plan.md +10 -0
- package/templates/commands/setup.md +112 -0
- package/templates/commands/start.md +3 -0
- package/templates/commands/status.md +6 -0
- package/templates/commands/techdebt.md +9 -0
- package/templates/commands/update-claude-md.md +9 -0
- package/templates/commands/verify.md +8 -0
- package/templates/mcp-json.json +3 -0
- package/templates/progress-md.md +21 -0
- package/templates/settings/base.json +64 -0
- package/templates/settings/docker.json +9 -0
- package/templates/settings/go.json +10 -0
- package/templates/settings/node.json +17 -0
- package/templates/settings/python.json +16 -0
- package/templates/settings/rust.json +11 -0
- package/templates/skills/templates/backend-conventions.md +57 -0
- package/templates/skills/templates/frontend-design-system.md +48 -0
- package/templates/skills/templates/project-patterns.md +48 -0
- package/templates/skills/universal/claude-md-maintenance.md +110 -0
- package/templates/skills/universal/context-management.md +71 -0
- package/templates/skills/universal/git-conventions.md +95 -0
- package/templates/skills/universal/planning-with-files.md +114 -0
- package/templates/skills/universal/prompt-engineering.md +97 -0
- package/templates/skills/universal/review-and-handoff.md +106 -0
- package/templates/skills/universal/subagent-usage.md +108 -0
- package/templates/skills/universal/testing.md +116 -0
- package/templates/skills/universal/verification.md +120 -0
- package/templates/spec-md-backend.md +85 -0
- package/templates/spec-md-cli.md +79 -0
- package/templates/spec-md-data.md +74 -0
- package/templates/spec-md-devops.md +87 -0
- package/templates/spec-md-frontend.md +81 -0
- package/templates/spec-md-fullstack.md +81 -0
- package/templates/spec-md-library.md +87 -0
- package/templates/spec-md.md +22 -0
- package/templates/workflow-meta.json +10 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sefa Ertunç
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# worclaude
|
|
2
|
+
|
|
3
|
+
A CLI tool that scaffolds a comprehensive Claude Code workflow into any project — derived from 53 tips by Boris Cherny, the creator of Claude Code at Anthropic.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/worclaude)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g worclaude
|
|
12
|
+
cd your-project
|
|
13
|
+
worclaude init
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
That's it. The `init` command walks you through project setup interactively.
|
|
17
|
+
|
|
18
|
+
## What It Does
|
|
19
|
+
|
|
20
|
+
Claude Code is powerful out of the box, but it gets dramatically better with structured guidance. `worclaude` installs a complete workflow system — agents, slash commands, skills, hooks, and configuration — that turns Claude Code into a disciplined engineering partner. It's the difference between a capable assistant and a well-organized team.
|
|
21
|
+
|
|
22
|
+
The workflow is based on [53 tips by Boris Cherny](https://www.howborisusesclaudecode.com/), the creator of Claude Code at Anthropic, distilled into a reusable scaffold that works with any tech stack.
|
|
23
|
+
|
|
24
|
+
## What Gets Installed
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
your-project/
|
|
28
|
+
├── CLAUDE.md # Project-specific guidance for Claude
|
|
29
|
+
├── .claude/
|
|
30
|
+
│ ├── settings.json # Permissions, hooks, sandbox config
|
|
31
|
+
│ ├── workflow-meta.json # Version tracking and file hashes
|
|
32
|
+
│ ├── agents/
|
|
33
|
+
│ │ ├── universal/ # 5 always-installed agents
|
|
34
|
+
│ │ └── optional/ # Selected agents by category
|
|
35
|
+
│ ├── commands/ # 10 slash commands
|
|
36
|
+
│ └── skills/
|
|
37
|
+
│ ├── universal/ # 9 knowledge files
|
|
38
|
+
│ └── templates/ # 3 project-specific placeholders
|
|
39
|
+
├── .mcp.json # MCP server configuration
|
|
40
|
+
└── docs/spec/
|
|
41
|
+
├── PROGRESS.md # Session-to-session tracking
|
|
42
|
+
└── SPEC.md # Project specification template
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- **CLAUDE.md** — Lean (<50 lines) project config that Claude reads every session. Points to skills for deeper guidance.
|
|
46
|
+
- **Agents** — Autonomous specialist workers that run in isolation (worktrees) for focused tasks.
|
|
47
|
+
- **Commands** — Slash commands (`/start`, `/end`, `/verify`, etc.) for common workflows.
|
|
48
|
+
- **Skills** — Knowledge files Claude loads on demand — testing philosophy, git conventions, context management, and more.
|
|
49
|
+
- **Settings** — Permissions, hooks, and sandbox configuration tuned for your tech stack.
|
|
50
|
+
|
|
51
|
+
## Commands
|
|
52
|
+
|
|
53
|
+
| Command | Purpose |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `worclaude init` | Set up workflow in a new or existing project |
|
|
56
|
+
| `worclaude upgrade` | Update workflow to latest version |
|
|
57
|
+
| `worclaude status` | Show current installation status |
|
|
58
|
+
| `worclaude backup` | Create a backup of Claude setup |
|
|
59
|
+
| `worclaude restore` | Restore from a backup |
|
|
60
|
+
| `worclaude diff` | Compare current setup vs installed version |
|
|
61
|
+
|
|
62
|
+
## Three Scenarios
|
|
63
|
+
|
|
64
|
+
`init` detects your project state and adapts:
|
|
65
|
+
|
|
66
|
+
### 1. Fresh project — full interactive scaffold
|
|
67
|
+
|
|
68
|
+
No existing `.claude/` directory or `CLAUDE.md`. You get the full setup flow: choose project type, tech stack, languages, and optional agents. Everything is scaffolded from scratch.
|
|
69
|
+
|
|
70
|
+
### 2. Existing project — smart merge
|
|
71
|
+
|
|
72
|
+
You already have a `CLAUDE.md` or `.claude/` directory. The tool creates a timestamped backup, then merges intelligently:
|
|
73
|
+
|
|
74
|
+
- **Missing files** (agents, commands, skills) are added directly
|
|
75
|
+
- **Conflicting files** are saved as `.workflow-ref.md` alongside yours
|
|
76
|
+
- **CLAUDE.md** is analyzed for missing sections — merge interactively or save suggestions to a separate file
|
|
77
|
+
- **Hooks and permissions** offer keep/replace/chain options for conflicts
|
|
78
|
+
|
|
79
|
+
### 3. Upgrade — update to latest version
|
|
80
|
+
|
|
81
|
+
You already have `workflow-meta.json` from a previous install. The tool compares file hashes to detect what changed, auto-updates unmodified files, and prompts for files you've customized.
|
|
82
|
+
|
|
83
|
+
## Agents
|
|
84
|
+
|
|
85
|
+
### Universal Agents (always installed)
|
|
86
|
+
|
|
87
|
+
| Agent | Purpose |
|
|
88
|
+
|---|---|
|
|
89
|
+
| plan-reviewer | Reviews plans for ambiguity, missing verification, and scope |
|
|
90
|
+
| code-simplifier | Finds duplication, simplifies complexity, ensures consistency |
|
|
91
|
+
| test-writer | Writes comprehensive unit, integration, and edge case tests |
|
|
92
|
+
| build-validator | Validates build, tests, linting, and type checking |
|
|
93
|
+
| verify-app | Tests actual running application behavior end-to-end |
|
|
94
|
+
|
|
95
|
+
### Optional Agent Catalog
|
|
96
|
+
|
|
97
|
+
During `init`, you choose from 18 optional agents across 6 categories. The tool pre-selects categories based on your project type:
|
|
98
|
+
|
|
99
|
+
| Project Type | Recommended Categories |
|
|
100
|
+
|---|---|
|
|
101
|
+
| Full-stack web | Frontend, Backend, Quality, Documentation |
|
|
102
|
+
| Backend / API | Backend, Quality |
|
|
103
|
+
| Frontend / UI | Frontend, Quality |
|
|
104
|
+
| CLI tool | Quality, Documentation |
|
|
105
|
+
| Data / ML / AI | Data/AI, Backend |
|
|
106
|
+
| Library / Package | Documentation, Quality |
|
|
107
|
+
| DevOps / Infrastructure | DevOps |
|
|
108
|
+
|
|
109
|
+
**Available categories:**
|
|
110
|
+
|
|
111
|
+
| Category | Agents |
|
|
112
|
+
|---|---|
|
|
113
|
+
| Frontend | ui-reviewer, style-enforcer |
|
|
114
|
+
| Backend | api-designer, database-analyst, auth-auditor |
|
|
115
|
+
| DevOps | dependency-manager, ci-fixer, docker-helper, deploy-validator |
|
|
116
|
+
| Quality | bug-fixer, security-reviewer, performance-auditor, refactorer |
|
|
117
|
+
| Documentation | doc-writer, changelog-generator |
|
|
118
|
+
| Data / AI | data-pipeline-reviewer, ml-experiment-tracker, prompt-engineer |
|
|
119
|
+
|
|
120
|
+
After selecting categories, you can fine-tune by adding or removing individual agents.
|
|
121
|
+
|
|
122
|
+
## Slash Commands
|
|
123
|
+
|
|
124
|
+
All 10 commands are installed in every project:
|
|
125
|
+
|
|
126
|
+
| Command | Purpose |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `/start` | Read PROGRESS.md, report current state and what's next |
|
|
129
|
+
| `/end` | Update PROGRESS.md with session work, blockers, next steps |
|
|
130
|
+
| `/commit-push-pr` | Stage, commit, push, and create PR with description |
|
|
131
|
+
| `/review-plan` | Send implementation plan to plan-reviewer agent |
|
|
132
|
+
| `/techdebt` | Scan for duplicated code, dead code, TODOs, complexity |
|
|
133
|
+
| `/verify` | Run full verification: tests, build, lint, type checks |
|
|
134
|
+
| `/compact-safe` | Compress context; PostCompact hook re-reads key files |
|
|
135
|
+
| `/status` | Report current task, branch, test status, context usage |
|
|
136
|
+
| `/update-claude-md` | Propose CLAUDE.md updates based on session learnings |
|
|
137
|
+
| `/setup` | **Post-install interview** — fills in all project-specific content |
|
|
138
|
+
|
|
139
|
+
`/setup` is the key post-install action. After running `worclaude init`, open Claude Code and run `/setup`. It interviews you about your project and fills in CLAUDE.md, skills, SPEC.md, and configuration files with real content.
|
|
140
|
+
|
|
141
|
+
## Skills
|
|
142
|
+
|
|
143
|
+
Skills are knowledge files that Claude loads on demand. They keep CLAUDE.md lean while providing deep guidance when needed.
|
|
144
|
+
|
|
145
|
+
### Universal Skills (9)
|
|
146
|
+
|
|
147
|
+
| Skill | What it teaches |
|
|
148
|
+
|---|---|
|
|
149
|
+
| context-management | Context budget, compaction timing, subagent offloading |
|
|
150
|
+
| git-conventions | Branch naming, commits, PR workflow, worktrees |
|
|
151
|
+
| planning-with-files | Implementation plan structure and review process |
|
|
152
|
+
| review-and-handoff | Session endings, handoff format, progress tracking |
|
|
153
|
+
| prompt-engineering | Effective prompting patterns for Claude |
|
|
154
|
+
| verification | Domain-specific verification beyond running tests |
|
|
155
|
+
| testing | Test philosophy, coverage strategy, test structure |
|
|
156
|
+
| claude-md-maintenance | Writing and maintaining rules in CLAUDE.md |
|
|
157
|
+
| subagent-usage | When and how to delegate work to subagents |
|
|
158
|
+
|
|
159
|
+
### Template Skills (3)
|
|
160
|
+
|
|
161
|
+
These are project-specific placeholders filled in by `/setup`:
|
|
162
|
+
|
|
163
|
+
- **backend-conventions** — Stack-specific backend patterns and conventions
|
|
164
|
+
- **frontend-design-system** — Design system, components, styling approach
|
|
165
|
+
- **project-patterns** — Architectural patterns specific to your codebase
|
|
166
|
+
|
|
167
|
+
## The Pipeline
|
|
168
|
+
|
|
169
|
+
The workflow follows a 6-stage pipeline for every significant task:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
Design → Review → Execute → Quality → Verify → PR
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
1. **Design** — Write an implementation plan in a plan file
|
|
176
|
+
2. **Review** — Send plan to `plan-reviewer` agent for critical review
|
|
177
|
+
3. **Execute** — Implement the plan, one step at a time
|
|
178
|
+
4. **Quality** — Run `code-simplifier`, `test-writer` agents
|
|
179
|
+
5. **Verify** — Run `build-validator`, `verify-app` agents, then `/verify`
|
|
180
|
+
6. **PR** — Use `/commit-push-pr` to stage, commit, push, and create a pull request
|
|
181
|
+
|
|
182
|
+
## Configuration
|
|
183
|
+
|
|
184
|
+
### Permissions
|
|
185
|
+
|
|
186
|
+
Settings include allow-lists for common tools, tuned per tech stack:
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"permissions": {
|
|
191
|
+
"allow": [
|
|
192
|
+
"Read(*)", "Glob(*)", "Grep(*)",
|
|
193
|
+
"Bash(git *)", "Bash(npm test)", "Bash(npx prettier *)"
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Hooks
|
|
200
|
+
|
|
201
|
+
Three universal hooks are installed:
|
|
202
|
+
|
|
203
|
+
1. **Format on write** — Auto-formats files after every Write/Edit (prettier, ruff, cargo fmt, gofmt — based on your stack)
|
|
204
|
+
2. **Notification on stop** — Desktop notification when Claude finishes a long task (Linux, macOS, Windows)
|
|
205
|
+
3. **PostCompact re-inject** — Automatically re-reads CLAUDE.md and PROGRESS.md after context compaction
|
|
206
|
+
|
|
207
|
+
### Sandbox
|
|
208
|
+
|
|
209
|
+
Default: `auto-allow` mode. Safety comes from structural isolation (worktrees, focused agents) rather than restrictive permissions.
|
|
210
|
+
|
|
211
|
+
### Effort & Output
|
|
212
|
+
|
|
213
|
+
- **Effort:** `high` by default, escalate to `max` per session for complex tasks
|
|
214
|
+
- **Output:** `concise` by default, switch to `explanatory` when exploring unfamiliar territory
|
|
215
|
+
|
|
216
|
+
## After Install — `/setup`
|
|
217
|
+
|
|
218
|
+
After running `worclaude init`, start Claude Code in your project and run:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
/setup
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
This launches an interactive interview that:
|
|
225
|
+
- Asks about your project's purpose, architecture, and conventions
|
|
226
|
+
- Fills in CLAUDE.md with real project context
|
|
227
|
+
- Populates SPEC.md with your actual tech stack and requirements
|
|
228
|
+
- Configures template skills with your specific patterns
|
|
229
|
+
- Sets up PROGRESS.md with your current state
|
|
230
|
+
|
|
231
|
+
This is the single most important step after installation. The scaffold provides structure; `/setup` fills it with your project's substance.
|
|
232
|
+
|
|
233
|
+
## Customization
|
|
234
|
+
|
|
235
|
+
### Adding custom agents
|
|
236
|
+
|
|
237
|
+
Create a `.md` file in `.claude/agents/` with a task description and instructions. Agents run autonomously — give them clear scope, success criteria, and verification steps.
|
|
238
|
+
|
|
239
|
+
### Adding custom commands
|
|
240
|
+
|
|
241
|
+
Create a `.md` file in `.claude/commands/`. Commands are invoked as `/command-name` in Claude Code. Keep them focused on a single workflow.
|
|
242
|
+
|
|
243
|
+
### Adding custom skills
|
|
244
|
+
|
|
245
|
+
Create a `.md` file in `.claude/skills/`. Skills are loaded on demand when Claude needs domain knowledge. Reference them from CLAUDE.md with `See .claude/skills/your-skill.md`.
|
|
246
|
+
|
|
247
|
+
### Settings
|
|
248
|
+
|
|
249
|
+
`settings.json` controls permissions, hooks, and sandbox. Edit directly or use `worclaude upgrade` to merge in new defaults while preserving your customizations.
|
|
250
|
+
|
|
251
|
+
### CLAUDE.md
|
|
252
|
+
|
|
253
|
+
CLAUDE.md grows naturally during development. Use `/update-claude-md` to propose additions based on patterns and gotchas discovered during sessions. Keep it under 50 lines — move detailed guidance to skills.
|
|
254
|
+
|
|
255
|
+
## Philosophy
|
|
256
|
+
|
|
257
|
+
Six principles guide the workflow design:
|
|
258
|
+
|
|
259
|
+
1. **Be a dispatcher, not an operator** — Use agents for focused tasks. The main session coordinates; specialists execute.
|
|
260
|
+
2. **Compounding improvement** — CLAUDE.md, skills, and PROGRESS.md accumulate project knowledge over time. Every session makes the next one better.
|
|
261
|
+
3. **Verification multiplies quality** — Tests alone aren't enough. Verify the running application, review plans before executing, validate builds after changes.
|
|
262
|
+
4. **Reduce friction, maintain safety** — Auto-allow sandbox, permissive tool access, auto-formatting. Safety comes from structure (worktrees, focused agents), not restrictions.
|
|
263
|
+
5. **Progressive disclosure** — CLAUDE.md is lean. Skills load on demand. Agents activate when needed. Complexity is available but not imposed.
|
|
264
|
+
6. **Plan before you build** — Write implementation plans in files. Review them with `plan-reviewer`. Execute step by step. This prevents wasted work and catches issues early.
|
|
265
|
+
|
|
266
|
+
## Why?
|
|
267
|
+
|
|
268
|
+
Boris Cherny published [53 tips for using Claude Code effectively](https://www.howborisusesclaudecode.com/). They cover everything from CLAUDE.md structure to agent design to session management. The tips are excellent — but implementing them manually in every project is tedious and error-prone.
|
|
269
|
+
|
|
270
|
+
`worclaude` packages all 53 tips into a single `init` command. You get the full workflow in seconds, customized for your tech stack, with upgrade support to pick up improvements over time.
|
|
271
|
+
|
|
272
|
+
## Credits
|
|
273
|
+
|
|
274
|
+
This project is derived from the [53 tips by Boris Cherny](https://www.howborisusesclaudecode.com/), the creator of Claude Code at Anthropic. The tips were analyzed, systematized, and packaged into a reusable CLI tool.
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
|
|
278
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "worclaude",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tool that scaffolds a comprehensive Claude Code workflow into any project",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"worclaude": "./src/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "src/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"src/",
|
|
12
|
+
"templates/",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/sefaertunc/Worclaude.git"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/sefaertunc/Worclaude#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/sefaertunc/Worclaude/issues"
|
|
23
|
+
},
|
|
24
|
+
"author": "Sefa Ertunç",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18.0.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test:watch": "vitest",
|
|
31
|
+
"test:coverage": "vitest run --coverage",
|
|
32
|
+
"lint": "eslint src/ tests/",
|
|
33
|
+
"format": "prettier --write .",
|
|
34
|
+
"prepublishOnly": "npm test && npm run lint"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"claude",
|
|
38
|
+
"claude-code",
|
|
39
|
+
"workflow",
|
|
40
|
+
"scaffolding",
|
|
41
|
+
"cli",
|
|
42
|
+
"developer-tools",
|
|
43
|
+
"productivity",
|
|
44
|
+
"ai",
|
|
45
|
+
"anthropic",
|
|
46
|
+
"agents",
|
|
47
|
+
"automation"
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"chalk": "^5.4.1",
|
|
52
|
+
"commander": "^13.1.0",
|
|
53
|
+
"fs-extra": "^11.3.0",
|
|
54
|
+
"inquirer": "^12.5.0",
|
|
55
|
+
"ora": "^8.2.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"eslint": "^9.22.0",
|
|
59
|
+
"prettier": "^3.5.3",
|
|
60
|
+
"vitest": "^3.0.9"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { createBackup } from '../core/backup.js';
|
|
4
|
+
import { fileExists, dirExists, listFiles } from '../utils/file.js';
|
|
5
|
+
import * as display from '../utils/display.js';
|
|
6
|
+
|
|
7
|
+
export async function backupCommand() {
|
|
8
|
+
const projectRoot = process.cwd();
|
|
9
|
+
|
|
10
|
+
const spinner = ora('Creating backup...').start();
|
|
11
|
+
let backupDir;
|
|
12
|
+
try {
|
|
13
|
+
backupDir = await createBackup(projectRoot);
|
|
14
|
+
spinner.succeed('Backup created!');
|
|
15
|
+
} catch (err) {
|
|
16
|
+
spinner.fail('Backup failed.');
|
|
17
|
+
display.error(err.message);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
display.newline();
|
|
22
|
+
display.success(`Backed up to ${path.basename(backupDir)}/`);
|
|
23
|
+
display.newline();
|
|
24
|
+
|
|
25
|
+
// Summarize contents
|
|
26
|
+
const contents = [];
|
|
27
|
+
|
|
28
|
+
if (await fileExists(path.join(backupDir, 'CLAUDE.md'))) {
|
|
29
|
+
contents.push('CLAUDE.md');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const claudeBackup = path.join(backupDir, '.claude');
|
|
33
|
+
if (await dirExists(claudeBackup)) {
|
|
34
|
+
const agents = await listFiles(path.join(claudeBackup, 'agents'));
|
|
35
|
+
const commands = await listFiles(path.join(claudeBackup, 'commands'));
|
|
36
|
+
const skills = await listFiles(path.join(claudeBackup, 'skills'));
|
|
37
|
+
const parts = [];
|
|
38
|
+
if (await fileExists(path.join(claudeBackup, 'settings.json'))) parts.push('settings.json');
|
|
39
|
+
if (agents.length > 0) parts.push(`${agents.length} agents`);
|
|
40
|
+
if (commands.length > 0) parts.push(`${commands.length} commands`);
|
|
41
|
+
if (skills.length > 0) parts.push(`${skills.length} skills`);
|
|
42
|
+
contents.push(`.claude/ (${parts.join(', ')})`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (await fileExists(path.join(backupDir, '.mcp.json'))) {
|
|
46
|
+
contents.push('.mcp.json');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (contents.length > 0) {
|
|
50
|
+
display.info('Contents:');
|
|
51
|
+
for (const item of contents) {
|
|
52
|
+
display.dim(` ${item}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { readWorkflowMeta, workflowMetaExists, getPackageVersion } from '../core/config.js';
|
|
2
|
+
import { categorizeFiles } from '../core/file-categorizer.js';
|
|
3
|
+
import * as display from '../utils/display.js';
|
|
4
|
+
|
|
5
|
+
export async function diffCommand() {
|
|
6
|
+
const projectRoot = process.cwd();
|
|
7
|
+
|
|
8
|
+
if (!(await workflowMetaExists(projectRoot))) {
|
|
9
|
+
display.info('Workflow is not installed. Run `worclaude init` to set up.');
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const meta = await readWorkflowMeta(projectRoot);
|
|
14
|
+
if (!meta) {
|
|
15
|
+
display.error('workflow-meta.json is corrupted. Run `worclaude init` to reinstall.');
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const categories = await categorizeFiles(projectRoot, meta);
|
|
20
|
+
|
|
21
|
+
display.header('Worclaude Diff');
|
|
22
|
+
display.newline();
|
|
23
|
+
display.dim(` Comparing current setup to workflow v${meta.version}:`);
|
|
24
|
+
display.newline();
|
|
25
|
+
|
|
26
|
+
let hasChanges = false;
|
|
27
|
+
|
|
28
|
+
if (categories.modified.length > 0) {
|
|
29
|
+
hasChanges = true;
|
|
30
|
+
display.info('Modified (your changes):');
|
|
31
|
+
for (const { key } of categories.modified) {
|
|
32
|
+
display.dim(` ~ .claude/${key}`);
|
|
33
|
+
}
|
|
34
|
+
display.newline();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (categories.deleted.length > 0) {
|
|
38
|
+
hasChanges = true;
|
|
39
|
+
display.info('Deleted (removed since install):');
|
|
40
|
+
for (const { key } of categories.deleted) {
|
|
41
|
+
display.dim(` - .claude/${key}`);
|
|
42
|
+
}
|
|
43
|
+
display.newline();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (categories.userAdded.length > 0) {
|
|
47
|
+
hasChanges = true;
|
|
48
|
+
display.info('Extra (you added):');
|
|
49
|
+
for (const { key } of categories.userAdded) {
|
|
50
|
+
display.dim(` + .claude/${key}`);
|
|
51
|
+
}
|
|
52
|
+
display.newline();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (categories.outdated.length > 0) {
|
|
56
|
+
hasChanges = true;
|
|
57
|
+
const cliVersion = await getPackageVersion();
|
|
58
|
+
display.info(`Outdated (newer version available in CLI v${cliVersion}):`);
|
|
59
|
+
for (const { key } of categories.outdated) {
|
|
60
|
+
display.dim(` ↑ .claude/${key}`);
|
|
61
|
+
}
|
|
62
|
+
display.newline();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
display.dim(` Unchanged: ${categories.unchanged.length} files`);
|
|
66
|
+
|
|
67
|
+
if (!hasChanges) {
|
|
68
|
+
display.newline();
|
|
69
|
+
display.success('No changes detected.');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (categories.outdated.length > 0) {
|
|
73
|
+
display.newline();
|
|
74
|
+
display.info('Run `worclaude upgrade` to update outdated files.');
|
|
75
|
+
}
|
|
76
|
+
}
|