# Self Learning Code Intelligence

> Use when working inside D:\skills\codex\LLMWIKI and the task involves project-local learning, self-improvement, correction, code understanding, knowledge-base updates, LLM Wiki, GitNexus, Graphify, or preventing cross-project contamination.

- Skill: `haoyuesheng1688/self-learning-code-intelligence` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add haoyuesheng1688/self-learning-code-intelligence`
- Raw SKILL.md: https://api.skillmd.com/api/skills/haoyuesheng1688/self-learning-code-intelligence/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: haoyuesheng1688 (https://skillmd.com/u/haoyuesheng1688)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/haoyuesheng1688/self-learning-code-intelligence

---


# Self Learning Code Intelligence

## Core Rule

Treat this repository as a closed learning system. Capture useful interaction
facts into project-local sources, query code intelligence before risky changes,
refresh graph indexes after changes, and keep all generated memory inside this
repository unless the user explicitly asks to export it.

## Automatic Loop

1. Start with project-local context:
   - Run `npm run graphify -- query "<task/question>"` when
     `graphify-out/graph.json` exists.
   - Run `npm run gitnexus:status`; if stale, run `npm run gitnexus:analyze`.
   - Read `AGENTS.md`, `docs/OPERATING_MODEL.md`, or `knowledge/README.md` only
     when the task touches project boundaries or learning behavior.
2. During the task, prefer project-local wrappers:
   - LLM Wiki: `npm run llmwiki -- <args>`
   - GitNexus: `npm run gitnexus:analyze`, `npm run gitnexus:status`
   - Graphify: `npm run graphify -- <args>`
   - Imported global digest: `npm run digest:imported`
   - Obsidian inbox: `npm run obsidian:sync`
   - Obsidian intelligence publish: `npm run obsidian:publish-intelligence`
   - One-click digestion: `npm run learn:all`
   - Health check: `npm run doctor`
3. After meaningful work, capture the learning:
   - Run `powershell -NoProfile -ExecutionPolicy Bypass -File skills/self-learning-code-intelligence/scripts/capture-learning.ps1 -Title "<short title>" -Summary "<what changed or was learned>"`
   - Include decisions, corrections, and open questions when useful.
4. Refresh local intelligence:
   - Run `npm run gitnexus:analyze`
   - Run `npm run graphify -- update .`
   - Run `npm run llmwiki:status`
   - Run `npm run llmwiki -- compile --review --lang zh-CN` only when LLM Wiki
     provider credentials are available or the user asked for compilation.
   - For broad automatic ingestion or routine learning refreshes, prefer
     `npm run learn:all` so Obsidian, imported digests, LLM Wiki review,
     GitNexus, Graphify, Obsidian intelligence publishing, and learning capture
     stay in one closed loop.

## Tool Roles

| Tool | Use for | Writes |
| --- | --- | --- |
| LLM Wiki | Persistent project knowledge, decisions, summaries, Q&A, reviewable compiled wiki | `sources/`, `.llmwiki/`, `wiki/` |
| GitNexus | Code dependency graph, impact analysis, stale-index detection, refactor safety | `.gitnexus/` |
| Graphify | Fast task-oriented graph query, project map, post-change graph refresh | `graphify-out/`, `.codex/hooks.json` |
| Obsidian | Human-facing inbox and project intelligence mirror for notes, graph reports, and status summaries | `sources/obsidian-inbox/`, Obsidian `LLMWIKI/project-intelligence/` |

## Capture Quality

Write source notes as facts and operational rules, not chat transcripts. Include:

- user intent and exact acceptance boundary,
- commands or tools that worked,
- commands or assumptions that failed,
- project-local decisions,
- portability or isolation implications,
- next trigger that should cause this skill to be used.

## Isolation Rules

- Do not write global Codex, Claude, Cursor, or MCP config by default.
- Do not import memories or skills from other workspaces unless the user asks.
- When global project assets are imported under
  `project-imports/global-new-project/`, treat them as references and candidate
  skills. Prefer LLMWIKI-local skills, memory, `.env`, and AGENTS.md rules.
- Before using an imported global skill, read `docs/IMPORTED_GLOBAL_DIGEST.md`
  or the digest sources under `sources/imported-global-new-project/digests/`.
  Promote imported skills into the main `skills/` directory only on explicit
  request or repeated local use.
- Do not run Graphify `--global`, GitNexus global setup, or plugin global
  installers unless explicitly requested.
- Keep API keys in project `.env`; never hardcode them in sources or skill files.
- Import only the Obsidian LLMWIKI inbox by default; do not scan the whole vault
  unless explicitly requested.
- Generated state is rebuildable. Portable logic belongs in `tools/`, `skills/`,
  `knowledge/`, and `docs/`.

## Common Mistakes

| Mistake | Correction |
| --- | --- |
| Answering from memory without updating local sources | Capture a compact source note before finishing |
| Running global setup because a tool suggests it | Use project-local wrappers and document any exception |
| Rebuilding Graphify but not GitNexus | Refresh both after code or workflow changes |
| Compiling LLM Wiki without credentials | Save sources first, then leave compile in review for later |
| Mixing unrelated project experience into this repo | Mark it as external or keep it out |
| Letting imported global skills override local rules | Use imported skills as references until explicitly promoted |

## References

- Read `references/tool-contracts.md` when choosing which tool to call.
- Use `scripts/capture-learning.ps1` for deterministic learning capture.

