@tekmidian/pai 0.3.0 → 0.3.1

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/FEATURE.md CHANGED
@@ -1,7 +1,3 @@
1
- ---
2
- links: "[[Ideaverse/AI/PAI/PAI|PAI]]"
3
- ---
4
-
5
1
  # PAI Feature Comparison
6
2
 
7
3
  ## Credit
@@ -117,6 +113,3 @@ Code to remember everything across sessions, use this.
117
113
 
118
114
  They're not mutually exclusive. Fabric handles one-shot prompt workflows. PAI Knowledge OS
119
115
  handles persistent memory for Claude Code. Many people will want both.
120
-
121
- ---
122
- *Links:* [[Ideaverse/AI/PAI/PAI|PAI]]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekmidian/pai",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "PAI Knowledge OS — Personal AI Infrastructure with federated memory and project management",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -1,7 +1,3 @@
1
- ---
2
- links: "[[Ideaverse/AI/PAI/templates/templates|templates]]"
3
- ---
4
-
5
1
  # PAI Configuration Templates
6
2
 
7
3
  This directory contains example configuration files for personalizing your PAI Knowledge OS setup.
@@ -183,6 +179,3 @@ Once you've customized the basic templates, you can:
183
179
  ---
184
180
 
185
181
  **Template Version**: 1.0
186
-
187
- ---
188
- *Links:* [[Ideaverse/AI/PAI/templates/templates|templates]]
@@ -1,7 +1,3 @@
1
- ---
2
- links: "[[Ideaverse/AI/PAI/templates/templates|templates]]"
3
- ---
4
-
5
1
  # PAI Agent Preferences (Personal Configuration)
6
2
 
7
3
  Copy this file to `~/.config/pai/agent-prefs.md` and customize for your workflow. This file is **NOT** committed to any repository and contains your personal preferences.
@@ -364,6 +360,3 @@ A: `.claude.json` is for Claude Code and MCP server configuration. This file is
364
360
 
365
361
  **Q: What if I delete this file?**
366
362
  A: PAI will use defaults. You can always recreate it from this template.
367
-
368
- ---
369
- *Links:* [[Ideaverse/AI/PAI/templates/templates|templates]]
@@ -1,7 +1,3 @@
1
- ---
2
- links: "[[Ideaverse/AI/PAI/templates/templates|templates]]"
3
- ---
4
-
5
1
  # CLAUDE.md - PAI Global Configuration
6
2
  <!-- Generated by PAI Setup — Do not edit directly. Run `pai setup` to regenerate. -->
7
3
  <!-- Personal preferences and project mappings are read from ~/.config/pai/agent-prefs.md -->
@@ -735,6 +731,3 @@ For personal preferences (notification channels, voice settings, agent defaults)
735
731
  13. **Task management** - plan to tasks/todo.md first, track progress, document results
736
732
 
737
733
  This is constitutional. Violations waste time, money, and context.
738
-
739
- ---
740
- *Links:* [[Ideaverse/AI/PAI/templates/templates|templates]]
@@ -1,11 +1,13 @@
1
1
  ---
2
- links: "[[Ideaverse/AI/PAI/templates/templates|templates]]"
2
+ pai:
3
+ slug: "${SLUG}"
4
+ registered: "${DATE}"
5
+ last_indexed: null
6
+ status: active
3
7
  ---
8
+
4
9
  # ${DISPLAY_NAME}
5
10
 
6
11
  <!-- Everything below the YAML frontmatter is yours — PAI never modifies content here. -->
7
12
  <!-- Use this file for project notes, decisions, preferences, or anything you want. -->
8
13
  <!-- PAI only reads and updates the `pai:` block in the frontmatter above. -->
9
-
10
- ---
11
- *Links:* [[Ideaverse/AI/PAI/templates/templates|templates]]
@@ -5,16 +5,38 @@ description: PAI session lifecycle automation. USE WHEN user says "go", "continu
5
5
 
6
6
  <!-- Generated by PAI Setup -->
7
7
 
