惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
WordPress大学
WordPress大学
Recent Announcements
Recent Announcements
G
Google Developers Blog
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
Check Point Blog
J
Java Code Geeks
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
量子位
A
About on SuperTechFans
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - idodekerobo/draft-cli-plugin: The Draft PM Agent...
idodekerobo · 2026-05-10 · via Hacker News: Show HN

Draft — Claude Code + Codex CLI + Cursor

Draft is a PM brain for Claude Code, Codex CLI, and Cursor. Install it once, run /setup, and every session starts with full product context — no re-explaining required.

Platform support: macOS and Linux only. The plugin's session hook is a bash script and requires a POSIX shell environment. Windows (including WSL) is untested and not currently supported.


Quick start

Claude Code

/plugin marketplace add idodekerobo/draft-cli-plugin
/plugin install draft
/draft:setup

Codex

curl -fsSL https://raw.githubusercontent.com/idodekerobo/draft-cli-plugin/main/scripts/codex-setup.sh | bash

Restart Codex, then run:

$draft-setup

Cursor

curl -fsSL https://raw.githubusercontent.com/idodekerobo/draft-cli-plugin/main/scripts/cursor-setup.sh | bash

Restart Cursor. Your product context loads automatically into every new Composer session — no action needed. If this is your first time using Draft, run /draft-setup in the Agent tab.


Why Draft

You open a new Claude session. It doesn't know what you shipped last week. It doesn't know you changed the ICP. It doesn't know you dropped that feature. You're back to square one — again.

That's the default. Every session starts blank.

Draft fixes two things that make this worse over time:

Context amnesia — the blank slate problem. Without Draft, you're re-explaining your product, your stack, your priorities at the start of every session. It's not just annoying — it means Claude is reasoning from whatever scraps you happened to paste in, not from a real picture of what you're building. Draft's session hook injects a live snapshot of your full product context (company, product, team, priorities, memory) before you type a single word.

Context rot — the slow decay problem. Even if you have a CLAUDE.md or context files, they go stale. You shipped something, changed direction, dropped a bet — and your docs still describe the old world. The longer you work, the more your context diverges from reality. Claude is confidently reasoning from a version of your product that no longer exists.

Draft solves this with an append-only log and a persistent index of recent changes. Every time something meaningful happens — a decision, a scope change, something shipped or dropped — draft-learner logs it and updates the index. That index loads in every session automatically. So even if your full context documents haven't been touched in weeks, the session always knows what just happened.

The feeling: your AI tool behaves like a collaborator who was in every previous session — not a new hire you brief from scratch each time.


Installation

Claude Code

Option 1 — Plugin marketplace (recommended):

/plugin marketplace add idodekerobo/draft-cli-plugin
/plugin install draft

Then run the setup interview:

/draft:setup

Option 2 — Local install (for testing/development):

claude --plugin-dir ./draft-cli-plugin
/draft:setup

The plugin's SessionStart hook handles everything else automatically on first launch.


Codex

This is a direct install, not a Codex plugin. The setup script writes directly into your ~/.codex/ directory — no plugin marketplace involved.

Option 1 — curl (no clone needed):

curl -fsSL https://raw.githubusercontent.com/idodekerobo/draft-cli-plugin/main/scripts/codex-setup.sh | bash

Option 2 — from a local clone:

bash ./scripts/codex-setup.sh

The script installs seven things:

  1. Creates ~/.draft/workspace/ with a blank context/memory structure
  2. Installs inject-context.sh to ~/.codex/hooks/draft/
  3. Registers the SessionStart hook in ~/.codex/hooks.json
  4. Enables the codex_hooks feature flag in ~/.codex/config.toml
  5. Installs sub-agent TOML files to ~/.codex/agents/
  6. Writes pm-agent instructions to ~/.codex/AGENTS.md
  7. Installs the $draft-setup skill to ~/.agents/skills/draft-setup/SKILL.md

After the script completes, restart Codex, then run:

$draft-setup

Note on $ prefix: $draft-setup is how Codex invokes skills. The $ prefix is Codex-specific — slash commands (like /draft:setup) are Codex built-ins only and cannot be extended by external installs.

To uninstall:

bash ./scripts/codex-uninstall.sh

Cursor

This is a direct install into ~/.cursor/. The setup script is smart about what it installs — if the Claude Code or Codex plugin is already installed, it skips anything that would create a duplicate PM brain in Cursor's context (see Multi-editor setup below).

Option 1 — curl (no clone needed):

curl -fsSL https://raw.githubusercontent.com/idodekerobo/draft-cli-plugin/main/scripts/cursor-setup.sh | bash

