Skip to content

Commit 4465ab9

Browse files
committed
v1.12.0: Version pinning, security hardening, git worktrees, plugin docs, zsh default
1 parent 18c65be commit 4465ab9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1631
-1054
lines changed

.devcontainer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Explicitly ignored (safety net on top of root .* rule)
22
.review
33
.secrets
4+
.build-cache/
45

56
# Un-ignore dotfiles that should be tracked (overrides root .* pattern)
67
!.env.example

.devcontainer/CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
# CodeForge Devcontainer Changelog
22

3+
## [v1.12.0] - 2026-02-18
4+
5+
### Added
6+
7+
#### Plugin README Documentation
8+
- **9 new README files** for all marketplace plugins: auto-formatter, auto-linter, code-directive, codeforge-lsp, dangerous-command-blocker, notify-hook, protected-files-guard, ticket-workflow, workspace-scope-guard. Each documents purpose, hook lifecycle, protected patterns, and plugin structure
9+
10+
#### Protected Files Guard: Bash Hook
11+
- **`guard-protected-bash.py`** — new PreToolUse/Bash hook blocking bash commands that write to protected file paths (companion to existing Edit/Write guard). Covers `>`, `>>`, `tee`, `cp`, `mv`, `sed -i` targeting `.env`, lock files, `.git`, certificates, and credentials
12+
13+
#### Devcontainer Secrets Declaration
14+
- **`secrets` block** in devcontainer.json declaring `GH_TOKEN`, `NPM_TOKEN`, `GH_USERNAME`, `GH_EMAIL` with documentation URLs for VS Code Codespaces/devcontainer secret management
15+
16+
#### Post-Start Hook System
17+
- **`run_poststart_hooks()`** in setup.sh — runs executable `.sh` scripts from `/usr/local/devcontainer-poststart.d/`; controlled by `SETUP_POSTSTART` env flag (default: true)
18+
19+
#### Git Worktree Support
20+
- **System prompt `<git_worktrees>` section** — layout convention, creation commands, project detection, and safety rules
21+
- **CLAUDE.md documentation** — full worktree section with layout, creation, detection, and compatibility details
22+
- **setup-projects.sh**`.worktrees/` explicit scanning at depth 3, `.git` file detection via `gitdir:` check, `"worktree"` tag in Project Manager
23+
- **protected-files-guard**`.git` regex updated from `\.git/` to `\.git(/|$)` to cover worktree `.git` pointer files
24+
25+
#### Other
26+
- **`CLAUDECODE=null` env var** — unsets the detection flag in `remoteEnv` to allow nested Claude Code sessions (claude-in-claude)
27+
- **Go runtime option** — commented-out `ghcr.io/devcontainers/features/go:1` entry in devcontainer.json for easy opt-in
28+
29+
### Changed
30+
31+
#### Feature Version Pinning
32+
- All local features pinned from `"latest"` to explicit versions: agent-browser `0.11.1`, ast-grep `0.40.5`, biome `2.4.2`, ruff `0.15.1`, pyright `1.1.408`, typescript-language-server `5.1.3`, TypeScript `5.9.3`
33+
- External features pinned to minor versions: node `1.6`, github-cli `1.0`, docker-outside-of-docker `1.7`, uv `1.0`, rust `1.4`, claude-code `1.1`
34+
35+
#### Default Shell: bash → zsh
36+
- VS Code terminal default profile changed from bash to zsh
37+
- Explicit `zsh` profile added to terminal profile list
38+
- Claude Teams tmux profile shell changed from bash to zsh
39+
40+
#### Security Hardening
41+
- **dangerous-command-blocker** — 7 new blocked patterns: Docker container escape (`--privileged`, host root mount), destructive Docker ops (`stop/rm/kill/rmi`), bare force push (no branch specified), `find -exec rm`, `find -delete`, `git clean -f`, `rm -rf ../`. JSON parse failures now fail closed (exit 2 instead of 0)
42+
- **protected-files-guard** — JSON parse failures fail closed (exit 2 instead of 0)
43+
44+
#### Build & Setup
45+
- **ccms build cache** — install.sh checks `.build-cache/bin/ccms` before cargo building; caches binary after first build for faster rebuilds; pinned to commit `f90d259a4476`
46+
- **setup.sh**`setup-update-claude.sh` now runs in background (non-blocking container start); script failure output displayed for diagnostics; new `background` status indicator in summary
47+
- **inotify-tools moved to build time** — tmux feature installs inotify-tools via apt at build; setup-projects.sh no longer attempts runtime apt-get install
48+
- **Container memory** — recommended from 4GB/8GB to 6GB/12GB in troubleshooting docs
49+
50+
#### Writing System Prompt
51+
- New **Emotional Architecture** section — cognitive-emotional loop, controlled emotion principle, autism framing for POV characters
52+
- Expanded metaphor guidance — secondary sources beyond primary domain, "would he think this?" test
53+
- Refined show-don't-tell rules — naming emotion permitted when it adds weight, brief internal processing after major events required
54+
- Character profile additions — emotional architecture and trigger fields
55+
56+
#### Other
57+
- **connect-external-terminal.ps1** — tmux session directory respects `WORKSPACE_ROOT` env var with fallback
58+
- **setup-projects.sh** — inotifywait exclude pattern narrowed from `\.git/` to `\.git` for worktree compatibility
59+
- **README.md** — 5 new badges (changelog, last commit, npm downloads, Node.js, issues), updated tool/feature/skill counts, added Rust/Bun/ccw, changelog section
60+
- **CLAUDE.md** — expanded ccw description, fixed Bun registry reference, documented setup-auth.sh/check-setup.sh, added CLAUDECODE/env flags/experimental vars/git worktrees/rules system sections, skill count 17→28
61+
- **Documentation**`SETUP_TERMINAL`/`SETUP_POSTSTART` in configuration reference, `CLAUDECODE=null` env var, workspace-scope-guard in plugins.md
62+
- **Agent definitions** — minor path/prompt fixes across 8 agents (claude-guide, debug-logs, dependency-analyst, explorer, generalist, git-archaeologist, researcher, security-auditor)
63+
- **.gitignore** — added `.build-cache/` exclusion
64+
65+
### Removed
66+
67+
- **mcp-reasoner feature** — entire feature directory deleted (README, devcontainer-feature.json, install.sh, poststart-hook.sh)
68+
- **splitrail feature** — entire feature directory deleted (README, devcontainer-feature.json, install.sh)
69+
70+
---
71+
372
## [v1.11.0] - 2026-02-17
473

