Skip to content
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Add `security-patterns` — PreToolUse on Edit/Write catches eval, XSS, shell injection, weak hashes, hardcoded secrets across JS/TS/Python/Go
- Add `audit-trail` — logs all Bash commands to `.devkit/audit.log` with UTC timestamps, auto-rotates at 10k lines
- Add `slop-detect` — PostToolUse on Edit/Write catches excessive docs, restating comments, JSDoc overuse
- Add `pr-gate` — prompts to run pr-ready pipeline before `gh pr create`, 10-minute cooldown

### Upgraded
- Upgrade `self:perf` to hypothesis-driven investigation — evidence gathering, ranked hypotheses, one-at-a-time testing with 3x benchmark runs
Expand All @@ -21,9 +22,12 @@
- Fix superpowers install: use `@claude-plugins-official`, not separate marketplace

### Skills
- Convert 6 commands to context-activated skills (no slash command needed): test-gen, doc-gen, changelog, onboard, research, scrape
- Add `dont-reinvent` skill — prefer existing solutions over custom code, reduce maintenance burden
- Add `gcli` skill — Google Workspace CLI reference with safety confirmation gate
- Remove 5 skills that overlap with superpowers: brainstorming, planning, writing-tests, skill-authoring, verify
- Keep 6 unique skills: executing, clean-code, dry, yagni, creating-workflows, stuck
- Evaluated `code-simplifier` as replacement — rejected (thin, React-specific, no test verification)
- Commands reduced from 26 to 20, skills increased from 6 to 14

