slashdev 0.1.0 → 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.
Files changed (70) hide show
  1. package/.gitmodules +3 -0
  2. package/CLAUDE.md +87 -0
  3. package/README.md +158 -21
  4. package/bin/check-setup.js +27 -0
  5. package/claude-skills/agentswarm/SKILL.md +479 -0
  6. package/claude-skills/bug-diagnosis/SKILL.md +34 -0
  7. package/claude-skills/code-review/SKILL.md +26 -0
  8. package/claude-skills/frontend-design/LICENSE.txt +177 -0
  9. package/claude-skills/frontend-design/SKILL.md +42 -0
  10. package/claude-skills/pr-description/SKILL.md +35 -0
  11. package/claude-skills/scope-estimate/SKILL.md +37 -0
  12. package/hooks/post-response.sh +242 -0
  13. package/package.json +11 -3
  14. package/skills/front-end-design/prompts/system.md +37 -0
  15. package/skills/front-end-testing/prompts/system.md +66 -0
  16. package/skills/github-manager/prompts/system.md +79 -0
  17. package/skills/product-expert/prompts/system.md +52 -0
  18. package/skills/server-admin/prompts/system.md +39 -0
  19. package/src/auth/index.js +115 -0
  20. package/src/cli.js +188 -18
  21. package/src/commands/setup-internals.js +137 -0
  22. package/src/commands/setup.js +104 -0
  23. package/src/commands/update.js +60 -0
  24. package/src/connections/index.js +449 -0
  25. package/src/connections/providers/github.js +71 -0
  26. package/src/connections/providers/servers.js +175 -0
  27. package/src/connections/registry.js +21 -0
  28. package/src/core/claude.js +78 -0
  29. package/src/core/codebase.js +119 -0
  30. package/src/core/config.js +110 -0
  31. package/src/index.js +8 -1
  32. package/src/info.js +54 -21
  33. package/src/skills/index.js +252 -0
  34. package/src/utils/ssh-keys.js +67 -0
  35. package/vendor/gstack/.env.example +5 -0
  36. package/vendor/gstack/autoplan/SKILL.md +1116 -0
  37. package/vendor/gstack/browse/SKILL.md +538 -0
  38. package/vendor/gstack/canary/SKILL.md +587 -0
  39. package/vendor/gstack/careful/SKILL.md +59 -0
  40. package/vendor/gstack/codex/SKILL.md +862 -0
  41. package/vendor/gstack/connect-chrome/SKILL.md +549 -0
  42. package/vendor/gstack/cso/ACKNOWLEDGEMENTS.md +14 -0
  43. package/vendor/gstack/cso/SKILL.md +929 -0
  44. package/vendor/gstack/design-consultation/SKILL.md +962 -0
  45. package/vendor/gstack/design-review/SKILL.md +1314 -0
  46. package/vendor/gstack/design-shotgun/SKILL.md +730 -0
  47. package/vendor/gstack/document-release/SKILL.md +718 -0
  48. package/vendor/gstack/freeze/SKILL.md +82 -0
  49. package/vendor/gstack/gstack-upgrade/SKILL.md +232 -0
  50. package/vendor/gstack/guard/SKILL.md +82 -0
  51. package/vendor/gstack/investigate/SKILL.md +504 -0
  52. package/vendor/gstack/land-and-deploy/SKILL.md +1367 -0
  53. package/vendor/gstack/office-hours/SKILL.md +1317 -0
  54. package/vendor/gstack/plan-ceo-review/SKILL.md +1537 -0
  55. package/vendor/gstack/plan-design-review/SKILL.md +1227 -0
  56. package/vendor/gstack/plan-eng-review/SKILL.md +1120 -0
  57. package/vendor/gstack/qa/SKILL.md +1136 -0
  58. package/vendor/gstack/qa/references/issue-taxonomy.md +85 -0
  59. package/vendor/gstack/qa/templates/qa-report-template.md +126 -0
  60. package/vendor/gstack/qa-only/SKILL.md +726 -0
  61. package/vendor/gstack/retro/SKILL.md +1197 -0
  62. package/vendor/gstack/review/SKILL.md +1138 -0
  63. package/vendor/gstack/review/TODOS-format.md +62 -0
  64. package/vendor/gstack/review/checklist.md +220 -0
  65. package/vendor/gstack/review/design-checklist.md +132 -0
  66. package/vendor/gstack/review/greptile-triage.md +220 -0
  67. package/vendor/gstack/setup-browser-cookies/SKILL.md +348 -0
  68. package/vendor/gstack/setup-deploy/SKILL.md +528 -0
  69. package/vendor/gstack/ship/SKILL.md +1931 -0
  70. package/vendor/gstack/unfreeze/SKILL.md +40 -0