Option 2 — from a local clone:

bash ./scripts/cursor-setup.sh

The script installs:

  1. Creates ~/.draft/workspace/ if it doesn't already exist
  2. Installs cursor-session-start.sh to ~/.cursor/hooks/draft/
  3. Registers the sessionStart hook in ~/.cursor/hooks.json
  4. [If no Claude Code/Codex plugin] Installs draft-context.mdc to ~/.cursor/rules/
  5. [If no Claude Code plugin] Installs sub-agents to ~/.cursor/agents/
  6. Installs the /draft-setup skill to ~/.cursor/skills/ and ~/.agents/skills/

After the script completes, restart Cursor. Your product context will be automatically injected into every new Agent tab (Composer) session — you don't need to do anything. The injection happens silently in the background via the sessionStart hook.

If this is a fresh Draft install, open the Agent tab and run:

/draft-setup

To uninstall:

bash ./scripts/cursor-uninstall.sh

Keeping Draft up to date

Draft checks for updates automatically in the background on every session start. When a new version is available, your pm-agent will mention it at the start of your next session and offer to apply the update.

Check and apply an update

Claude Code:

/draft:update

Codex:

$draft-update

Cursor:

/draft-update

The update command shows what version you're on, what's available, and asks for confirmation before doing anything. It downloads the new files, updates your install, and tells you what changed. You'll need to restart your session for changes to take effect.

The update never touches your PM brain data at ~/.draft/workspace/ — only the plugin files themselves are updated.

How version tracking works

  • Your installed version is recorded at ~/.draft/version when you first install
  • The update check fetches the latest VERSION from the GitHub repo and compares (runs in background, cached for 60–720 minutes)
  • The update script re-downloads files at the exact tagged release version — no moving targets

Release workflow (for contributors)

# Bump VERSION and .claude-plugin/plugin.json, then:
git tag v1.x.x && git push origin v1.x.x
gh release create v1.x.x --title "v1.x.x" --notes "..."

How it works

Agent architecture

Draft uses an orchestrator + three sub-agents pattern. The pm-agent is the main thread — it handles all PM work and delegates to specialists.

Agent Role
pm-agent Orchestrator. Owns all PM behavior. Delegates to the three agents below.
draft-researcher Need to KNOW something — reads workspace files, fetches web content
draft-executor Need to DO something — writes PRDs, decision docs, updates files
draft-learner Need to REMEMBER something — updates context files, logs decisions

Most requests follow: draft-researcher gathers context → draft-executor acts → draft-learner saves. You can also invoke draft-learner directly — run /draft:learn anytime to capture a decision, scope change, or anything worth remembering outside of a full PM session.


Slash commands

Draft ships two slash commands (skills). Both are auto-discovered by Claude Code, and manually installed by the Codex and Cursor setup scripts.

/draft:setup ($draft-setup on Codex, /draft-setup on Cursor)

Runs the PM brain initialization interview. Ask it once at install, or again after a significant product shift. See Quick start.


/draft:learn ($draft-learn on Codex, /draft-learn on Cursor)

Manually tells Draft to remember something — a decision you made, a priority that shifted, a term your team uses, anything worth persisting to your workspace. You can call it three ways:

1. No arguments — conversational

/draft:learn

Draft asks one question: "What did you learn or decide?" You answer, it figures out where to write it, confirms what it saved.

Best when: you want to capture something but haven't formed it into a statement yet.


2. Free-form statement

/draft:learn we decided to drop the bridge daemon and go plugin-only

Draft reads the statement, classifies the type of learning (decision, priority shift, product direction, company update, team change, or preference), routes it to the right file(s), and confirms. It will only ask a clarifying question if the classification is genuinely ambiguous — most statements are clear enough to route automatically.

Best when: you know what you want to save and just want to say it.


3. Explicit tag

/draft:learn [decision] drop the bridge daemon
/draft:learn [priority] bridge daemon is now deferred
/draft:learn [product] ICP is now "the curator" — one high-agency PM who owns source of truth
/draft:learn [vocab] "builders" = PMs and founders using Claude Code

The tag tells Draft exactly where to write without any inference. Supported tags: [decision], [priority], [product], [company], [team], [memory], [pref], [vocab].

Best when: you know the type and want the fastest, most predictable path.


What gets written and where

Learning type Destination Log entry?
[decision] context/decisions/{slug}.md No (plus any affected index files)
[priority] context/priorities/index.md Yes
[product] context/product/index.md Yes
[company] context/company/index.md Structural changes only
[team] context/team/index.md Structural changes only
[memory] / [pref] / [vocab] memory/memory.md No

