devflow-kit 0.3.3 → 0.5.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/CHANGELOG.md CHANGED
@@ -5,6 +5,135 @@ All notable changes to DevFlow will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.5.0] - 2025-10-24
9
+
10
+ ### Added
11
+
12
+ #### Installation Scope Support
13
+ - **Two-tier installation strategy** - Choose between user-wide and project-specific installation
14
+ - **User scope** (default): Install to `~/.claude/` for all projects
15
+ - **Local scope**: Install to `<git-root>/.claude/` for current project only
16
+ - Interactive prompt with clear descriptions when `--scope` flag not provided
17
+ - CLI flag: `devflow init --scope <user|local>`
18
+ - Automatic .gitignore updates for local scope (excludes `.claude/` and `.devflow/`)
19
+ - Perfect for team projects where DevFlow should be project-specific
20
+
21
+ #### Smart Uninstall with Scope Detection
22
+ - **Auto-detection of installed scopes** - Intelligently finds and removes DevFlow installations
23
+ - Automatically detects which scopes have DevFlow installed (user and/or local)
24
+ - Default behavior: Remove from all detected scopes
25
+ - Manual override: `--scope <user|local>` to target specific scope
26
+ - Clear feedback showing which scopes are being uninstalled
27
+ - Graceful handling when no installation found
28
+
29
+ ### Changed
30
+
31
+ #### Code Quality Improvements
32
+ - **Extracted shared utilities** - Eliminated code duplication between init and uninstall commands
33
+ - Created `src/cli/utils/paths.ts` for path resolution functions
34
+ - Created `src/cli/utils/git.ts` for git repository operations
35
+ - Reduced duplication by ~65 lines
36
+ - Single source of truth for path and git logic
37
+
38
+ #### Performance Optimizations
39
+ - **Eliminated redundant git detection** - Cache git root result for reuse
40
+ - Previously called `git rev-parse` twice during installation
41
+ - Now cached once and reused throughout installation process
42
+ - Faster installation, especially in large repositories
43
+
44
+ ### Fixed
45
+
46
+ #### CI/CD Compatibility
47
+ - **TTY detection for interactive prompts** - Prevents hanging in non-interactive environments
48
+ - Detects when running in CI/CD pipelines, Docker containers, or automated scripts
49
+ - Falls back to default scope (user) when no TTY available
50
+ - Clear messaging when non-interactive environment detected
51
+ - Explicit instructions for CI/CD usage: `devflow init --scope <user|local>`
52
+
53
+ #### Security Hardening
54
+ - **Environment variable path validation** - Prevents malicious path overrides
55
+ - Validates `CLAUDE_CODE_DIR` and `DEVFLOW_DIR` are absolute paths
56
+ - Warns when paths point outside user's home directory
57
+ - Prevents path traversal attacks via environment variables
58
+ - Security-first approach to custom path configuration
59
+
60
+ ### Documentation
61
+ - **Installation Scopes section** in README with clear use cases
62
+ - **Updated CLI commands table** with scope options for init and uninstall
63
+ - **Migration guide** for existing users (scope defaults to user for compatibility)
64
+ - **.gitignore patterns** documented for local scope installations
65
+
66
+ ---
67
+
68
+ ## [0.4.0] - 2025-10-21
69
+
70
+ ### Added
71
+
72
+ #### Skills Infrastructure
73
+ - **Auto-activating skills system** - Intelligent context-aware capabilities that activate when relevant
74
+ - Skills replace standalone commands with intelligent activation patterns
75
+ - 7 new skills: research, debug, devlog, test-generation, api-integration, data-migration, refactoring-assistant
76
+ - Skills displayed on devflow init with clear descriptions
77
+ - Installed to `~/.claude/skills/devflow/` directory
78
+ - Automatic activation based on conversation context
79
+
80
+ #### Smart Interactive Commands
81
+ - **/implement command** - Orchestrator for guided feature implementation
82
+ - Interactive workflow for planning, research, and execution
83
+ - Integrates with project-state agent for context gathering
84
+ - Guides through research, design, implementation, and testing phases
85
+ - Prevents blind coding by requiring user approval at each stage
86
+
87
+ #### Command→Agent→Skill Architecture
88
+ - **Dual-mode pattern** - Commands for explicit invocation, skills for auto-activation
89
+ - Commands: `/research`, `/debug` for explicit user requests
90
+ - Skills: Auto-activated versions when conversation context matches
91
+ - Clear separation of concerns and activation modes
92
+ - Documented pattern for extending DevFlow functionality
93
+
94
+ #### Enhanced /devlog Command
95
+ - **Orchestrator pattern** - Refactored to use project-state agent
96
+ - Delegates project analysis to specialized agent
97
+ - Cleaner separation of orchestration vs analysis logic
98
+ - More maintainable and extensible architecture
99
+ - Comprehensive session documentation with context gathering
100
+
101
+ ### Changed
102
+ - **Skills-first approach** - research and debug migrated to dual-mode (command + skill)
103
+ - Commands remain for explicit invocation
104
+ - Skills provide automatic activation based on context
105
+ - No loss of functionality, enhanced discoverability
106
+
107
+ ### Fixed
108
+ - **Security vulnerability** - Added input validation for execSync to prevent command injection
109
+ - Validates all user input before shell execution
110
+ - Proper escaping and sanitization
111
+ - Security hardening in CLI commands
112
+
113
+ - **Uninstall bug** - Fixed cleanup issue and refactored CLI to namespace pattern
114
+ - Proper cleanup of all installed assets
115
+ - Consistent namespace pattern across CLI
116
+ - Improved error handling and user feedback
117
+
118
+ ### Documentation
119
+ - **Comprehensive skills guide** - Added to README and CLAUDE.md
120
+ - Detailed explanation of skills infrastructure
121
+ - How to create new skills
122
+ - When to use skills vs commands
123
+ - Auto-activation patterns and best practices
124
+
125
+ - **Development guide updates** - Enhanced CLAUDE.md for contributors
126
+ - Skills development patterns
127
+ - Command→Agent→Skill architecture explanation
128
+ - Testing guidelines for dual-mode functionality
129
+
130
+ - **Documentation gap fixes** - Addressed critical gaps from code review
131
+ - Improved clarity and completeness
132
+ - Fixed missing examples and use cases
133
+ - Better organization and navigation
134
+
135
+ ---
136
+
8
137
  ## [0.3.3] - 2025-10-19