package/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "vendor/gstack"]
2
+ path = vendor/gstack
3
+ url = https://github.com/garrytan/gstack.git
package/CLAUDE.md ADDED
@@ -0,0 +1,87 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ Slashdev is a Node.js CLI tool that provides AI-powered "skills" (specialized agents) for developers. It uses the Anthropic Claude API to deliver expert assistance across domains like front-end design, product management, GitHub workflows, and testing.
8
+
9
+ - **Version:** 0.2.0 (early stage)
10
+ - **Runtime:** Node.js >= 18.0.0
11
+ - **Module system:** ES modules (`"type": "module"`)
12
+ - **Package manager:** npm
13
+ - **Claude Code integration:** Installs hooks + skills to `~/.claude/` via `slashdev setup`
14
+ - **Logging API:** `https://v1api.slashdev.io/api/logs` — prompt/response logs sent via post-response hook
15
+ - **Auth (Claude Code):** Email domain validation (`@slashdev.io`), no tokens
16
+
17
+ ## Commands
18
+
19
+ ```bash
20
+ npm start # Run CLI (node bin/slashdev.js)
21
+ npm test # Currently just runs the CLI (no test framework yet)
22
+ ```
23
+
24
+ No linter or formatter is configured.
25
+
26
+ ## Architecture
27
+
28
+ **Entry flow:** `bin/slashdev.js` → `src/cli.js` (commander setup) → individual command handlers
29
+
30
+ **Core modules (`src/core/`):**
31
+ - `config.js` — Two separate `conf` stores: `~/.slashdev/config.json` (settings) and `~/.slashdev/credentials.json` (API keys + connections)
32
+ - `claude.js` — Anthropic SDK wrapper with streaming/non-streaming chat. Default model: `claude-sonnet-4-20250514`, max tokens: 4096
33
+ - `codebase.js` — Project context detection (frameworks, file listing). Ignores: node_modules, .git, dist, build, .next, .nuxt, coverage, .cache
34
+
35
+ **Skill system (`src/skills/` + `skills/`):**
36
+ Skills are registered in `src/skills/index.js` as a SKILLS object mapping. Each skill has:
37
+ 1. A registry entry (name, description, commands, optional `requiredConnections`)
38
+ 2. A system prompt markdown file at `skills/<skill-name>/prompts/system.md`
39
+ 3. A CLI command registered in `src/cli.js`
40
+
41
+ The skill runner loads the system prompt, gathers project context via `codebase.js`, checks required connections, and streams Claude responses to stdout.
42
+
43
+ **Installed skills:** front-end-design, product-expert, github-manager (requires github connection), front-end-testing, server-admin (requires servers connection)
44
+
45
+ **Auth (`src/auth/`):** Interactive login with API key validation, stored separately in credentials config.
46
+
47
+ **Claude Code integration (`src/commands/` + `hooks/` + `claude-skills/`):**
48
+ - `src/commands/setup.js` — Prompts for `@slashdev.io` email, writes `~/.slashdev/config.json`, copies hooks to `~/.claude/hooks/`, copies skills to `~/.claude/skills/`, registers Stop hook in `~/.claude/settings.json`
49
+ - `src/commands/update.js` — Re-copies hooks/skills without re-prompting for email, updates packageVersion in config
50
+ - `src/commands/setup-internals.js` — Shared `installHooks()` and `installSkills()` used by both setup and update
51
+ - `hooks/post-response.sh` — Claude Code Stop hook that reads JSON from stdin, extracts session/prompt/response, POSTs to Slashdev logging API (fire-and-forget, async curl)
52
+ - `claude-skills/` — Claude Code skill files (SKILL.md with YAML frontmatter) copied to `~/.claude/skills/` during setup. Current skills: code-review, pr-description, scope-estimate, bug-diagnosis
53
+ - `bin/check-setup.js` — Postinstall script that prints setup reminder if `~/.slashdev/config.json` is missing
54
+
55
+ **Connections system (`src/connections/`):**
56
+ Registry-based system for external service integrations. Each provider (in `providers/`) defines `promptForCredentials()`, `validate()`, and `createClient()`. Connections are stored in `~/.slashdev/credentials.json` under a `connections` key. Skills can declare `requiredConnections` to enforce availability. Providers can set `multiple: true` to support multiple entries (e.g. servers stores an array, GitHub stores a single object). SSH key auto-detection is in `src/utils/ssh-keys.js`. To add a new provider: create a provider file in `providers/`, register it in `registry.js` — no other changes needed.
57
+
58
+ ## CLI Commands
59
+
60
+ ```bash
61
+ # Claude Code integration
62
+ slashdev setup # Install hooks + skills, configure email
63
+ slashdev update # Update hooks + skills to latest version
64
+
65
+ # Authentication & connections
66
+ slashdev login # Set API key
67
+ slashdev logout # Clear credentials
68
+ slashdev whoami # Show auth status
69
+ slashdev connect [service] # Connect an external service (e.g. github, servers)
70
+ slashdev disconnect [service] # Remove a connection
71
+ slashdev connections # List all connections and status
72
+
73
+ # Skills (standalone, uses Anthropic API directly)
74
+ slashdev skills # List installed skills
75
+ slashdev design <prompt> # Front-end design help
76
+ slashdev product <prompt> # Product management help
77
+ slashdev github <prompt> # GitHub workflow help (alias: gh)
78
+ slashdev test <prompt> # Testing assistance
79
+ slashdev server <prompt> # Server administration (alias: ssh)
80
+ ```
81
+
82
+ ## Conventions
83
+
84
+ - File names: camelCase (`codebase.js`)
85
+ - Skill/command names: kebab-case (`front-end-design`)
86
+ - Constants: UPPER_SNAKE_CASE (`BRAND_BLUE`, `IGNORE_DIRS`)
87
+ - Brand color: `#215ff6` (blue) — used throughout terminal output via chalk
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Slashdev CLI
2
2
 