A single learning can map to multiple files. "We decided to cut the bridge daemon" writes a decision file, updates context/product/index.md, and updates context/priorities/index.md — because all three reflect the new reality.

Claude Code

settings.json activates draft:pm-agent as the main Claude Code thread. Every session opens with the pm-agent system prompt rather than the default Claude Code prompt.

Codex

~/.codex/AGENTS.md contains the pm-agent instructions and loads as persistent context for every Codex session. Sub-agents are installed as custom agent .toml files in ~/.codex/agents/.

Cursor

~/.cursor/rules/draft-context.mdc (installed with alwaysApply: true) contains the pm-agent instructions and is injected into every Agent tab session. Sub-agents are available in ~/.cursor/agents/ and invocable by name in the Agent tab. When Claude Code is also installed, Cursor reads ~/.claude/agents/ directly and draft-context.mdc is skipped to avoid duplication.


Context loading

There are two layers of context loaded at session start:

1. Agent system prompt — static

The pm-agent's instructions define:

  • PM role and orchestration behavior
  • Delegation rules and when to use each sub-agent
  • Document writing flow and template selection
  • Context staleness policy (7-day / 21-day)
  • Proactive memory rules and what's worth persisting
  • Onboarding detection (auto-starts setup interview if no context exists)

2. Workspace context — dynamic

Injected on every session start via hook. Outputs a live snapshot of:

