Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/philngt/contextd/contextd-plannergit clone --depth 1 https://github.com/philngt/contextdWhat 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 | $0.00041 | $0.01130 |
| Opus 5 | $0.00020 | $0.00565 |
| Sonnet 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 yesterday.
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.
- yesterday 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 12d ago), licensed MIT. It adds 41 tokens to every session and 1,130 once invoked, about $0.0002 per session on Opus 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.
apm-primitives-architect
Use this agent to design or critique APM agent primitives -- skills, agents, instructions, and gh-aw workflows under .apm/ and .github/. Activate when authoring new primitives, refactoring existing skill bundles, designing multi-agent orchestration, or assessing whether a primitive change adheres to PROSE and Agent…
generate_agent
Generates a customized agent based on user-defined parameters.
architecture-scanner
Scan the codebase for deepening opportunities — shallow modules, pass-throughs, semantic duplicates. Read-only. Produces a visual HTML report with before/after diagrams. Routes: CODEBASE-HEALTH workflow.
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.