9
138
 
10
139
  ### Fixed
@@ -288,6 +417,8 @@ devflow init
288
417
 
289
418
  ---
290
419
 
420
+ [0.5.0]: https://github.com/dean0x/devflow/releases/tag/v0.5.0
421
+ [0.4.0]: https://github.com/dean0x/devflow/releases/tag/v0.4.0
291
422
  [0.3.3]: https://github.com/dean0x/devflow/releases/tag/v0.3.3
292
423
  [0.3.2]: https://github.com/dean0x/devflow/releases/tag/v0.3.2
293
424
  [0.3.1]: https://github.com/dean0x/devflow/releases/tag/v0.3.1
package/README.md CHANGED
@@ -9,19 +9,71 @@ A comprehensive collection of Claude Code commands and configurations designed t
9
9
  npx devflow-kit init
10
10
  ```
11
11
 
12
+ ### Installation Scopes
13
+
14
+ DevFlow supports two installation scopes:
15
+
16
+ **User Scope (Default)** - Install for all projects
17
+ ```bash
18
+ npx devflow-kit init --scope user
19
+ # Or interactively: npx devflow-kit init (prompts for scope)
20
+ ```
21
+ - Installs to `~/.claude/` and `~/.devflow/`
22
+ - Available across all projects
23
+ - Recommended for personal use
24
+
25
+ **Local Scope** - Install for current project only
26
+ ```bash
27
+ npx devflow-kit init --scope local
28
+ ```
29
+ - Installs to `<git-root>/.claude/` and `<git-root>/.devflow/`
30
+ - Only available in the current project
31
+ - Recommended for team projects where DevFlow should be project-specific
32
+ - Requires a git repository (run `git init` first)
33
+ - Add `.claude/` and `.devflow/` to `.gitignore` (done automatically)
34
+
12
35
  That's it! DevFlow is now installed and ready to use in Claude Code.
13
36
 
14
37
  ## What's Included
15
38
 
16
- ### 📊 Slash Commands
39
+ ### 🎯 Skills (Auto-Activate)
40
+
41
+ **Skills are model-invoked** - Claude automatically activates them based on context, enforcing quality without manual invocation.
42
+
43
+ | Skill | Purpose | Auto-Triggers When |
44
+ |-------|---------|---------------------|
45
+ | `pattern-check` | Architectural pattern validation (Result types, DI, immutability) | Code changes are made, new functions added |
46
+ | `test-design` | Test quality enforcement (setup complexity, mocking, behavior vs implementation) | Tests are written or modified |
47
+ | `code-smell` | Anti-pattern detection (fake solutions, unlabeled workarounds, magic values) | Features are implemented, code is reviewed |
48
+ | `research` | Pre-implementation planning, documentation study, integration strategy | Unfamiliar features requested, architectural decisions needed |
49
+ | `debug` | Systematic debugging with hypothesis testing and root cause analysis | Errors occur, tests fail, performance issues detected |
50
+ | `input-validation` | Boundary validation enforcement (parse-don't-validate, SQL injection prevention) | API endpoints created, external data handled |
51
+ | `error-handling` | Result type consistency and exception boundary enforcement | Error handling code written, functions that can fail |
52
+
53
+ **How Skills Work:**
54
+ - **Proactive enforcement** - Catch issues during implementation, not after
55
+ - **No manual invocation** - Model decides when skills are relevant
56
+ - **Quality gates** - Block anti-patterns automatically
57
+ - **Context-aware** - Activate based on what you're doing
58
+
59
+ **IMPORTANT**: Skills are **automatically activated** by Claude based on context. They cannot be manually invoked like slash commands.
60
+
61
+ **Dual-Mode Pattern**: The `research` and `debug` skills also exist as slash commands (`/research`, `/debug`) for manual control:
62
+ - **Skill mode** (auto): Activates when Claude detects unfamiliar features or errors
63
+ - **Command mode** (manual): Use `/research` or `/debug` when you want explicit control over the workflow
64
+
65
+ This gives you the best of both worlds: automatic assistance when needed, manual control when preferred.
66
+
67
+ ### 📊 Slash Commands (User-Invoked)
17
68
 
18
69
  | Command | Purpose | When to Use |
19
70
  |---------|---------|-------------|
20
71
  | `/catch-up` | Smart summaries for starting new sessions with status validation | Starting a session |
21
- | `/research [topic]` | Comprehensive pre-implementation research and planning | Before implementing features |
22
72
  | `/devlog` | Development log for comprehensive session documentation | Ending a session |
23
73
  | `/plan-next-steps` | Extract actionable next steps from current discussion | After planning discussion |
24
- | `/debug [issue]` | Systematic debugging with issue-specific investigation | When troubleshooting |
74
+ | `/implement` | Smart interactive implementation orchestrator with todo triage | After planning, ready to implement todos |
75
+ | `/debug` | Systematic debugging workflow with hypothesis testing | When errors occur, tests fail, or investigating issues |
76
+ | `/research` | Pre-implementation research and approach analysis | Before implementing unfamiliar features or integrations |
25
77
  | `/code-review` | Comprehensive code review using specialized sub-agents | Before committing or creating PR |
26
78
  | `/commit` | Intelligent atomic commit creation with safety checks | When ready to commit |
27
79
  | `/release` | Automated release workflow with version management and publishing | Creating a new release |
@@ -95,10 +147,10 @@ Covers patterns for all major languages and operating systems.
95
147
  3. Review recommended next actions
96
148
 
97
149
  ### During Development
98
- 1. `/research [topic]` - Research implementation approaches before coding
99
- 2. `/code-review` - Review changes before committing
100
- 3. `/commit` - Create intelligent atomic commits
101
- 4. Invoke audit sub-agents as needed
150
+ 1. **Skills auto-activate** - `research` skill triggers for unfamiliar features, `pattern-check` validates architecture
151
+ 2. **Code with confidence** - Skills catch anti-patterns and violations during implementation
152
+ 3. `/code-review` - Review changes before committing
153
+ 4. `/commit` - Create intelligent atomic commits
102
154
 
103
155
  ### Ending a Session
104
156
  1. `/devlog` - Document decisions and state
@@ -116,26 +168,39 @@ Covers patterns for all major languages and operating systems.
116
168
  3. Verify package in registry
117
169
 
118
170
  ### When Things Go Wrong
119
- 1. Check git log and recent commits
120
- 2. `/debug [issue description]` - Structured debugging
171
+ 1. **Skills auto-activate** - `debug` skill triggers on errors/failures with systematic approach
172
+ 2. Check git log and recent commits
121
173
  3. Revert changes using git
122
- 4. Document lessons learned
174
+ 4. Document lessons learned in `.docs/debug/`
123
175
 
124
176
  ## CLI Commands
125
177
 
126
178
  | Command | Purpose | Options |
127
179
  |---------|---------|---------|
128
- | `devflow init` | Initialize DevFlow for Claude Code | `--skip-docs` - Skip creating `.docs/` structure |
129
- | `devflow uninstall` | Remove DevFlow from Claude Code | `--keep-docs` - Keep `.docs/` directory |
180
+ | `devflow init` | Initialize DevFlow for Claude Code | `--scope <user\|local>` - Installation scope (user: user-wide, local: project-only)<br>`--skip-docs` - Skip creating `.docs/` structure |
181
+ | `devflow uninstall` | Remove DevFlow from Claude Code | `--scope <user\|local>` - Uninstall from specific scope only (default: auto-detect all)<br>`--keep-docs` - Keep `.docs/` directory |
130
182
 
131
183
  **What `devflow init` does:**
184
+
185
+ **User Scope** (default):
132
186
  - Installs commands to `~/.claude/commands/devflow/`
133
187
  - Installs sub-agents to `~/.claude/agents/devflow/`
188
+ - Installs skills to `~/.claude/skills/devflow/`
134
189
  - Installs scripts to `~/.devflow/scripts/`
135
190
  - Updates `~/.claude/settings.json` (statusline and model)
136
191
  - Creates `.claudeignore` at git repository root
137
192
  - Creates `.docs/` structure for project documentation
138
193
 
194
+ **Local Scope** (`--scope local`):
195
+ - Installs commands to `<git-root>/.claude/commands/devflow/`
196
+ - Installs sub-agents to `<git-root>/.claude/agents/devflow/`
197
+ - Installs skills to `<git-root>/.claude/skills/devflow/`
198
+ - Installs scripts to `<git-root>/.devflow/scripts/`
199
+ - Creates `<git-root>/.claude/settings.json` (statusline and model)
200
+ - Creates `.claudeignore` at git repository root
201
+ - Creates `.docs/` structure for project documentation
202
+ - Adds `.claude/` and `.devflow/` to `.gitignore`
203
+
139
204
  **First Run:**
140
205
  ```bash