574
### Added

.devcontainer/CLAUDE.md

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ CodeForge devcontainer for AI-assisted development with Claude Code.
4949
| `claude` | Run Claude Code with auto-configuration (prefers native binary at `~/.local/bin/claude`) |
5050
| `cc` | Shorthand for `claude` with config |
5151
| `ccraw` | Vanilla Claude Code without any config (bypasses function override) |
52-
| `ccw` | Shorthand for `claude` with writing system prompt |
52+
| `ccw` | Claude Code with the writing system prompt — uses `writing-system-prompt.md` instead of `main-system-prompt.md`, optimized for creative and technical writing tasks |
5353
| `ccusage` | Analyze token usage history |
5454
| `ccburn` | Real-time token burn rate visualization |
5555
| `agent-browser` | Headless Chromium for browser automation (Playwright-based) |
@@ -113,7 +113,7 @@ ast-grep, biome, ccms, ccstatusline, claude-monitor, dprint, hadolint, lsp-serve
113113
`ghcr.io/devcontainers/features/node`, `ghcr.io/devcontainers/features/github-cli`, `ghcr.io/devcontainers/features/docker-outside-of-docker`, `ghcr.io/devcontainers/features/go` (all official Microsoft features)
114114

115115
**External features without `version: "none"` support:**
116-
`ghcr.io/devcontainers-extra/features/uv`, `ghcr.io/anthropics/devcontainer-features/claude-code`, `ghcr.io/nickmccurdy/bun`
116+
`ghcr.io/devcontainers-extra/features/uv`, `ghcr.io/anthropics/devcontainer-features/claude-code`, `ghcr.io/rails/devcontainer/features/bun`
117117

