Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
[
{
"src": "defaults/settings.json",
"src": "config/settings.json",
"dest": "${CLAUDE_CONFIG_DIR}",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/keybindings.json",
"src": "config/keybindings.json",
"dest": "${CLAUDE_CONFIG_DIR}",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/main-system-prompt.md",
"src": "config/main-system-prompt.md",
"dest": "${CLAUDE_CONFIG_DIR}",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/rules/spec-workflow.md",
"src": "config/rules/spec-workflow.md",
"dest": "${CLAUDE_CONFIG_DIR}/rules",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/rules/workspace-scope.md",
"src": "config/rules/workspace-scope.md",
"dest": "${CLAUDE_CONFIG_DIR}/rules",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/rules/session-search.md",
"src": "config/rules/session-search.md",
"dest": "${CLAUDE_CONFIG_DIR}/rules",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/writing-system-prompt.md",
"src": "config/writing-system-prompt.md",
"dest": "${CLAUDE_CONFIG_DIR}",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/orchestrator-system-prompt.md",
"src": "config/orchestrator-system-prompt.md",
"dest": "${CLAUDE_CONFIG_DIR}",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/ccstatusline-settings.json",
"src": "config/ccstatusline-settings.json",
"dest": "${HOME}/.config/ccstatusline",
"destFilename": "settings.json",
"enabled": true,
"overwrite": "if-changed"
},
{
"src": "defaults/ccstatusline-settings.json",
"src": "config/ccstatusline-settings.json",
"dest": "/usr/local/share/ccstatusline",
"destFilename": "settings.template.json",
"enabled": true,
Expand Down
5 changes: 3 additions & 2 deletions .devcontainer/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

# Paths (defaults shown — uncomment to override)
# CLAUDE_CONFIG_DIR=$HOME/.claude
# CONFIG_SOURCE_DIR=/custom/path/to/config
# CODEFORGE_DIR=/workspaces/.codeforge
# CONFIG_SOURCE_DIR is deprecated — use CODEFORGE_DIR instead

# Setup: copy config files to CLAUDE_CONFIG_DIR (per config/file-manifest.json)
# Setup: copy config files to CLAUDE_CONFIG_DIR (per .codeforge/file-manifest.json)
SETUP_CONFIG=true

# Setup: add cc/claude/ccraw aliases to shell rc files
Expand Down
30 changes: 30 additions & 0 deletions .devcontainer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
- **`agent-system/README.md`** — updated `verify-no-regression.py` comment to list both consumers (implementer, refactorer); hyphenated "question-surfacing protocol"
- **`orchestrator-system-prompt.md`** — clarified plan mode allows investigator delegation for research; added catch-all entry in selection criteria pointing to the full specialist catalog
- **MD040 compliance** — added `text` language specifiers to 7 fenced code blocks across `investigator.md`, `tester.md`, and `documenter.md`
- **`setup.js` path traversal** — `configApply()` now validates that source paths resolve within `.codeforge/` and destination paths resolve within allowed directories (`CLAUDE_CONFIG_DIR`, `HOME`, `/usr/local/`), preventing directory traversal via `../` in manifest entries
- **`setup.sh` CODEFORGE_DIR** — deprecation guard now uses default-assignment semantics (`:=`) instead of unconditional overwrite, preserving any user-defined `CODEFORGE_DIR` from `.env`
- **Docs site URLs** — replaced `anexileddev.github.io/CodeForge/` with custom domain `codeforge.core-directive.com/` across README.md, CLAUDE.md, and .devcontainer/README.md
- **Architecture docs** — added `.checksums/` and `.markers/` directories to the `.codeforge/` tree in architecture.md
- **Troubleshooting docs** — renamed "Reset to Defaults" to "How to Reset" and clarified that `--reset` preserves `.codeforge/` user modifications; added step for restoring default config sources

### Changed

Expand Down Expand Up @@ -197,6 +202,31 @@
#### VS Code Extensions
- **Todo+** (`fabiospampinato.vscode-todo-plus`) — removed from devcontainer extensions

## [v2.0.0] - 2026-02-26

### Added

#### .codeforge/ User Customization Directory
- New `.codeforge/` directory centralizes all user-customizable configuration files
- Checksum-based modification detection preserves user changes during updates
- `codeforge config apply` CLI command deploys config files to `~/.claude/` (same as container start)
- Auto-migration from `.devcontainer/config/defaults/` to `.codeforge/config/` for existing users
- `.codeforge/.codeforge-preserve` for listing additional files to preserve during updates

### Changed

#### Configuration
- Config files moved from `.devcontainer/config/defaults/` to `.codeforge/config/`
- File manifest moved from `.devcontainer/config/file-manifest.json` to `.codeforge/file-manifest.json`
- Terminal connection scripts moved from `.devcontainer/` to `.codeforge/scripts/`
- `CONFIG_SOURCE_DIR` env var deprecated in favor of `CODEFORGE_DIR`
- `--force` updates now use checksum comparison for `.codeforge/` files (writes `.default` instead of `.codeforge-new`)
- `--reset` preserves `.codeforge/` user modifications (only `.devcontainer/` is wiped)

#### Migration
- v2 migration marker moved to `.codeforge/.markers/v2-migrated`
- Container start auto-migrates `.devcontainer/config/defaults/` to `.codeforge/config/` if needed

## [v1.14.2] - 2026-02-24

### Added
Expand Down
55 changes: 31 additions & 24 deletions .devcontainer/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,39 @@ CodeForge devcontainer for AI-assisted development with Claude Code.
.devcontainer/
├── devcontainer.json # Container definition
├── .env # Setup flags (SETUP_CONFIG, SETUP_ALIASES, etc.)
├── config/
│ ├── file-manifest.json # Declarative config file deployment
│ └── defaults/ # Source files deployed on start via file-manifest
│ ├── settings.json # Model, permissions, plugins, env vars
│ ├── keybindings.json # Keyboard shortcuts
│ ├── main-system-prompt.md
│ ├── orchestrator-system-prompt.md
│ ├── writing-system-prompt.md
│ ├── ccstatusline-settings.json # Status bar widget layout
│ └── rules/ # Deployed to .claude/rules/
├── features/ # Custom devcontainer features
├── plugins/devs-marketplace/ # Local plugin marketplace
└── scripts/ # Setup scripts (run via postStartCommand)

.codeforge/
├── file-manifest.json # Declarative config file deployment
├── config/ # Source files deployed on start via file-manifest
│ ├── settings.json # Model, permissions, plugins, env vars
│ ├── keybindings.json # Keyboard shortcuts
│ ├── main-system-prompt.md
│ ├── orchestrator-system-prompt.md
│ ├── writing-system-prompt.md
│ ├── ccstatusline-settings.json # Status bar widget layout
│ └── rules/ # Deployed to .claude/rules/
├── scripts/ # Terminal connection scripts
│ ├── connect-external-terminal.sh
│ └── connect-external-terminal.ps1
└── .codeforge-preserve # Lists additional files to preserve during updates
```

## Key Configuration

| File | Purpose |
|------|---------|
| `config/defaults/settings.json` | Model, tokens, permissions, plugins, env vars |
| `config/defaults/main-system-prompt.md` | System prompt defining assistant behavior |
| `config/defaults/orchestrator-system-prompt.md` | Orchestrator mode prompt (delegation-first) |
| `config/defaults/ccstatusline-settings.json` | Status bar widget layout (deployed to ~/.config/ccstatusline/) |
| `config/file-manifest.json` | Controls which config files deploy and when |
| `.codeforge/config/settings.json` | Model, tokens, permissions, plugins, env vars |
| `.codeforge/config/main-system-prompt.md` | System prompt defining assistant behavior |
| `.codeforge/config/orchestrator-system-prompt.md` | Orchestrator mode prompt (delegation-first) |
| `.codeforge/config/ccstatusline-settings.json` | Status bar widget layout (deployed to ~/.config/ccstatusline/) |
| `.codeforge/file-manifest.json` | Controls which config files deploy and when |
| `devcontainer.json` | Container definition: image, features, mounts |
| `.env` | Boolean flags controlling setup steps |

Config files deploy via `file-manifest.json` on every container start. Most deploy to `~/.claude/`; ccstatusline config deploys to `~/.config/ccstatusline/`. Each entry supports `overwrite`: `"if-changed"` (default, sha256), `"always"`, or `"never"`. Supported variables: `${CLAUDE_CONFIG_DIR}`, `${WORKSPACE_ROOT}`, `${HOME}`.
Config files deploy via `.codeforge/file-manifest.json` on every container start. Most deploy to `~/.claude/`; ccstatusline config deploys to `~/.config/ccstatusline/`. Each entry supports `overwrite`: `"if-changed"` (default, sha256), `"always"`, or `"never"`. Supported variables: `${CLAUDE_CONFIG_DIR}`, `${WORKSPACE_ROOT}`, `${HOME}`.

## Worktrees

Expand Down Expand Up @@ -70,6 +75,8 @@ git worktree add /workspaces/projects/.worktrees/<branch-name> -b <branch>
| Command | Purpose |
|---------|---------|
| `cc` / `claude` | Run Claude Code with auto-configuration |
| `codeforge config apply` | Deploy config files to `~/.claude/` (same as container start) |
| `codeforge` | CLI for CodeForge management commands |
| `ccraw` | Vanilla Claude Code (bypasses config) |
| `ccw` | Claude Code with writing system prompt |
| `cc-orc` | Claude Code in orchestrator mode (delegation-first) |
Expand Down Expand Up @@ -102,11 +109,11 @@ Declared in `settings.json` under `enabledPlugins`, auto-activated on start:

## Rules System

Rules in `config/defaults/rules/` deploy to `.claude/rules/` on every container start. They load into ALL sessions automatically.
Rules in `.codeforge/config/rules/` deploy to `.claude/rules/` on every container start. They load into ALL sessions automatically.

**Current rules:** `spec-workflow.md`, `workspace-scope.md`, `session-search.md`

**Adding rules:** Create `.md` in `config/defaults/rules/`, add a manifest entry in `file-manifest.json`.
**Adding rules:** Create `.md` in `.codeforge/config/rules/`, add a manifest entry in `.codeforge/file-manifest.json`.

## Environment

Expand All @@ -129,17 +136,17 @@ The `~/.claude/` directory is backed by a Docker named volume (`codeforge-claude

## Modifying Behavior

1. **Change model**: Edit `config/defaults/settings.json` → `"model"` field
2. **Change system prompt**: Edit `config/defaults/main-system-prompt.md`
3. **Add config file**: Add entry to `config/file-manifest.json`
1. **Change model**: Edit `.codeforge/config/settings.json` → `"model"` field
2. **Change system prompt**: Edit `.codeforge/config/main-system-prompt.md`
3. **Add config file**: Place in `.codeforge/config/`, add entry to `.codeforge/file-manifest.json`
4. **Add features**: Add to `"features"` in `devcontainer.json`
5. **Disable features**: Set `"version": "none"` in the feature's config
6. **Disable setup steps**: Set flags to `false` in `.env`
7. **Customize status bar**: Edit `config/defaults/ccstatusline-settings.json` (see below)
7. **Customize status bar**: Edit `.codeforge/config/ccstatusline-settings.json` (see below)

## Status Bar Widgets

The status bar is configured in `config/defaults/ccstatusline-settings.json` (deploys to `~/.config/ccstatusline/settings.json`). Each widget is a JSON object in a line array.
The status bar is configured in `.codeforge/config/ccstatusline-settings.json` (deploys to `~/.config/ccstatusline/settings.json`). Each widget is a JSON object in a line array.

### Widget Properties

Expand Down Expand Up @@ -194,4 +201,4 @@ Three mechanisms handle port access depending on your client:

VS Code auto-detects all ports opened inside the container (configured via `portsAttributes` in `devcontainer.json`). Outside VS Code, `dbr` provides dynamic port discovery via a reverse connection model (container→host). The container daemon auto-starts and is inert without the host daemon (`dbr host-daemon`). Both mechanisms coexist. See [devcontainer-bridge](https://github.com/bradleybeddoes/devcontainer-bridge).

For full setup instructions, see the [Port Forwarding reference](https://anexileddev.github.io/CodeForge/reference/port-forwarding/) in the docs.
For full setup instructions, see the [Port Forwarding reference](https://codeforge.core-directive.com/reference/port-forwarding/) in the docs.
26 changes: 13 additions & 13 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ GitHub CLI credentials are automatically persisted across container rebuilds. Th

### The `cc` Command

The `cc` command is an alias that launches Claude Code with the project's system prompt and plan-mode permissions. For Agent Teams split-pane support, use the **"Claude Teams (tmux)"** terminal profile in VS Code (dropdown next to the `+` button) or connect via `connect-external-terminal.sh`.
The `cc` command is an alias that launches Claude Code with the project's system prompt and plan-mode permissions. For Agent Teams split-pane support, use the **"Claude Teams (tmux)"** terminal profile in VS Code (dropdown next to the `+` button) or connect via `.codeforge/scripts/connect-external-terminal.sh`.

```bash
cc # Start Claude Code in current directory
Expand Down Expand Up @@ -225,7 +225,7 @@ Copy `.devcontainer/.env.example` to `.devcontainer/.env` and customize:

### Claude Code Settings

Default settings are in `.devcontainer/config/defaults/settings.json`. File copying is controlled by `config/file-manifest.json`, which specifies per-file overwrite behavior (`"if-changed"`, `"always"`, or `"never"`).
Default settings are in `.codeforge/config/settings.json`. File copying is controlled by `.codeforge/file-manifest.json`, which specifies per-file overwrite behavior (`"if-changed"`, `"always"`, or `"never"`).

To add a custom config file, append an entry to `file-manifest.json`:
```json
Expand All @@ -243,7 +243,7 @@ Key defaults:

### Keybindings

Default keybindings are in `.devcontainer/config/defaults/keybindings.json` (empty by default — Claude Code defaults apply). Customize by adding entries to the `bindings` array.
Default keybindings are in `.codeforge/config/keybindings.json` (empty by default — Claude Code defaults apply). Customize by adding entries to the `bindings` array.

**VS Code Terminal Passthrough**: `Ctrl+P` and `Ctrl+F` are configured to pass through to the terminal (via `terminal.integrated.commandsToSkipShell`) so Claude Code receives them. Other VS Code shortcuts that conflict with Claude Code:

Expand All @@ -260,7 +260,7 @@ For conflicting shortcuts, use Meta (Alt) variants or add custom keybindings.

### System Prompt

The default system prompt is in `.devcontainer/config/defaults/main-system-prompt.md`. Override it by creating a `.claude/main-system-prompt.md` in your project directory.
The default system prompt is in `.codeforge/config/main-system-prompt.md`. Override it by creating a `.claude/main-system-prompt.md` in your project directory.

## Custom Features

Expand Down Expand Up @@ -426,32 +426,32 @@ The `setup-projects.sh` script auto-detects projects under `/workspaces/` and ma

- **Authentication required**: Run `claude` once to authenticate before using `cc`
- **Plan mode default**: The container starts in "plan" mode, which prompts for approval before making changes
- **Config is managed by manifest**: `config/file-manifest.json` controls which files are copied and when — default `overwrite: "if-changed"` uses sha256 comparison. Persistent changes go in `.devcontainer/config/defaults/settings.json`
- **Config is managed by manifest**: `.codeforge/file-manifest.json` controls which files are copied and when — default `overwrite: "if-changed"` uses sha256 comparison. Persistent changes go in `.codeforge/config/settings.json`
- **GitHub auth persists**: Run `gh auth login` once or configure `.secrets`; credentials survive container rebuilds
- **Agent Teams needs tmux**: Split panes only work inside tmux. Use the "Claude Teams (tmux)" VS Code terminal profile or `connect-external-terminal.sh` from WezTerm/iTerm2
- **Agent Teams needs tmux**: Split panes only work inside tmux. Use the "Claude Teams (tmux)" VS Code terminal profile or `.codeforge/scripts/connect-external-terminal.sh` from WezTerm/iTerm2

## Troubleshooting

Common issues and solutions. For detailed troubleshooting, see [docs/troubleshooting.md](docs/troubleshooting.md).
Common issues and solutions. For detailed troubleshooting, see the [Troubleshooting](https://codeforge.core-directive.com/reference/troubleshooting/) page on the docs site.

| Problem | Solution |
|---------|----------|
| `cc: command not found` | Run `source ~/.bashrc` or open a new terminal |
| `claude` fails during startup | Background update may be in progress — wait 10s and retry |
| GitHub push fails | Run `gh auth status` to check authentication |
| Plugin not loading | Check `enabledPlugins` in `config/defaults/settings.json` |
| Plugin not loading | Check `enabledPlugins` in `.codeforge/config/settings.json` |
| Feature not installed | Check `devcontainer.json` for `"version": "none"` |
| Tool version/status | Run `cc-tools` to list all tools with version info |
| Full health check | Run `check-setup` to verify setup status |

## Further Reading

**CodeForge Documentation**:
- [Configuration Reference](docs/configuration-reference.md) — all env vars and config options
- [Plugin System](docs/plugins.md) — plugin architecture and per-plugin docs
- [Optional Features](docs/optional-features.md) — mcp-qdrant and other optional components, disabling features
- [Keybinding Customization](docs/keybindings.md) — resolving VS Code conflicts
- [Troubleshooting](docs/troubleshooting.md) — common issues and solutions
- [Configuration Reference](https://codeforge.core-directive.com/customization/configuration/) — all env vars and config options
- [Plugin System](https://codeforge.core-directive.com/plugins/) — plugin architecture and per-plugin docs
- [Optional Features](https://codeforge.core-directive.com/customization/optional-features/) — mcp-qdrant and other optional components, disabling features
- [Keybinding Customization](https://codeforge.core-directive.com/customization/keybindings/) — resolving VS Code conflicts
- [Troubleshooting](https://codeforge.core-directive.com/reference/troubleshooting/) — common issues and solutions

**External**:
- [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code)
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/features/ccstatusline/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ else
fi

# Widget config is managed by file-manifest.json (deployed by setup-config.sh)
# Source: .devcontainer/config/defaults/ccstatusline-settings.json
# Source: .codeforge/config/ccstatusline-settings.json
# Deployed to: ~/.config/ccstatusline/settings.json (if-changed)
# Template: /usr/local/share/ccstatusline/settings.template.json (always)
echo "[ccstatusline] Widget config managed by file-manifest.json"
Expand Down Expand Up @@ -237,7 +237,7 @@ echo " ccstatusline Installation Complete"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Configuration:"
echo " • Source: .devcontainer/config/defaults/ccstatusline-settings.json"
echo " • Source: .codeforge/config/ccstatusline-settings.json"
echo " • Deployed to: ~/.config/ccstatusline/settings.json (by file-manifest)"
echo " • Template: /usr/local/share/ccstatusline/settings.template.json"
echo " • User: ${USERNAME}"
Expand All @@ -249,7 +249,7 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━
echo ""
echo "1. Widget config is deployed automatically on container start"
echo ""
echo "2. To customize: edit .devcontainer/config/defaults/ccstatusline-settings.json"
echo "2. To customize: edit .codeforge/config/ccstatusline-settings.json"
echo " Changes deploy on next container start (if-changed)"
echo ""
echo "3. Test manually:"
Expand Down
Loading