8
+ ## RESPONSE MODE CLASSIFICATION (Always Active)
9
+
10
+ **Classify EVERY request into one of three modes BEFORE emitting any response token.**
11
+
12
+ | Mode | When | Format |
13
+ |------|------|--------|
14
+ | **MINIMAL** | Greetings, thanks, acks, simple yes/no, one-word answers | Natural conversational response. No structured format. 1-3 sentences max. |
15
+ | **STANDARD** | Single-step tasks, quick lookups, simple file reads, direct questions | Compact: just answer the question directly. |
16
+ | **FULL** | Multi-step work, research, implementation, analysis, 3+ tool calls | Full structured format with SUMMARY/ANALYSIS/ACTIONS/RESULTS/STATUS/NEXT. |
17
+
18
+ **Decision rule:** If you can answer in under 3 sentences without tools → MINIMAL. If it's one action or lookup → STANDARD. Everything else → FULL.
19
+
20
+ ---
21
+
8
22
  ## TOKEN MONITORING (Always Active)
9
23
 
10
24
  **Token Limit:** ~200k total context window
11
25
  **Auto-Reset Threshold:** ~100k tokens (50%)
12
26
 
13
- **After major actions, estimate token usage:**
14
- - Each file read ≈ 1-3k tokens
15
- - Each file written/edited 0.5-2k tokens
16
- - Each user message + response ≈ 2-5k tokens
17
- - Large search results 2-5k tokens
27
+ ### Proactive Context Management
28
+
29
+ **After every 5+ sequential tool calls, PAUSE and self-assess:**
30
+ 1. Estimate current context usage (each file read ≈ 1-3k, edit 0.5-2k, message+response ≈ 2-5k, search results ≈ 2-5k)
31
+ 2. If estimated usage > 60% of window (~120k tokens): **self-summarize before continuing**
32
+ - **Preserve:** key decisions, numbers, code references, file paths, next actions
33
+ - **Discard:** verbose tool output, intermediate reasoning, raw search results
34
+ - Write a 1-3 paragraph summary replacing prior phase content
35
+ 3. If > 80%: consider whether to checkpoint and suggest `/clear`
36
+
37
+ **This is proactive, not reactive.** Don't wait for auto-compact to surprise you. Manage context like a budget.
38
+
39
+ ### Auto-Reset Protocol
18
40
 
19
41
  **When approaching ~100k tokens, initiate AUTO-RESET:**
20
42
 