118118
**External features with `version: "none"` support (Rust):**
119119
`ghcr.io/devcontainers/features/rust` (official Microsoft feature)
@@ -139,6 +139,8 @@ Scripts in `./scripts/` run via `postStartCommand`:
139139
| `setup-update-claude.sh` | Installs native Claude Code binary on first run; background auto-updates on subsequent starts |
140140
| `setup-terminal.sh` | Configures VS Code Shift+Enter keybinding for Claude Code multi-line input |
141141
| `setup-projects.sh` | Auto-detects projects for VS Code Project Manager |
142+
| `setup-auth.sh` | Configures Git and NPM auth from `.secrets` file or environment variables |
143+
| `check-setup.sh` | Verifies CodeForge setup health (binary paths, config files, features) |
142144
| `setup-symlink-claude.sh` | Symlinks ~/.claude for third-party tool compatibility |
143145
144146
### External Terminal
@@ -148,6 +150,8 @@ Scripts in `./scripts/` run via `postStartCommand`:
148150
.devcontainer/connect-external-terminal.sh
149151
```
150152
153+
On Windows, use `connect-external-terminal.ps1` (PowerShell equivalent).
154+
151155
## Installed Plugins
152156

153157
Plugins are declared in `config/defaults/settings.json` under `enabledPlugins` and auto-activated on container start:
@@ -163,7 +167,7 @@ Plugins are declared in `config/defaults/settings.json` under `enabledPlugins` a
163167
- `protected-files-guard@devs-marketplace` — Blocks edits to secrets/lock files
164168
- `auto-formatter@devs-marketplace` — Batch-formats edited files at Stop (Ruff for Python, Biome for JS/TS/CSS/JSON/GraphQL/HTML; also supports shfmt, dprint, gofmt, rustfmt when installed)
165169
- `auto-linter@devs-marketplace` — Auto-lints edited files at Stop (Pyright + Ruff for Python, Biome for JS/TS/CSS/GraphQL; also supports ShellCheck, hadolint, go vet, clippy when installed)
166-
- `code-directive@devs-marketplace` — 17 custom agents, 17 skills, syntax validation, skill suggestions, agent redirect hook
170+
- `code-directive@devs-marketplace` — 17 custom agents, 28 skills, syntax validation, skill suggestions, agent redirect hook
167171
- `workspace-scope-guard@devs-marketplace` — Blocks writes and warns on reads outside the working directory
168172

169173
### Local Marketplace
@@ -223,6 +227,64 @@ Key environment variables set in the container:
223227
| `GH_CONFIG_DIR` | `/workspaces/.gh` |
224228
| `ANTHROPIC_MODEL` | `claude-opus-4-6` |
225229
| `TMPDIR` | `/workspaces/.tmp` |
230+
| `CLAUDECODE` | `null` (unset) |
231+
232+
Setting `"CLAUDECODE": null` in `remoteEnv` unsets this variable inside the container, which allows nested Claude Code sessions (claude-in-claude) that would otherwise be blocked by the outer session's detection flag.
233+
234+
All setup steps are controlled by boolean flags in `.devcontainer/.env`. Set any to `false` to disable:
235+
`SETUP_CONFIG`, `SETUP_ALIASES`, `SETUP_AUTH`, `SETUP_PLUGINS`, `SETUP_UPDATE_CLAUDE`, `SETUP_TERMINAL`, `SETUP_PROJECTS`, `SETUP_POSTSTART`.
236+
237+
### Experimental Environment Variables
238+
239+
These are set in `config/defaults/settings.json` under `env` and control Claude Code experimental features:
240+
241+
| Variable | Value | Description |
242+
|----------|-------|-------------|
243+
| `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` | `1` | Enables Agent Teams (multi-agent orchestration) |
244+
| `CLAUDE_CODE_EFFORT_LEVEL` | `high` | Sets reasoning effort level |
245+
| `CLAUDE_CODE_ENABLE_TASKS` | `true` | Enables the task/todo system |
246+
| `CLAUDE_CODE_PLAN_MODE_INTERVIEW_PHASE` | `true` | Enables interview phase before plan execution |
247+
| `CLAUDE_CODE_PLAN_V2_AGENT_COUNT` | `3` | Number of agents in Plan V2 orchestration |
248+
| `CLAUDE_CODE_PLAN_MODE_REQUIRED` | `true` | Forces plan mode for teammate agents |
249+
| `ENABLE_CLAUDE_CODE_SM_COMPACT` | `1` | Enables smart compaction for context management |
250+
| `CLAUDE_CODE_FORCE_GLOBAL_CACHE` | `1` | Forces global prompt caching |
251+
| `FORCE_AUTOUPDATE_PLUGINS` | `1` | Auto-updates plugins on every session start |
252+
253+
## Git Worktrees
254+
255+
CodeForge supports git worktrees for working on multiple branches simultaneously.
256+
257+
### Layout
258+
259+
Worktrees live in a `.worktrees/` directory alongside the main repo:
260+
261+
```
262+
/workspaces/projects/
263+
├── CodeForge/ # main repo (.git directory)
264+
└── .worktrees/ # worktree container
265+
├── feature-a/ # worktree checkout (.git file)
266+
└── bugfix-b/ # worktree checkout (.git file)
267+
```
268+
269+
### Creating Compatible Worktrees
270+
271+
```bash
272+
cd /workspaces/projects/CodeForge
273+
mkdir -p /workspaces/projects/.worktrees
274+
git worktree add /workspaces/projects/.worktrees/my-branch my-branch
275+
```
276+
277+
### Project Detection
278+
279+
- `setup-projects.sh` scans `.worktrees/` directories at depth 3 (inside container dirs like `projects/`)
280+
- Worktrees are detected by their `.git` file (containing `gitdir:`) and tagged with both `"git"` and `"worktree"` in Project Manager
281+
- Each worktree appears as an independent project in VS Code Project Manager
282+
283+
### Compatibility
284+
285+
- `workspace-scope-guard` resolves worktree paths correctly via `os.path.realpath()`
286+
- `protected-files-guard` protects both `.git/` directories and `.git` files (worktree pointers)
287+
- Read-only agents (e.g., git-archaeologist) can use `git worktree list` but cannot add/remove worktrees
226288

227289
## Modifying Behavior
228290

@@ -232,3 +294,11 @@ Key environment variables set in the container:
232294
4. **Add a custom config file**: Add an entry to `config/file-manifest.json` with `src`, `dest`, and optional `overwrite`/`destFilename`
233295
5. **Add features**: Add to `"features"` in `devcontainer.json`
234296
6. **Disable auto-setup**: Set variables to `false` in `.env`
297+
298+
## Rules System
299+
300+
Rules live in `config/defaults/rules/` and are copied to `.claude/rules/` by the file manifest (`config/file-manifest.json`) on every container start. Unlike CLAUDE.md (which loads on demand when entering a project), rules load automatically on every Claude Code session.
301+
302+
**Current rules**: `spec-workflow.md`, `workspace-scope.md`, `session-search.md`
303+
304+
**Adding custom rules**: Create a `.md` file in `config/defaults/rules/`, then add a manifest entry in `config/file-manifest.json` pointing to `${CLAUDE_CONFIG_DIR}/rules` as the destination. The rule will be deployed on the next container start.

.devcontainer/README.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ claude --resume # Resume previous session
144144
| Python 3.14 | Base language runtime |
145145
| Node.js LTS | JavaScript runtime |
146146
| TypeScript | Via Node.js |
147-
| Go | Latest stable via devcontainer feature |
147+
| Go | Optional — uncomment Go feature in `devcontainer.json` to enable |
148+
| Rust | Latest stable via devcontainer feature |
148149
| Bun | Fast JavaScript runtime and toolkit |
149150

150151
### Package Managers
@@ -203,7 +204,9 @@ Copy `.devcontainer/.env.example` to `.devcontainer/.env` and customize:
203204
| `SETUP_AUTH` | `true` | Configure Git/NPM auth from `.secrets` |
204205
| `SETUP_PLUGINS` | `true` | Install official plugins + register marketplace |
205206
| `SETUP_UPDATE_CLAUDE` | `true` | Auto-update Claude Code on container start |
207+
| `SETUP_TERMINAL` | `true` | Configure VS Code Shift+Enter keybinding for Claude Code terminal |
206208
| `SETUP_PROJECTS` | `true` | Auto-detect projects for VS Code Project Manager |
209+
| `SETUP_POSTSTART` | `true` | Run post-start hooks from `/usr/local/devcontainer-poststart.d/` |
207210
| `PLUGIN_BLACKLIST` | `""` | Comma-separated plugin names to skip |
208211

209212
### Claude Code Settings
@@ -247,7 +250,7 @@ The default system prompt is in `.devcontainer/config/defaults/main-system-promp
247250