141
206
  devflow init
@@ -161,11 +226,14 @@ git commit -m "Session status: completed user auth feature"
161
226
 
162
227
  ### Integration Examples
163
228
  ```bash
164
- /research "add JWT authentication" # Research before implementing
229
+ # Skills auto-activate during development
230
+ "Add JWT authentication" # research skill triggers automatically
231
+ "Fix this error" # debug skill activates and guides systematic approach
232
+
233
+ # Manual command invocation
165
234
  /code-review # Review changes (uncommitted or full branch)
166
235
  /commit # Create atomic commits
167
236
  /release # Automated release workflow
168
- /debug "TypeError in auth module" # Debug specific issue
169
237
  ```
170
238
 
171
239
  ## Philosophy
@@ -202,6 +270,7 @@ src/
202
270
  └── claude/ # Claude Code configuration
203
271
  ├── agents/devflow/ # Sub-agent definitions (.md)
204
272
  ├── commands/devflow/ # Slash command definitions (.md)
273
+ ├── skills/devflow/ # Auto-activate skill definitions (.md)
205
274
  ├── scripts/ # statusline.sh
206
275
  └── settings.json # Claude Code settings
207
276
  ```
@@ -210,7 +279,7 @@ src/
210
279
 
211
280
  - Check installed command documentation
212
281
  - Review `.docs/status/` for recent sessions
213
- - Use `/debug [issue]` for systematic troubleshooting
282
+ - Skills auto-activate for systematic troubleshooting
214
283
  - Report issues at https://github.com/dean0x/devflow/issues
215
284
 
216
285
  ## License
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+DpC,eAAO,MAAM,WAAW,SAidpB,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6BpC,eAAO,MAAM,WAAW,SA+fpB,CAAC"}