Section What it contains
Workspace structure Two-level directory listing of context/
Context index Frontmatter from each context/*/index.md: name, description, last_updated, source
Current priorities Full context/priorities/index.md
Memory Full memory/memory.md — vocabulary, preferences, patterns, goals

The pm-agent uses this as its orientation layer. When a task needs more detail than the frontmatter provides, it reads the relevant file in full.

Editor Hook mechanism Output format
Claude Code SessionStartinject-context.sh Raw text into session context
Codex SessionStartinject-context.sh Raw text as developer context
Cursor sessionStartcursor-session-start.sh { "additional_context": "..." } JSON into initial system context

Session lifecycle

Claude Code — first session (after install)

  1. SessionStart hook fires → runs scripts/session-init.sh
  2. Workspace bootstrap (guarded — runs once): copies workspace-template/~/.draft/workspace/
  3. ~/.claude/settings.json updated (guarded — runs once): sets DRAFT_WORKSPACE env var, adds ~/.draft/workspace to additionalDirectories, grants Read/Write/Edit for ~/.draft/**
  4. Settings take effect on the next session start

Claude Code — every subsequent session

  1. session-init.sh guards pass, exits in <10ms
  2. inject-context.sh runs — outputs live workspace snapshot into session context
  3. draft:pm-agent activates as main thread
  4. pm-agent is oriented: context dimensions, freshness, priorities, memory

Codex — after running codex-setup.sh

  1. SessionStart hook fires → inject-context.sh runs, outputs workspace snapshot as developer context
  2. ~/.codex/AGENTS.md (pm-agent instructions) loads as persistent context
  3. pm-agent is oriented and ready

Cursor — after running cursor-setup.sh

  1. New Agent tab (Composer) session opens
  2. sessionStart hook fires → cursor-session-start.sh runs silently in the background
  3. Workspace snapshot injected as initial system context via additional_context
  4. draft-context.mdc rule loaded (if Claude Code plugin is not also installed)
  5. pm-agent is oriented and ready — context loads before you type your first message

Multi-editor setup

Draft's workspace at ~/.draft/workspace/ is shared across all editors. Running setup for multiple editors does not create multiple workspaces — it just connects each editor to the same PM brain.

If you use Claude Code + Cursor: Run claude plugin install first, then cursor-setup.sh. The Cursor setup script detects the Claude Code plugin and skips installing duplicate rules and sub-agents. Cursor reads ~/.claude/agents/ natively.

If you use Codex + Cursor: Run codex-setup.sh first, then cursor-setup.sh. The Cursor setup script detects ~/.codex/AGENTS.md and skips the rules install. Sub-agents are still installed to ~/.cursor/agents/ since Cursor does not read ~/.codex/agents/ natively.

If you use all three: Claude Code install first, then Codex, then Cursor. Cursor will use Claude Code's agents and skip its own rules install.


Plugin structure

draft-cli-plugin/
├── .claude-plugin/
│   ├── plugin.json               Claude Code plugin manifest
│   └── marketplace.json          Plugin marketplace catalog
├── .codex/
│   ├── AGENTS.md                 pm-agent instructions for Codex (→ ~/.codex/AGENTS.md)
│   └── agents/
│       ├── draft-researcher.toml Codex sub-agent definition
│       ├── draft-executor.toml   Codex sub-agent definition
│       └── draft-learner.toml    Codex sub-agent definition
├── .cursor/
│   ├── hooks.json                In-repo Cursor hooks config (dev use)
│   └── rules/
│       └── draft-context.mdc     pm-agent instructions for Cursor (→ ~/.cursor/rules/)
├── .cursor-plugin/
│   └── plugin.json               Cursor marketplace manifest (pending submission)
├── agents/
│   ├── pm-agent.md               Orchestrator agent (Claude Code + Cursor)
│   ├── draft-researcher.md       Researcher sub-agent
│   ├── draft-executor.md         Executor sub-agent
│   └── draft-learner.md          Learner sub-agent
├── skills/
│   ├── draft-setup/SKILL.md      Onboarding interview skill
│   └── draft-learn/SKILL.md      Manual learning capture skill
├── hooks/
│   └── hooks.json                Claude Code SessionStart hooks config
├── scripts/
│   ├── session-init.sh           Claude Code — guarded bootstrap + settings config
│   ├── inject-context.sh         Claude Code + Codex — context injection hook
│   ├── cursor-session-start.sh   Cursor — context injection hook (JSON output)
│   ├── codex-setup.sh            Codex — one-time setup
│   ├── codex-uninstall.sh        Codex — removes everything codex-setup.sh installed
│   ├── cursor-setup.sh           Cursor — one-time setup
│   └── cursor-uninstall.sh       Cursor — removes everything cursor-setup.sh installed
├── workspace-template/           Blank workspace, copied to ~/.draft/workspace on first run
│   ├── CLAUDE.md
│   ├── context/
│   │   ├── company/index.md
│   │   ├── product/index.md
│   │   ├── priorities/index.md
│   │   ├── team/index.md
│   │   ├── user/index.md
│   │   ├── decisions/            (empty — populated as decisions are made)
│   │   └── tensions.md
│   ├── docs/                     (empty — written artifacts live here)
│   └── memory/
│       └── memory.md
├── README.md
└── CHANGELOG.md

Workspace layout

All editors share the same workspace at ~/.draft/workspace/:

~/.draft/workspace/
├── context/
│   ├── company/index.md + log/
│   ├── product/index.md + log/
│   ├── user/index.md
│   ├── team/index.md + log/
│   ├── priorities/index.md + log/
│   ├── decisions/                 ← all decisions, one file per decision
│   └── tensions.md
├── memory/
│   └── memory.md
└── docs/                          ← written artifacts: analyses, PRDs, strategies
    YYYYMMDDHHMMSS_slug.md         (flat — no subdirectories)

The workspace lives outside ~/.claude/, ~/.codex/, and ~/.cursor/ intentionally — it's editor-agnostic and shared across all three.


Path conventions

Variable Resolves to Set by
$DRAFT_WORKSPACE ~/.draft/workspace session-init.sh (Claude Code) / codex-setup.sh (Codex) / cursor-setup.sh (Cursor)

Testing locally

Claude Code

# Load the plugin for a single session
claude --plugin-dir ./draft-cli-plugin

# Verify settings were written after first session
cat ~/.claude/settings.json | python3 -m json.tool

# Run setup
/draft:setup

# Verify workspace
ls ~/.draft/workspace/

Codex

# Run the setup script from the plugin repo
bash ./scripts/codex-setup.sh

# Verify hook was registered
cat ~/.codex/hooks.json | python3 -m json.tool

# Verify agents were installed
ls ~/.codex/agents/

# Verify AGENTS.md was written
head -5 ~/.codex/AGENTS.md

# Verify the skill was installed
ls ~/.agents/skills/

# Restart Codex, then run setup
$draft-setup

# To uninstall
bash ./scripts/codex-uninstall.sh

Cursor

# Run the setup script from the plugin repo
bash ./scripts/cursor-setup.sh

# Verify hook was registered
cat ~/.cursor/hooks.json | python3 -m json.tool

# Verify the session-start script outputs valid JSON
bash ~/.cursor/hooks/draft/cursor-session-start.sh

# Verify sub-agents were installed (if Claude Code plugin is not present)
ls ~/.cursor/agents/

# Verify rules file was installed (if Claude Code plugin is not present)
ls ~/.cursor/rules/

# Verify the skill was installed
ls ~/.cursor/skills/

# Restart Cursor — context loads automatically in every new Agent tab session
# If fresh install, run /draft-setup in the Agent tab

# To uninstall
bash ./scripts/cursor-uninstall.sh