248251
## Custom Features
249252

250-
CodeForge includes several custom devcontainer features:
253+
CodeForge includes custom devcontainer features. Any feature can be disabled by setting `"version": "none"` in `devcontainer.json` — the entry stays in place for easy re-enabling. Each feature's README documents its options and dependencies.
251254

252255
| Feature | Description |
253256
|---------|-------------|
@@ -261,9 +264,14 @@ CodeForge includes several custom devcontainer features:
261264
| `tree-sitter` | Parser with JS/TS/Python grammars |
262265
| `lsp-servers` | Pyright and TypeScript language servers |
263266
| `biome` | Fast JS/TS/JSON/CSS formatter (global install) |
267+
| `ruff` | Fast Python linter and formatter |
268+
| `shfmt` | Shell script formatter (disabled by default) |
269+
| `shellcheck` | Static analysis for shell scripts (disabled by default) |
270+
| `hadolint` | Dockerfile linter (disabled by default) |
271+
| `dprint` | Pluggable formatter for Markdown/YAML/TOML (disabled by default) |
272+
| `ccms` | Claude Code session history search |
264273
| `notify-hook` | Desktop notifications on Claude completion |
265274
| `mcp-qdrant` | Qdrant vector database MCP server (optional) |
266-
| `mcp-reasoner` | Enhanced AI reasoning MCP server (optional) |
267275