3
- Skills & workflows for AI agents in the Slashdev ecosystem.
3
+ AI-powered skills and agent workflows for developers, built for Claude Code.
4
4
 
5
5
  ```
6
6
  _____ __ __ __
@@ -14,42 +14,179 @@ Skills & workflows for AI agents in the Slashdev ecosystem.
14
14
 
15
15
  ```bash
16
16
  npm install -g slashdev
17
+ slashdev setup
17
18
  ```
18
19
 
19
- ## Usage
20
+ `slashdev setup` prompts for your `@slashdev.io` email, then installs hooks and skills to `~/.claude/`. After setup, all skills are immediately available in Claude Code.
21
+
22
+ ## What You Get
23
+
24
+ ### Claude Code Skills
25
+
26
+ Installed to `~/.claude/skills/` and invoked directly in Claude Code:
27
+
28
+ | Skill | Command | Description |
29
+ |-------|---------|-------------|
30
+ | **Agentswarm** | `/agentswarm` | Launch a full agent team to analyze, plan, implement, and review a task. Adapts to any stack. |
31
+ | **Frontend Design** | `/frontend-design` | Distinctive, production-grade UI design. Avoids generic AI aesthetics. |
32
+ | **Code Review** | `/code-review` | Security, performance, and maintainability review. |
33
+ | **PR Description** | `/pr-description` | Generate structured pull request descriptions from diffs. |
34
+ | **Scope Estimate** | `/scope-estimate` | Estimate effort for development tasks. |
35
+ | **Bug Diagnosis** | `/bug-diagnosis` | Systematic root-cause analysis. |
36
+
37
+ ### gstack Skills
38
+
39
+ [gstack](https://github.com/garrytan/gstack) by Garry Tan is bundled as a vendored submodule. After setup, all 29 gstack skills are available in Claude Code.
40
+
41
+ #### Planning & Strategy
42
+
43
+ | Skill | Description |
44
+ |-------|-------------|
45
+ | `/plan-ceo-review` | CEO/founder-level plan review — rethinks the problem, finds the 10-star product, challenges premises with four scope modes |
46
+ | `/plan-eng-review` | Engineering manager plan review — locks in architecture, data flow, diagrams, and edge cases |
47
+ | `/plan-design-review` | Designer's eye plan review — rates design dimensions 0-10 and iteratively improves the plan |
48
+ | `/office-hours` | YC Office Hours mode — startup diagnostic or builder brainstorming with design doc output |
49
+ | `/autoplan` | Auto-review pipeline with auto-decisions; surfaces taste decisions at the final approval gate |
50
+
51
+ #### Design
52
+
53
+ | Skill | Description |
54
+ |-------|-------------|
55
+ | `/design-consultation` | Proposes a complete design system and generates font + color preview pages |
56
+ | `/design-review` | Designer's eye QA — finds visual inconsistency, spacing issues, and hierarchy problems, then fixes them |
57
+ | `/design-shotgun` | Design exploration — generates multiple AI design variants and iterates on structured feedback |
58
+
59
+ #### Building & Testing
60
+
61
+ | Skill | Description |
62
+ |-------|-------------|
63
+ | `/qa` | Systematically QA tests your web app and fixes bugs found — iterative fix-verify loop with health scores |
64
+ | `/qa-only` | Report-only QA testing — structured bug report without making code changes |
65
+ | `/review` | Pre-landing PR review — analyzes diff for SQL safety, LLM trust violations, and structural issues |
66
+ | `/investigate` | Systematic debugging with root cause investigation — four phases, no fixes without root cause |
67
+ | `/browse` | Fast headless browser — navigate URLs, interact with elements, verify state, take screenshots |
68
+ | `/benchmark` | Performance regression detection — establishes baselines and compares before/after on every PR |
69
+ | `/codex` | OpenAI Codex CLI wrapper with code review, challenge mode, and consult |
70
+
71
+ #### Shipping & Deployment
72
+
73
+ | Skill | Description |
74
+ |-------|-------------|
75
+ | `/ship` | Ship workflow — merge base branch, run tests, review diff, bump version, update changelog, create PR |
76
+ | `/land-and-deploy` | Merges PR, waits for CI/deploy, verifies production health via canary checks |
77
+ | `/canary` | Post-deploy monitoring — watches live app for console errors, performance regressions, and page failures |
78
+ | `/document-release` | Updates README, ARCHITECTURE, CONTRIBUTING, and CLAUDE.md to match what shipped |
79
+ | `/retro` | Weekly engineering retrospective — analyzes commit history, work patterns, and code quality |
80
+
81
+ #### Safety & Control
82
+
83
+ | Skill | Description |
84
+ |-------|-------------|
85
+ | `/careful` | Warns before destructive commands (rm -rf, DROP TABLE, force-push, git reset --hard) |
86
+ | `/cso` | Chief Security Officer mode — infrastructure-first security audit with secrets archaeology and OWASP Top 10 |
87
+ | `/freeze` | Restrict file edits to a specific directory for the session |
88
+ | `/unfreeze` | Clear the freeze boundary, allowing edits to all directories again |
89
+ | `/guard` | Full safety mode — combines destructive command warnings with directory-scoped edits |
90
+
91
+ #### Setup & Utilities
92
+
93
+ | Skill | Description |
94
+ |-------|-------------|
95
+ | `/connect-chrome` | Launch real Chrome controlled by gstack with Side Panel extension for real-time action watching |
96
+ | `/setup-browser-cookies` | Import cookies from your real browser into headless browse sessions |
97
+ | `/setup-deploy` | Configure deployment settings for land-and-deploy; detects platform and writes config |
98
+ | `/gstack-upgrade` | Upgrade gstack to latest version; detects global vs vendored install |
99
+
100
+ ### Standalone CLI Skills
101
+
102
+ These use the Anthropic API directly from your terminal (requires `slashdev login`):
20
103
 
21
104
  ```bash
