Compare commits

..
63 Commits
Author SHA1 Message Date
jparkerweb fda0146969 URL updates 2026-08-01 13:04:39 -07:00
jparkerweb 75605e5e41 update URLs 2026-08-01 12:56:52 -07:00
jparkerweb 3b18b42e30 Merge pull request #3 from jparkerweb/statusline-worktree
Add git worktree awareness to status line (v1.16.1)
2026-07-31 22:24:02 -07:00
jparkerweb 8e457fa6e4 Bump to v1.16.1 for status line git worktree awareness 2026-07-31 22:20:38 -07:00
jparkerweb 6740e26261 Add git worktree awareness to status line
Sessions in a linked worktree previously showed only the worktree's
directory name, so the underlying repository was unidentifiable and the
session looked like an unrelated project.

The project segment now renders as "repo | worktree". Repo identity comes
from git rev-parse --git-common-dir, so it is correct regardless of how the
worktree directory was named. A leading repo prefix is stripped from the
worktree name, and the name collapses to a bare marker when it merely
restates the branch already on screen -- matched across / _ . - separators
and type prefixes like feature/, and only when the branch is displayed.

Gated behind the new items.worktree config flag (default on). Costs one
extra timeout-bounded git call, skipped entirely outside git repos.
2026-07-31 22:20:38 -07:00
jparkerweb aedfe944b2 Merge pull request #2 from jparkerweb/handoff
Release v1.16.0: install handoff skill, add publish skill, sync upstream
2026-07-20 22:39:25 -07:00
jparkerweb 9b3c06b498 Address PR review feedback: update step label + release-list limit 2026-07-20 22:36:35 -07:00
jparkerweb 8fe1bfa805 Set v1.16.0 releaseDate to 2026-07-20 2026-07-20 22:33:24 -07:00
jparkerweb 68542fd778 Release v1.16.0: install handoff skill, add publish skill, sync upstream
- Make plan2code-handoff an installed workflow prompt: move to src/,
  register in install.js SOURCE_PROMPTS, remove repo-local-only copy
- Add repo-local maintainer /plan2code-publish skill (cuts GitHub Releases;
  excluded from install.js)
- Review workflow next-step suggestion made context-aware (upstream v1.15.4)
- Doc updates: list handoff in README, QUICK-REFERENCE, architecture table;
  add "Adding a New Workflow Prompt / Skill" checklist to dev-commands
- Fix broken AGENTS.md index links: rename .agents-docs loop/metrics files
  to plan2code-* to match references
- Bump version.json to 1.16.0 to align with package.json and CHANGELOG
2026-07-20 22:31:37 -07:00
jparkerweb 4656a6ebb7 Merge pull request #1 from jparkerweb/handoff
Add plan2code-handoff skill for conversation handoff documents
2026-07-20 22:09:45 -07:00
jparkerweb 7e9de755f1 Add plan2code-handoff skill for conversation handoff documents
AI Assisted
2026-07-20 22:07:21 -07:00
jparkerweb 4b20f93bb9 Bump to v1.15.4 for status line reasoning effort and context token count
AI Assisted
2026-07-19 21:22:54 -07:00
jparkerweb 5b3b84f0a9 Add reasoning effort label and context token count to status line
AI Assisted
2026-07-19 21:18:10 -07:00
jparkerweb 1015b99a6a Sync upstream workflow improvements (v1.15.3): session-end summaries, Sync & Maintain in init-update, plan research steps, ls-based spec discovery, revision/commit guardrails; bump version to v1.15.3
AI Assisted
2026-06-28 11:46:40 -07:00
jparkerweb 20a9e2f040 sync update 2026-06-01 20:44:05 -07:00
jparkerweb 28bda05cbf Stop ignoring CLAUDE.md
AI Assisted
2026-06-01 19:42:19 -07:00
jparkerweb 5274bdbd51 Add password-protected sync-repo skill with encrypted body
Adds a project-local /sync-repo skill whose real instructions are encrypted
at rest (AES-256-GCM + scrypt) in sync-repo.enc and only revealed in-session
after the user supplies the correct passphrase. Plaintext SYNC.md is gitignored
and never committed; *.enc is marked binary to protect the ciphertext bytes.

