@getpipher/workspace 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RECTOR (https://github.com/rz1989s)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @getpipher/workspace
2
+
3
+ repo catch-up, AGENTS.md initialization, ecosystem context-file architecture, doc organization, planning sync, and cross-session handoff. Built for [pi](https://github.com/earendil-works/pi-coding-agent).
4
+
5
+ ## Skills
6
+
7
+ | Skill | Purpose |
8
+ |---|---|
9
+ | `workspace-catch-up` | Show repo mission, tech stack, current state, last 5 commits, analyze uncommitted files |
10
+ | `workspace-ecosystem-claude` | Create ecosystem-wide context-file architecture (AGENTS.md | CLAUDE.md) for multi-repo orgs |
11
+ | `workspace-init-agents` | Create or improve a project AGENTS.md with intelligent codebase analysis (host-neutral) |
12
+ | `workspace-organize-docs` | Intelligently analyze and organize all .md files in a repository (read-only advisor) |
13
+ | `workspace-planning-sync` | Analyze repo and provide intelligent planning documentation suggestions (read-only) |
14
+ | `workspace-session-handoff` | Self-contained starter prompt so the next session continues without context loss |
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ pi install npm:@getpipher/workspace
20
+ ```
21
+
22
+ Requires [pi](https://github.com/earendil-works/pi-coding-agent).
23
+
24
+ ## License
25
+
26
+ MIT
@@ -0,0 +1,169 @@
1
+ ---
2
+ name: workspace-catch-up
3
+ description: Show repo mission, tech stack, current state, last 5 commits, and analyze uncommitted files
4
+ allowed-tools: ["bash", "read", "write", "edit"]
5
+ ---
6
+
7
+ # Catch-Up: Complete Repository Context
8
+
9
+ Bismillah! Let me show you where we are and what we just did.
10
+
11
+ ## Implementation Steps
12
+
13
+ Let me gather complete context for you:
14
+
15
+ 1. **Extract Mission & Purpose**
16
+ - Read the project context file — `AGENTS.md` (or `CLAUDE.md`, CC's legacy name) — first, for Repository Overview and Tech Stack
17
+ - Fallback to README.md if no context file exists
18
+ - Parse mission statement (why this repo exists)
19
+ - Extract tech stack with reasons (how we achieve the mission)
20
+
21
+ 2. **Show Current State**
22
+ - Current branch and tracking status
23
+ - Working tree status (clean/dirty)
24
+ - Staged/unstaged file counts
25
+
26
+ 3. **Display Recent Activity (Last 5 Commits)**
27
+ - Commit hash, message, and time
28
+ - Show commit graph for visual context
29
+
30
+ 4. **Analyze Uncommitted Files (Smart Detection)**
31
+ - For each uncommitted file:
32
+ - Detect if it's auto-generated (lock files, build artifacts)
33
+ - Check for WIP indicators (TODO, FIXME, console.log, commented code)
34
+ - Analyze change size and nature (new file vs modified)
35
+ - Categorize as:
36
+ - ✅ **Forgotten Commits**: Complete work ready to commit
37
+ - 🚧 **Work in Progress**: Unfinished work with WIP indicators
38
+ - 📦 **Generated Files**: Auto-generated (lockfiles, builds)
39
+ - ⚠️ **Should be Ignored**: Belongs in .gitignore
40
+
41
+ 5. **Provide Concise Summary**
42
+ - Quick overview of repo mission
43
+ - Current status (clean/dirty)
44
+ - Action items based on uncommitted file analysis
45
+
46
+ ## Extraction Logic
47
+
48
+ ### Mission & Purpose
49
+ - Check the context file (AGENTS.md) for these sections:
50
+ - `## Repository Overview`
51
+ - `## Architecture and Structure`
52
+ - `## Technology Stack`
53
+ - If not found, check README.md:
54
+ - First paragraph after title
55
+ - Features/Goals section
56
+ - Tech Stack section
57
+ - If no docs found: Infer from file structure and suggest creating an `AGENTS.md` (try `/workspace:init-agents`)
58
+
59
+ ### Smart File Analysis Patterns
60
+
61
+ **Auto-generated files:**
62
+ - `*lock.json`, `*.lock`, `Cargo.lock`, `Gemfile.lock`, `poetry.lock`
63
+ - `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`
64
+ - `dist/`, `build/`, `target/`, `.next/`, `.nuxt/`
65
+ - `.DS_Store`, `Thumbs.db`
66
+
67
+ **WIP Indicators:**
68
+ - Comments: `TODO`, `FIXME`, `HACK`, `XXX`, `WIP`, `NOTE`
69
+ - Debug code: `console.log`, `print(`, `debugger`, `dd(`
70
+ - Commented-out code blocks (>3 lines)
71
+ - Incomplete functions (missing return statements, empty blocks)
72
+
73
+ **Config changes (likely forgotten commits):**
74
+ - Small modifications (<20 lines) to `.json`, `.yaml`, `.toml`, `.conf`
75
+ - Version bumps in package.json
76
+ - Dependency updates without other changes
77
+
78
+ **Should be ignored:**
79
+ - `.env`, `.env.local`, `.env.*.local`
80
+ - `.cache`, `tmp/`, `temp/`, `.tmp/`
81
+ - IDE files: `.idea/`, `.vscode/`, `*.swp`
82
+ - OS files: `.DS_Store`, `Thumbs.db`
83
+
84
+ ## Output Format
85
+
86
+ ```
87
+ ═══════════════════════════════════════════════════════
88
+ 📍 CATCH-UP: [repo name]
89
+ ═══════════════════════════════════════════════════════
90
+
91
+ 🎯 MISSION & PURPOSE
92
+ [2-3 sentence summary from docs]
93
+
94
+ Goal: [Primary objective]
95
+
96
+ Key Benefit: [Main value proposition]
97
+
98
+ 🛠️ TECH STACK & APPROACH
99
+ • [Tool/Framework]
100
+ Why: [Reason for choosing this]
101
+
102
+ • [Tool/Framework]
103
+ Why: [Reason for choosing this]
104
+
105
+ [Max 4-5 key technologies]
106
+
107
+ 🌿 CURRENT STATE
108
+ Branch: [branch-name] ([X files modified, Y untracked])
109
+ Last activity: [time since last commit]
110
+
111
+ 📝 RECENT ACTIVITY (Last 5 commits)
112
+ [hash] [message]
113
+ [hash] [message]
114
+ [hash] [message]
115
+ [hash] [message]
116
+ [hash] [message]
117
+
118
+ ⚠️ UNCOMMITTED CHANGES ([X files])
119
+
120
+ [If no uncommitted files:]
121
+ ✅ Working tree is clean - no uncommitted changes
122
+
123
+ [If uncommitted files exist, categorize:]
124
+
125
+ Forgotten Commits ([count]):
126
+ ✅ [file-path] ([+lines/-lines])
127
+ → [Analysis: why it's a forgotten commit]
128
+
129
+ Work in Progress ([count]):
130
+ 🚧 [file-path] ([+lines/-lines])
131
+ → [Analysis: what's incomplete, found WIP indicators]
132
+
133
+ Generated Files ([count]):
134
+ 📦 [file-path] ([+lines/-lines])
135
+ → [Type of generated file, e.g., lockfile, build artifact]
136
+
137
+ Should be Ignored ([count]):
138
+ ⚠️ [file-path]
139
+ → [Reason it should be in .gitignore]
140
+
141
+ 💡 SUMMARY
142
+ Mission: [One-line mission statement]
143
+ Status: [Clean/Active development/Pending commits]
144
+ Action: [Specific next steps based on analysis]
145
+ ```
146
+
147
+ ## Usage Examples
148
+
149
+ ```bash
150
+ # Get complete context when returning to a project
151
+ /catch-up
152
+
153
+ # Use when:
154
+ # - You just opened the project after time away
155
+ # - You forgot what you were working on
156
+ # - You need to understand the repo quickly
157
+ # - You want to check if you forgot to commit something
158
+ ```
159
+
160
+ ## Error Handling
161
+
162
+ - If not in a git repository: "Not a git repository. Run this command from a git repo."
163
+ - If neither a context file (AGENTS.md) nor README.md exists: Show inference + suggest creating docs
164
+ - If no commits exist: "New repository with no commits yet"
165
+ - If git commands fail: Show clear error message with suggested fix
166
+
167
+ ---
168
+
169
+ Alhamdulillah! This command provides complete context restoration in a concise, scannable format.
@@ -0,0 +1,357 @@
1
+ ---
2
+ name: workspace-ecosystem-claude
3
+ description: Create ecosystem-wide context-file architecture (AGENTS.md | CLAUDE.md) for multi-repo organizations. Host-neutral — works for Claude Code, Pi, and any AGENTS.md-aware agent.
4
+ argument-hint: "[org-name]"
5
+ allowed-tools: ["bash", "read", "write", "edit"]
6
+ ---
7
+
8
+ # Ecosystem Context-File Architecture (AGENTS.md)
9
+
10
+ Bismillah! I'll analyze your organization's repositories and help set up an ecosystem-wide **context-file architecture** — the cross-tool standard where `AGENTS.md` is the primary file (read by Claude Code, Pi, and any `AGENTS.md`-aware agent) and `CLAUDE.md` is Claude Code's legacy name for the same file.
11
+
12
+ > **Hub / satellite model.** One **ecosystem hub** `AGENTS.md` (usually in your org's main/overview repo) carries org-wide context: mission, repo index, cross-repo standards. Each member repo gets a lightweight **satellite** `AGENTS.md` that links to the hub and holds only repo-specific content. An agent landing in any repo can orient itself: the satellite points to the hub, the hub indexes everything. This mirrors the `/workspace:init-agents` hub/satellite pattern at org scale.
13
+
14
+ **This command is always safe to run.** It detects first, shows analysis, and asks before any changes.
15
+
16
+ ---
17
+
18
+ ## STEP 0 — Normalize legacy `CLAUDE.md` (host decoupling)
19
+
20
+ `AGENTS.md` is the cross-tool standard; `CLAUDE.md` is CC's legacy name. If both exist in a repo, it double-loads and drifts. Before and while building the ecosystem, normalize each repo to one file:
21
+
22
+ - **`CLAUDE.md` exists, no `AGENTS.md`** → `git mv CLAUDE.md AGENTS.md`, then proceed (treat its content as the seed).
23
+ - **Both exist** → ask the user which to keep; default: merge into `AGENTS.md`, `git rm CLAUDE.md`.
24
+ - **`AGENTS.md` exists** → analyze and build on it.
25
+ - **Neither exists** → create from scratch (Step 4+).
26
+
27
+ When migrating, rephrase any CC-flavored framing host-neutrally ("guidance to Claude Code" → "guidance for AI agents"). This is the same migration the `/workspace:init-agents` skill performs per-repo; run it across every member repo as you wire the ecosystem.
28
+
29
+ ---
30
+
31
+ ## STEP 1: DETECT (Always runs first — completely safe)
32
+
33
+ ### 1.1 Get Repository Info
34
+
35
+ ```bash
36
+ # Get organization from git remote
37
+ git remote get-url origin 2>/dev/null
38
+
39
+ # Get current branch
40
+ git branch --show-current
41
+
42
+ # Check which context file exists and count lines (AGENTS.md is primary; CLAUDE.md is legacy)
43
+ ls -la AGENTS.md CLAUDE.md 2>/dev/null
44
+ wc -l AGENTS.md 2>/dev/null
45
+ ```
46
+
47
+ ### 1.2 Determine Context-File Type
48
+
49
+ Read the context file (prefer `AGENTS.md`; fall back to `CLAUDE.md` only if that's all a repo has) and check for these markers:
50
+
51
+ | Marker Found | Type |
52
+ |--------------|------|
53
+ | `## ECOSYSTEM OVERVIEW` | Ecosystem Hub |
54
+ | `## REPOSITORY INDEX` | Ecosystem Hub |
55
+ | `> **Ecosystem Hub:**` | Satellite |
56
+ | None of above | Standard (single-repo) |
57
+ | No context file | None |
58
+
59
+ Also flag the **legacy state**: if only `CLAUDE.md` exists (no `AGENTS.md`), recommend the Step 0 migration so the repo joins the cross-tool ecosystem cleanly.
60
+
61
+ ### 1.3 Scan for Related Repositories
62
+
63
+ Look for related repos:
64
+ - Check README.md for mentions of other repos
65
+ - Check the existing context file for repo references
66
+ - Look for common local paths (same parent directory)
67
+ - Parse organization from git remote URL
68
+
69
+ For each related repo found, check which context file it has and what type.
70
+
71
+ ---
72
+
73
+ ## STEP 2: SHOW ANALYSIS REPORT
74
+
75
+ **Always show this report before any action:**
76
+
77
+ ```
78
+ ┌─────────────────────────────────────────────────────────────┐
79
+ │ ECOSYSTEM CONTEXT-FILE ANALYSIS │
80
+ ├─────────────────────────────────────────────────────────────┤
81
+ │ Organization: [org-name] │
82
+ │ Current Repo: [repo-name] │
83
+ │ Branch: [branch] │
84
+ ├─────────────────────────────────────────────────────────────┤
85
+ │ │
86
+ │ THIS REPOSITORY: │
87
+ │ Context file: [AGENTS.md / CLAUDE.md (legacy) / Missing] │
88
+ │ Type: [Ecosystem Hub / Satellite / Standard / None] │
89
+ │ Lines: [N] │
90
+ │ │
91
+ │ RELATED REPOSITORIES: │
92
+ │ [repo-1]: [Hub ✅ / Satellite ✅ / Standard ⚠️ / None ❌] │
93
+ │ [repo-2]: [Hub ✅ / Satellite ✅ / Standard ⚠️ / None ❌] │
94
+ │ ... │
95
+ │ │
96
+ ├─────────────────────────────────────────────────────────────┤
97
+ │ ARCHITECTURE STATUS: [✅ Complete / ⚠️ Partial / ❌ Missing]│
98
+ │ │
99
+ │ [Details about what exists and what's missing] │
100
+ ├─────────────────────────────────────────────────────────────┤
101
+ │ RECOMMENDATION: │
102
+ │ │
103
+ │ [Specific actionable suggestion] │
104
+ └─────────────────────────────────────────────────────────────┘
105
+ ```
106
+
107
+ ---
108
+
109
+ ## STEP 3: ASK USER (Interactive decision)
110
+
111
+ Based on analysis, ask the user which path to take:
112
+
113
+ ### If no context file exists:
114
+
115
+ ```
116
+ Question: "What would you like to create?"
117
+ Options:
118
+ - Ecosystem Hub (this is the main repo for the org)
119
+ - Satellite (this links to a hub elsewhere)
120
+ - Nothing (just wanted to check status)
121
+ ```
122
+
123
+ ### If a Standard context file exists:
124
+
125
+ ```
126
+ Question: "Upgrade to ecosystem architecture?"
127
+ Options:
128
+ - Upgrade to Hub (add ecosystem sections, keep existing content)
129
+ - Convert to Satellite (lightweight, links to hub)
130
+ - Keep as-is (no changes)
131
+ ```
132
+
133
+ ### If an Ecosystem Hub exists:
134
+
135
+ ```
136
+ Question: "Ecosystem Hub exists. What would you like to do?"
137
+ Options:
138
+ - Update entries (refresh repo info, versions, test counts)
139
+ - Nothing (just checking status)
140
+ ```
141
+
142
+ ### If a Satellite exists:
143
+
144
+ ```
145
+ Question: "Satellite exists. What would you like to do?"
146
+ Options:
147
+ - Update content (refresh info)
148
+ - Nothing (just checking status)
149
+ ```
150
+
151
+ ### If Architecture is Complete:
152
+
153
+ ```
154
+ Just report: "Architecture is complete. All repos have proper context files."
155
+ No action needed.
156
+ ```
157
+
158
+ ---
159
+
160
+ ## STEP 4: EXECUTE (Only after user choice)
161
+
162
+ ### 4.1 Commit Strategy
163
+
164
+ The context file lives in each repo as a regular file. `AGENTS.md` is the standard name; if a legacy `CLAUDE.md` exists, migrate it first (Step 0):
165
+
166
+ ```bash
167
+ # Migrate legacy name if needed (AGENTS.md is the cross-tool standard)
168
+ if [ -f CLAUDE.md ] && [ ! -f AGENTS.md ]; then
169
+ git mv CLAUDE.md AGENTS.md
170
+ fi
171
+
172
+ git add AGENTS.md
173
+ git commit -m "docs: update ecosystem context file"
174
+ git push
175
+ ```
176
+
177
+ ### 4.2 Creating an Ecosystem Hub
178
+
179
+ Add these sections at the top of `AGENTS.md`, preserving existing content below:
180
+
181
+ ```markdown
182
+ <!-- Ecosystem hub context file — org-wide context for AI agents (Claude Code, Pi, any AGENTS.md-aware agent). Host-neutral. -->
183
+
184
+ # AGENTS.md - [Project] Ecosystem
185
+
186
+ **Organization:** https://github.com/[org]
187
+ **Website:** [url]
188
+ **Purpose:** Ecosystem-wide context for AI agents working across all [org] repositories
189
+
190
+ ---
191
+
192
+ ## ECOSYSTEM OVERVIEW
193
+
194
+ [Brief description]
195
+
196
+ ### Related Repositories
197
+
198
+ | Repo | Purpose | Tech Stack | Version |
199
+ |------|---------|------------|---------|
200
+ | `org/repo1` | **Core** - [desc] | [stack] | vX.X.X |
201
+ | `org/repo2` | [desc] | [stack] | vX.X.X |
202
+
203
+ **Organization Mission:** [mission]
204
+
205
+ ---
206
+
207
+ ## CROSS-REPO STANDARDS
208
+
209
+ ### Shared Coding Standards
210
+ [formatting, quality gates, git workflow]
211
+
212
+ ### Shared AI Agent Guidelines
213
+
214
+ **DO:**
215
+ - [best practices]
216
+
217
+ **DON'T:**
218
+ - [anti-patterns]
219
+
220
+ ### Licenses
221
+ [license info]
222
+
223
+ ---
224
+
225
+ ## REPOSITORY INDEX
226
+
227
+ ### 1. [main-repo] (Core) - **YOU ARE HERE**
228
+
229
+ **Purpose:** [description]
230
+ **Tech Stack:** [tech]
231
+ **Key Commands:**
232
+ \`\`\`bash
233
+ [commands]
234
+ \`\`\`
235
+ **Key Files:**
236
+ - [files]
237
+
238
+ **Full details:** See "[PROJECT] CORE REPOSITORY" section below
239
+
240
+ ---
241
+
242
+ ### 2. [other-repo]
243
+
244
+ **Purpose:** [description]
245
+ **Tech Stack:** [tech]
246
+ **Key Commands:**
247
+ \`\`\`bash
248
+ [commands]
249
+ \`\`\`
250
+ **Key Files:**
251
+ - [files]
252
+
253
+ **Context file:** [link to repo's AGENTS.md]
254
+
255
+ ---
256
+
257
+ ## CURRENT FOCUS
258
+
259
+ See [ROADMAP.md](ROADMAP.md) for detailed tracking.
260
+
261
+ **Cross-Repo Coordination:**
262
+ - [notes]
263
+
264
+ ---
265
+
266
+ # [PROJECT] CORE REPOSITORY
267
+
268
+ > **Note:** Sections below are specific to this repository.
269
+
270
+ [EXISTING CONTENT PRESERVED HERE]
271
+ ```
272
+
273
+ ### 4.3 Creating a Satellite
274
+
275
+ ```markdown
276
+ <!-- Satellite context file — extends the ecosystem hub (link below). Host-neutral; repo-specific only. Do not duplicate hub standards here. -->
277
+
278
+ # AGENTS.md - [Repo Name]
279
+
280
+ > **Ecosystem Hub:** See [hub-repo/AGENTS.md](link) for full ecosystem context
281
+
282
+ **Repository:** https://github.com/[org]/[repo]
283
+ **Purpose:** [description]
284
+
285
+ ---
286
+
287
+ ## Quick Reference
288
+
289
+ **Tech Stack:** [tech]
290
+ **Deployment:** [if applicable]
291
+
292
+ **Key Commands:**
293
+ \`\`\`bash
294
+ [commands]
295
+ \`\`\`
296
+
297
+ ---
298
+
299
+ ## Key Files
300
+
301
+ | Path | Description |
302
+ |------|-------------|
303
+ | [path] | [desc] |
304
+
305
+ ---
306
+
307
+ ## Repo-Specific Guidelines
308
+
309
+ **DO:**
310
+ - [guidelines]
311
+
312
+ **DON'T:**
313
+ - [anti-patterns]
314
+
315
+ ---
316
+
317
+ **Last Updated:** [date]
318
+ ```
319
+
320
+ ---
321
+
322
+ ## DISCOVERY HELPERS
323
+
324
+ When gathering info for a repo:
325
+
326
+ **From package.json / Cargo.toml / pyproject.toml:**
327
+ - name, version, description
328
+ - scripts/commands
329
+
330
+ **From README.md:**
331
+ - Project purpose
332
+ - Related repos
333
+
334
+ **From directory structure:**
335
+ - Entry points (src/index.ts, main.py, cmd/main.go)
336
+ - Key directories
337
+
338
+ **From git:**
339
+ - Organization name (from remote URL)
340
+ - Current branch
341
+
342
+ ---
343
+
344
+ ## KEY PRINCIPLES
345
+
346
+ 1. **`AGENTS.md` is the standard** — `CLAUDE.md` is CC's legacy name; migrate it (`git mv CLAUDE.md AGENTS.md`) so the file works across all agents, not just CC.
347
+ 2. **Always safe** — detect first, ask before write
348
+ 3. **User decides** — never assume, always ask
349
+ 4. **Hub = full context** — an agent can work anywhere with just the hub
350
+ 5. **Satellite = lightweight** — only repo-specific info, links to the hub
351
+ 6. **No status fields** — avoid things that need constant updates
352
+ 7. **Simple table** — `| Repo | Purpose | Tech Stack | Version |`
353
+ 8. **Regular files** — the context file lives in each repo, committed to git normally
354
+
355
+ ---
356
+
357
+ Alhamdulillah! Run this command anytime — it's safe and will guide you through building a clean, cross-tool context-file architecture for your whole organization. InshaAllah!