forge-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/hooks/worktree-create.sh +64 -0
- package/.claude/hooks/worktree-remove.sh +57 -0
- package/.claude/settings.local.json +29 -0
- package/.forge/knowledge/conventions.yaml +1 -0
- package/.forge/knowledge/decisions.yaml +1 -0
- package/.forge/knowledge/gotchas.yaml +1 -0
- package/.forge/knowledge/patterns.yaml +1 -0
- package/.forge/manifest.yaml +6 -0
- package/CLAUDE.md +144 -0
- package/bin/setup-forge.sh +132 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +553 -0
- package/dist/cli.js.map +1 -0
- package/dist/context/codebase.d.ts +57 -0
- package/dist/context/codebase.d.ts.map +1 -0
- package/dist/context/codebase.js +301 -0
- package/dist/context/codebase.js.map +1 -0
- package/dist/context/injector.d.ts +147 -0
- package/dist/context/injector.d.ts.map +1 -0
- package/dist/context/injector.js +533 -0
- package/dist/context/injector.js.map +1 -0
- package/dist/context/memory.d.ts +32 -0
- package/dist/context/memory.d.ts.map +1 -0
- package/dist/context/memory.js +140 -0
- package/dist/context/memory.js.map +1 -0
- package/dist/context/session-index.d.ts +54 -0
- package/dist/context/session-index.d.ts.map +1 -0
- package/dist/context/session-index.js +265 -0
- package/dist/context/session-index.js.map +1 -0
- package/dist/context/session.d.ts +42 -0
- package/dist/context/session.d.ts.map +1 -0
- package/dist/context/session.js +121 -0
- package/dist/context/session.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/ingestion/chunker.d.ts +19 -0
- package/dist/ingestion/chunker.d.ts.map +1 -0
- package/dist/ingestion/chunker.js +189 -0
- package/dist/ingestion/chunker.js.map +1 -0
- package/dist/ingestion/embedder.d.ts +45 -0
- package/dist/ingestion/embedder.d.ts.map +1 -0
- package/dist/ingestion/embedder.js +152 -0
- package/dist/ingestion/embedder.js.map +1 -0
- package/dist/ingestion/git-analyzer.d.ts +77 -0
- package/dist/ingestion/git-analyzer.d.ts.map +1 -0
- package/dist/ingestion/git-analyzer.js +437 -0
- package/dist/ingestion/git-analyzer.js.map +1 -0
- package/dist/ingestion/indexer.d.ts +79 -0
- package/dist/ingestion/indexer.d.ts.map +1 -0
- package/dist/ingestion/indexer.js +766 -0
- package/dist/ingestion/indexer.js.map +1 -0
- package/dist/ingestion/markdown-chunker.d.ts +19 -0
- package/dist/ingestion/markdown-chunker.d.ts.map +1 -0
- package/dist/ingestion/markdown-chunker.js +243 -0
- package/dist/ingestion/markdown-chunker.js.map +1 -0
- package/dist/ingestion/markdown-knowledge.d.ts +21 -0
- package/dist/ingestion/markdown-knowledge.d.ts.map +1 -0
- package/dist/ingestion/markdown-knowledge.js +129 -0
- package/dist/ingestion/markdown-knowledge.js.map +1 -0
- package/dist/ingestion/parser.d.ts +20 -0
- package/dist/ingestion/parser.d.ts.map +1 -0
- package/dist/ingestion/parser.js +429 -0
- package/dist/ingestion/parser.js.map +1 -0
- package/dist/ingestion/watcher.d.ts +28 -0
- package/dist/ingestion/watcher.d.ts.map +1 -0
- package/dist/ingestion/watcher.js +147 -0
- package/dist/ingestion/watcher.js.map +1 -0
- package/dist/knowledge/hydrator.d.ts +37 -0
- package/dist/knowledge/hydrator.d.ts.map +1 -0
- package/dist/knowledge/hydrator.js +220 -0
- package/dist/knowledge/hydrator.js.map +1 -0
- package/dist/knowledge/registry.d.ts +129 -0
- package/dist/knowledge/registry.d.ts.map +1 -0
- package/dist/knowledge/registry.js +361 -0
- package/dist/knowledge/registry.js.map +1 -0
- package/dist/knowledge/search.d.ts +114 -0
- package/dist/knowledge/search.d.ts.map +1 -0
- package/dist/knowledge/search.js +428 -0
- package/dist/knowledge/search.js.map +1 -0
- package/dist/knowledge/store.d.ts +76 -0
- package/dist/knowledge/store.d.ts.map +1 -0
- package/dist/knowledge/store.js +230 -0
- package/dist/knowledge/store.js.map +1 -0
- package/dist/learning/confidence.d.ts +30 -0
- package/dist/learning/confidence.d.ts.map +1 -0
- package/dist/learning/confidence.js +165 -0
- package/dist/learning/confidence.js.map +1 -0
- package/dist/learning/patterns.d.ts +52 -0
- package/dist/learning/patterns.d.ts.map +1 -0
- package/dist/learning/patterns.js +290 -0
- package/dist/learning/patterns.js.map +1 -0
- package/dist/learning/trajectory.d.ts +55 -0
- package/dist/learning/trajectory.d.ts.map +1 -0
- package/dist/learning/trajectory.js +200 -0
- package/dist/learning/trajectory.js.map +1 -0
- package/dist/memory/memory-compat.d.ts +100 -0
- package/dist/memory/memory-compat.d.ts.map +1 -0
- package/dist/memory/memory-compat.js +146 -0
- package/dist/memory/memory-compat.js.map +1 -0
- package/dist/memory/observation-store.d.ts +57 -0
- package/dist/memory/observation-store.d.ts.map +1 -0
- package/dist/memory/observation-store.js +154 -0
- package/dist/memory/observation-store.js.map +1 -0
- package/dist/memory/session-tracker.d.ts +81 -0
- package/dist/memory/session-tracker.d.ts.map +1 -0
- package/dist/memory/session-tracker.js +262 -0
- package/dist/memory/session-tracker.js.map +1 -0
- package/dist/pipeline/engine.d.ts +179 -0
- package/dist/pipeline/engine.d.ts.map +1 -0
- package/dist/pipeline/engine.js +691 -0
- package/dist/pipeline/engine.js.map +1 -0
- package/dist/pipeline/events.d.ts +54 -0
- package/dist/pipeline/events.d.ts.map +1 -0
- package/dist/pipeline/events.js +157 -0
- package/dist/pipeline/events.js.map +1 -0
- package/dist/pipeline/parallel.d.ts +83 -0
- package/dist/pipeline/parallel.d.ts.map +1 -0
- package/dist/pipeline/parallel.js +277 -0
- package/dist/pipeline/parallel.js.map +1 -0
- package/dist/pipeline/state-machine.d.ts +65 -0
- package/dist/pipeline/state-machine.d.ts.map +1 -0
- package/dist/pipeline/state-machine.js +176 -0
- package/dist/pipeline/state-machine.js.map +1 -0
- package/dist/query/graph-queries.d.ts +84 -0
- package/dist/query/graph-queries.d.ts.map +1 -0
- package/dist/query/graph-queries.js +216 -0
- package/dist/query/graph-queries.js.map +1 -0
- package/dist/query/hybrid-search.d.ts +34 -0
- package/dist/query/hybrid-search.d.ts.map +1 -0
- package/dist/query/hybrid-search.js +263 -0
- package/dist/query/hybrid-search.js.map +1 -0
- package/dist/query/intent-detector.d.ts +35 -0
- package/dist/query/intent-detector.d.ts.map +1 -0
- package/dist/query/intent-detector.js +115 -0
- package/dist/query/intent-detector.js.map +1 -0
- package/dist/query/ranking.d.ts +57 -0
- package/dist/query/ranking.d.ts.map +1 -0
- package/dist/query/ranking.js +109 -0
- package/dist/query/ranking.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +291 -0
- package/dist/server.js.map +1 -0
- package/dist/storage/falkordb-store.d.ts +73 -0
- package/dist/storage/falkordb-store.d.ts.map +1 -0
- package/dist/storage/falkordb-store.js +346 -0
- package/dist/storage/falkordb-store.js.map +1 -0
- package/dist/storage/file-cache.d.ts +32 -0
- package/dist/storage/file-cache.d.ts.map +1 -0
- package/dist/storage/file-cache.js +115 -0
- package/dist/storage/file-cache.js.map +1 -0
- package/dist/storage/interfaces.d.ts +151 -0
- package/dist/storage/interfaces.d.ts.map +1 -0
- package/dist/storage/interfaces.js +7 -0
- package/dist/storage/interfaces.js.map +1 -0
- package/dist/storage/qdrant-store.d.ts +110 -0
- package/dist/storage/qdrant-store.d.ts.map +1 -0
- package/dist/storage/qdrant-store.js +467 -0
- package/dist/storage/qdrant-store.js.map +1 -0
- package/dist/storage/schema.d.ts +4 -0
- package/dist/storage/schema.d.ts.map +1 -0
- package/dist/storage/schema.js +136 -0
- package/dist/storage/schema.js.map +1 -0
- package/dist/storage/sqlite.d.ts +35 -0
- package/dist/storage/sqlite.d.ts.map +1 -0
- package/dist/storage/sqlite.js +132 -0
- package/dist/storage/sqlite.js.map +1 -0
- package/dist/tools/collaboration-tools.d.ts +111 -0
- package/dist/tools/collaboration-tools.d.ts.map +1 -0
- package/dist/tools/collaboration-tools.js +174 -0
- package/dist/tools/collaboration-tools.js.map +1 -0
- package/dist/tools/context-tools.d.ts +293 -0
- package/dist/tools/context-tools.d.ts.map +1 -0
- package/dist/tools/context-tools.js +437 -0
- package/dist/tools/context-tools.js.map +1 -0
- package/dist/tools/graph-tools.d.ts +129 -0
- package/dist/tools/graph-tools.d.ts.map +1 -0
- package/dist/tools/graph-tools.js +237 -0
- package/dist/tools/graph-tools.js.map +1 -0
- package/dist/tools/ingestion-tools.d.ts +96 -0
- package/dist/tools/ingestion-tools.d.ts.map +1 -0
- package/dist/tools/ingestion-tools.js +90 -0
- package/dist/tools/ingestion-tools.js.map +1 -0
- package/dist/tools/learning-tools.d.ts +168 -0
- package/dist/tools/learning-tools.d.ts.map +1 -0
- package/dist/tools/learning-tools.js +158 -0
- package/dist/tools/learning-tools.js.map +1 -0
- package/dist/tools/memory-tools.d.ts +183 -0
- package/dist/tools/memory-tools.d.ts.map +1 -0
- package/dist/tools/memory-tools.js +197 -0
- package/dist/tools/memory-tools.js.map +1 -0
- package/dist/tools/phase-tools.d.ts +954 -0
- package/dist/tools/phase-tools.d.ts.map +1 -0
- package/dist/tools/phase-tools.js +1215 -0
- package/dist/tools/phase-tools.js.map +1 -0
- package/dist/tools/pipeline-tools.d.ts +140 -0
- package/dist/tools/pipeline-tools.d.ts.map +1 -0
- package/dist/tools/pipeline-tools.js +162 -0
- package/dist/tools/pipeline-tools.js.map +1 -0
- package/dist/tools/registration-tools.d.ts +220 -0
- package/dist/tools/registration-tools.d.ts.map +1 -0
- package/dist/tools/registration-tools.js +391 -0
- package/dist/tools/registration-tools.js.map +1 -0
- package/dist/util/circuit-breaker.d.ts +75 -0
- package/dist/util/circuit-breaker.d.ts.map +1 -0
- package/dist/util/circuit-breaker.js +159 -0
- package/dist/util/circuit-breaker.js.map +1 -0
- package/dist/util/config.d.ts +23 -0
- package/dist/util/config.d.ts.map +1 -0
- package/dist/util/config.js +164 -0
- package/dist/util/config.js.map +1 -0
- package/dist/util/logger.d.ts +13 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +45 -0
- package/dist/util/logger.js.map +1 -0
- package/dist/util/token-counter.d.ts +24 -0
- package/dist/util/token-counter.d.ts.map +1 -0
- package/dist/util/token-counter.js +48 -0
- package/dist/util/token-counter.js.map +1 -0
- package/dist/util/types.d.ts +525 -0
- package/dist/util/types.d.ts.map +1 -0
- package/dist/util/types.js +5 -0
- package/dist/util/types.js.map +1 -0
- package/docker-compose.yml +20 -0
- package/docs/plans/2026-02-27-swarm-coordination/architecture.md +203 -0
- package/docs/plans/2026-02-27-swarm-coordination/vision.md +57 -0
- package/docs/plans/completed/2026-02-26-forge-plugin-bundling/architecture.md +1 -0
- package/docs/plans/completed/2026-02-26-forge-plugin-bundling/vision.md +300 -0
- package/docs/plans/completed/2026-02-27-forge-swarm-learning/architecture.md +480 -0
- package/docs/plans/completed/2026-02-27-forge-swarm-learning/verification-checklist.md +462 -0
- package/docs/plans/completed/2026-02-27-git-history-atlassian/git-jira-plan.md +181 -0
- package/package.json +39 -0
- package/plugin/.claude-plugin/plugin.json +8 -0
- package/plugin/.mcp.json +15 -0
- package/plugin/README.md +134 -0
- package/plugin/agents/architect.md +367 -0
- package/plugin/agents/backend-specialist.md +263 -0
- package/plugin/agents/brainstormer.md +122 -0
- package/plugin/agents/data-specialist.md +266 -0
- package/plugin/agents/designer.md +408 -0
- package/plugin/agents/frontend-specialist.md +241 -0
- package/plugin/agents/inspector.md +406 -0
- package/plugin/agents/knowledge-keeper.md +443 -0
- package/plugin/agents/platform-engineer.md +326 -0
- package/plugin/agents/product-manager.md +268 -0
- package/plugin/agents/product-owner.md +438 -0
- package/plugin/agents/pulse-checker.md +73 -0
- package/plugin/agents/qa-strategist.md +500 -0
- package/plugin/agents/self-improver.md +310 -0
- package/plugin/agents/strategist.md +360 -0
- package/plugin/agents/supervisor.md +380 -0
- package/plugin/commands/brainstorm.md +25 -0
- package/plugin/commands/forge.md +88 -0
- package/plugin/docs/atlassian-integration.md +110 -0
- package/plugin/docs/workflow.md +126 -0
- package/plugin/skills/agent-development/.skillfish.json +10 -0
- package/plugin/skills/agent-development/SKILL.md +415 -0
- package/plugin/skills/agent-development/examples/agent-creation-prompt.md +238 -0
- package/plugin/skills/agent-development/examples/complete-agent-examples.md +427 -0
- package/plugin/skills/agent-development/references/agent-creation-system-prompt.md +207 -0
- package/plugin/skills/agent-development/references/system-prompt-design.md +411 -0
- package/plugin/skills/agent-development/references/triggering-examples.md +491 -0
- package/plugin/skills/agent-development/scripts/validate-agent.sh +217 -0
- package/plugin/skills/agent-handoff/SKILL.md +335 -0
- package/plugin/skills/anti-stub/SKILL.md +317 -0
- package/plugin/skills/brainstorm/SKILL.md +31 -0
- package/plugin/skills/debugging/SKILL.md +276 -0
- package/plugin/skills/fix/SKILL.md +62 -0
- package/plugin/skills/frontend-design/.skillfish.json +10 -0
- package/plugin/skills/frontend-design/SKILL.md +42 -0
- package/plugin/skills/gotchas/SKILL.md +61 -0
- package/plugin/skills/graph-orchestrator/SKILL.md +38 -0
- package/plugin/skills/history/SKILL.md +58 -0
- package/plugin/skills/impact/SKILL.md +59 -0
- package/plugin/skills/implementation-execution/SKILL.md +291 -0
- package/plugin/skills/index-repo/SKILL.md +55 -0
- package/plugin/skills/interviewing/SKILL.md +225 -0
- package/plugin/skills/knowledge-curation/SKILL.md +393 -0
- package/plugin/skills/learn/SKILL.md +69 -0
- package/plugin/skills/mcp-integration/.skillfish.json +10 -0
- package/plugin/skills/mcp-integration/SKILL.md +554 -0
- package/plugin/skills/mcp-integration/examples/http-server.json +20 -0
- package/plugin/skills/mcp-integration/examples/sse-server.json +19 -0
- package/plugin/skills/mcp-integration/examples/stdio-server.json +26 -0
- package/plugin/skills/mcp-integration/references/authentication.md +549 -0
- package/plugin/skills/mcp-integration/references/server-types.md +536 -0
- package/plugin/skills/mcp-integration/references/tool-usage.md +538 -0
- package/plugin/skills/nestjs/.skillfish.json +10 -0
- package/plugin/skills/nestjs/SKILL.md +669 -0
- package/plugin/skills/nestjs/drizzle-reference.md +1894 -0
- package/plugin/skills/nestjs/reference.md +1447 -0
- package/plugin/skills/nestjs/workflow-optimization.md +229 -0
- package/plugin/skills/parallel-dispatch/SKILL.md +308 -0
- package/plugin/skills/project-discovery/SKILL.md +304 -0
- package/plugin/skills/search/SKILL.md +56 -0
- package/plugin/skills/security-audit/SKILL.md +362 -0
- package/plugin/skills/skill-development/.skillfish.json +10 -0
- package/plugin/skills/skill-development/SKILL.md +637 -0
- package/plugin/skills/skill-development/references/skill-creator-original.md +209 -0
- package/plugin/skills/tdd/SKILL.md +273 -0
- package/plugin/skills/terminal-presentation/SKILL.md +395 -0
- package/plugin/skills/test-strategy/SKILL.md +365 -0
- package/plugin/skills/verification-protocol/SKILL.md +256 -0
- package/plugin/skills/visual-explainer/CHANGELOG.md +97 -0
- package/plugin/skills/visual-explainer/LICENSE +21 -0
- package/plugin/skills/visual-explainer/README.md +137 -0
- package/plugin/skills/visual-explainer/SKILL.md +352 -0
- package/plugin/skills/visual-explainer/banner.png +0 -0
- package/plugin/skills/visual-explainer/package.json +11 -0
- package/plugin/skills/visual-explainer/prompts/diff-review.md +68 -0
- package/plugin/skills/visual-explainer/prompts/fact-check.md +63 -0
- package/plugin/skills/visual-explainer/prompts/generate-slides.md +18 -0
- package/plugin/skills/visual-explainer/prompts/generate-web-diagram.md +10 -0
- package/plugin/skills/visual-explainer/prompts/plan-review.md +86 -0
- package/plugin/skills/visual-explainer/prompts/project-recap.md +61 -0
- package/plugin/skills/visual-explainer/references/css-patterns.md +1188 -0
- package/plugin/skills/visual-explainer/references/libraries.md +470 -0
- package/plugin/skills/visual-explainer/references/responsive-nav.md +212 -0
- package/plugin/skills/visual-explainer/references/slide-patterns.md +1403 -0
- package/plugin/skills/visual-explainer/templates/architecture.html +596 -0
- package/plugin/skills/visual-explainer/templates/data-table.html +540 -0
- package/plugin/skills/visual-explainer/templates/mermaid-flowchart.html +435 -0
- package/plugin/skills/visual-explainer/templates/slide-deck.html +913 -0
- package/src/cli.ts +655 -0
- package/src/context/.gitkeep +0 -0
- package/src/context/codebase.ts +393 -0
- package/src/context/injector.ts +797 -0
- package/src/context/memory.ts +187 -0
- package/src/context/session-index.ts +327 -0
- package/src/context/session.ts +152 -0
- package/src/index.ts +47 -0
- package/src/ingestion/.gitkeep +0 -0
- package/src/ingestion/chunker.ts +277 -0
- package/src/ingestion/embedder.ts +167 -0
- package/src/ingestion/git-analyzer.ts +545 -0
- package/src/ingestion/indexer.ts +984 -0
- package/src/ingestion/markdown-chunker.ts +337 -0
- package/src/ingestion/markdown-knowledge.ts +175 -0
- package/src/ingestion/parser.ts +475 -0
- package/src/ingestion/watcher.ts +182 -0
- package/src/knowledge/.gitkeep +0 -0
- package/src/knowledge/hydrator.ts +246 -0
- package/src/knowledge/registry.ts +463 -0
- package/src/knowledge/search.ts +565 -0
- package/src/knowledge/store.ts +262 -0
- package/src/learning/.gitkeep +0 -0
- package/src/learning/confidence.ts +193 -0
- package/src/learning/patterns.ts +360 -0
- package/src/learning/trajectory.ts +268 -0
- package/src/memory/.gitkeep +0 -0
- package/src/memory/memory-compat.ts +233 -0
- package/src/memory/observation-store.ts +224 -0
- package/src/memory/session-tracker.ts +332 -0
- package/src/pipeline/.gitkeep +0 -0
- package/src/pipeline/engine.ts +1139 -0
- package/src/pipeline/events.ts +253 -0
- package/src/pipeline/parallel.ts +394 -0
- package/src/pipeline/state-machine.ts +199 -0
- package/src/query/.gitkeep +0 -0
- package/src/query/graph-queries.ts +262 -0
- package/src/query/hybrid-search.ts +337 -0
- package/src/query/intent-detector.ts +131 -0
- package/src/query/ranking.ts +161 -0
- package/src/server.ts +352 -0
- package/src/storage/.gitkeep +0 -0
- package/src/storage/falkordb-store.ts +388 -0
- package/src/storage/file-cache.ts +141 -0
- package/src/storage/interfaces.ts +201 -0
- package/src/storage/qdrant-store.ts +557 -0
- package/src/storage/schema.ts +139 -0
- package/src/storage/sqlite.ts +168 -0
- package/src/tools/.gitkeep +0 -0
- package/src/tools/collaboration-tools.ts +208 -0
- package/src/tools/context-tools.ts +493 -0
- package/src/tools/graph-tools.ts +295 -0
- package/src/tools/ingestion-tools.ts +122 -0
- package/src/tools/learning-tools.ts +181 -0
- package/src/tools/memory-tools.ts +234 -0
- package/src/tools/phase-tools.ts +1452 -0
- package/src/tools/pipeline-tools.ts +188 -0
- package/src/tools/registration-tools.ts +450 -0
- package/src/util/.gitkeep +0 -0
- package/src/util/circuit-breaker.ts +193 -0
- package/src/util/config.ts +177 -0
- package/src/util/logger.ts +53 -0
- package/src/util/token-counter.ts +52 -0
- package/src/util/types.ts +710 -0
- package/tests/context/.gitkeep +0 -0
- package/tests/integration/.gitkeep +0 -0
- package/tests/knowledge/.gitkeep +0 -0
- package/tests/learning/.gitkeep +0 -0
- package/tests/pipeline/.gitkeep +0 -0
- package/tests/tools/.gitkeep +0 -0
- package/tsconfig.json +21 -0
- package/vitest.config.ts +10 -0
- package/vscode-extension/.vscodeignore +7 -0
- package/vscode-extension/README.md +43 -0
- package/vscode-extension/out/edge-collector.js +274 -0
- package/vscode-extension/out/edge-collector.js.map +1 -0
- package/vscode-extension/out/extension.js +264 -0
- package/vscode-extension/out/extension.js.map +1 -0
- package/vscode-extension/out/forge-client.js +318 -0
- package/vscode-extension/out/forge-client.js.map +1 -0
- package/vscode-extension/package-lock.json +59 -0
- package/vscode-extension/package.json +71 -0
- package/vscode-extension/src/edge-collector.ts +320 -0
- package/vscode-extension/src/extension.ts +269 -0
- package/vscode-extension/src/forge-client.ts +364 -0
- package/vscode-extension/tsconfig.json +19 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Agent Creation System Prompt
|
|
2
|
+
|
|
3
|
+
This is the exact system prompt used by Claude Code's agent generation feature, refined through extensive production use.
|
|
4
|
+
|
|
5
|
+
## The Prompt
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
|
|
9
|
+
|
|
10
|
+
**Important Context**: You may have access to project-specific instructions from CLAUDE.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
|
|
11
|
+
|
|
12
|
+
When a user describes what they want an agent to do, you will:
|
|
13
|
+
|
|
14
|
+
1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from CLAUDE.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
|
|
15
|
+
|
|
16
|
+
2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
|
|
17
|
+
|
|
18
|
+
3. **Architect Comprehensive Instructions**: Develop a system prompt that:
|
|
19
|
+
- Establishes clear behavioral boundaries and operational parameters
|
|
20
|
+
- Provides specific methodologies and best practices for task execution
|
|
21
|
+
- Anticipates edge cases and provides guidance for handling them
|
|
22
|
+
- Incorporates any specific requirements or preferences mentioned by the user
|
|
23
|
+
- Defines output format expectations when relevant
|
|
24
|
+
- Aligns with project-specific coding standards and patterns from CLAUDE.md
|
|
25
|
+
|
|
26
|
+
4. **Optimize for Performance**: Include:
|
|
27
|
+
- Decision-making frameworks appropriate to the domain
|
|
28
|
+
- Quality control mechanisms and self-verification steps
|
|
29
|
+
- Efficient workflow patterns
|
|
30
|
+
- Clear escalation or fallback strategies
|
|
31
|
+
|
|
32
|
+
5. **Create Identifier**: Design a concise, descriptive identifier that:
|
|
33
|
+
- Uses lowercase letters, numbers, and hyphens only
|
|
34
|
+
- Is typically 2-4 words joined by hyphens
|
|
35
|
+
- Clearly indicates the agent's primary function
|
|
36
|
+
- Is memorable and easy to type
|
|
37
|
+
- Avoids generic terms like "helper" or "assistant"
|
|
38
|
+
|
|
39
|
+
6. **Example agent descriptions**:
|
|
40
|
+
- In the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
|
|
41
|
+
- Examples should be of the form:
|
|
42
|
+
<example>
|
|
43
|
+
Context: The user is creating a code-review agent that should be called after a logical chunk of code is written.
|
|
44
|
+
user: "Please write a function that checks if a number is prime"
|
|
45
|
+
assistant: "Here is the relevant function: "
|
|
46
|
+
<function call omitted for brevity only for this example>
|
|
47
|
+
<commentary>
|
|
48
|
+
Since a logical chunk of code was written and the task was completed, now use the code-review agent to review the code.
|
|
49
|
+
</commentary>
|
|
50
|
+
assistant: "Now let me use the code-reviewer agent to review the code"
|
|
51
|
+
</example>
|
|
52
|
+
- If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
|
|
53
|
+
- NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
|
|
54
|
+
|
|
55
|
+
Your output must be a valid JSON object with exactly these fields:
|
|
56
|
+
{
|
|
57
|
+
"identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'code-reviewer', 'api-docs-writer', 'test-generator')",
|
|
58
|
+
"whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
|
|
59
|
+
"systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
Key principles for your system prompts:
|
|
63
|
+
- Be specific rather than generic - avoid vague instructions
|
|
64
|
+
- Include concrete examples when they would clarify behavior
|
|
65
|
+
- Balance comprehensiveness with clarity - every instruction should add value
|
|
66
|
+
- Ensure the agent has enough context to handle variations of the core task
|
|
67
|
+
- Make the agent proactive in seeking clarification when needed
|
|
68
|
+
- Build in quality assurance and self-correction mechanisms
|
|
69
|
+
|
|
70
|
+
Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Usage Pattern
|
|
74
|
+
|
|
75
|
+
Use this prompt to generate agent configurations:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
**User input:** "I need an agent that reviews pull requests for code quality issues"
|
|
79
|
+
|
|
80
|
+
**You send to Claude with the system prompt above:**
|
|
81
|
+
Create an agent configuration based on this request: "I need an agent that reviews pull requests for code quality issues"
|
|
82
|
+
|
|
83
|
+
**Claude returns JSON:**
|
|
84
|
+
{
|
|
85
|
+
"identifier": "pr-quality-reviewer",
|
|
86
|
+
"whenToUse": "Use this agent when the user asks to review a pull request, check code quality, or analyze PR changes. Examples:\n\n<example>\nContext: User has created a PR and wants quality review\nuser: \"Can you review PR #123 for code quality?\"\nassistant: \"I'll use the pr-quality-reviewer agent to analyze the PR.\"\n<commentary>\nPR review request triggers the pr-quality-reviewer agent.\n</commentary>\n</example>",
|
|
87
|
+
"systemPrompt": "You are an expert code quality reviewer...\n\n**Your Core Responsibilities:**\n1. Analyze code changes for quality issues\n2. Check adherence to best practices\n..."
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Converting to Agent File
|
|
92
|
+
|
|
93
|
+
Take the JSON output and create the agent markdown file:
|
|
94
|
+
|
|
95
|
+
**agents/pr-quality-reviewer.md:**
|
|
96
|
+
```markdown
|
|
97
|
+
---
|
|
98
|
+
name: pr-quality-reviewer
|
|
99
|
+
description: Use this agent when the user asks to review a pull request, check code quality, or analyze PR changes. Examples:
|
|
100
|
+
|
|
101
|
+
<example>
|
|
102
|
+
Context: User has created a PR and wants quality review
|
|
103
|
+
user: "Can you review PR #123 for code quality?"
|
|
104
|
+
assistant: "I'll use the pr-quality-reviewer agent to analyze the PR."
|
|
105
|
+
<commentary>
|
|
106
|
+
PR review request triggers the pr-quality-reviewer agent.
|
|
107
|
+
</commentary>
|
|
108
|
+
</example>
|
|
109
|
+
|
|
110
|
+
model: inherit
|
|
111
|
+
color: blue
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
You are an expert code quality reviewer...
|
|
115
|
+
|
|
116
|
+
**Your Core Responsibilities:**
|
|
117
|
+
1. Analyze code changes for quality issues
|
|
118
|
+
2. Check adherence to best practices
|
|
119
|
+
...
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Customization Tips
|
|
123
|
+
|
|
124
|
+
### Adapt the System Prompt
|
|
125
|
+
|
|
126
|
+
The base prompt is excellent but can be enhanced for specific needs:
|
|
127
|
+
|
|
128
|
+
**For security-focused agents:**
|
|
129
|
+
```
|
|
130
|
+
Add after "Architect Comprehensive Instructions":
|
|
131
|
+
- Include OWASP top 10 security considerations
|
|
132
|
+
- Check for common vulnerabilities (injection, XSS, etc.)
|
|
133
|
+
- Validate input sanitization
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**For test-generation agents:**
|
|
137
|
+
```
|
|
138
|
+
Add after "Optimize for Performance":
|
|
139
|
+
- Follow AAA pattern (Arrange, Act, Assert)
|
|
140
|
+
- Include edge cases and error scenarios
|
|
141
|
+
- Ensure test isolation and cleanup
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**For documentation agents:**
|
|
145
|
+
```
|
|
146
|
+
Add after "Design Expert Persona":
|
|
147
|
+
- Use clear, concise language
|
|
148
|
+
- Include code examples
|
|
149
|
+
- Follow project documentation standards from CLAUDE.md
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Best Practices from Internal Implementation
|
|
153
|
+
|
|
154
|
+
### 1. Consider Project Context
|
|
155
|
+
|
|
156
|
+
The prompt specifically mentions using CLAUDE.md context:
|
|
157
|
+
- Agent should align with project patterns
|
|
158
|
+
- Follow project-specific coding standards
|
|
159
|
+
- Respect established practices
|
|
160
|
+
|
|
161
|
+
### 2. Proactive Agent Design
|
|
162
|
+
|
|
163
|
+
Include examples showing proactive usage:
|
|
164
|
+
```
|
|
165
|
+
<example>
|
|
166
|
+
Context: After writing code, agent should review proactively
|
|
167
|
+
user: "Please write a function..."
|
|
168
|
+
assistant: "[Writes function]"
|
|
169
|
+
<commentary>
|
|
170
|
+
Code written, now use review agent proactively.
|
|
171
|
+
</commentary>
|
|
172
|
+
assistant: "Now let me review this code with the code-reviewer agent"
|
|
173
|
+
</example>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 3. Scope Assumptions
|
|
177
|
+
|
|
178
|
+
For code review agents, assume "recently written code" not entire codebase:
|
|
179
|
+
```
|
|
180
|
+
For agents that review code, assume recent changes unless explicitly
|
|
181
|
+
stated otherwise.
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 4. Output Structure
|
|
185
|
+
|
|
186
|
+
Always define clear output format in system prompt:
|
|
187
|
+
```
|
|
188
|
+
**Output Format:**
|
|
189
|
+
Provide results as:
|
|
190
|
+
1. Summary (2-3 sentences)
|
|
191
|
+
2. Detailed findings (bullet points)
|
|
192
|
+
3. Recommendations (action items)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Integration with Plugin-Dev
|
|
196
|
+
|
|
197
|
+
Use this system prompt when creating agents for your plugins:
|
|
198
|
+
|
|
199
|
+
1. Take user request for agent functionality
|
|
200
|
+
2. Feed to Claude with this system prompt
|
|
201
|
+
3. Get JSON output (identifier, whenToUse, systemPrompt)
|
|
202
|
+
4. Convert to agent markdown file with frontmatter
|
|
203
|
+
5. Validate with agent validation rules
|
|
204
|
+
6. Test triggering conditions
|
|
205
|
+
7. Add to plugin's `agents/` directory
|
|
206
|
+
|
|
207
|
+
This provides AI-assisted agent generation following proven patterns from Claude Code's internal implementation.
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
# System Prompt Design Patterns
|
|
2
|
+
|
|
3
|
+
Complete guide to writing effective agent system prompts that enable autonomous, high-quality operation.
|
|
4
|
+
|
|
5
|
+
## Core Structure
|
|
6
|
+
|
|
7
|
+
Every agent system prompt should follow this proven structure:
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
You are [specific role] specializing in [specific domain].
|
|
11
|
+
|
|
12
|
+
**Your Core Responsibilities:**
|
|
13
|
+
1. [Primary responsibility - the main task]
|
|
14
|
+
2. [Secondary responsibility - supporting task]
|
|
15
|
+
3. [Additional responsibilities as needed]
|
|
16
|
+
|
|
17
|
+
**[Task Name] Process:**
|
|
18
|
+
1. [First concrete step]
|
|
19
|
+
2. [Second concrete step]
|
|
20
|
+
3. [Continue with clear steps]
|
|
21
|
+
[...]
|
|
22
|
+
|
|
23
|
+
**Quality Standards:**
|
|
24
|
+
- [Standard 1 with specifics]
|
|
25
|
+
- [Standard 2 with specifics]
|
|
26
|
+
- [Standard 3 with specifics]
|
|
27
|
+
|
|
28
|
+
**Output Format:**
|
|
29
|
+
Provide results structured as:
|
|
30
|
+
- [Component 1]
|
|
31
|
+
- [Component 2]
|
|
32
|
+
- [Include specific formatting requirements]
|
|
33
|
+
|
|
34
|
+
**Edge Cases:**
|
|
35
|
+
Handle these situations:
|
|
36
|
+
- [Edge case 1]: [Specific handling approach]
|
|
37
|
+
- [Edge case 2]: [Specific handling approach]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Pattern 1: Analysis Agents
|
|
41
|
+
|
|
42
|
+
For agents that analyze code, PRs, or documentation:
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
You are an expert [domain] analyzer specializing in [specific analysis type].
|
|
46
|
+
|
|
47
|
+
**Your Core Responsibilities:**
|
|
48
|
+
1. Thoroughly analyze [what] for [specific issues]
|
|
49
|
+
2. Identify [patterns/problems/opportunities]
|
|
50
|
+
3. Provide actionable recommendations
|
|
51
|
+
|
|
52
|
+
**Analysis Process:**
|
|
53
|
+
1. **Gather Context**: Read [what] using available tools
|
|
54
|
+
2. **Initial Scan**: Identify obvious [issues/patterns]
|
|
55
|
+
3. **Deep Analysis**: Examine [specific aspects]:
|
|
56
|
+
- [Aspect 1]: Check for [criteria]
|
|
57
|
+
- [Aspect 2]: Verify [criteria]
|
|
58
|
+
- [Aspect 3]: Assess [criteria]
|
|
59
|
+
4. **Synthesize Findings**: Group related issues
|
|
60
|
+
5. **Prioritize**: Rank by [severity/impact/urgency]
|
|
61
|
+
6. **Generate Report**: Format according to output template
|
|
62
|
+
|
|
63
|
+
**Quality Standards:**
|
|
64
|
+
- Every finding includes file:line reference
|
|
65
|
+
- Issues categorized by severity (critical/major/minor)
|
|
66
|
+
- Recommendations are specific and actionable
|
|
67
|
+
- Positive observations included for balance
|
|
68
|
+
|
|
69
|
+
**Output Format:**
|
|
70
|
+
## Summary
|
|
71
|
+
[2-3 sentence overview]
|
|
72
|
+
|
|
73
|
+
## Critical Issues
|
|
74
|
+
- [file:line] - [Issue description] - [Recommendation]
|
|
75
|
+
|
|
76
|
+
## Major Issues
|
|
77
|
+
[...]
|
|
78
|
+
|
|
79
|
+
## Minor Issues
|
|
80
|
+
[...]
|
|
81
|
+
|
|
82
|
+
## Recommendations
|
|
83
|
+
[...]
|
|
84
|
+
|
|
85
|
+
**Edge Cases:**
|
|
86
|
+
- No issues found: Provide positive feedback and validation
|
|
87
|
+
- Too many issues: Group and prioritize top 10
|
|
88
|
+
- Unclear code: Request clarification rather than guessing
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Pattern 2: Generation Agents
|
|
92
|
+
|
|
93
|
+
For agents that create code, tests, or documentation:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
You are an expert [domain] engineer specializing in creating high-quality [output type].
|
|
97
|
+
|
|
98
|
+
**Your Core Responsibilities:**
|
|
99
|
+
1. Generate [what] that meets [quality standards]
|
|
100
|
+
2. Follow [specific conventions/patterns]
|
|
101
|
+
3. Ensure [correctness/completeness/clarity]
|
|
102
|
+
|
|
103
|
+
**Generation Process:**
|
|
104
|
+
1. **Understand Requirements**: Analyze what needs to be created
|
|
105
|
+
2. **Gather Context**: Read existing [code/docs/tests] for patterns
|
|
106
|
+
3. **Design Structure**: Plan [architecture/organization/flow]
|
|
107
|
+
4. **Generate Content**: Create [output] following:
|
|
108
|
+
- [Convention 1]
|
|
109
|
+
- [Convention 2]
|
|
110
|
+
- [Best practice 1]
|
|
111
|
+
5. **Validate**: Verify [correctness/completeness]
|
|
112
|
+
6. **Document**: Add comments/explanations as needed
|
|
113
|
+
|
|
114
|
+
**Quality Standards:**
|
|
115
|
+
- Follows project conventions (check CLAUDE.md)
|
|
116
|
+
- [Specific quality metric 1]
|
|
117
|
+
- [Specific quality metric 2]
|
|
118
|
+
- Includes error handling
|
|
119
|
+
- Well-documented and clear
|
|
120
|
+
|
|
121
|
+
**Output Format:**
|
|
122
|
+
Create [what] with:
|
|
123
|
+
- [Structure requirement 1]
|
|
124
|
+
- [Structure requirement 2]
|
|
125
|
+
- Clear, descriptive naming
|
|
126
|
+
- Comprehensive coverage
|
|
127
|
+
|
|
128
|
+
**Edge Cases:**
|
|
129
|
+
- Insufficient context: Ask user for clarification
|
|
130
|
+
- Conflicting patterns: Follow most recent/explicit pattern
|
|
131
|
+
- Complex requirements: Break into smaller pieces
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Pattern 3: Validation Agents
|
|
135
|
+
|
|
136
|
+
For agents that validate, check, or verify:
|
|
137
|
+
|
|
138
|
+
```markdown
|
|
139
|
+
You are an expert [domain] validator specializing in ensuring [quality aspect].
|
|
140
|
+
|
|
141
|
+
**Your Core Responsibilities:**
|
|
142
|
+
1. Validate [what] against [criteria]
|
|
143
|
+
2. Identify violations and issues
|
|
144
|
+
3. Provide clear pass/fail determination
|
|
145
|
+
|
|
146
|
+
**Validation Process:**
|
|
147
|
+
1. **Load Criteria**: Understand validation requirements
|
|
148
|
+
2. **Scan Target**: Read [what] needs validation
|
|
149
|
+
3. **Check Rules**: For each rule:
|
|
150
|
+
- [Rule 1]: [Validation method]
|
|
151
|
+
- [Rule 2]: [Validation method]
|
|
152
|
+
4. **Collect Violations**: Document each failure with details
|
|
153
|
+
5. **Assess Severity**: Categorize issues
|
|
154
|
+
6. **Determine Result**: Pass only if [criteria met]
|
|
155
|
+
|
|
156
|
+
**Quality Standards:**
|
|
157
|
+
- All violations include specific locations
|
|
158
|
+
- Severity clearly indicated
|
|
159
|
+
- Fix suggestions provided
|
|
160
|
+
- No false positives
|
|
161
|
+
|
|
162
|
+
**Output Format:**
|
|
163
|
+
## Validation Result: [PASS/FAIL]
|
|
164
|
+
|
|
165
|
+
## Summary
|
|
166
|
+
[Overall assessment]
|
|
167
|
+
|
|
168
|
+
## Violations Found: [count]
|
|
169
|
+
### Critical ([count])
|
|
170
|
+
- [Location]: [Issue] - [Fix]
|
|
171
|
+
|
|
172
|
+
### Warnings ([count])
|
|
173
|
+
- [Location]: [Issue] - [Fix]
|
|
174
|
+
|
|
175
|
+
## Recommendations
|
|
176
|
+
[How to fix violations]
|
|
177
|
+
|
|
178
|
+
**Edge Cases:**
|
|
179
|
+
- No violations: Confirm validation passed
|
|
180
|
+
- Too many violations: Group by type, show top 20
|
|
181
|
+
- Ambiguous rules: Document uncertainty, request clarification
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Pattern 4: Orchestration Agents
|
|
185
|
+
|
|
186
|
+
For agents that coordinate multiple tools or steps:
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
You are an expert [domain] orchestrator specializing in coordinating [complex workflow].
|
|
190
|
+
|
|
191
|
+
**Your Core Responsibilities:**
|
|
192
|
+
1. Coordinate [multi-step process]
|
|
193
|
+
2. Manage [resources/tools/dependencies]
|
|
194
|
+
3. Ensure [successful completion/integration]
|
|
195
|
+
|
|
196
|
+
**Orchestration Process:**
|
|
197
|
+
1. **Plan**: Understand full workflow and dependencies
|
|
198
|
+
2. **Prepare**: Set up prerequisites
|
|
199
|
+
3. **Execute Phases**:
|
|
200
|
+
- Phase 1: [What] using [tools]
|
|
201
|
+
- Phase 2: [What] using [tools]
|
|
202
|
+
- Phase 3: [What] using [tools]
|
|
203
|
+
4. **Monitor**: Track progress and handle failures
|
|
204
|
+
5. **Verify**: Confirm successful completion
|
|
205
|
+
6. **Report**: Provide comprehensive summary
|
|
206
|
+
|
|
207
|
+
**Quality Standards:**
|
|
208
|
+
- Each phase completes successfully
|
|
209
|
+
- Errors handled gracefully
|
|
210
|
+
- Progress reported to user
|
|
211
|
+
- Final state verified
|
|
212
|
+
|
|
213
|
+
**Output Format:**
|
|
214
|
+
## Workflow Execution Report
|
|
215
|
+
|
|
216
|
+
### Completed Phases
|
|
217
|
+
- [Phase]: [Result]
|
|
218
|
+
|
|
219
|
+
### Results
|
|
220
|
+
- [Output 1]
|
|
221
|
+
- [Output 2]
|
|
222
|
+
|
|
223
|
+
### Next Steps
|
|
224
|
+
[If applicable]
|
|
225
|
+
|
|
226
|
+
**Edge Cases:**
|
|
227
|
+
- Phase failure: Attempt retry, then report and stop
|
|
228
|
+
- Missing dependencies: Request from user
|
|
229
|
+
- Timeout: Report partial completion
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Writing Style Guidelines
|
|
233
|
+
|
|
234
|
+
### Tone and Voice
|
|
235
|
+
|
|
236
|
+
**Use second person (addressing the agent):**
|
|
237
|
+
```
|
|
238
|
+
✅ You are responsible for...
|
|
239
|
+
✅ You will analyze...
|
|
240
|
+
✅ Your process should...
|
|
241
|
+
|
|
242
|
+
❌ The agent is responsible for...
|
|
243
|
+
❌ This agent will analyze...
|
|
244
|
+
❌ I will analyze...
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Clarity and Specificity
|
|
248
|
+
|
|
249
|
+
**Be specific, not vague:**
|
|
250
|
+
```
|
|
251
|
+
✅ Check for SQL injection by examining all database queries for parameterization
|
|
252
|
+
❌ Look for security issues
|
|
253
|
+
|
|
254
|
+
✅ Provide file:line references for each finding
|
|
255
|
+
❌ Show where issues are
|
|
256
|
+
|
|
257
|
+
✅ Categorize as critical (security), major (bugs), or minor (style)
|
|
258
|
+
❌ Rate the severity of issues
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Actionable Instructions
|
|
262
|
+
|
|
263
|
+
**Give concrete steps:**
|
|
264
|
+
```
|
|
265
|
+
✅ Read the file using the Read tool, then search for patterns using Grep
|
|
266
|
+
❌ Analyze the code
|
|
267
|
+
|
|
268
|
+
✅ Generate test file at test/path/to/file.test.ts
|
|
269
|
+
❌ Create tests
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Common Pitfalls
|
|
273
|
+
|
|
274
|
+
### ❌ Vague Responsibilities
|
|
275
|
+
|
|
276
|
+
```markdown
|
|
277
|
+
**Your Core Responsibilities:**
|
|
278
|
+
1. Help the user with their code
|
|
279
|
+
2. Provide assistance
|
|
280
|
+
3. Be helpful
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
**Why bad:** Not specific enough to guide behavior.
|
|
284
|
+
|
|
285
|
+
### ✅ Specific Responsibilities
|
|
286
|
+
|
|
287
|
+
```markdown
|
|
288
|
+
**Your Core Responsibilities:**
|
|
289
|
+
1. Analyze TypeScript code for type safety issues
|
|
290
|
+
2. Identify missing type annotations and improper 'any' usage
|
|
291
|
+
3. Recommend specific type improvements with examples
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### ❌ Missing Process Steps
|
|
295
|
+
|
|
296
|
+
```markdown
|
|
297
|
+
Analyze the code and provide feedback.
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Why bad:** Agent doesn't know HOW to analyze.
|
|
301
|
+
|
|
302
|
+
### ✅ Clear Process
|
|
303
|
+
|
|
304
|
+
```markdown
|
|
305
|
+
**Analysis Process:**
|
|
306
|
+
1. Read code files using Read tool
|
|
307
|
+
2. Scan for type annotations on all functions
|
|
308
|
+
3. Check for 'any' type usage
|
|
309
|
+
4. Verify generic type parameters
|
|
310
|
+
5. List findings with file:line references
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### ❌ Undefined Output
|
|
314
|
+
|
|
315
|
+
```markdown
|
|
316
|
+
Provide a report.
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Why bad:** Agent doesn't know what format to use.
|
|
320
|
+
|
|
321
|
+
### ✅ Defined Output Format
|
|
322
|
+
|
|
323
|
+
```markdown
|
|
324
|
+
**Output Format:**
|
|
325
|
+
## Type Safety Report
|
|
326
|
+
|
|
327
|
+
### Summary
|
|
328
|
+
[Overview of findings]
|
|
329
|
+
|
|
330
|
+
### Issues Found
|
|
331
|
+
- `file.ts:42` - Missing return type on `processData`
|
|
332
|
+
- `utils.ts:15` - Unsafe 'any' usage in parameter
|
|
333
|
+
|
|
334
|
+
### Recommendations
|
|
335
|
+
[Specific fixes with examples]
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## Length Guidelines
|
|
339
|
+
|
|
340
|
+
### Minimum Viable Agent
|
|
341
|
+
|
|
342
|
+
**~500 words minimum:**
|
|
343
|
+
- Role description
|
|
344
|
+
- 3 core responsibilities
|
|
345
|
+
- 5-step process
|
|
346
|
+
- Output format
|
|
347
|
+
|
|
348
|
+
### Standard Agent
|
|
349
|
+
|
|
350
|
+
**~1,000-2,000 words:**
|
|
351
|
+
- Detailed role and expertise
|
|
352
|
+
- 5-8 responsibilities
|
|
353
|
+
- 8-12 process steps
|
|
354
|
+
- Quality standards
|
|
355
|
+
- Output format
|
|
356
|
+
- 3-5 edge cases
|
|
357
|
+
|
|
358
|
+
### Comprehensive Agent
|
|
359
|
+
|
|
360
|
+
**~2,000-5,000 words:**
|
|
361
|
+
- Complete role with background
|
|
362
|
+
- Comprehensive responsibilities
|
|
363
|
+
- Detailed multi-phase process
|
|
364
|
+
- Extensive quality standards
|
|
365
|
+
- Multiple output formats
|
|
366
|
+
- Many edge cases
|
|
367
|
+
- Examples within system prompt
|
|
368
|
+
|
|
369
|
+
**Avoid > 10,000 words:** Too long, diminishing returns.
|
|
370
|
+
|
|
371
|
+
## Testing System Prompts
|
|
372
|
+
|
|
373
|
+
### Test Completeness
|
|
374
|
+
|
|
375
|
+
Can the agent handle these based on system prompt alone?
|
|
376
|
+
|
|
377
|
+
- [ ] Typical task execution
|
|
378
|
+
- [ ] Edge cases mentioned
|
|
379
|
+
- [ ] Error scenarios
|
|
380
|
+
- [ ] Unclear requirements
|
|
381
|
+
- [ ] Large/complex inputs
|
|
382
|
+
- [ ] Empty/missing inputs
|
|
383
|
+
|
|
384
|
+
### Test Clarity
|
|
385
|
+
|
|
386
|
+
Read the system prompt and ask:
|
|
387
|
+
|
|
388
|
+
- Can another developer understand what this agent does?
|
|
389
|
+
- Are process steps clear and actionable?
|
|
390
|
+
- Is output format unambiguous?
|
|
391
|
+
- Are quality standards measurable?
|
|
392
|
+
|
|
393
|
+
### Iterate Based on Results
|
|
394
|
+
|
|
395
|
+
After testing agent:
|
|
396
|
+
1. Identify where it struggled
|
|
397
|
+
2. Add missing guidance to system prompt
|
|
398
|
+
3. Clarify ambiguous instructions
|
|
399
|
+
4. Add process steps for edge cases
|
|
400
|
+
5. Re-test
|
|
401
|
+
|
|
402
|
+
## Conclusion
|
|
403
|
+
|
|
404
|
+
Effective system prompts are:
|
|
405
|
+
- **Specific**: Clear about what and how
|
|
406
|
+
- **Structured**: Organized with clear sections
|
|
407
|
+
- **Complete**: Covers normal and edge cases
|
|
408
|
+
- **Actionable**: Provides concrete steps
|
|
409
|
+
- **Testable**: Defines measurable standards
|
|
410
|
+
|
|
411
|
+
Use the patterns above as templates, customize for your domain, and iterate based on agent performance.
|