AI Assisted
2026-06-01 19:41:34 -07:00
jparkerweb 25d874d87d v1.15.2 — add Claude CLI status line, Zed support, rename 3b-review to review
- Status line: new src/statusline-claude/ (Planny box-star mascot icon),
  install/uninstall wiring in install.js, Install All (A) + Custom (S)
- Zed agent support across README, AGENTS, docs, init prompt, installer
- Rename /plan2code-3b-review to /plan2code-review (now a standalone
  utility workflow); update file, reference dir, and all cross-references
- install.js: fs.rmSync simplifications, async install, summary cleanup
- Bump to v1.15.2; CHANGELOG entries for v1.15.0/1/2
2026-06-01 16:39:35 -07:00
jparkerweb 5e48e98293 v1.14.0 — add Step 3b review workflow, unify file naming, resilient code references
- Add /plan2code-3b-review: 5-step post-implementation review with adaptive
  scope, 11 dimensions, reference-file architecture, and Plan/Apply/Verify fixes
- Unify workflow/skill file naming to single-dash (drop -- and --- conventions)
- Add Devin platform support and CLAUDE.md MANDATORY FIRST STEP template
- Guide agents to use semantic anchors over line numbers in workflow prompts
- Bump version to 1.14.0
2026-05-23 06:58:20 -07:00
jparkerweb 8e0b1a2ab2 v1.11.1 — installer 'A' option and bot evaluation notes
- install.js: split into 'I' (prompts + loop) and new 'A' (everything
  including bot + metrics); update prompt to (I, A, U, C, Q).
- CHANGELOG: document complexity check (1.11.1) and expand 1.11.0
  notes for the LLM-as-judge evaluation system.
- version.json: 1.10.0 -> 1.11.1.
2026-05-11 13:14:35 -07:00
jparkerweb c2579a7b6a plan2code-bot: replace auto-responder with LLM-as-judge evaluation
Bot now acts as an authentic QA agent instead of rubber-stamping every
question and step.

- intelligent-responder answers AskUserQuestion via LLM using current
  observations (tools used, files created, errors) instead of keyword
  matching; auto-responder removed.
- evaluator runs after each step with step-specific criteria
  (prompts/evaluation-criteria.ts), produces 0-100 score plus
  strengths/weaknesses/critical issues. Avg <60 blocks finalization.
- observation-collector captures tool_use, file writes, errors, and
  question reasoning; session-runner falls back to scraping tool_use
  blocks when canUseTool doesn't fire and dedupes both sources.
- Bot writes BOT-EVALUATION.md and BOT-NOTES.md for metrics analysis.
- Idea generator: 12 categories instead of CLI/web-app coin flip,
  stronger seed adherence, less developer-tool bias.
- Init step now writes a minimal AGENTS.md stub instead of running
  the full init skill, avoiding hallucinated architecture before plan.
- Implement step uses Read/Write/Edit/Glob/Grep directly instead of
  a Skill sub-session that produced no visible tool observations.
- bin: add --help, accept --idea="value" form, strip surrounding
  quotes; evaluator maxTurns 3 -> 30; warn when parser misses SCORE.
2026-05-11 13:14:28 -07:00
jparkerweb 9d1104d105 metrics: adopt METRICS_JSON HTML comment as primary format
Plan, document, and finalize prompts now emit a single
<!-- METRICS_JSON {...} --> block with all structured fields. Collector
parses these directly and keeps the old prose/table parsing as fallback.