@@ -77,6 +99,28 @@ The GDPR requires consent for processing personal data ([GDPR Art. 6](https://gd
77
99
 
78
100
  ---
79
101
 
102
+ ## ANTI-CRITERIA IN PLANNING (Always Active)
103
+
104
+ **When planning non-trivial work, define what MUST NOT happen alongside what must happen.**
105
+
106
+ - Prefix negative requirements with `ISC-A` (Anti-Criteria): `ISC-A1: No personal data in exported files`
107
+ - Anti-criteria are first-class verifiable requirements — verify them in the same pass as positive criteria
108
+ - Common anti-criteria: no regressions, no secrets in commits, no breaking changes to public API, no data loss
109
+
110
+ ---
111
+
112
+ ## INVOCATION OBLIGATION (Always Active)
113
+
114
+ **If you mention a tool or capability during planning, you MUST actually invoke it.**
115
+
116
+ - Listing a capability but never calling it via tool is dishonest — it's "capability theater."
117
+ - If you say "let me search for that" → you MUST call a search tool. Don't generate from memory.
118
+ - If you plan to use a skill → you MUST call the Skill tool. Don't simulate the output.
119
+ - If you decide NOT to use a planned capability → explicitly state why: "Skipping X because Y."
120
+ - At the end of multi-step work, verify: every tool/skill you mentioned was either invoked or explicitly declined.
121
+
122
+ ---
123
+
80
124
  ## GIT COMMIT RULES (Always Active)
81
125
 
82
126
  **MANDATORY FOR ALL COMMITS:**
@@ -292,4 +336,93 @@ Session notes are stored in: `~/.claude/projects/{encoded-cwd}/Notes/` or local
292
336
 
293
337
  ---
294
338
 
295
- **This skill is installed by `pai setup`. For personal customization (identity, personality, response format, notification preferences), create your own skill in `~/.claude/skills/`.**
339
+ ## DELEGATION & PARALLELIZATION (Always Active)
340
+
341
+ **Whenever a task can be parallelized, use multiple agents.**
342
+
343
+ ### Model Selection for Agents
344
+
345
+ | Task Type | Model | Why |
346
+ |-----------|-------|-----|
347
+ | Deep reasoning, complex architecture | `opus` | Maximum intelligence needed |
348
+ | Standard implementation, most coding | `sonnet` | Good balance of speed + capability |
349
+ | Simple lookups, quick checks, grunt work | `haiku` | 10-20x faster, sufficient intelligence |
350
+
351
+ **Rule of Thumb:**
352
+ - Grunt work or verification → `haiku`
353
+ - Implementation or research → `sonnet`
354
+ - Deep strategic thinking → `opus`
355
+
356
+ ### How to Parallelize
357
+
358
+ - Use a SINGLE message with MULTIPLE Agent/Task tool calls = parallel execution
359
+ - Each agent gets FULL CONTEXT and DETAILED INSTRUCTIONS
360
+ - **ALWAYS launch a spotcheck agent after parallel work completes**
361
+
362
+ ### Context Conservation
363
+
364
+ Bulk/repetitive work consumes context. Delegate it to conserve your main conversation space for planning and decisions.
365
+
366
+ **When to delegate:** Updating many files, batch refactoring, repetitive transformations, large-scale testing, batch file operations.
367
+
368
+ **Pattern:**
369
+ 1. Plan the work in main conversation
370
+ 2. Delegate to agent(s) with detailed instructions
371
+ 3. Agent executes bulk changes efficiently
372
+ 4. Review results and iterate if needed
373
+ 5. Main conversation remains lean and focused
374
+
375
+ ---
376
+
377
+ ## STACK PREFERENCES (Always Active)
378
+
379
+ - **TypeScript > Python** — Use TypeScript unless explicitly told otherwise
380
+ - **Package managers:** bun for JS/TS (NOT npm/yarn/pnpm), uv for Python (NOT pip)
381
+ - **Markdown > HTML:** Never use HTML tags for basic content
382
+ - **Analysis vs Action:** If asked to analyze, do analysis only — don't change things unless asked
383
+
384
+ ---
385
+
386
+ ## FILE ORGANIZATION (Always Active)
387
+
388
+ - **Scratchpad** (`${PAI_DIR}/scratchpad/`) — Temporary files only. Delete when done.
389
+ - **History** (`${PAI_DIR}/History/`) — Permanent valuable outputs.
390
+ - **Backups** (`${PAI_DIR}/History/backups/`) — All backups go here, NEVER inside skill directories.
391
+
392
+ **Rules:**
393
+ - Save valuable work to history, not scratchpad
394
+ - Never create `backups/` directories inside skills
395
+ - Never use `.bak` suffixes
396
+
397
+ ---
398
+
399
+ ## HISTORY SYSTEM — Past Work Lookup (Always Active)
400
+
401
+ **When the user asks about anything done in the past, check the history system first.**
402
+
403
+ The history system at `${PAI_DIR}/History/` contains all past work — sessions, learnings, research, decisions.
404
+
405
+ ### How to Search History
406
+
407
+ ```bash
408
+ # Quick keyword search across all history
409
+ rg -i "keyword" ${PAI_DIR}/History/
410
+
411
+ # Search sessions specifically
412
+ rg -i "keyword" ${PAI_DIR}/History/sessions/
413
+
414
+ # List recent files
415
+ ls -lt ${PAI_DIR}/History/sessions/ | head -20
416
+ ```
417
+
418
+ ### Directory Quick Reference
419
+
420
+ | What you're looking for | Where to search |
421
+ |------------------------|-----------------|
422
+ | Session summaries | `History/sessions/YYYY-MM/` |
423
+ | Problem-solving narratives | `History/learnings/YYYY-MM/` |
424
+ | Research & investigations | `History/research/YYYY-MM/` |
425
+
426
+ ---
427
+
428
+ **This skill is installed by `pai setup`. For personal customization (identity, personality, notification preferences), create your own skill in `~/.claude/skills/`.**