|
1 | | -@AGENTS.md |
| 1 | +# .devcontainer |
| 2 | + |
| 3 | +The CodeForge devcontainer definition — features, plugins, scripts, config defaults, and AI documentation. |
| 4 | + |
| 5 | +Entry: `AGENTS.md` — authoritative reference for all AI assistants; covers config keys, commands, plugins, auth, and modification procedures. |
| 6 | + |
| 7 | +## Key Files |
| 8 | + |
| 9 | +- `devcontainer.json` — container definition: 34+ features, VSCode settings/extensions, port mappings, postStartCommand |
| 10 | +- `docker-compose.yml` — base Compose file: image, named volumes, resource limits |
| 11 | +- `scripts/setup.sh` — postStartCommand orchestrator; runs all setup-*.sh subscripts, reads flags from `.codeforge/container.json` |
| 12 | +- `scripts/generate-compose.mjs` — initializeCommand; discovers `.codeforge/secrets/` and generates `docker-compose.codeforge.yml` |
| 13 | +- `scripts/generate-settings-profiles.js` — generates `.generated/codeforge/claude/settings/settings*.json` from base.json + profiles |
| 14 | +- `defaults/codeforge/file-manifest.json` — controls which config files deploy to `~/.claude/` on container start; each entry has `id`, `src`, `dest`, `overwrite` (`if-changed`|`always`|`never`) |
| 15 | +- `CHANGELOG.md` — user-facing change history (required entry for every PR) |
| 16 | +- `AI-CONTEXT.md` — machine-readable environment facts for AI assistants (~700 token target) |
| 17 | + |
| 18 | +## Subdirectories |
| 19 | + |
| 20 | +- `features/` — 34 custom devcontainer features (see list below) |
| 21 | +- `plugins/devs-marketplace/` — single marketplace plugin bundle; contains 12 Claude Code plugins under `plugins/` |
| 22 | +- `scripts/` — setup-*.sh subscripts + generate-compose.mjs + generate-settings-profiles.js |
| 23 | +- `defaults/codeforge/` — packaged config defaults deployed on every container start |
| 24 | + - `claude/settings/` — `base.json` (shared settings) + `profiles/*.json` (model overlays) |
| 25 | + - `claude/system-prompts/` — `template.md` (Jinja2), `main.md`, `orchestrator.md`, `writing.md`, `claude-default.md`, `components/` (14 partials) |
| 26 | + - `claude/rules/` — behavioral rules deployed to `~/.claude/rules/` every start |
| 27 | + - `claude/router/` — LLM provider routing config |
| 28 | + - `claude/statusline/` — ccstatusline widget layout |
| 29 | + - `rtk/`, `codex/` — tool-specific configs |
| 30 | + |
| 31 | +## Features (custom, under features/) |
| 32 | + |
| 33 | +agent-browser, ast-grep, biome, ccburn, ccdiag, ccms, ccstatusline, ccusage, chromaterm, claude-code-karma, claude-code-native, claude-code-router, claude-mem, claude-monitor, claude-session-analyzer, codeforge-cli, codex-cli, dprint, hadolint, hermes-agent, kitty-terminfo, lamarck, lsp-servers, mcp-qdrant, notify-hook, oh-my-claude, rtk, ruff, sandcastle, shellcheck, shfmt, tmux, tree-sitter, zsh-completions |
| 34 | + |
| 35 | +## Plugins (under plugins/devs-marketplace/plugins/) |
| 36 | + |
| 37 | +Active: agent-system, auto-code-quality, dangerous-command-blocker, protected-files-guard, session-context, skill-engine, workspace-scope-guard, codeforge-lsp |
| 38 | +Archived/disabled: git-workflow, notify-hook, prompt-snippets, spec-workflow, ticket-workflow |
| 39 | + |
| 40 | +## System Prompt Architecture |
| 41 | + |
| 42 | +`defaults/codeforge/claude/system-prompts/` uses a Jinja2 template system: |
| 43 | +- `template.md` — master template with named blocks (`{% block identity %}`, etc.) and `{% include "components/…" %}` directives |
| 44 | +- `components/` — 14 partial files (identity, guardrails, task-approach, decision-authority, task-intake, code-quality, communication, platform, context-management, tools, subagent-routing, error-recovery, self-review, memory) |
| 45 | +- `main.md`, `orchestrator.md`, `writing.md` — rendered variants (deployed via file-manifest) |
| 46 | +- `claude-default.md` — fallback prompt for unmodified deployments |
| 47 | + |
| 48 | +## Conventions |
| 49 | + |
| 50 | +- Feature install order is explicit in `devcontainer.json` `overrideFeatureInstallOrder` — runtimes first, then Claude Code, then npm/uv-dependent tools |
| 51 | +- Disable a feature without removing it: set `"version": "none"` in its config block |
| 52 | +- `overwrite: "never"` entries in file-manifest are one-time seeds (user owns them after first deploy) |
| 53 | +- Plugin hook scripts are Python; tested directly via importlib in `container/tests/plugins/` |
| 54 | +- AGENTS.md is the source of truth for AI assistants; AI-CONTEXT.md is the machine-readable summary (~700 token hard ceiling) |
| 55 | +- `workspace-scope-guard` MUST NOT be disabled without explicit user instruction |
0 commit comments