268276
## Safety Plugins
269277

@@ -273,9 +281,27 @@ CodeForge includes several custom devcontainer features:
273281
| `protected-files-guard` | Blocks modifications to .env, lock files, .git/, and credentials |
274282
| `workspace-scope-guard` | Enforces working directory scope — blocks writes and warns on reads outside the project |
275283

284+
### auto-code-quality (Not Active by Default)
285+
286+
A self-contained combined auto-formatter and auto-linter plugin available in the marketplace at `plugins/devs-marketplace/plugins/auto-code-quality/`. It bundles formatting and linting into a single plugin with a three-phase pipeline: collect edited files (PostToolUse), batch format (Stop), and batch lint (Stop). Supports the same languages as auto-formatter + auto-linter. **Do not enable alongside auto-formatter or auto-linter** — they overlap in functionality.
287+
288+
## Alias Management
289+
290+
Features create shell aliases during container build (e.g., `ccusage`, `ccburn`). Separately, `setup-aliases.sh` creates a managed block in `~/.bashrc` and `~/.zshrc` on every container start for `cc`, `claude`, `ccraw`, `ccw`, and `cc-tools`. Both coexist without conflict — feature aliases are installed at build time while setup aliases are refreshed at start time.
291+
292+
## Credential Management
293+
294+
Three methods for providing GitHub/NPM credentials, in order of precedence:
295+
296+
1. **Environment variables** — Set `GH_TOKEN`, `GH_USERNAME`, `GH_EMAIL`, `NPM_TOKEN` as environment variables (e.g., via Codespaces secrets or `localEnv` in `devcontainer.json`)
297+
2. **`.secrets` file** — Create `.devcontainer/.secrets` with token values (see template at `.secrets.example`). Auto-configured by `setup-auth.sh` on container start
298+
3. **Interactive login** — Run `gh auth login` for GitHub CLI, then set git identity manually
299+
300+
All methods persist across container rebuilds via the bind-mounted `/workspaces/.gh/` directory.
301+
276302
## Agents & Skills
277303

278-
The `code-directive` plugin includes specialized agent definitions and coding reference skills.
304+
The `code-directive` plugin includes 17 custom agent definitions and 28 coding reference skills.
279305

280306
### Custom Agents (17)
281307

@@ -301,11 +327,11 @@ Agent definitions in `plugins/devs-marketplace/plugins/code-directive/agents/` p
301327
| `statusline-config` | ccstatusline configuration |
302328
| `test-writer` | Test authoring with pass verification |
303329

304-
### Skills (17)
330+
### Skills (28)
305331

306332
Skills in `plugins/devs-marketplace/plugins/code-directive/skills/` provide domain-specific coding references:
307333

308-
`claude-agent-sdk` · `claude-code-headless` · `debugging` · `docker` · `docker-py` · `fastapi` · `git-forensics` · `performance-profiling` · `pydantic-ai` · `refactoring-patterns` · `security-checklist` · `skill-building` · `spec-refine` · `specification-writing` · `sqlite` · `svelte5` · `testing`
334+
`api-design` · `ast-grep-patterns` · `claude-agent-sdk` · `claude-code-headless` · `debugging` · `dependency-management` · `docker` · `docker-py` · `documentation-patterns` · `fastapi` · `git-forensics` · `migration-patterns` · `performance-profiling` · `pydantic-ai` · `refactoring-patterns` · `security-checklist` · `skill-building` · `spec-build` · `spec-check` · `spec-init` · `spec-new` · `spec-refine` · `spec-review` · `spec-update` · `specification-writing` · `sqlite` · `svelte5` · `testing`
309335

310336
## Specification Workflow
311337

@@ -400,7 +426,7 @@ Common issues and solutions. For detailed troubleshooting, see [docs/troubleshoo
400426
**CodeForge Documentation**:
401427
- [Configuration Reference](docs/configuration-reference.md) — all env vars and config options
402428
- [Plugin System](docs/plugins.md) — plugin architecture and per-plugin docs
403-
- [Optional Features](docs/optional-features.md) — mcp-qdrant, mcp-reasoner, splitrail
429+
- [Optional Features](docs/optional-features.md) — mcp-qdrant and other optional components
404430
- [Keybinding Customization](docs/keybindings.md) — resolving VS Code conflicts
405431
- [Troubleshooting](docs/troubleshooting.md) — common issues and solutions
406432

0 commit comments

Comments
 (0)