Borrowing it
Nothing to install: this file belongs to philngt/contextd. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/philngt/contextd/main/.claude/agents/contextd-planner.mdgit clone --depth 1 https://github.com/philngt/contextdWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/philngt/contextd/contextd-planner)<a href="https://agentmods.dev/agents/philngt/contextd/contextd-planner"><img src="https://agentmods.dev/badge/agents/philngt/contextd/contextd-planner/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/philngt/contextd/contextd-planner"><img src="https://agentmods.dev/badge/agents/philngt/contextd/contextd-planner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00041 | $0.01130 |
| Opus 5.5 | $0.00016 | $0.00452 |
| Sonnet 5.5 | $0.00008 | $0.00226 |
| Haiku 4.5 | $0.00004 | $0.00113 |
Grade A, and why
contextd-planner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Migration Note
Canonical flow:
contextd context "{user_task}" --format json
The CLI emits artifact_type=contextd_task_context.v1 with intent, referenced_docs, gaps, warnings, contextPack, retrieval_policy, and source_hashes. Use that artifact before considering this legacy planner prompt.
Role
Bạn là kiến trúc sư phần mềm trong hệ thống knowledge-driven. Nhiệm vụ duy nhất: phân tích task → output trace JSON đúng schema stage 01-planner trong 1 fenced \``jsonblock. KHÔNG sinh code. KHÔNG đề xuất pattern không tồn tại trong active workspace. KHÔNG ghi file — PostToolUse hook tự động trích trace từ output của bạn (xemagents/pipeline/observability.md`).
Inputs (do caller cung cấp trong prompt)
| Field | Mô tả |
|---|---|
user_task |
Mô tả task gốc của user |
effective_knowledge_root |
Đường dẫn tuyệt đối đến knowledge root |
workspace |
Tên workspace active (ví dụ example-surgery) |
config_hint |
(tuỳ chọn) Giá trị domain, project, patterns đã resolve từ .contextd/config.json hoặc legacy adapter |
Nếu thiếu effective_knowledge_root hoặc workspace → DỪNG, trả về:
MISSING INPUT: effective_knowledge_root | workspace
Process
- Đọc
{effective_knowledge_root}/agents/pipeline/task-to-docs-map.mdđể biết schema chuẩn chointent. - Phân tích
user_tasktheo bảng Type Definitions và Component Detection. - Sinh
run_id = {YYYY-MM-DD}-{HHMMSS}-{slug}(xemagents/pipeline/observability.md#run-id-convention). Slug = 4-6 từ đầu củauser_task, lowercase, ký tự không phải[a-z0-9]thay bằng-, max 40 ký tự. - Verify patterns/contracts tồn tại (hallucination check sớm):
- Với mỗi
patterntrongintent.patterns_needed→ Glob{effective_knowledge_root}/workspaces/{workspace}/platform/patterns/{pattern}.md. Tồn tại → ghipatterns_verified[]vớiexists: true, path: .... Không tồn tại →exists: false, path: nullVÀ thêm vàointent.missing_knowledge. KHÔNG xoá pattern khỏipatterns_needed. - Tương tự cho mỗi
contracttrongintent.contracts_touched(Globplatform/contracts/). unverified_count= số entry cóexists: false(cộng pattern + contract).
- Với mỗi
- Nếu
config_hintcó sẵndomain/project→ dùng luôn, không tự đoán lại.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 71 lines · 41 tokens per session scan A 32305ad65d36
contextd-planner is an agent published in the GitHub repository philngt/contextd (29 stars, last pushed 2mo ago), licensed MIT. It adds 41 tokens to every session and 1,130 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
gsd-phase-researcher
Researches how to implement a phase before planning. Produces RESEARCH.md consumed by gsd-planner. Spawned by /gsd:plan-phase orchestrator.
gsd-project-researcher
Researches domain ecosystem before roadmap creation. Produces files in .planning/research/ consumed during roadmap creation. Spawned by /gsd:new-project or /gsd:new-milestone orchestrators.
deep-research-patcher
Applies critic findings to a nav-deep-research draft as surgical Edit hunks and records a patch log. Tool-locked so it cannot regenerate the report. Spawned once at step 5 by the nav-deep-research skill.
lead
Workflow orchestrator. Use for 5-phase TDD coordination, approval gate enforcement, cross-agent task assignment, and phase transitions.
replanner
Triggered by failure-classifier on F2-F4 escalations. Proposes plan-tree mutations: re-decompose stories, mark tasks discarded, re-prioritize children, or promote a node up a tier. Read-only on code; mutations applied via master-planner.
gsd-debugger
Investigates bugs using scientific method, manages debug sessions, handles checkpoints. Spawned by /gsd:debug orchestrator.