### Fixes
- Fix stop-gate: disabled — fires every turn, not just session end. Needs architectural redesign.
Expand Down
120 changes: 79 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,22 @@ Devkit focuses on enforcement, orchestration, and multi-agent workflows. For a c
| **[commit-commands](https://github.com/anthropics/claude-plugins-official)** | Quick commits — auto-message `/commit`, one-shot `/commit-push-pr`, stale branch cleanup `/clean_gone` | `/plugin install commit-commands@claude-plugins-official` |
| **[hookify](https://github.com/anthropics/claude-plugins-official)** | Hook creation — markdown-based rules, hot reload, conversation analysis for auto-detection | `/plugin install hookify@claude-plugins-official` |
| **[skill-creator](https://github.com/anthropics/claude-plugins-official)** | Skill development — eval/benchmark framework, blind A/B comparison, iterative improvement | `/plugin install skill-creator@claude-plugins-official` |
| **[context-mode](https://github.com/mksglu/context-mode)** | Context window management — sandboxes large outputs, session continuity via SQLite, 98% savings | See repo for MCP server install |
| **[context-mode](https://github.com/mksglu/context-mode)** | Context window management — sandboxes large outputs, session continuity via SQLite, 98% savings | See below |

#### Context Mode Install

Plugin install (recommended — includes hooks + slash commands):
```bash
/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode
```

MCP-only install (lighter — sandbox tools only, no auto-routing):
```bash
claude mcp add context-mode -- npx -y context-mode
```

Verify with `/context-mode:ctx-doctor` (plugin install) or check MCP tools are available (MCP install).

**Why these and not others?** We evaluated every plugin in the official marketplace. These are the ones that add unique value without duplicating what devkit already does. Notably:

Expand All @@ -48,16 +63,18 @@ Devkit focuses on enforcement, orchestration, and multi-agent workflows. For a c
│ers: │ feature │ pr-ready │ self-improve/test/ │
│ brain- │ bugfix │ pr-moni- │ lint/perf/migrate │
│ storm │ refactor │ tor │ │
│ plan │ test-gen │ │ tri-review/debug/ │
│ TDD │ decompose│ commit- │ security/test-gen │
│ debug │ │ commands │ │
│ │feature- │ │ pr-review-toolkit │
│ │dev: │ │ │
│ │ explore │ │ audit │
│ │ design │ │ repo-map │
│ plan │ decompose│ │ tri-review/debug/ │
│ TDD │ │ commit- │ security/test-gen │
│ debug │feature- │ commands │ │
│ │dev: │ │ pr-review-toolkit │
│ │ explore │ │ │
│ │ design │ │ audit, repo-map │
├──────────┴──────────┴──────────┴─────────────────────┤
│ Auto skills: test-gen, doc-gen, changelog, onboard, │
│ research, scrape (no slash command needed) │
├──────────────────────────────────────────────────────┤
│ Always active: devkit hooks (safety, security, │
│ audit trail, slop detection, post-validation)
│ audit trail, slop detection, pr-gate, post-validate)
├──────────────────────────────────────────────────────┤
│ Meta: hookify (create hooks), skill-creator (skills) │
│ context-mode (token management) │
Expand All @@ -72,18 +89,17 @@ Devkit focuses on enforcement, orchestration, and multi-agent workflows. For a c
# Check what's available
/devkit:status

# Generate tests for your code
/devkit:test-gen src/parser.ts
# These activate automatically — just ask naturally:
# "write tests for src/parser.ts"
# "generate a changelog"
# "help me understand this codebase"
# "research the best auth library for Node"
# "scrape this URL: https://example.com"

# Fix all lint errors automatically
# Slash commands for complex workflows:
/self:lint --lint "npm run lint" --target src/

# Full PR preparation pipeline
/devkit:pr-ready

# Multi-agent code review (uses whatever CLIs you have)
/tri:review

```

---
Expand All @@ -94,20 +110,14 @@ Devkit focuses on enforcement, orchestration, and multi-agent workflows. For a c

| Command | Description |
|---|---|
| `/devkit:test-gen` | Generate test suite — writes tests, runs them, fixes failures |
| `/devkit:doc-gen` | Generate documentation from code analysis |
| `/devkit:pr-ready` | Full PR pipeline — lint, test, security, changelog, create PR |
| `/devkit:pr-monitor` | Post-PR review monitor — watches CI, resolves reviewer comments iteratively |
| `/devkit:repo-map` | AST-based symbol index — exports, classes, imports, dependency graph, cached |
| `/devkit:onboard` | Generate codebase onboarding guide for new contributors |
| `/devkit:changelog` | Generate structured changelog from git history |
| `/devkit:workflow` | Run user-defined YAML workflows from `workflows/` |
| `/devkit:bugfix` | Full bug fix lifecycle — reproduce, diagnose, fix, regression test, verify |
| `/devkit:feature` | Full feature lifecycle — brainstorm, plan, implement, test, lint, review |
| `/devkit:refactor` | Full refactor lifecycle — analyze, plan, restructure, verify, compare |
| `/devkit:research` | Deep research — clarify, parallel search, analyze sources, synthesize |
| `/devkit:decompose` | Goal decomposition — break into task DAG, assign agents, execute in dependency order |
| `/devkit:scrape` | URL-to-Markdown conversion via Jina Reader / Firecrawl / WebFetch |
| `/devkit:audit` | Full project health audit — deps, vulnerabilities, licenses, lint, security |
| `/devkit:status` | Health check — installed CLIs, available agents, ready commands |

Expand Down Expand Up @@ -152,24 +162,48 @@ These run with whatever agents are available. Claude always runs. Codex and Gemi

## Skills

Coding methodology guides loaded as reference material when relevant commands run.
Skills activate automatically based on context — no slash command needed. Just ask naturally.

### Context-Activated Workflows

These replace slash commands. Ask naturally and the skill fires:

| Skill | Triggers on |
|---|---|
| `devkit:test-gen` | "write tests for X", "add test coverage", "generate tests" |
| `devkit:doc-gen` | "document this module", "generate API docs", "write docs for" |
| `devkit:changelog` | "generate a changelog", "release notes", "what changed since" |
| `devkit:onboard` | "explain this codebase", "help me understand the architecture", "onboard" |
| `devkit:research` | "research X", "deep dive on", "compare approaches for" |
| `devkit:scrape` | "scrape this URL", "fetch content from", "extract from this page" |

### Coding Principles

Loaded as reference material when relevant:

| Skill | Description |
|---|---|
| `devkit:executing` | Execute plans methodically — understand, implement, verify, commit |
| `devkit:clean-code` | Meaningful names, small functions, single responsibility, flat nesting |
| `devkit:dry` | Rule of Three, when duplication is fine, extracting the right abstraction |
| `devkit:yagni` | Build only what's needed, no speculative features or premature abstractions |
| `devkit:creating-workflows` | How to create workflow YAML files — schema, step types, interpolation |
| `devkit:dont-reinvent` | Use existing libraries, tools, and stdlib before building custom solutions |
| `devkit:stuck` | Detect agent looping/failing, structured recovery — backtrack, simplify, escalate |

### Tools

| Skill | Description |
|---|---|
| `devkit:gcli` | Google Workspace CLI (Gmail, Calendar, Drive) via gcli with `--for-ai` |
| `devkit:creating-workflows` | How to create workflow YAML files — schema, step types, interpolation |

For brainstorming, planning, TDD, verification, and skill authoring — install [superpowers](https://github.com/obra/superpowers).

---

## Hooks

Devkit ships 7 hooks across 4 lifecycle events. All are installed automatically with the plugin — no setup required.
Devkit ships 8 hooks across 3 lifecycle events. All are installed automatically with the plugin — no setup required.

### PreToolUse

Expand All @@ -178,6 +212,7 @@ Devkit ships 7 hooks across 4 lifecycle events. All are installed automatically
| **safety-check** | Bash, Edit, Write | Blocks destructive commands (`rm -rf /`, `DROP TABLE`, private key writes). Prompts on risky operations (force push, `git reset --hard`, editing secrets). |
| **security-patterns** | Edit, Write | Catches vulnerability patterns at creation time — `eval()`, XSS, shell injection, weak hashes, hardcoded secrets. Language-aware (JS/TS/Python/Go). |
| **audit-trail** | Bash | Logs every command to `.devkit/audit.log` with UTC timestamps. Auto-rotates at 10k lines. |
| **pr-gate** | Bash | Detects `gh pr create` and prompts to run `/devkit:pr-ready` first. 10-minute cooldown. |
| **rtk-rewrite** | Bash | Rewrites commands through [RTK](https://github.com/rtk-ai/rtk) for 60-90% token savings. No-op if RTK not installed. |

### PostToolUse
Expand Down Expand Up @@ -253,24 +288,18 @@ devkit/
├── manifest.json # Plugin manifest
├── ROADMAP.md # Implemented features and future plans
├── PREFERENCES.md # Agent behavior guidelines
├── commands/ # 26 commands
├── commands/ # 20 slash commands
│ ├── tri-*.md # Multi-agent commands (5)
│ ├── self-*.md # Self-improvement loops (5)
│ ├── pr-ready.md # PR preparation pipeline
│ ├── pr-monitor.md # Post-PR review monitor
│ ├── repo-map.md # AST-based symbol index
│ ├── audit.md # Project health audit
│ ├── test-gen.md # Test generation
│ ├── doc-gen.md # Documentation generation
│ ├── onboard.md # Codebase onboarding
│ ├── changelog.md # Changelog generation
│ ├── workflow.md # YAML workflow runner
│ ├── feature.md # Feature lifecycle
│ ├── bugfix.md # Bug fix lifecycle
│ ├── refactor.md # Refactor lifecycle
│ ├── research.md # Deep research
│ ├── decompose.md # Goal decomposition
│ ├── scrape.md # URL-to-Markdown
│ └── status.md # Health check
├── agents/ # 6 agents
│ ├── reviewer.md # Opus, worktree isolation
Expand All @@ -279,21 +308,30 @@ devkit/
│ ├── test-writer.md # Sonnet, worktree isolation
│ ├── documenter.md # Haiku, worktree isolation
│ └── security-auditor.md # Opus, worktree isolation
├── skills/ # 6 skills
│ ├── executing.md
│ ├── clean-code.md
│ ├── dry.md
│ ├── yagni.md
│ ├── creating-workflows.md
│ └── stuck.md
├── hooks/ # 7 hooks
├── skills/ # 14 skills (6 context-activated workflows + 8 principles/tools)
│ ├── test-gen.md # Auto: "write tests for X"
│ ├── doc-gen.md # Auto: "document this module"
│ ├── changelog.md # Auto: "generate a changelog"
│ ├── onboard.md # Auto: "explain this codebase"
│ ├── research.md # Auto: "research X"
│ ├── scrape.md # Auto: "scrape this URL"
│ ├── executing.md # Principle: methodical execution
│ ├── clean-code.md # Principle: readability
│ ├── dry.md # Principle: don't repeat yourself
│ ├── yagni.md # Principle: no speculative features
│ ├── dont-reinvent.md # Principle: use existing solutions
│ ├── stuck.md # Principle: loop recovery
│ ├── gcli.md # Tool: Google Workspace CLI
│ └── creating-workflows.md # Tool: YAML workflow authoring
├── hooks/ # 8 hooks
│ ├── hooks.json # Hook config (auto-loaded)
│ ├── safety-check.sh # Dangerous operation blocker
│ ├── security-patterns.sh # Edit-time vulnerability detection
│ ├── audit-trail.sh # Command logging
│ ├── rtk-rewrite.sh # Token optimization
│ ├── post-validate.sh # Output validation
│ ├── slop-detect.sh # AI pattern detection
│ ├── pr-gate.sh # PR pipeline prompt
│ ├── subagent-stop.sh # Subagent work verification
│ └── stop-gate.sh # Quality gate (disabled — needs redesign)
├── workflows/ # 12 YAML workflow definitions
Expand Down
6 changes: 3 additions & 3 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## Implemented

- **26 commands** — Solo workflows, self-improvement loops, multi-agent dispatch, project health audit, post-PR monitoring, AST repo mapping
- **6 skills** — Execution methodology, clean code principles (DRY, YAGNI), workflow authoring, stuck recovery
- **20 slash commands** — Lifecycle workflows, self-improvement loops, multi-agent dispatch, project health audit, post-PR monitoring, AST repo mapping
- **14 skills** — 6 context-activated workflows (test-gen, doc-gen, changelog, onboard, research, scrape) + 6 coding principles (executing, clean-code, DRY, YAGNI, dont-reinvent, stuck) + 2 tools (gcli, creating-workflows)
- **6 agents** — Scoped tool access, worktree isolation, model assignment
- **7 hooks** — Safety (destructive command blocking, edit-time security patterns), observability (audit trail, slop detection, post-validation, subagent verification), optimization (RTK token compression)
- **8 hooks** — Safety (destructive command blocking, edit-time security patterns, PR gate), observability (audit trail, slop detection, post-validation, subagent verification), optimization (RTK token compression)
- **Graceful degradation** — tri:* commands work with 1-3 agents depending on installed CLIs
- **Goal decomposition** — Task DAG with dependency ordering and parallel execution
- **Concurrency limits** — Max 3 parallel agents in multi-agent commands
Expand Down
2 changes: 2 additions & 0 deletions commands/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ echo -n "codex: " && (command -v codex && codex --version 2>/dev/null || echo "n
echo -n "gemini: " && (command -v gemini && gemini --version 2>/dev/null || echo "not installed")
echo -n "gh: " && (command -v gh && gh --version 2>/dev/null | head -1 || echo "not installed")
echo -n "rtk: " && (command -v rtk && rtk --version 2>/dev/null || echo "not installed (optional — 60-90% token savings)")
echo -n "gcli: " && (command -v gcli >/dev/null 2>&1 && echo "installed" || echo "not installed (optional — Google Workspace: Gmail, Calendar, Drive)")
echo -n "sg: " && (command -v sg >/dev/null 2>&1 && (sg --version 2>/dev/null || echo "installed") || echo "not installed (optional — AST-based repo mapping)")
echo ""
echo "=== RTK Status ==="
if command -v rtk >/dev/null 2>&1; then
Expand Down
14 changes: 13 additions & 1 deletion commands/tri-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,25 @@ Input: {prompt}

### Codex — if available

**Plugin (preferred):**

```
/codex:rescue --effort high --background \
"{prompt} $(cat /tmp/tri-review-diff.txt)"
```

Retrieve result with `/codex:result` when done. Omit `--model` to use the account default.

**CLI fallback (only if plugin not installed):**

```bash
if [ "$HAS_CODEX_CLI" = "yes" ]; then
codex exec --full-auto "{prompt} $(cat /tmp/tri-review-diff.txt)" \
> /tmp/tri-review-codex.txt 2>/dev/null &
CODEX_PID=$!
fi
```

### Gemini — if available

**Plugin (preferred):**
Expand Down Expand Up @@ -135,7 +147,7 @@ Note: Gemini CLI defaults to the best available model. Don't hardcode a model na
| Agent | Method | Flags |
|---|---|---|
| Claude | Native background agent | `isolation: worktree`, `background: true` |
| Codex | Plugin (preferred) / CLI fallback | `/codex:rescue --background` or `codex -q` |
| Codex | Plugin (preferred) / CLI fallback | `/codex:rescue --background` or `codex exec --full-auto` |
| Gemini | Plugin (preferred) / CLI fallback | `/gemini:rescue --background` or `-y` |

## Step 5: Consolidate
Expand Down
11 changes: 11 additions & 0 deletions hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@
}
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/pr-gate.sh",
"statusMessage": "PR check...",
"timeout": 5
}
]
},
{
"matcher": "Edit|Write",
"hooks": [
Expand Down
39 changes: 39 additions & 0 deletions hooks/pr-gate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# devkit PR gate hook — prompts to run pr-ready pipeline before creating a PR
# Runs on PreToolUse for Bash tool
#
# Detects `gh pr create` commands and asks the user if they want to run
# the full pr-ready pipeline first.

INPUT=$(cat)
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')

# Only trigger on gh pr create
echo "$COMMAND" | grep -qE 'gh\s+pr\s+create' || exit 0

# Check if pr-ready already ran this session (cooldown file)
PR_GATE_FILE="/tmp/devkit-pr-gate-done"
if [ -f "$PR_GATE_FILE" ]; then
LAST=$(cat "$PR_GATE_FILE" 2>/dev/null)
NOW=$(date +%s 2>/dev/null)
if [ -n "$LAST" ] && [ -n "$NOW" ]; then
ELAPSED=$(( NOW - LAST )) 2>/dev/null || ELAPSED=0
if [ "$ELAPSED" -lt 600 ] 2>/dev/null; then
# Pipeline already ran recently, allow the PR creation
exit 0
fi
fi
fi

# Set cooldown so this only fires once
date +%s > "$PR_GATE_FILE" 2>/dev/null

# Ask the user
jq -n '{
hookSpecificOutput: {
hookEventName: "PreToolUse",
permissionDecision: "ask",
permissionDecisionReason: "PR creation detected — want to run /devkit:pr-ready first? (lint, test, security, DRY review, changelog). Say yes to run the pipeline, or approve to skip and create the PR directly."
}
}'
exit 0
Loading
Loading