Also adds a per-task complexity check to the document prompt:
split tasks with 3+ complexity signals (5+ logic branches, 2+
integration points, shared interface mutation, etc.), combine
adjacent trivial tasks.
2026-05-11 13:14:15 -07:00
jparkerweb 72fed09aab prompts: drop Git Commit Messages section from AGENTS.md and init flows
Project-specific commit conventions don't belong in the generic init
templates. AGENTS.md, init, and init-update no longer mention or audit
a Git Commit Messages section.
2026-05-11 13:14:08 -07:00
jparkerweb 37311a7e68 v1.11.0 — add plan2code-bot to root changelog 2026-03-01 21:33:57 -08:00
jparkerweb c92865c395 feat: add plan2code-bot with --resume capability and state cleanup
Add the autonomous workflow test runner (plan2code-bot) that uses the
Claude Agent SDK to run plan2code end-to-end. Includes --resume flag
to continue incomplete runs from saved state, and automatic state file
cleanup on successful completion.
2026-03-01 21:30:45 -08:00
jparkerweb 63656d339d v1.10.0 2026-03-01 12:24:11 -08:00
jparkerweb 628e688ab9 Planny hit the gym and lost some weight
Trimmed the mascot ASCII art across all prompts and installer.
Planny is now more aerodynamic and 40% less chunky.
2026-02-22 21:48:13 -08:00
jparkerweb 157e55ef2e docs: update AGENTS.md with plan2code-metrics section and corrections
- Add plan2code-metrics to architecture tree, dev commands, installer menu
- Add full metrics section (data flow, CLI menu, key files, feedback format, metric targets)
- Fix Code Style: split install.js (CommonJS) vs loop/metrics (TypeScript+ESM)
- Update finalize prompt description to reflect 7 steps
- Add metrics-specific gotchas (internal prompts, feedback table format)
2026-02-22 21:47:45 -08:00
jparkerweb 02fd4efa40 v1.8.1 — add user feedback collection to plan2code-metrics 2026-02-22 21:41:16 -08:00
jparkerweb 348c8ed7b2 feat: add user feedback collection to plan2code-metrics
- Add UserFeedback type (rating 1-10, reason, went well, went poorly)
- Collector parses ## User Feedback table from overview.md
- Aggregator computes avg_user_rating and feedback_count per cohort
- CLI offers interactive feedback collection with pipe-safe escaping
- Finalize prompt collects optional feedback as Step 5 (before archival)
- Analysis/improvement prompts reference avg_user_rating metric target
2026-02-22 21:38:58 -08:00
jparkerweb 5c2f70a37c v1.8.0 — add plan2code-metrics recursive self-improvement toolchain
New package for contributors to collect, aggregate, analyze, and improve
workflow prompts based on real project data. Includes unit tests (vitest),
installer integration, and loop/finalize hints.
2026-02-22 19:57:40 -08:00
jparkerweb de46275b51 v1.7.0 2026-02-22 12:58:08 -08:00
jparkerweb b7b2595fe1 v1.6.1 2026-02-18 15:16:11 -08:00
jparkerweb 6f98f6bd7f v1.5.4 2026-02-17 09:13:23 -08:00
jparkerweb 035cc680a7 spacing 2026-02-03 20:32:18 -08:00
jparkerweb 34704eaf84 v1.5.2 2026-01-27 12:11:00 -08:00
jparkerweb 474e591f58 v1.3.3: Learning Capture Protocol and improved session instructions 2025-12-31 13:07:27 -08:00
jparkerweb 6a6b4c6fac naming and prompt cleanup 2025-12-25 22:02:24 -08:00
jparkerweb b865b74cd0 docs 2025-12-25 21:45:41 -08:00
jparkerweb f8c7a96bc7 docs
Updated README to include new workflow details and installation instructions.
2025-12-25 21:45:05 -08:00
jparkerweb edee3fc65e docs 2025-12-23 17:23:23 -08:00
jparkerweb 9d67de78c8 improved build and install process 2025-12-23 15:42:35 -08:00
jparkerweb 2409e8dbfb Delete .windsurf directory 2025-12-22 09:11:18 -08:00
jparkerweb eaa9a633a0 Delete .github directory 2025-12-22 09:11:10 -08:00
jparkerweb 9a49ba09fb Delete .cursor directory 2025-12-22 09:11:00 -08:00
jparkerweb 7898ebf7ab Delete .continue directory 2025-12-22 09:10:49 -08:00
jparkerweb e33a67e269 Delete .claude directory 2025-12-22 09:10:40 -08:00
jparkerweb 92acc99b71 Delete .agent directory 2025-12-22 09:10:27 -08:00
jparkerweb 50c281f11f v1.0.4 - Added explicit transition check to Planning Phase 6 2025-12-07 17:52:40 -08:00
jparkerweb 5159b531ec v1.0.3 2025-12-05 21:44:21 -08:00
jparkerweb 0cee0f8962 v1.0.2 2025-12-05 15:41:23 -08:00
jparkerweb b2fdab6814 - Added Initial Context Check to Planning Phase 1 - Model now asks about additional files, reference materials, and external integrations before
analyzing requirements
- Added user verification checklist and git checkpoint to `Implementation Phase 3` - Phase completion reports now guide users through verification and git checkpointing before starting the next phase
2025-12-05 10:43:58 -08:00
jparkerweb f7da7d34c0 docs 2025-12-04 21:30:41 -08:00
jparkerweb 18321b62da docs 2025-12-04 20:51:05 -08:00
jparkerweb 495a5bb861 docs 2025-12-04 20:28:25 -08:00
jparkerweb d9f87a7eb1 update website 2025-12-04 20:23:33 -08:00
jparkerweb be41f3f1f8 Revise README for Plan2Code workflow updates
Updated the README to reflect changes in the Plan2Code workflow, including new file references and installation instructions.
2025-12-04 18:10:42 -08:00
jparkerweb 87167f54f4 docs 2025-12-04 18:09:23 -08:00
jparkerweb a4d15faba9 Create CNAME 2025-12-04 17:47:20 -08:00
jparkerweb 7a25084d25 Update and rename plan2code.html to index.html 2025-12-04 17:42:27 -08:00
jparkerweb d908a4d44c docs 2025-12-04 17:36:20 -08:00
jparkerweb 15911e970a v1.0.0 2025-12-04 17:34:22 -08:00
jparkerweb 4086c2e592 Initial commit 2025-12-02 20:59:19 -08:00
11 changed files with 144 additions and 35 deletions

