incitaciones 0.1.0 → 0.3.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.
Files changed (36) hide show
  1. package/README.md +102 -3
  2. package/content/distilled/close/SKILL.md +67 -0
  3. package/content/distilled/create-issues/SKILL.md +10 -0
  4. package/content/distilled/issue-review/SKILL.md +5 -4
  5. package/content/distilled/issue-review/references/pass-0-preflight.md +37 -0
  6. package/content/distilled/next/SKILL.md +54 -0
  7. package/content/distilled/park/SKILL.md +97 -0
  8. package/content/distilled/renew/SKILL.md +163 -0
  9. package/content/distilled/whisper/SKILL.md +83 -0
  10. package/content/distilled/whisper/references/check.md +33 -0
  11. package/content/distilled/whisper/references/decommission.md +53 -0
  12. package/content/distilled/whisper/references/init.md +103 -0
  13. package/content/distilled/whisper/references/link.md +70 -0
  14. package/content/distilled/whisper/references/status.md +49 -0
  15. package/content/manifest.json +101 -3
  16. package/package.json +2 -1
  17. package/pi-package/README.md +8 -0
  18. package/pi-package/prompts/close.md +10 -0
  19. package/pi-package/prompts/next.md +10 -0
  20. package/pi-package/prompts/park.md +10 -0
  21. package/pi-package/prompts/renew.md +10 -0
  22. package/pi-package/prompts/whisper.md +10 -0
  23. package/pi-package/skills/close/SKILL.md +73 -0
  24. package/pi-package/skills/create-issues/SKILL.md +10 -0
  25. package/pi-package/skills/issue-review/SKILL.md +5 -4
  26. package/pi-package/skills/issue-review/references/pass-0-preflight.md +37 -0
  27. package/pi-package/skills/next/SKILL.md +60 -0
  28. package/pi-package/skills/park/SKILL.md +103 -0
  29. package/pi-package/skills/renew/SKILL.md +169 -0
  30. package/pi-package/skills/whisper/SKILL.md +89 -0
  31. package/pi-package/skills/whisper/references/check.md +33 -0
  32. package/pi-package/skills/whisper/references/decommission.md +53 -0
  33. package/pi-package/skills/whisper/references/init.md +103 -0
  34. package/pi-package/skills/whisper/references/link.md +70 -0
  35. package/pi-package/skills/whisper/references/status.md +49 -0
  36. package/scripts/generate-pi-resources.mjs +122 -0