22
- # Show banner and info
23
- slashdev
105
+ slashdev design "review my Button component"
106
+ slashdev product "write a PRD for user authentication"
107
+ slashdev github "create a PR description for the auth feature"
108
+ slashdev test "write unit tests for the UserService"
109
+ slashdev server "harden the SSH config"
110
+ ```
24
111
 
25
- # Display help
26
- slashdev --help
112
+ ## Agentswarm
113
+
114
+ The headline feature. `/agentswarm` in Claude Code launches a hierarchical team of specialized agents:
27
115
 
28
- # Show version
29
- slashdev --version
30
116
  ```
117
+ /agentswarm "Add user profiles with edit page"
31
118
 
32
- ## What is Slashdev?
119
+ Analyst → Scans codebase, detects stack (Laravel, React, Flutter, etc.)
120
+ Planner → Creates file-by-file implementation plan with test plan
121
+ Implementer(s) → Writes code AND tests (backend + frontend in parallel)
122
+ Reviewer → Code quality, security, performance review
123
+ QA Agent → Test quality audit + API request count audit
124
+ ```
33
125
 
34
- Slashdev is a collection of skills and workflows designed for AI agents. It provides:
126
+ **Key behaviors:**
127
+ - **Stack-agnostic** — Detects and adapts to Laravel, React, Flutter, Vue, Rails, Django, or any framework
128
+ - **Tests are mandatory** — Planner plans tests, Implementers write tests, QA Agent verifies test quality
129
+ - **API request audit** — QA Agent counts API calls per frontend page and flags pages making too many requests (a common performance mistake)
130
+ - **`/frontend-design` enforced** — Every frontend implementer invokes the design skill for distinctive UI
131
+ - **Reviewer + QA run in parallel** — Code quality and behavioral correctness checked simultaneously
35
132
 
36
- - **Agent Skills** — Reusable capabilities for AI agents
37
- - **Workflows** — Orchestrated sequences of agent actions
38
- - **MCP Integrations** — Connect with Model Context Protocol servers
39
- - **Team Tools** — Collaboration utilities for agent teams
133
+ ## Setup & Authentication
40
134
 
41
- ## Roadmap
135
+ ```bash
136
+ # Initial setup (installs hooks + skills to ~/.claude/)
137
+ slashdev setup
138
+
139
+ # Set your Anthropic API key (for standalone CLI skills)
140
+ slashdev login
141
+
142
+ # Connect external services
143
+ slashdev connect github # GitHub personal access token
144
+ slashdev connect servers # SSH server connections
145
+ ```
42
146
 
43
- - [x] v0.1.0 — Initial CLI with banner display
44
- - [ ] v0.2.0 — `slashdev init` for project scaffolding
45
- - [ ] v0.3.0 — Skill management commands
46
- - [ ] v0.4.0 Workflow definitions
47
- - [ ] v0.5.0 — MCP server integration
48
- - [ ] v1.0.0 — Stable API release
147
+ ## Updating
148
+
149
+ ```bash
150
+ # Update slashdev skills and hooks
151
+ slashdev update
152
+
153
+ # Update gstack to latest from upstream
154
+ cd /path/to/slashdev-cli
155
+ git submodule update --remote vendor/gstack
156
+ slashdev update
157
+ ```
158
+
159
+ ## All Commands
160
+
161
+ ```bash
162
+ # Setup & updates
163
+ slashdev setup # Install hooks + skills, configure email
164
+ slashdev update # Update hooks + skills to latest version
165
+
166
+ # Authentication
167
+ slashdev login # Set Anthropic API key
168
+ slashdev logout # Clear credentials
169
+ slashdev whoami # Show auth status
170
+
171
+ # Connections
172
+ slashdev connect [service] # Connect external service (github, servers)
173
+ slashdev disconnect [service] # Remove a connection
174
+ slashdev connections # List all connections
175
+
176
+ # Standalone skills
177
+ slashdev skills # List installed skills
178
+ slashdev design <prompt> # Front-end design
179
+ slashdev product <prompt> # Product management
180
+ slashdev github <prompt> # GitHub workflows (alias: gh)
181
+ slashdev test <prompt> # Testing assistance
182
+ slashdev server <prompt> # Server administration (alias: ssh)
183
+ ```
49
184
 
50
185
  ## Requirements
51
186
 
52
187
  - Node.js >= 18.0.0
188
+ - Claude Code (for Claude Code skills)
189
+ - Anthropic API key (for standalone CLI skills)
53
190
 
54
191
  ## License
55
192
 
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, readFileSync } from 'fs';
4
+ import { join } from 'path';
5
+ import { homedir } from 'os';
6
+
7
+ const configPath = join(homedir(), '.slashdev', 'config.json');
8
+
9
+ function hasEngineer(filePath) {
10
+ try {
11
+ const data = JSON.parse(readFileSync(filePath, 'utf-8'));
12
+ return !!data.engineer;
13
+ } catch {
14
+ return false;
15
+ }
16
+ }
17
+
18
+ if (!existsSync(configPath) || !hasEngineer(configPath)) {
19
+ console.log('');
20
+ console.log('\x1b[36m ┌──────────────────────────────────────────────────┐\x1b[0m');
21
+ console.log('\x1b[36m │ │\x1b[0m');
22
+ console.log('\x1b[36m │\x1b[0m Run \x1b[1mslashdev setup\x1b[0m to complete installation. \x1b[36m│\x1b[0m');
23
+ console.log('\x1b[36m │\x1b[0m This will install Claude Code hooks & skills. \x1b[36m│\x1b[0m');
24
+ console.log('\x1b[36m │ │\x1b[0m');
25
+ console.log('\x1b[36m └──────────────────────────────────────────────────┘\x1b[0m');
26
+ console.log('');
27
+ }