No files matched your search

+9
View File
@@ -2,6 +2,15 @@
All notable changes to Plan2Code will be documented in this file.
## v1.16.1
### ✨ Added
- **Status line: git worktree awareness** — a session running in a linked git worktree now renders the project segment as `repo ⑂ worktree` (e.g. `plan2code ⑂ spike`) instead of only the worktree's directory name, which previously made the session look like an unrelated project
- Repo identity resolved from `git rev-parse --git-common-dir`, so it is correct regardless of how the worktree directory was named (bare `<name>.git` main repos included)
- A leading repo prefix is stripped from the worktree name (`plan2code-user-auth` → `user-auth`), and the name collapses to a bare `⑂` when it merely restates the branch already on screen — matched across `/ _ . -` separators and type prefixes like `feature/`, and only when the branch is actually displayed
- Toggleable via the new `items.worktree` config flag (default on); one extra timeout-bounded `git` call, skipped outside git repos
## v1.16.0
### ✨ Added
+3 -15
View File
@@ -75,14 +75,8 @@ The install script requires **Node.js** (v14 or later). If you don't have Node.j
Run the interactive installer directly using `npx` with your preferred GitHub authentication method:
**If you use SSH keys:**
```bash
npx git+ssh://git@github.com/jparkerweb/plan2code.git
```
**If you use HTTPS authentication:**
```bash
npx git+https://github.com/jparkerweb/plan2code.git
npx git+https://code.jparkerweb.com/jparkerweb/plan2code.git
```
This downloads the installer to a temporary location, runs it, installs the workflow files to your machine, and cleans up automatically. The installed workflows remain on your system and work independently. To update or reinstall, simply run the command again.
@@ -93,14 +87,8 @@ This downloads the installer to a temporary location, runs it, installs the work
Run the interactive installer directly using `npx` with your preferred GitHub authentication method:
**If you use SSH keys:**
```bash
npx git+ssh://git@github.com/jparkerweb/plan2code.git
```
**If you use HTTPS authentication:**
```bash
npx git+https://github.com/jparkerweb/plan2code.git
npx git+https://code.jparkerweb.com/jparkerweb/plan2code.git
```
This downloads the installer to a temporary location, runs it, installs the workflow files to your machine, and cleans up automatically. The installed workflows remain on your system and work independently. To update or reinstall, simply run the command again.
@@ -109,7 +97,7 @@ This downloads the installer to a temporary location, runs it, installs the work
```bash
# Clone the repository
git clone https://github.com/jparkerweb/plan2code.git
git clone https://code.jparkerweb.com/jparkerweb/plan2code.git
cd plan2code
# Run the interactive installer
+6 -6
View File
@@ -905,7 +905,7 @@
<h1 class="code">CODE</h1>
</div>
<p class="hero-subtitle">The AI workflow that puts planning first</p>
<a href="https://github.com/jparkerweb/plan2code" class="github-link" target="_blank" rel="noopener noreferrer">
<a href="https://code.jparkerweb.com/jparkerweb/plan2code" class="github-link" target="_blank" rel="noopener noreferrer">
<svg class="github-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
Get the Code
</a>
@@ -1083,14 +1083,14 @@
<h3 class="subheadline">Install the workflow</h3>
<p>Run the install script to copy the Plan2Code prompts to your AI assistant workflow directories. Works with Claude Code, Cursor, GitHub Copilot, Windsurf, and more.</p>
<pre class="code-block"><span class="comment"># Clone the repository</span>
<span class="command">git clone https://github.com/jparkerweb/plan2code.git</span>
<span class="command">git clone https://code.jparkerweb.com/jparkerweb/plan2code.git</span>
<span class="comment"># Navigate to the directory</span>
<span class="command">cd plan2code</span>
<span class="comment"># Run the interactive installer</span>
<span class="command">node install.js</span></pre>
<p><a href="https://github.com/jparkerweb/plan2code" class="inline-link" target="_blank" rel="noopener noreferrer">Get the Code &rarr;</a></p>
<p><a href="https://code.jparkerweb.com/jparkerweb/plan2code" class="inline-link" target="_blank" rel="noopener noreferrer">Get the Code &rarr;</a></p>
<div class="install-screenshot">
<img src="install-script.jpg" alt="Plan2Code global installation terminal interface showing platform selection menu">
</div>
@@ -1124,8 +1124,8 @@
<!-- CTA Section -->
<section class="cta">
<h2 class="cta-text headline"><a class="-plain" href="https://github.com/jparkerweb/plan2code">START<br>PLANNING<br>NOW</a></h2>
<a href="https://github.com/jparkerweb/plan2code" class="cta-button" target="_blank" rel="noopener noreferrer">GET THE CODE</a>
<h2 class="cta-text headline"><a class="-plain" href="https://code.jparkerweb.com/jparkerweb/plan2code">START<br>PLANNING<br>NOW</a></h2>
<a href="https://code.jparkerweb.com/jparkerweb/plan2code" class="cta-button" target="_blank" rel="noopener noreferrer">GET THE CODE</a>
<p class="cta-subtext">Transform your AI development workflow today</p>
</section>
@@ -1199,7 +1199,7 @@
document.querySelector('.cta-text').setAttribute('tabindex', '0');
document.querySelector('.cta-text').addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
window.open('https://github.com/jparkerweb/plan2code', '_blank');
window.open('https://code.jparkerweb.com/jparkerweb/plan2code', '_blank');
}
});
});
+2 -2
View File
@@ -646,7 +646,7 @@ function displayHeader() {
console.log('║ ╰───╯ Welcome to Plan2Code! ║');
console.log('║ ║');
console.log('║ G L O B A L I N S T A L L A T I O N S Y S T E M ║');
console.log('║ https://jparkerweb.github.io/plan2code ║');
console.log('║ https://code.jparkerweb.com/jparkerweb/plan2code ║');
console.log('║ ║');
console.log('╚═════════════════════════════════════════════════════════╝');
console.log(COLORS.RESET);
@@ -1299,7 +1299,7 @@ async function install(targets = null) {
if (totalErrors === 0) {
console.log(`${COLORS.GREEN} ╭───╮${COLORS.RESET} ${COLORS.BRIGHT}All done! Happy coding!${COLORS.RESET}`);
console.log(`${COLORS.GREEN} │ ${COLORS.CYAN}★${COLORS.GREEN} │${COLORS.RESET} ${COLORS.BRIGHT}If this is your first time using Plan2Code, read the docs here:${COLORS.RESET}`);
console.log(`${COLORS.GREEN} │ ${COLORS.BRIGHT}◡${COLORS.GREEN} │${COLORS.RESET} ${COLORS.BRIGHT}https://github.com/jparkerweb/plan2code${COLORS.RESET}`);
console.log(`${COLORS.GREEN} │ ${COLORS.BRIGHT}◡${COLORS.GREEN} │${COLORS.RESET} ${COLORS.BRIGHT}https://code.jparkerweb.com/jparkerweb/plan2code${COLORS.RESET}`);
console.log(`${COLORS.GREEN} ╰───╯${COLORS.RESET}`);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "plan2code",
"version": "1.16.0",
"version": "1.16.1",
"private": true,
"bin": {
"plan2code": "./install.js"
+1 -1
View File
@@ -48,7 +48,7 @@ Examples:
plan2code-bot --resume
Documentation:
https://jparkerweb.github.io/plan2code
https://code.jparkerweb.com/jparkerweb/plan2code
`);
}
@@ -57,7 +57,7 @@ Run against EVERY finding. If any question raises doubt, re-investigate or drop.
**Finding survives (real bug):** Reviewer finds `processItems()` at line 47 accesses `items[0].id` with no empty-array check. Re-reads source — confirmed no guard. Traces callers — `orchestrator.js:82` can pass empty array. Adversarial check passes (correctness issue, additive fix). Presented at High.
**Finding dropped (jira skill false positive):** Reviewer recommends removing `jira-api-catalog.md` from consumer loading to "reduce context." Adversarial check: "Does my fix remove something the system depends on?" YES — agents Read these files at runtime to construct valid API calls. Four of five checks fail. Dropped.
**Finding dropped (pcweb-jira false positive):** Reviewer recommends removing `jira-api-catalog.md` from consumer loading to "reduce context." Adversarial check: "Does my fix remove something the system depends on?" YES — agents Read these files at runtime to construct valid API calls. Four of five checks fail. Dropped.
**Finding dropped (false consolidation):** Reviewer flags per-platform config files as "duplicates." Adversarial check: "Am I optimizing for the wrong metric?" YES — platforms have distinct values and will diverge further. Separation is a design choice. Dropped.
+31
View File
@@ -20,6 +20,14 @@ A persistent three-line status bar for Claude Code that displays model info, pro
╰─╯ 2m ($0.18) │ ▰▰▱▱▱▱▱▱▱▱▱▱ 18% (36k) │ 88k in · 3k out
```
**Git worktree** — session running in a linked worktree at `C:\git\plan2code-user-auth`:
```
╭─╮ Opus 4.6 | High │ plan2code ⑂ │ feature/user-auth │ +12 -3
│★│ ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
╰─╯ 3h 5m ($4.62) │ ▰▰▰▰▰▱▱▱▱▱▱▱ 42% (84k) │ 5h: 28% · 7d: 61%
```
**Line 1:** Planny icon | Model name + reasoning effort | Project name | Git branch | Uncommitted changes
**Line 2:** Planny icon | Gray separator
**Line 3:** Planny icon | Session duration + cost | Context window bar | Usage (rate limits or token counts)
@@ -65,6 +73,7 @@ Edit `~/.claude/statusline-config.json`:
"model": true,
"effort": true,
"project": true,
"worktree": true,
"branch": true,
"contextBar": true,
"planUsage": true,
@@ -83,6 +92,7 @@ Edit `~/.claude/statusline-config.json`:
| `items.model` | `true` | Show model name (Opus, Sonnet, Haiku) |
| `items.effort` | `true` | Append the current reasoning effort level (Low/Medium/High/XHigh/Max) to the model segment, e.g. `Sonnet 5 \| High`. Reads `effort.level` from stdin; hidden when the current model doesn't support an effort parameter (field absent from stdin). |
| `items.project` | `true` | Show project directory name |
| `items.worktree` | `true` | Detect [git worktrees](https://git-scm.com/docs/git-worktree) and render the project segment as `repo ⑂ worktree` instead of just the worktree's directory name. See [Worktree Display](#worktree-display). Requires `items.project`. |
| `items.branch` | `true` | Show current git branch (falls back to short SHA when detached HEAD) |
| `items.contextBar` | `true` | Show context window usage bar with percentage |
| `items.contextTokens` | `true` | Append raw tokens used in the context window next to the percentage, e.g. `42% (84k)`. Reads `context_window.total_input_tokens` (the same input-token count `used_percentage` is derived from — excludes output tokens). Requires `items.contextBar` to also be enabled. |
@@ -101,6 +111,27 @@ Malformed config falls back to defaults silently. Type errors on individual keys
| Copilot CLI | Planned | Deferred — CLI lacks status line script support as of v0.0.421 |
| Others | Not supported | Codex CLI, Gemini CLI have built-in status, not scriptable |
## Worktree Display
With `items.worktree` disabled, a session in a linked worktree shows only that worktree's directory name (`plan2code-user-auth`) — the underlying repository identity is lost, and the session looks like an unrelated project.
When enabled, the project segment becomes `repo ⑂ worktree`:
| Worktree directory | Branch | Rendered | Why |
|--------------------|--------|----------|-----|
| `plan2code` (primary checkout) | `main` | `plan2code` | Not a linked worktree — unchanged |
| `plan2code-spike` | `spike-thing` | `plan2code ⑂ spike` | Repo prefix stripped from the worktree name |
| `plan2code-user-auth` | `feature/user-auth` | `plan2code ⑂` | Name is redundant with the visible branch — collapses to the bare marker |
| `plan2code-user-auth` | `feature/user-auth`, `items.branch: false` | `plan2code ⑂ user-auth` | No branch shown, so the name is kept |
Details:
- **Detection** — a single `git rev-parse --git-dir --git-common-dir`. The two paths differ only inside a linked worktree. The true repo name comes from `--git-common-dir` (its parent directory, or the `<name>.git` basename for a bare main repo), so it is correct regardless of how the worktree directory was named.
- **Prefix stripping** — a leading repo name followed by `-`, `_`, or `.` is removed, so `plan2code-user-auth` reads as `user-auth`.
- **Redundancy collapse** — worktree directories usually mirror their branch. The name is dropped (leaving `⑂`) when it matches the branch after normalizing case and `/ _ . -` separators, compared against both the full branch and its trailing segment so type prefixes like `feature/` don't defeat the match. This only applies when the branch is actually displayed.
- **Color** — the repo keeps its bold silver; the `⑂` marker and worktree name render in amber so a non-primary checkout is obvious at a glance. Monochrome output is `repo ⑂ worktree`.
- **Cost** — one extra `git` invocation, subject to the same 1.5s timeout, and skipped entirely outside git repos.
## Usage Display
The usage segment reads data directly from Claude Code's stdin JSON — no API calls, no auth needed, no background processes.
@@ -6,6 +6,7 @@
"model": true,
"effort": true,
"project": true,
"worktree": true,
"branch": true,
"contextBar": true,
"contextTokens": true,
+85 -5
View File
@@ -28,6 +28,7 @@ const DEFAULTS = {
model: true,
effort: true,
project: true,
worktree: true,
branch: true,
contextBar: true,
contextTokens: true,
@@ -90,6 +91,7 @@ const C = {
// Plan2Code brand
teal: rgb(190, 192, 200), // Silver — repo
sky: rgb(120, 195, 255), // Light sky blue — branch
amber: rgb(235, 170, 95), // Amber — linked worktree marker
muted: rgb(40, 120, 200), // Mid blue — model
label: rgb(130, 135, 150), // Mid gray — field labels (5h, 7d)
// Bar & quota thresholds
@@ -150,6 +152,54 @@ function getGitBranch(stdinData) {
return sha || '';
}
// Linked worktrees have their own .git dir under the main repo's
// .git/worktrees/<name>, while --git-common-dir still points at the main repo's
// .git. Equal paths mean we're in the primary checkout.
function getWorktreeInfo(cwd) {
const raw = gitExec(['rev-parse', '--git-dir', '--git-common-dir'], cwd);
if (!raw) return null;
const [gitDir, commonDir] = raw.split('\n').map((p) => path.resolve(cwd, p.trim()));
if (!gitDir || !commonDir) return null;
const samePath = process.platform === 'win32'
? gitDir.toLowerCase() === commonDir.toLowerCase()
: gitDir === commonDir;
if (samePath) return null;
// commonDir is normally <repo>/.git; bare repos use <name>.git directly
const commonBase = path.basename(commonDir);
const repoName = commonBase === '.git'
? path.basename(path.dirname(commonDir))
: commonBase.replace(/\.git$/i, '');
const toplevel = gitExec(['rev-parse', '--show-toplevel'], cwd);
const worktreeName = path.basename(toplevel || cwd);
if (!repoName || !worktreeName) return null;
return { repoName, worktreeName };
}
// "plan2code-user-auth" in repo "plan2code" reads as just "user-auth"
function stripRepoPrefix(worktreeName, repoName) {
const lowerWt = worktreeName.toLowerCase();
const lowerRepo = repoName.toLowerCase();
if (!lowerWt.startsWith(lowerRepo) || lowerWt === lowerRepo) return worktreeName;
const rest = worktreeName.slice(repoName.length);
return /^[-_.]/.test(rest) ? rest.slice(1) : worktreeName;
}
const normalizeName = (s) => s.toLowerCase().replace(/[/_.\s-]+/g, '-').replace(/^-|-$/g, '');
// Worktree dirs usually mirror their branch (plan2code-user-auth / feature/user-auth).
// Compare against both the full branch and its trailing segment so the common
// type prefixes (feature/, bugfix/, ...) don't defeat the match.
function isRedundantWithBranch(worktreeName, branch) {
if (!branch) return false;
const candidates = new Set([normalizeName(branch), normalizeName(branch.split('/').pop())]);
return candidates.has(normalizeName(worktreeName));
}
// ============================================================================
// Formatters
// ============================================================================
@@ -192,6 +242,34 @@ function getProjectName(stdinData) {
return path.basename(projectDir);
}
// Returns the project segment: "plan2code" normally, "plan2code ⑂ spike" in a
// linked worktree — the name collapsing to a bare ⑂ when the branch says it already.
function formatProject(stdinData, config, branch) {
const project = getProjectName(stdinData);
if (!project) return null;
const plain = (text) => (config.color ? `${C.bold}${C.teal}${text}${C.reset}` : text);
if (!config.items.worktree) return plain(project);
const cwd = stdinData?.workspace?.project_dir || process.cwd();
if (!isGitRepo(cwd)) return plain(project);
const info = getWorktreeInfo(cwd);
if (!info) return plain(project);
const shortName = stripRepoPrefix(info.worktreeName, info.repoName);
// Only dedupe against a branch the user can actually see — otherwise the
// worktree identity would vanish entirely.
const visibleBranch = config.items.branch ? branch : '';
const redundant = isRedundantWithBranch(shortName, visibleBranch)
|| isRedundantWithBranch(info.worktreeName, visibleBranch)
|| normalizeName(shortName) === normalizeName(info.repoName);
const marker = redundant ? '⑂' : `⑂ ${shortName}`;
if (!config.color) return `${info.repoName} ${marker}`;
return `${C.bold}${C.teal}${info.repoName}${C.reset} ${C.amber}${marker}${C.reset}`;
}
function calculateContextPercent(stdinData, config) {
const cw = stdinData?.context_window;
if (!cw) return null;
@@ -339,14 +417,16 @@ function formatLine1(stdinData, config) {
}
}
// Branch is resolved first — the project segment dedupes the worktree name against it
const branch = config.items.branch || config.items.worktree ? getGitBranch(stdinData) : '';
if (config.items.project) {
const project = getProjectName(stdinData);
if (project) segments.push(config.color ? `${C.bold}${C.teal}${project}${C.reset}` : project);
const project = formatProject(stdinData, config, branch);
if (project) segments.push(project);
}
if (config.items.branch) {
const branch = getGitBranch(stdinData);
if (branch) segments.push(config.color ? `${C.sky}${branch}${C.reset}` : branch);
if (config.items.branch && branch) {
segments.push(config.color ? `${C.sky}${branch}${C.reset}` : branch);
}
if (config.items.linesChanged) {
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "Plan2Code",
"version": "1.16.0",
"version": "1.16.1",
"description": "A structured 4-step workflow methodology for AI-assisted software development",
"keywords": [
"ai",
@@ -14,10 +14,10 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/jparkerweb/plan2code"
"url": "https://code.jparkerweb.com/jparkerweb/plan2code"
},
"homepage": "https://plan2code.jparkerweb.com",
"releaseDate": "2026-07-20",
"homepage": "https://code.jparkerweb.com/jparkerweb/plan2code",
"releaseDate": "2026-07-31",
"mode": "utility"
}