package/README.md CHANGED
@@ -1,8 +1,32 @@
1
1
  # Incitaciones 🤖
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/incitaciones)](https://www.npmjs.com/package/incitaciones)
4
+ [![Publish to npm](https://github.com/charly-vibes/incitaciones/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/charly-vibes/incitaciones/actions/workflows/npm-publish.yml)
5
+
3
6
  A collection of reusable prompts and best practices for CLI LLM tools.
4
7
 
5
- ## Install
8
+ ## Quick Install
9
+
10
+ ### Via npm / npx (recommended)
11
+
12
+ ```bash
13
+ # Install as pi package (native skills, best UX):
14
+ pi install npm:incitaciones
15
+
16
+ # Or install across all tools (pi, Claude Code, Amp, Gemini CLI, etc.):
17
+ npx incitaciones install
18
+
19
+ # Install only the essentials bundle:
20
+ npx incitaciones install --bundle essentials
21
+
22
+ # List available skills:
23
+ npx incitaciones list
24
+
25
+ # Show skill details:
26
+ npx incitaciones info commit
27
+ ```
28
+
29
+ ### From git
6
30
 
7
31
  Clone and install prompts as skills for pi CLI, Claude Code, Amp, Gemini CLI, and other tools:
8
32
 
@@ -49,10 +73,12 @@ Skills are installed to `~/.agents/skills/` (or project `.agents/skills/`) and c
49
73
 
50
74
  ### Native pi package install
51
75
 
52
- This repository now includes a `package.json` with a `pi` manifest, so pi can install it directly as a package:
76
+ This repository is published as an npm package with a `pi` manifest, so pi can install it directly:
53
77
 
54
78
  ```bash
55
- pi install https://github.com/charly-vibes/incitaciones
79
+ pi install npm:incitaciones
80
+ # or from git
81
+ pi install git:github.com/charly-vibes/incitaciones
56
82
  # or from a local clone
57
83
  pi install .
58
84
  ```
@@ -64,6 +90,51 @@ The repository includes checked-in pi package resources under `pi-package/`, and
64
90
 
65
91
  After changing distilled content or manifest entries, run `just generate-pi-resources` and commit the updated `pi-package/` files.
66
92
 
93
+ ### Publishing a new version
94
+
95
+ ```bash
96
+ npm version patch # bumps to 0.2.1, creates a git tag
97
+ npm version minor # bumps to 0.3.0
98
+ npm version major # bumps to 1.0.0
99
+
100
+ git push --tags # triggers CI → auto-publishes to npm
101
+ ```
102
+
103
+ CI workflow: `.github/workflows/npm-publish.yml` — runs on `v*` tags, generates pi resources, then publishes.
104
+
105
+ ## Top 10 Most Used Skills
106
+
107
+ Based on analysis of 621 pi sessions across 43 repositories:
108
+
109
+ | Skill | Invocations | Repos | What it does |
110
+ |-------|:-----------:|:-----:|-------------|
111
+ | **commit** | 513 | 41 | Create well-structured, atomic git commits with clear intent |
112
+ | **rule-of-5-universal** | 254 | 35 | 5-stage review for any artifact (Steve Yegge's method) |
113
+ | **tdd** | 168 | 28 | Test-driven development workflow |
114
+ | **issue-review** | 158 | 31 | Review issues for completeness and dependencies |
115
+ | **debug** | 94 | 27 | 7-step diagnostic workflow for debugging issues |
116
+ | **create-issues** | 44 | 19 | Generate trackable issues from implementation plans |
117
+ | **create-handoff** | 31 | 10 | Generate context documents for session continuity |
118
+ | **grill-me** | 28 | 12 | Interview the user relentlessly about a plan or design |
119
+ | **doc-link-verifier** | 27 | 9 | Audit documentation for broken links |
120
+ | **review-documentation** | 27 | 9 | Review docs for cognitive scannability and AI-readiness |
121
+
122
+ ## Session Lifecycle & Knowledge Management
123
+
124
+ Workflow skills that form a complete session lifecycle with persistent operational knowledge:
125
+
126
+ | Skill | When | What it does |
127
+ |-------|------|-------------|
128
+ | **whisper** | Start of project/branch | Manage `~/.whisper/` — global, tiered knowledge directory (init, check, status, link, decommission) |
129
+ | **next** | Quick context switch | Rapid snapshot to `~/.whisper/` — no git, no tickets, just stash |
130
+ | **park** | Thorough context switch | Log to journal, release ticket claims, record to beads epic |
131
+ | **close** | End of day | Log to journal, route knowledge to `~/.whisper/`, commit, clear |
132
+ | **renew** | Start of session | Load journal + whisper + beads context, claim tickets with file conflict detection |
133
+
134
+ Uses `$JOURNAL_PATH` (default `~/dev/status`) for the daily log. See [`content/references-whisper-workflow.md`](content/references-whisper-workflow.md) for the full reference.
135
+
136
+ Full analysis: [`content/research-finding-skill-usage-analysis.md`](content/research-finding-skill-usage-analysis.md)
137
+
67
138
  ## Quick Start
68
139
 
69
140
  ```bash
@@ -90,6 +161,15 @@ Everything lives in `content/` with descriptive filenames:
90
161
  - `example-*.md` - Real-world examples
91
162
  - `template-*.md` - Templates for new content
92
163
 
164
+ Key infrastructure files:
165
+
166
+ - `package.json` — npm package with `pi` manifest and `bin` entry for npx CLI
167
+ - `scripts/cli.mjs` — npx CLI entry point (`npx incitaciones install` / `list` / `info`)
168
+ - `scripts/generate-pi-resources.mjs` — generates `pi-package/` from manifest
169
+ - `pi-package/` — generated pi-compatible skills and prompt templates (gitignored)
170
+ - `.github/workflows/npm-publish.yml` — CI: auto-publishes to npm on `v*` tags
171
+ - `.github/workflows/pages.yml` — CI: deploys GitHub Pages site
172
+
93
173
  See [AGENTS.md](AGENTS.md) for detailed structure and [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
94
174
 
95
175
  ## Commands
@@ -111,6 +191,8 @@ just validate-distilled # Validate distilled prompts
111
191
  just list-bundles # Show available bundles
112
192
  just sync-manifest # Validate manifest references and update content/manifest.json version
113
193
  just generate-skill NAME # Preview SKILL.md output for a prompt
194
+ just nucleus-roundtrip NAME # Use pi to compile+decompile a prompt via Nucleus lambda
195
+ just compare-nucleus NAME # Diff a Nucleus roundtrip against the canonical distilled prompt
114
196
  just analyze-traces PATH # Analyze trace exports from agent tools
115
197
  just analyze-traces-auto # Auto-detect local CLI history locations
116
198
  just trace-insights # Process traces and write insight artifacts
@@ -342,6 +424,23 @@ just validate
342
424
  # Reports any issues
343
425
  ```
344
426
 
427
+ **Experimenting with Nucleus lambda roundtrips:**
428
+ ```bash
429
+ just nucleus-roundtrip distill-prompt
430
+ # Uses pi -p to compile the distilled prompt to lambda and decompile it back to prose
431
+ # Writes content/compiled/nucleus/distill-prompt.lambda.md
432
+ # Writes content/compiled/nucleus/distill-prompt.roundtrip.md
433
+ just compare-nucleus distill-prompt
434
+ # Diffs the roundtrip prose against the canonical distilled prompt
435
+ ```
436
+
437
+ Pass extra pi flags through when needed:
438
+ ```bash
439
+ just nucleus-roundtrip distill-prompt --model sonnet:high
440
+ ```
441
+
442
+ The `content/compiled/nucleus/` directory is experimental. It is intentionally kept outside `content/distilled/` so these comparison artifacts do not affect installation or packaged skills.
443
+
345
444
  ## What Goes Here?
346
445
 
347
446
  ✅ **Good candidates:**
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: close
3
+ description: "End-of-session wrap-up. Summarizes what was done, logs it to the daily journal, commits, pushes, and clears context. Trigger when the user says '/close', 'close session', or 'wrap up session'."
4
+ tools: Read, Write, Edit, Glob, Bash
5
+ ---
6
+
7
+ # Close Session
8
+
9
+ End the current session: log what was done, update tasks, route durable knowledge to `~/.whisper/`, commit and push, clear context.
10
+
11
+ Uses `$JOURNAL_PATH` (defaults to `~/dev/status`) for the daily log, and `~/.whisper/` for accumulated operational knowledge.
12
+
13
+ ## Steps
14
+
15
+ 1. Pull the journal repo:
16
+ ```bash
17
+ JOURNAL="${JOURNAL_PATH:-$HOME/dev/status}"
18
+ cd "$JOURNAL" && git pull
19
+ ```
20
+
21
+ 2. Get today's date and time (`date +%Y-%m-%d`, `date +%H:%M`).
22
+ Derive the log path: `$JOURNAL/log/YYYY/YYYY-MM/YYYY-MM-DD.md`
23
+
24
+ 3. If the log file does not exist, create it with the daily log template.
25
+
26
+ 4. Review the full conversation history and write a concise session summary covering:
27
+ - What was worked on (key topics, files, repos)
28
+ - Decisions made
29
+ - Tasks completed or created
30
+ - Any unresolved items or next steps
31
+
32
+ 5. Append the summary to the `## Log` section of today's daily log:
33
+ ```
34
+ ### Session:HH:MM (<context>)
35
+ - bullet point summary entries
36
+ - **Next:** what to pick up next time (if applicable)
37
+ ```
38
+
39
+ 6. Update project/area files if tasks were completed or created:
40
+ - Mark completed tasks `[x]`
41
+ - Add new tasks as `[ ]`
42
+ - Add/update `[~]` waiting items
43
+ - Update `## Notes` with decisions
44
+
45
+ 7. If any tasks or follow-ups came up that aren't in a project/area, add them to `inbox.md`.
46
+
47
+ 8. **Route durable knowledge to `~/.whisper/`.** Scan the session for anything worth keeping and route by scope (skip this step entirely if nothing durable was learned):
48
+ - **Branch-specific finding** → `bd note <beads-epic>` or `~/.whisper/repos/<repo>/branches/<slug>/notes.md`
49
+ - **Repo-wide infra fact** → `~/.whisper/repos/<repo>/env.md`
50
+ - **Universal agent behavior rule** → `bd remember` or `~/.whisper/rules.md`
51
+ - **Worktree setup fact** → `~/.whisper/repos/<repo>/worktrees/<name>/env.md`
52
+ - **No secrets anywhere:** never write tokens, keys, or PII
53
+ - **Extend, don't duplicate:** append to existing notes rather than creating new ones
54
+
55
+ 9. Commit and push. Stage only the files this session touched, explicitly by name:
56
+ ```bash
57
+ cd "$JOURNAL" && git add <log-file> [<files>] && git commit -m "log: YYYY-MM-DD session notes" && git push
58
+ ```
59
+
60
+ 10. As the very last step, run `/clear` to reset the conversation context.
61
+
62
+ ## Rules
63
+
64
+ - Do NOT ask the user any questions. Summarize automatically from conversation context.
65
+ - Keep the summary concise — bullet points, not paragraphs.
66
+ - If today's log already has content, append to it; never overwrite existing entries.
67
+ - Always pull before reading and push after committing.
@@ -54,6 +54,16 @@ You are a Technical Project Manager. Translate a plan, spec, or PRD into thin en
54
54
  - Apply tracker labels such as `needs-triage` when the project uses them.
55
55
  - Wire dependencies using actual captured identifiers or explicit body references.
56
56
  - Verify each creation step succeeded before continuing.
57
+ - **After each successful creation**, extract the `**Files / Systems:**` bullet list from
58
+ the issue description and store it as structured metadata:
59
+ ```bash
60
+ bd update <id> --metadata '{"files": ["path/to/file1.py", "path/to/file2.py"]}'
61
+ ```
62
+ This enables automated file-conflict detection by concurrent agents (see `renew` skill
63
+ **Claiming work** section). If the Files/Systems section is empty or contains only
64
+ subsystem names without concrete paths, **stop and ask the user for specific file paths
65
+ before publishing the ticket** — a ticket without concrete paths cannot participate in
66
+ conflict detection and is incomplete.
57
67
 
58
68
  7. **Final report:**
59
69
  - Summarize the approved slice set, created issues, labels, and dependency links.
@@ -9,15 +9,16 @@ Read `references/setup.md` for tracker-specific collection commands before revie
9
9
  ## Procedure
10
10
 
11
11
  1. Gather the issue set to review plus the source plan/spec/parent issue when available.
12
- 2. Run the passes in order:
12
+ 2. For Beads trackers, run PASS 0 pre-flight checks first: `references/pass-0-preflight.md`
13
+ 3. Run the content passes in order:
13
14
  - Pass 1: `references/pass-1-clarity.md`
14
15
  - Pass 2: `references/pass-2-scope.md`
15
16
  - Pass 3: `references/pass-3-dependencies.md`
16
17
  - Pass 4: `references/pass-4-alignment.md`
17
18
  - Pass 5: `references/pass-5-executability.md`
18
- 3. After each pass starting with pass 2, evaluate convergence using `references/convergence.md`.
19
- 4. If converged, stop.
20
- 5. Produce the final report using `references/final-report.md`.
19
+ 4. After each pass starting with pass 2, evaluate convergence using `references/convergence.md`.
20
+ 5. If converged, stop.
21
+ 6. Produce the final report using `references/final-report.md`.
21
22
 
22
23
  ## Review Lens
23
24
 
@@ -0,0 +1,37 @@
1
+ # PASS 0: Pre-flight (Beads only)
2
+
3
+ Run before all content passes. Mechanical checks that don't require reading issue bodies.
4
+
5
+ **Check 1 — metadata.files coverage:**
6
+ ```bash
7
+ bd list --format json | python3 -c "
8
+ import json, sys
9
+ issues = json.load(sys.stdin)
10
+ missing = [i['id'] for i in issues
11
+ if not (i.get('metadata') or {}).get('files')]
12
+ if missing: print('Missing metadata.files:', missing)
13
+ "
14
+ ```
15
+ Flag `[PRE-001] MEDIUM` for each ticket missing `metadata.files`.
16
+ Fix: `bd update <id> --set-metadata 'files=["path/to/file.py"]'`
17
+
18
+ **Check 2 — shared-file architecture smell:**
19
+ ```bash
20
+ bd list --format json | python3 -c "
21
+ import json, sys
22
+ from collections import defaultdict
23
+ issues = json.load(sys.stdin)
24
+ owners = defaultdict(list)
25
+ for i in issues:
26
+ for f in (i.get('metadata') or {}).get('files', []):
27
+ owners[f].append(i['id'])
28
+ for f, ids in owners.items():
29
+ if len(ids) >= 3: print(f, '->', ids)
30
+ "
31
+ ```
32
+ Flag `[PRE-002] LOW` for any file claimed by 3+ open tickets.
33
+ Recommendation: consider a decomposition ticket to split `<file>` before these
34
+ tickets run (see navari-a3cv pattern). If not decomposing now, add a
35
+ co-modification note to all affected tickets.
36
+
37
+ **Prefix:** PRE-001, PRE-002, etc.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: next
3
+ description: "Rapid session snapshot to ~/.whisper/ — no full close ceremony. Trigger when the user says '/next', 'snap', 'quick save', 'stash session', or 'moving on'."
4
+ tools: Read, Write, Edit, Bash
5
+ ---
6
+
7
+ # Next
8
+
9
+ Snapshot the current session to `~/.whisper/` and move on. Fast — no project file updates, no inbox triage, no ticket operations. Pure stash.
10
+
11
+ ## Steps
12
+
13
+ 1. Get timestamp: `date +%Y-%m-%d` and `date +%H:%M`.
14
+
15
+ 2. Detect repo and branch:
16
+ ```bash
17
+ repo_url=$(git remote get-url origin 2>/dev/null | sed 's|https://||;s|git@||;s|\.git$||')
18
+ branch=$(git rev-parse --abbrev-ref HEAD)
19
+ branch_slug=$(echo "$branch" | sed 's|/|--|g')
20
+ notes_path=~/.whisper/repos/"${repo_url}"/branches/"${branch_slug}"/notes.md
21
+ ```
22
+
23
+ 3. If `~/.whisper/` doesn't exist or the branch slot doesn't exist, run `/w check` first (which will offer to init). If the user declines, skip and warn.
24
+
25
+ 4. Scan the last portion of the conversation and write a 2–5 bullet snapshot:
26
+ - What was worked on (files, topics)
27
+ - Key decisions or changes made
28
+ - **Next:** the most logical continuation point
29
+
30
+ 5. Append the snapshot to `notes.md`:
31
+ ```
32
+ ### YYYY-MM-DD HH:MM — snap
33
+ - what was worked on
34
+ - decisions made
35
+ - **Next:** continuation point
36
+ ```
37
+
38
+ 6. No commit, no push, no ticket operations. Just write the file.
39
+
40
+ ## Output
41
+
42
+ ```
43
+ ✓ Snapped to ~/.whisper/repos/<repo>/branches/<slug>/notes.md
44
+
45
+ Use `/renew` later to pick this back up.
46
+ ```
47
+
48
+ ## Rules
49
+
50
+ - Do NOT ask questions — summarize automatically from conversation context.
51
+ - Keep it brief — 2–5 bullets, not paragraphs.
52
+ - Do NOT commit or push anything.
53
+ - Do NOT update project files, inbox, or tickets.
54
+ - Do NOT run `/clear`.
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: park
3
+ description: "Snapshot current work before switching context. Logs what was done and what's next without ending the day. Trigger when the user says '/park', 'park this', 'switching to', 'pause this', or 'context switch'."
4
+ tools: Read, Write, Edit, Bash
5
+ ---
6
+
7
+ # Park
8
+
9
+ Snapshot the current session's work on a project/area before switching context. This is NOT end-of-day — just a context switch.
10
+
11
+ Uses `$JOURNAL_PATH` (defaults to `~/dev/status`) for the daily log, and `~/.whisper/` for accumulated operational knowledge.
12
+
13
+ ## Steps
14
+
15
+ 1. Get today's date and current time (`date +%Y-%m-%d`, `date +%H:%M`).
16
+ ```bash
17
+ JOURNAL="${JOURNAL_PATH:-$HOME/dev/status}"
18
+ ```
19
+
20
+ 2. Read today's log: `$JOURNAL/log/YYYY/YYYY-MM/YYYY-MM-DD.md`
21
+ If it doesn't exist, create it with the daily log template.
22
+
23
+ 3. Review the conversation history to determine:
24
+ - What project/area was being worked on
25
+ - What was accomplished in this session
26
+ - What the logical next step is
27
+ - Any new tasks, decisions, or blockers discovered
28
+
29
+ 4. Append a session entry to today's log under `## Log`:
30
+ ```
31
+ ### Session:HH:MM (<project/area context>)
32
+ - what was done
33
+ - decisions made
34
+ - **Next:** what to do when resuming
35
+ ```
36
+
37
+ 5. Update the relevant project/area file if needed:
38
+ - Mark completed tasks `[x]`
39
+ - Add new tasks discovered during the session
40
+ - Add/update `[~]` waiting items with context
41
+ - Update `## Notes` with any decisions
42
+
43
+ 6. If there are uncommitted changes in the project's git worktree, note them in the log entry.
44
+
45
+ 7. **Release any in-progress ticket claim if leaving mid-work.**
46
+ Check whether a ticket was claimed for this session:
47
+ ```bash
48
+ BRANCH=$(git branch --show-current 2>/dev/null)
49
+ bd list --status in_progress --label branch:$BRANCH 2>/dev/null
50
+ ```
51
+ For each in-progress ticket that is NOT complete:
52
+ - **If meaningful work was committed:** keep the claim and append a progress note:
53
+ ```bash
54
+ bd note <id> "Session parked $(date +%H:%M). Done: <brief>. Safe to resume from: <last commit>."
55
+ ```
56
+ - **If nothing was committed:** release the claim so another agent can pick it up:
57
+ ```bash
58
+ bd update <id> --assignee "" --status open
59
+ ```
60
+
61
+ 8. **Record snapshot to `~/.whisper/`.** If `~/.whisper/` exists and a beads-epic is linked, append a note to the epic:
62
+ ```bash
63
+ repo_url=$(git remote get-url origin 2>/dev/null | sed 's|https://||;s|git@||;s|\.git$||')
64
+ branch_slug=$(git rev-parse --abbrev-ref HEAD | sed 's|/|--|g')
65
+ context_path=~/.whisper/repos/"${repo_url}"/branches/"${branch_slug}"/context.md
66
+ beads_epic=$(grep '^beads-epic:' "$context_path" 2>/dev/null | sed 's/^beads-epic: *//')
67
+ if [ -n "$beads_epic" ]; then
68
+ bd note "$beads_epic" "Parked $(date +%H:%M). Done: <what was accomplished>. Next: <the logical continuation>."
69
+ fi
70
+ ```
71
+
72
+ 9. Do NOT commit/push the journal repo yet — that happens at `/close`. Just write the files.
73
+
74
+ ## Output format
75
+
76
+ ```
77
+ ---
78
+ **Parked: <project/area name>**
79
+
80
+ **Session summary**
81
+ - what was accomplished
82
+
83
+ **Next step** *(for when you /renew)*
84
+ - the logical continuation
85
+
86
+ **Updated**
87
+ - files modified in status repo (log, project file, etc.)
88
+
89
+ *Ready to switch context. Use `/renew <slug>` to pick up something else.*
90
+ ```
91
+
92
+ ## Rules
93
+
94
+ - Do NOT ask questions — summarize automatically from conversation context.
95
+ - Keep it brief — this is a quick snapshot, not a full report.
96
+ - Do NOT commit or push the journal repo.
97
+ - Do NOT run `/clear` — the user may continue working in this session.
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: renew
3
+ description: "Resume work on a specific project or area. Loads focused context for continuing where you left off. When no name is given, infers the project/area from the current repo and git branch. Trigger when the user says '/renew', '/renew <name>', 'pick up <project>', 'continue <project>', or 'back to <project>'."
4
+ tools: Read, Write, Edit, Glob, Bash, Grep
5
+ ---
6
+
7
+ # Renew
8
+
9
+ Load focused context for a specific project or area to continue work.
10
+
11
+ Uses `$JOURNAL_PATH` (defaults to `~/dev/status`) for the daily log, and `~/.whisper/` for accumulated operational knowledge.
12
+
13
+ ## Steps
14
+
15
+ 1. Pull the journal repo:
16
+ ```bash
17
+ JOURNAL="${JOURNAL_PATH:-$HOME/dev/status}"
18
+ cd "$JOURNAL" && git pull
19
+ ```
20
+
21
+ 2. Identify the target.
22
+
23
+ **If a `<slug>` is provided:** The user says `/renew <slug>`.
24
+
25
+ **If no slug is provided:** Infer from the current workspace context:
26
+ - Get the repo name: `basename $(git rev-parse --show-toplevel 2>/dev/null)`
27
+ - Get the branch name: `git branch --show-current 2>/dev/null`
28
+ - Extract a candidate slug from the branch (strip prefix like `ak/`, `feature/`, etc.)
29
+ - Use both the repo name and branch-derived slug as candidates
30
+
31
+ **Match candidates** against:
32
+ - `$JOURNAL/projects/*.md` — check filenames and grep for repo/branch references
33
+ - `$JOURNAL/areas/*.md` — same
34
+ - Try exact match, then partial/substring match
35
+ - If multiple matches found, list them and ask the user to pick
36
+ - If no match found, list available projects/areas and ask
37
+
38
+ 3. Read the matched project or area file.
39
+
40
+ 4. Read today's log (`$JOURNAL/log/YYYY/YYYY-MM/YYYY-MM-DD.md`).
41
+ If it doesn't exist, create it with the daily log template.
42
+ Scan for any earlier session entries related to this project/area today.
43
+
44
+ 5. Search recent logs for context (last 3 days):
45
+ ```bash
46
+ grep -rl "<slug>" "$JOURNAL"/log/YYYY/YYYY-MM/ 2>/dev/null | tail -3
47
+ ```
48
+ Read any matches to understand recent session history.
49
+
50
+ 6. Search inbox for related items:
51
+ ```bash
52
+ grep -i "<slug>" "$JOURNAL"/inbox.md
53
+ ```
54
+
55
+ 7. **Check `~/.whisper/` for accumulated knowledge.**
56
+ If `~/.whisper/` exists, load context:
57
+ ```bash
58
+ repo_url=$(git remote get-url origin 2>/dev/null | sed 's|https://||;s|git@||;s|\.git$||')
59
+ branch_slug=$(git rev-parse --abbrev-ref HEAD | sed 's|/|--|g')
60
+ whisper_dir=~/.whisper/repos/"${repo_url}"/branches/"${branch_slug}"
61
+ ```
62
+ - Read `context.md` if it exists (extract beads-epic, status)
63
+ - Read `plan.md` if it has real content
64
+ - Read `notes.md` if it has real content
65
+ - Read `env.md` at repo level for infra facts
66
+ - If beads is available, fetch open issues:
67
+ ```bash
68
+ bd list --label branch:<branch> 2>/dev/null
69
+ bd list --status in_progress --label branch:<branch> 2>/dev/null
70
+ ```
71
+ Surface any `in_progress` tickets prominently. The **Suggested next step** must only reference tickets NOT currently `in_progress`.
72
+
73
+ 8. If the project/area has a worktree or repo path noted in its file, gather git context:
74
+ - `cd <worktree-path> && git branch --show-current`
75
+ - `git log --oneline -5`
76
+ - `git status --short`
77
+ - `git log --oneline origin/main..HEAD`
78
+
79
+ ## Output format
80
+
81
+ ```
82
+ ---
83
+ **Resuming: Project/Area Name**
84
+
85
+ **Status**: brief one-line summary of where things stand
86
+
87
+ **Last session** *(from most recent log entry)*
88
+ - what was done last time
89
+
90
+ **Open tasks**
91
+ - [ ] task list from the project/area file
92
+
93
+ **Waiting**
94
+ - [~] any blocked items and who/what they're waiting on
95
+
96
+ **Related inbox items** *(if any)*
97
+ - items that mention this project
98
+
99
+ **Whisper context** *(if ~/.whisper/ exists)*
100
+ - Plan: summary of current plan
101
+ - Notes: key findings
102
+ - Beads issues: <n> open, <n> in_progress
103
+
104
+ **⚠ Active in flight** *(omit if none)*
105
+ - ◐ `<id>` — <title> [started: <date>]
106
+ - *(If your intended ticket is listed here, see **Claiming work** below.)*
107
+
108
+ **Workspace**
109
+ - Worktree: path, branch, status
110
+ - Commits ahead of main, uncommitted changes, etc.
111
+
112
+ **Suggested next step**
113
+ - what makes sense to do next — only suggest tickets NOT currently in_progress
114
+ ```
115
+
116
+ Then ask: *"Ready to continue, or want to adjust the plan?"*
117
+
118
+ ---
119
+
120
+ ## Claiming work
121
+
122
+ Before writing any code, claim the ticket atomically and check for file conflicts.
123
+
124
+ ### Steps
125
+
126
+ 1. **Claim atomically:**
127
+ ```bash
128
+ bd update <ticket-id> --claim
129
+ ```
130
+
131
+ 2. **Check for file-level conflicts** with other in-progress tickets:
132
+ ```bash
133
+ bd list --status in_progress --label branch:<branch> --json 2>/dev/null \
134
+ | python3 -c "
135
+ import json, sys
136
+ issues = json.loads(sys.stdin.read() or '[]')
137
+ for i in issues:
138
+ files = (i.get('metadata') or {}).get('files', [])
139
+ for f in files:
140
+ print(i['id'] + '\t' + f)
141
+ "
142
+ ```
143
+ Cross-reference against the claimed ticket's own `metadata.files`.
144
+ If overlap found, surface a warning:
145
+ ```
146
+ ⚠ File conflict detected:
147
+ services/api.py is also claimed by ticket-abc (in_progress)
148
+
149
+ Options:
150
+ A) Gate this ticket until the blocker closes
151
+ B) Coordinate merge order
152
+ C) Proceed — accept the conflict (reconcile at merge time)
153
+ ```
154
+
155
+ 3. **If backing off** (chose option A):
156
+ ```bash
157
+ bd update <ticket-id> --assignee "" --status open
158
+ bd gate create <ticket-id> --type bead --await-id <blocking-id>
159
+ ```
160
+
161
+ ### Metadata coverage warning
162
+
163
+ File conflict detection only works when both tickets have `metadata.files` populated (set by `create-issues` or `/w link` at ticket creation time). Tickets created before this convention was adopted have no metadata. For those tickets, **"no conflict found" means unknown, not safe**.