Skip to content

Commit 4e320ed

Browse files
authored
Refine system prompts — personality, communication protocols, agent routing (#38)
* Refine system prompts — add personality, communication protocols, compress main prompt Main system prompt redesigned from 672 to 462 lines: added personality section with communication style and AuDHD-aware patterns, compressed specification management and code standards, removed browser automation and git worktrees (moved to loadable skills), added mandatory context-passing protocol for subagent spawning, absorbed assumption_surfacing and professional_objectivity into core sections. All 21 agent prompts now have communication protocols — read-only agents get "Handling Uncertainty" (flag assumptions, continue working), write-capable agents get "Question Surfacing Protocol" (BLOCKED + return for ambiguity). Architect agent gains anti-fluff enforcement and team orchestration planning. Generalist rewritten as explicit last-resort fallback. Bash guard hooks added to researcher, debug-logs, and perf-profiler agents. * Resolve review items, merge agents, improve routing, strengthen plans Address all 10 CodeRabbit review items plus 3 nitpicks: - Fix communication protocol contradictions across 8 agent files (aligned "ask the user" instructions with Handling Uncertainty / Question Surfacing Protocol sections) - Add `text` language identifier to fenced code block in main prompt - Soften architect anti-fluff rule to allow evidence-based rationale in alternatives analysis (was: ban ALL justification) - Merge duplicate ### Changed sections in CHANGELOG under [Unreleased] - Clarify spec-writer BLOCKED section and fix hyphenation Additional changes from approved plan (sessions 2-3): - Main prompt: add delegation-only orchestrator, git workflow discipline, dynamic team sizing, remove artificial teammate caps - Architect: complexity scaling, 20+ banned fluff patterns, edit ordering, rollback strategy, schema detection, 3 new examples - Merge tester→test-writer (absorb 120s timeout, delete tester.md) - Merge doc-writer→documenter (absorb README/API/docstring patterns, add worktree isolation, delete doc-writer.md) - Narrow investigator to cross-domain investigations only - Improve descriptions on 8 agents for routing accuracy - Fix stale doc-writer/tester references across 6 files * Address second-round review items - security-auditor: soften dependency boundary from "use X instead" to "prefer X" — agent still has A06 dependency tooling for surface-level checks, which doesn't conflict with a preference statement - dependency-analyst: add Ruby/Gem ecosystem to description (agent already supports Gemfile scanning) - documenter: add `bash` language identifier to fenced code block - generalist: refine Question Surfacing Protocol to distinguish correctness-affecting ambiguity (STOP) from minor ambiguity (proceed with documented assumption) * Address third-round review items - documenter: distinguish blocking ambiguity (scope, audience, approval) from non-blocking ambiguity (unclear code → TODO: verify), resolving contradiction between MUST-stop protocol and continue-with-TODO rule - documenter: clarify that hand-written usage examples are encouraged while verbatim source reproduction is forbidden - security-auditor: explicitly state basic dependency scanning is included in comprehensive audits, improving routing clarity --------- Co-authored-by: AnExiledDev <AnExiledDev@users.noreply.github.com>
1 parent 5612bc4 commit 4e320ed

File tree

28 files changed

+909
-1268
lines changed

28 files changed

+909
-1268
lines changed

.codeforge/config/main-system-prompt.md

Lines changed: 188 additions & 448 deletions
Large diffs are not rendered by default.

.devcontainer/CHANGELOG.md

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,60 @@
2222
- Updated Bun feature to install latest version (was pinned to outdated 1.3.9)
2323
- Added npm cache cleanup to 6 features: agent-browser, ast-grep, biome, claude-session-dashboard, lsp-servers, tree-sitter (saves ~96 MB runtime disk)
2424

25+
#### System Prompts
26+
- **Main system prompt redesigned** — reorganized from 672 to 462 lines with new section order prioritizing personality, core directives, and response guidelines at the top
27+
- **Added personality section** — defines communication style (casual-professional, direct, terse), humor rules, honesty approach, AuDHD-aware patterns, and good/bad response examples; replaces the empty `<identity>` tag
28+
- **Compressed specification management** — reduced from 98 to 28 lines; full template and enforcement workflow moved to loadable skills
29+
- **Compressed code standards** — removed textbook principle recitations (SOLID, DRY/KISS/YAGNI by name); kept only concrete actionable rules
30+
- **Removed browser automation section** — moved to loadable skill (relevant in <10% of sessions)
31+
- **Removed git worktrees section** — moved to loadable skill; EnterWorktree and `--worktree` flag documented in CLAUDE.md
32+
- **Added context-passing protocol** to orchestration — mandatory instructions for including gathered context, file paths, and constraints when spawning subagents
33+
- **Absorbed `<assumption_surfacing>` into `<core_directives>`** — key rules preserved, wrapper removed
34+
- **Absorbed `<professional_objectivity>` into `<personality>`** — technical accuracy stance woven into personality definition
35+
- **Deduplicated team composition examples** — consolidated into orchestration section only
36+
- **Consolidated "no filler" instructions** — previously stated three different ways across three sections
37+
38+
#### Agent System
39+
- **All 21 agents now have communication protocols** — read-only agents get "Handling Uncertainty" (make best judgment, flag assumptions); write-capable agents get "Question Surfacing Protocol" (BLOCKED + return for ambiguity)
40+
- **Architect agent: anti-fluff enforcement** — explicit banned patterns ("This approach follows best practices...", restating the problem, explaining why the approach is good), good/bad plan line examples
41+
- **Architect agent: team orchestration planning** — can now plan teammate composition, file ownership, task dependencies, and worktree usage when tasks warrant parallel work
42+
- **Architect agent: strengthened output format** — team plan section added, edit ordering section added, file references must be specific
43+
- **Generalist agent rewritten as last-resort** — description changed to "LAST RESORT agent. Only use when NO specialist agent matches", identity paragraph flags when a specialist might have been better
44+
- **Investigator agent: structured output guidance** — added instruction to include actionable next steps, not just observations
45+
- **Added Bash guard hooks** to researcher, debug-logs, and perf-profiler agents — prevents accidental state-changing commands in read-only agents
46+
- **Architect agent: major plan quality improvements** — complexity scaling framework (simple/moderate/complex), 20+ banned fluff patterns, concrete edit ordering (Models→Services→Routes→Tests→Config), rollback strategy requirement for schema/API changes, schema change detection, verification criteria per phase, 3 new examples (migration, multi-agent refactoring, ambiguous requirement)
47+
- **Merged tester agent into test-writer** — test-writer is now the single test agent; tester.md removed (test-writer was more comprehensive with better examples and Question Surfacing Protocol)
48+
- **Merged doc-writer agent into documenter** — documenter is now the single documentation agent with full spec lifecycle AND rich documentation patterns (README 5-question structure, API docs format, language-specific docstring examples, architectural docs, style guide); doc-writer.md removed
49+
- **Narrowed investigator description** — repositioned from catch-all "all read-only analysis" to "cross-domain investigations spanning 2+ specialist areas"; prevents over-selection when a focused specialist (explorer, researcher, git-archaeologist, etc.) is the better fit
50+
- **Improved agent descriptions for routing accuracy** — added missing trigger phrases to explorer, researcher, debug-logs, dependency-analyst, security-auditor, perf-profiler, refactorer, and test-writer; clarified overlap boundaries between security-auditor (code-level) and dependency-analyst (package-level), explorer (codebase-only) and researcher (web+code)
51+
- **Resolved communication protocol contradictions** — aligned all "ask the user/caller" instructions in agent behavioral rules with the new Handling Uncertainty / Question Surfacing Protocol sections, eliminating conflicting guidance about direct user interaction
52+
53+
#### Skill Engine: Auto-Suggestion
54+
- **Weighted scoring** — Skill suggestion phrases now carry confidence weights (0.0–1.0) instead of binary match/no-match. Specific phrases like "build a fastapi app" score 1.0; ambiguous phrases like "start building" score 0.2
55+
- **Negative patterns** — Skills can define substrings that instantly disqualify them. Prevents `fastapi` from triggering when discussing `pydantic-ai`, and `docker` from triggering for `docker-py` prompts
56+
- **Context guards** — Low-confidence matches (score < 0.6) require a confirming context word elsewhere in the prompt. "health check" only suggests `docker` if "docker", "container", or "compose" also appears
57+
- **Ranked results, capped at 3** — Suggestions are sorted by score (then priority tier), and only the top 3 are returned. Eliminates 6+ skill suggestion floods
58+
- **Priority tiers** — Explicit commands (priority 10) outrank technology skills (7), which outrank patterns (5) and generic skills (3) when scores tie
59+
60+
#### Claude Code Installation
61+
- **Claude Code now installs as a native binary** — uses Anthropic's official installer (`https://claude.ai/install.sh`) via new `./features/claude-code-native` feature, replacing the npm-based `ghcr.io/anthropics/devcontainer-features/claude-code:1.0.5`
62+
- **In-session auto-updater now works without root** — native binary at `~/.local/bin/claude` is owned by the container user, so `claude update` succeeds without permission issues
63+
64+
#### System Prompt
65+
- **`<git_worktrees>` section** — Updated to document Claude Code native worktree convention (`<repo>/.claude/worktrees/`) as the recommended approach alongside the legacy `.worktrees/` convention. Added `EnterWorktree` tool guidance, `.worktreeinclude` file documentation, and path convention comparison table.
66+
67+
#### Configuration
68+
- Moved `.claude` directory from `/workspaces/.claude` to `~/.claude` (home directory)
69+
- Added Docker named volume for persistence across rebuilds (per-instance isolation via `${devcontainerId}`)
70+
- `CLAUDE_CONFIG_DIR` now defaults to `~/.claude`
71+
- `file-manifest.json` — added deployment entry for `orchestrator-system-prompt.md`
72+
- `setup-aliases.sh` — added `cc-orc` alias alongside existing `cc`, `claude`, `ccw`, `ccraw`
73+
- `CLAUDE.md` — documented `cc-orc` command and orchestrator system prompt in key configuration table
74+
75+
#### Agent System (previous)
76+
- Agent count increased from 17 to 21 (4 workhorse + 17 specialist)
77+
- Agent-system README updated with workhorse agent table, per-agent hooks for implementer and tester, and updated plugin structure
78+
2579
#### Port Forwarding
2680
- Dynamic port forwarding for all ports in VS Code — previously only port 7847 was statically forwarded; now all ports auto-forward with notification
2781

@@ -169,34 +223,6 @@
169223
- **`documenter`** — consolidated documentation and specification agent (opus) merging doc-writer and spec-writer; handles README, API docs, docstrings, and the full spec lifecycle (create, refine, build, review, update, check)
170224
- **Question Surfacing Protocol** — all 4 workhorse agents carry an identical protocol requiring them to STOP and return `## BLOCKED: Questions` sections when hitting ambiguities, ensuring no assumptions are made without user input
171225

172-
### Changed
173-
174-
#### Skill Engine: Auto-Suggestion
175-
- **Weighted scoring** — Skill suggestion phrases now carry confidence weights (0.0–1.0) instead of binary match/no-match. Specific phrases like "build a fastapi app" score 1.0; ambiguous phrases like "start building" score 0.2
176-
- **Negative patterns** — Skills can define substrings that instantly disqualify them. Prevents `fastapi` from triggering when discussing `pydantic-ai`, and `docker` from triggering for `docker-py` prompts
177-
- **Context guards** — Low-confidence matches (score < 0.6) require a confirming context word elsewhere in the prompt. "health check" only suggests `docker` if "docker", "container", or "compose" also appears
178-
- **Ranked results, capped at 3** — Suggestions are sorted by score (then priority tier), and only the top 3 are returned. Eliminates 6+ skill suggestion floods
179-
- **Priority tiers** — Explicit commands (priority 10) outrank technology skills (7), which outrank patterns (5) and generic skills (3) when scores tie
180-
181-
#### Claude Code Installation
182-
- **Claude Code now installs as a native binary** — uses Anthropic's official installer (`https://claude.ai/install.sh`) via new `./features/claude-code-native` feature, replacing the npm-based `ghcr.io/anthropics/devcontainer-features/claude-code:1.0.5`
183-
- **In-session auto-updater now works without root** — native binary at `~/.local/bin/claude` is owned by the container user, so `claude update` succeeds without permission issues
184-
185-
#### System Prompt
186-
- **`<git_worktrees>` section** — Updated to document Claude Code native worktree convention (`<repo>/.claude/worktrees/`) as the recommended approach alongside the legacy `.worktrees/` convention. Added `EnterWorktree` tool guidance, `.worktreeinclude` file documentation, and path convention comparison table.
187-
188-
#### Configuration
189-
- Moved `.claude` directory from `/workspaces/.claude` to `~/.claude` (home directory)
190-
- Added Docker named volume for persistence across rebuilds (per-instance isolation via `${devcontainerId}`)
191-
- `CLAUDE_CONFIG_DIR` now defaults to `~/.claude`
192-
- `file-manifest.json` — added deployment entry for `orchestrator-system-prompt.md`
193-
- `setup-aliases.sh` — added `cc-orc` alias alongside existing `cc`, `claude`, `ccw`, `ccraw`
194-
- `CLAUDE.md` — documented `cc-orc` command and orchestrator system prompt in key configuration table
195-
196-
#### Agent System
197-
- Agent count increased from 17 to 21 (4 workhorse + 17 specialist)
198-
- Agent-system README updated with workhorse agent table, per-agent hooks for implementer and tester, and updated plugin structure
199-
200226
#### Authentication
201227
- Added `CLAUDE_AUTH_TOKEN` support in `.secrets` for long-lived tokens from `claude setup-token`
202228
- Auto-creates `.credentials.json` from token on container start (skips if already exists)

.devcontainer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ Agent definitions in `plugins/devs-marketplace/plugins/agent-system/agents/` pro
331331
| `claude-guide` | Claude Code feature guidance |
332332
| `debug-logs` | Log analysis and error diagnosis |
333333
| `dependency-analyst` | Dependency analysis and upgrades |
334-
| `doc-writer` | Documentation authoring |
334+
| `documenter` | Documentation, specs, and spec lifecycle |
335335
| `explorer` | Fast codebase search and navigation |
336336
| `generalist` | General-purpose multi-step tasks |
337337
| `git-archaeologist` | Git history forensics |

.devcontainer/plugins/devs-marketplace/plugins/agent-system/README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# agent-system
22

3-
Claude Code plugin that provides 21 custom agents (4 workhorse + 17 specialist) with automatic built-in agent redirection, working directory injection, read-only bash enforcement, and team quality gates.
3+
Claude Code plugin that provides 19 custom agents (3 workhorse + 16 specialist) with automatic built-in agent redirection, working directory injection, read-only bash enforcement, and team quality gates.
44

55
## What It Does
66

77
Replaces Claude Code's built-in agents with enhanced custom agents that carry domain-specific instructions, safety hooks, and tailored tool configurations. Also provides team orchestration quality gates.
88

99
### Workhorse Agents
1010

11-
General-purpose agents designed for orchestrator mode (`cc-orc`). Each covers a broad domain, carrying detailed execution discipline, code standards, and a question-surfacing protocol. Most tasks need only 2-3 of these.
11+
General-purpose agents designed for orchestrator mode (`cc-orc`). Each covers a broad domain, carrying detailed execution discipline, code standards, and a question-surfacing protocol.
1212

1313
| Agent | Domain | Access | Model |
1414
|-------|--------|--------|-------|
15-
| investigator | Research, codebase search, git forensics, dependency audit, log analysis, performance profiling | Read-only | Sonnet |
15+
| investigator | Cross-domain research spanning 2+ specialist areas | Read-only | Sonnet |
1616
| implementer | Code changes, bug fixes, refactoring, migrations | Full access (worktree) | Opus |
17-
| tester | Test suite creation, coverage analysis, test verification | Full access (worktree) | Opus |
18-
| documenter | Documentation, specs, spec lifecycle (create/refine/review/update) | Full access | Opus |
17+
| documenter | Documentation, specs, spec lifecycle, docstrings, architecture docs | Full access (worktree) | Opus |
1918

2019
### Specialist Agents
2120

@@ -28,7 +27,6 @@ Domain-specific agents for targeted tasks. Used by both `cc` (monolithic) and `c
2827
| claude-guide | Claude Code features, configuration, best practices | Read-only |
2928
| debug-logs | Log investigation and issue diagnosis | Read-only |
3029
| dependency-analyst | Outdated/vulnerable dependency analysis | Read-only |
31-
| doc-writer | READMEs, API docs, usage guides | Full access |
3230
| explorer | Fast codebase search and structure mapping | Read-only |
3331
| generalist | General-purpose multi-step tasks | Full access |
3432
| git-archaeologist | Git history, blame, branch analysis | Read-only |
@@ -67,7 +65,6 @@ Per-agent hooks (registered within agent definitions, not in hooks.json):
6765
|-------|------|--------|---------|
6866
| implementer | PostToolUse (Edit) | `verify-no-regression.py` | Runs tests after each edit to catch regressions |
6967
| refactorer | PostToolUse (Edit) | `verify-no-regression.py` | Runs tests after each edit to catch regressions |
70-
| tester | Stop | `verify-tests-pass.py` | Verifies written tests actually pass |
7168
| test-writer | Stop | `verify-tests-pass.py` | Verifies written tests actually pass |
7269

7370
## How It Works
@@ -171,16 +168,14 @@ agent-system/
171168
+-- .claude-plugin/
172169
| +-- plugin.json # Plugin metadata
173170
+-- agents/
174-
| +-- investigator.md # 4 workhorse agents (orchestrator mode)
171+
| +-- investigator.md # 3 workhorse agents (orchestrator mode)
175172
| +-- implementer.md
176-
| +-- tester.md
177173
| +-- documenter.md
178-
| +-- architect.md # 17 specialist agents
174+
| +-- architect.md # 16 specialist agents
179175
| +-- bash-exec.md
180176
| +-- claude-guide.md
181177
| +-- debug-logs.md
182178
| +-- dependency-analyst.md
183-
| +-- doc-writer.md
184179
| +-- explorer.md
185180
| +-- generalist.md
186181
| +-- git-archaeologist.md

0 commit comments

Comments
 (0)