[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73426":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":15,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},73426,"Pensieve","kingkongshot\u002FPensieve","kingkongshot","tore your decisions and principles. Claude reads them to make better choices.","",null,"Shell",2524,257,16,5,0,3,10,9,68.73,"MIT License",false,"main",true,[],"2026-06-12 04:01:09","\u003Cdiv align=\"center\">\n\n# Pensieve\n\n**Give your AI agent a continuously growing project memory.**\n\n[![GitHub Stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fkingkongshot\u002FPensieve?color=ffcb47&labelColor=black&style=flat-square)](https:\u002F\u002Fgithub.com\u002Fkingkongshot\u002FPensieve\u002Fstargazers)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-white?labelColor=black&style=flat-square)](LICENSE)\n\n[中文 README](https:\u002F\u002Fgithub.com\u002Fkingkongshot\u002FPensieve\u002Fblob\u002Fzh\u002FREADME.md)\n\n\u003C\u002Fdiv>\n\n**In one sentence: Pensieve is a self-growing CLAUDE.md that runs as a skill -- minimal context usage, compatible with all AI tools that support skills.**\n\n| | CLAUDE.md \u002F agents.md | Pensieve |\n|---|---|---|\n| Form | Single static file | Four-layer structured knowledge |\n| Maintenance | Manual writing, manual updates | Auto-accumulation, auto-alignment |\n| Scope | Project conventions | Conventions + decisions + facts + workflows |\n| Linking | Flat | Semantic links forming a knowledge graph |\n| Context usage | Full-text injection | Skill-based on-demand routing, minimal usage |\n\n## Why Use Pensieve\n\n| Without | With |\n|---|---|\n| Have to re-explain project specs every time | Specs stored as maxims, loaded automatically |\n| Code review standards depend on mood | Review standards solidified into executable pipelines |\n| Repeat last week's mistake this week | Lessons auto-accumulated, skipped next time |\n| Forget why you designed it this way three months later | Decisions record context and alternatives |\n| Have to re-read docs to locate module boundaries every time | Knowledge caches exploration results, reuse directly |\n\n## Self-Reinforcing Loop\n\nPensieve doesn't just store documentation -- it makes every agent conversation more precise:\n\n- **Validate AI-generated plans** -- `\"Use pensieve to check the accuracy of this plan\"` -> Automatically cross-references maxims and decisions; plans that violate architectural conventions are intercepted before execution\n- **Narrow the exploration scope** -- `\"Use pensieve to locate the entry point of the payment module\"` -> Knowledge contains previous exploration results, reuse directly without global search, saving tokens and time\n- **Establish implicit connections** -- `\"Use pensieve to analyze which workflows this refactoring will affect\"` -> Four-layer knowledge forms a graph through semantic links, following association chains to discover design intent and dependencies\n- **Reduce repeated confirmations** -- `\"Use pensieve conventions to commit code\"` -> Conventions and decisions are already accumulated, no more asking \"what style?\" or \"where's the boundary?\"\n\nYou don't need to manually maintain the knowledge base -- daily development feeds it automatically:\n\n```\n    Develop --> Commit --> Review (pipeline)\n     ^                      |\n     |   \u003C-- Auto-accumulate experience \u003C--   |\n     |                      v\n     +-- maxim \u002F decision \u002F knowledge \u002F pipeline\n```\n\n- **During editing**: After Write\u002FEdit, the knowledge graph syncs automatically (Claude Code triggers via hooks; other clients can manually run `self-improve`)\n- **During review**: Executes according to project pipelines, conclusions flow back as knowledge\n- **During retrospective**: `\"Use pensieve to accumulate this experience\"` -> Insights are written to the corresponding layer\n\nYou steer the direction, Pensieve helps you avoid pitfalls.\n\n## Four-Layer Knowledge Model\n\n| Layer | Type | What It Answers | Cross-project? |\n|---|---|---|---|\n| **MUST** | maxim | What must never be violated? | Yes -- holds across projects and languages |\n| **WANT** | decision | Why was this approach chosen? | No -- active trade-offs for the current project |\n| **HOW** | pipeline | How should this workflow run? | Depends |\n| **IS** | knowledge | What are the current facts? | No -- verifiable system facts |\n\nLayers are connected through three types of semantic links: `based-on \u002F leads-to \u002F related`. As usage accumulates, Pensieve automatically builds a directed graph of project knowledge:\n\n\u003Cimg src=\"docs\u002Fgraph-overview.png\" width=\"100%\" alt=\"Pensieve knowledge graph overview\" \u002F>\n\u003Cimg src=\"docs\u002Fgraph-detail.png\" width=\"100%\" alt=\"Pensieve knowledge graph detail\" \u002F>\n\nSee the detailed specifications under `.src\u002Freferences\u002F`: [maxims.md](.src\u002Freferences\u002Fmaxims.md), [decisions.md](.src\u002Freferences\u002Fdecisions.md), [knowledge.md](.src\u002Freferences\u002Fknowledge.md), [pipelines.md](.src\u002Freferences\u002Fpipelines.md).\n\n## Five Tools\n\n| Tool | What It Does | Trigger Example |\n|---|---|---|\n| `init` | Create data directory, seed default content | \"Initialize pensieve for me\" |\n| `upgrade` | Refresh skill source code | \"Upgrade pensieve\" |\n| `migrate` | Migrate legacy data, align seed files | \"Migrate to v2\" |\n| `doctor` | Read-only scan, check structure and format | \"Check if the data has any issues\" |\n| `self-improve` | Extract insights from conversations and diffs, write to four-layer knowledge | \"Accumulate this experience\" |\n\nTool boundaries and redirection rules: [tool-boundaries.md](.src\u002Freferences\u002Ftool-boundaries.md).\n\n## Looking for the Linus Prompt?\n\nPensieve was initially known for a Linus Torvalds-style guiding prompt -- using \"good taste\", \"don't break userspace\", and \"paranoid about simplicity\" to constrain agent behavior.\n\nThat engineering philosophy is still at the core of Pensieve, but it's no longer an isolated prompt. It's now built in as executable principles, so the agent has \"good taste\" from day one:\n\n| Type | Built-in Content | Effect |\n|---|---|---|\n| maxim | 4 Linus-style engineering principles | Agent avoids patchy code, simplifies before extending, and preserves existing behavior |\n| pipeline | Commit + code review + refactor | Every commit, review, and refactor checks against the standards and feeds conclusions back into knowledge |\n| knowledge | Code-taste review standard | \"Good code\" becomes executable |\n\nTry it: `\"Use pensieve to review the code taste of recent commits\"` or `\"Use pensieve to commit local changes\"`.\n\n## Installation\n\nPrerequisites: `git`, `bash`, `Python 3.8+`.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Claude Code\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# 1. Global install (one-time only)\ngit clone -b main https:\u002F\u002Fgithub.com\u002Fkingkongshot\u002FPensieve.git ~\u002F.claude\u002Fskills\u002Fpensieve\n\n# 2. Install hooks (recommended; auto-syncs knowledge graph after edits, auto-checks status on session start)\nbash ~\u002F.claude\u002Fskills\u002Fpensieve\u002F.src\u002Fscripts\u002Finstall-hooks.sh\n\n# 3. Initialize in your project\ncd \u003Cyour-project>\nbash ~\u002F.claude\u002Fskills\u002Fpensieve\u002F.src\u002Fscripts\u002Finit-project-data.sh\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Other Clients (Cursor \u002F General Agents, etc.)\u003C\u002Fb>\u003C\u002Fsummary>\n\nReplace `\u003Cskill-path>` with the skill directory for your client (e.g., `~\u002F.cursor\u002Fskills\u002Fpensieve`).\n\n```bash\n# 1. Global install (one-time only)\ngit clone -b main https:\u002F\u002Fgithub.com\u002Fkingkongshot\u002FPensieve.git \u003Cskill-path>\n\n# 2. Initialize in your project\ncd \u003Cyour-project>\nbash \u003Cskill-path>\u002F.src\u002Fscripts\u002Finit-project-data.sh\n```\n\n\u003C\u002Fdetails>\n\nSystem code is installed globally once; user data is stored per project in `\u003Cproject>\u002F.pensieve\u002F`. Multiple projects share the same system code, each maintaining independent project knowledge.\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>AI Agent Auto-Install Reference\u003C\u002Fb>\u003C\u002Fsummary>\n\nWhen a user asks an AI agent to install Pensieve, the agent should follow this decision flow. Below, `SKILL_PATH` refers to the client-specific installation path (e.g., `~\u002F.claude\u002Fskills\u002Fpensieve`).\n\n**Step 1: Check global installation status**\n\n```bash\nSKILL_PATH=\"$HOME\u002F.claude\u002Fskills\u002Fpensieve\"  # Adjust per client\n\nif [[ -d \"$SKILL_PATH\u002F.src\" ]]; then\n    echo \"Pensieve is already globally installed, skipping clone\"\nelse\n    SKILL_PARENT=\"$(dirname \"$SKILL_PATH\")\"\n    # Check if parent directory is a git repo (some users sync configs with git)\n    if git -C \"$SKILL_PARENT\u002F..\" rev-parse --is-inside-work-tree >\u002Fdev\u002Fnull 2>&1; then\n        git -C \"$SKILL_PARENT\u002F..\" submodule add -b main https:\u002F\u002Fgithub.com\u002Fkingkongshot\u002FPensieve.git \"skills\u002Fpensieve\"\n    else\n        git clone -b main https:\u002F\u002Fgithub.com\u002Fkingkongshot\u002FPensieve.git \"$SKILL_PATH\"\n    fi\n    # Hooks are a Claude Code-specific feature; other clients skip this step\n    # bash \"$SKILL_PATH\u002F.src\u002Fscripts\u002Finstall-hooks.sh\"\nfi\n```\n\n**Step 2: Determine whether to run project initialization**\n\n```bash\n# If the current directory is the skill's parent config directory, don't auto-initialize project data\nCURRENT_DIR=\"$(pwd)\"\nCONFIG_DIR=\"$(cd \"$(dirname \"$SKILL_PATH\")\u002F..\" 2>\u002Fdev\u002Fnull && pwd)\"\nif [[ \"$CURRENT_DIR\" == \"$CONFIG_DIR\" ]]; then\n    echo \"Current directory is the config directory, skipping project initialization. If you need to use Pensieve here, please specify explicitly.\"\n    exit 0\nfi\n```\n\n**Step 3: Check for legacy data and initialize**\n\n```bash\nHAS_LEGACY=0\nfor legacy_dir in .claude\u002Fskills\u002Fpensieve .agents\u002Fskills\u002Fpensieve skills\u002Fpensieve .claude\u002Fpensieve; do\n    if [[ -d \"$legacy_dir\" ]] && [[ -d \"$legacy_dir\u002Fmaxims\" || -d \"$legacy_dir\u002Fdecisions\" || -d \"$legacy_dir\u002Fknowledge\" || -d \"$legacy_dir\u002Fpipelines\" ]]; then\n        HAS_LEGACY=1\n        break\n    fi\ndone\n\nif [[ \"$HAS_LEGACY\" -eq 1 ]]; then\n    echo \"Legacy Pensieve user data detected. Migrate to v2?\"\n    bash \"$SKILL_PATH\u002F.src\u002Fscripts\u002Finit-project-data.sh\"\n    bash \"$SKILL_PATH\u002F.src\u002Fscripts\u002Frun-migrate.sh\"\n    bash \"$SKILL_PATH\u002F.src\u002Fscripts\u002Frun-doctor.sh\" --strict\nelif [[ -d .pensieve ]]; then\n    echo \"Pensieve is already initialized in the current project\"\nelse\n    bash \"$SKILL_PATH\u002F.src\u002Fscripts\u002Finit-project-data.sh\"\nfi\n```\n\n> **Key takeaway**: Check global install first -> Determine if parent directory is a git repo to decide clone\u002Fsubmodule -> Skip project initialization for config directories -> Check for legacy data to decide init\u002Fmigrate.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Updating\u003C\u002Fb>\u003C\u002Fsummary>\n\n```bash\n# Update system code (one operation, all projects take effect)\ncd \u003Cskill-path>\ngit pull --ff-only || { git fetch origin && git reset --hard \"origin\u002F$(git rev-parse --abbrev-ref HEAD)\"; }\n\n# Health check in your project (optional but recommended)\ncd \u003Cyour-project>\nbash \u003Cskill-path>\u002F.src\u002Fscripts\u002Frun-doctor.sh --strict\n```\n\n`git pull --ff-only` works for normal updates. If the remote branch was force-pushed (e.g., after a squash and republish), ff-only will fail, and `fetch + reset` will sync local to the latest remote state. This is safe -- the skill directory only contains tracked system files; user data is in `\u003Cproject>\u002F.pensieve\u002F` and won't be overwritten.\n\nFull installation, update, reinstall, and uninstall instructions: [skill-lifecycle.md](.src\u002Freferences\u002Fskill-lifecycle.md).\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Upgrading from Legacy Versions\u003C\u002Fb>\u003C\u002Fsummary>\n\nIf your Pensieve was installed at project level (code in `\u003Cproject>\u002F.claude\u002Fskills\u002Fpensieve\u002F`), or installed via `claude plugin install`, you need to migrate to the v2 architecture:\n\n```bash\n# 1. Global install system code (if not already installed)\nif [[ ! -d \u003Cskill-path> ]]; then\n    git clone -b main https:\u002F\u002Fgithub.com\u002Fkingkongshot\u002FPensieve.git \u003Cskill-path>\nfi\n\n# 2. Install hooks (Claude Code only; other clients skip this)\n# bash \u003Cskill-path>\u002F.src\u002Fscripts\u002Finstall-hooks.sh\n\n# 3. Run migration in each project\ncd \u003Cyour-project>\nbash \u003Cskill-path>\u002F.src\u002Fscripts\u002Finit-project-data.sh\nbash \u003Cskill-path>\u002F.src\u002Fscripts\u002Frun-migrate.sh\nbash \u003Cskill-path>\u002F.src\u002Fscripts\u002Frun-doctor.sh --strict\n\n# 4. Uninstall old plugin (if applicable, Claude Code only)\n# claude plugin uninstall pensieve 2>\u002Fdev\u002Fnull || true\n```\n\n`run-migrate.sh` will automatically move user data (`maxims\u002F`, `decisions\u002F`, `knowledge\u002F`, `pipelines\u002F`) from legacy paths into `\u003Cproject>\u002F.pensieve\u002F`, runtime state from `\u003Cproject>\u002F.state\u002F` into `\u003Cproject>\u002F.pensieve\u002F.state\u002F`, clean up old graph files and README copies, then delete the legacy directories.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>Architecture Details\u003C\u002Fb>\u003C\u002Fsummary>\n\n### Directory Structure\n\n```text\n~\u002F.claude\u002Fskills\u002Fpensieve\u002F          # User-level (single global install)\n├── SKILL.md                        #   Static routing file (tracked)\n├── .src\u002F                           #   System code, templates, references, core engine\n│   ├── core\u002F\n│   ├── scripts\u002F\n│   ├── templates\u002F\n│   │   ├── agents\u002F\n│   │   ├── knowledge\u002F\n│   │   ├── maxims\u002F\n│   │   └── pipelines\u002F\n│   ├── references\u002F\n│   └── tools\u002F\n└── agents\u002F                         #   agent\u002FUI metadata\n\n\u003Cproject>\u002F.codex\u002Fskills\u002F            # Project-level Codex skill (only for maintaining this repository)\n└── pensieve-sync-to-main\u002F\n    ├── SKILL.md\n    └── agents\u002F\n        └── openai.yaml\n\n\u003Cproject>\u002F.pensieve\u002F                # Project-level (per-project, can be version-controlled)\n├── maxims\u002F                         #   Engineering principles\n├── decisions\u002F                      #   Architectural decisions\n├── knowledge\u002F                      #   Cached exploration results\n├── pipelines\u002F                      #   Reusable workflows\n├── state.md                        #   Dynamic: lifecycle state + knowledge graph\n└── .state\u002F                         #   Runtime artifacts (gitignored)\n```\n\n`.src\u002Fmanifest.json` is the anchor for the skill root directory -- scripts locate all paths through it.\n\n### Design Principles\n\n- **Physical isolation of system code and user data** -- System code lives in `~\u002F.claude\u002Fskills\u002Fpensieve\u002F`, user data in `\u003Cproject>\u002F.pensieve\u002F`; `git pull` to update the system can never touch project data\n- **Single source of truth for rules** -- Directories, key files, and migration paths are all defined in `.src\u002Fcore\u002Fschema.json`\n- **Confirm before executing** -- When scope is unclear, ask first; don't auto-launch long workflows\n- **Read specs before writing data** -- Before creating any user data, read the format specifications in `.src\u002Freferences\u002F`\n\n\u003C\u002Fdetails>\n\n## Community\n\n\u003Cimg src=\"docs\u002FQRCode.png\" width=\"200\" alt=\"QR Code\" \u002F>\n\n## License\n\nMIT\n","Pensieve 是一个用于存储决策和原则的工具，让AI助手Claude能够基于这些信息做出更优的选择。其核心功能包括自动积累与对齐知识、构建四层结构化知识体系以及形成语义链接的知识图谱，以实现最小上下文使用并兼容所有支持技能的AI工具。特别适用于需要持续维护项目记忆、规范代码审查标准、避免重复错误及快速定位模块边界等场景，通过自增长的知识库来提升开发效率和决策质量。",2,"2026-06-11 03:45:29","high_star"]