alinaqi/maggy/icpg
- community
Checking that the SKILL.md file is still in the repository.
Intent-Augmented Code Property Graph — tracks WHY code exists via ReasonNodes with formal contracts, 6-dimension drift detection, and 3 canonical pre-task queries for autonomous development
Install
npx vskill@latest install alinaqi/maggy/icpgSKILL.md
iCPG Skill (Intent-Augmented Code Property Graph)
Purpose: Add a Reason Graph layer on top of code structure so every function, class, and module is traceable to the goal that created it, the agent or human that owns it, and whether it's still doing what it was supposed to do.
Core Principle
Intent first, code second. Before writing or modifying code, query the reason graph to understand WHY existing code was written, WHAT constraints it must preserve, and WHETHER your change duplicates prior work.
The 3 Canonical Pre-Task Queries
Every agent MUST run these before writing code:
| # | Query | Command | What It Answers | |
|---|---|---|---|---|
| 1 | search_prior_work | icpg query prior "<goal>" | Has this been attempted before? Prevents duplication. | |
| 2 | get_constraints | icpg query constraints <file> | What invariants apply to files I'll touch? Prevents breakage. | |
| 3 | get_risk_profile | icpg query risk <symbol> | Is this symbol fragile? Drift history, ownership changes. |
ReasonNode — The Core Primitive
Each ReasonNode captures a stated purpose with a formal contract:
Drift = predicate failure. A symbol has drifted when its current behavior no longer satisfies the postconditions of the ReasonNode that created it, or when an invariant is violated.
Six Edge Types
6-Dimension Drift Model
| Dimension | What It Means | Detection | |
|---|---|---|---|
| Spec drift | Symbol checksum changed without a MODIFIES edge | Compare stored vs current checksum | |
| Decision drift | Postconditions no longer hold | Evaluate predicates against codebase | |
| Ownership drift | >3 different owners without coherent oversight | Count unique owners on edges | |
| Test drift | VALIDATED_BY tests missing or failing | Check test file existence + run | |
| Usage drift | Symbol used outside original scope | Grep for imports beyond scope | |
| Dependency drift | Downstream REQUIRES reasons have drifted | Traverse REQUIRES edges |
Run icpg drift check to scan all dimensions. Each produces a 0-1 severity score.
CLI Reference
Setup
Create & Record
Query (the 3 canonical queries)
Drift
Status
Storage
Per-project, gitignored, zero infrastructure:
Install options:
Workflow: Before Any Code Change
Step 0 is non-negotiable for autonomous agents. Every change must be linked to a stated purpose. Without an intent, there's nothing to measure drift against.
Hook Integration
PreToolUse Hook (automatic context injection)
Add to .claude/settings.json:
Before every file edit, agents see:
Stop Hook (automatic symbol recording)
After implementation passes tests, auto-records symbols:
Agent Teams Integration
Updated Pipeline (agent-teams + iCPG)
Agent Responsibilities
| Agent | iCPG Action | |
|---|---|---|
| Team Lead | icpg create when creating task chains. icpg query prior to check duplicates. | |
| Feature Agent | icpg query constraints before implementing. Writes .icpg/.current-intent for auto-recording. | |
| Quality Agent | icpg drift check during GREEN verify. Verifies scope alignment. | |
| Review Agent | Sees intent context via PreToolUse hook when reviewing files. | |
| Merger Agent | Includes intent traceability in PR description. |
Bootstrapping from Git History
For existing codebases, infer ReasonNodes from commit history:
This will:
- Get commits from last 90 days
- Cluster by temporal proximity (2-hour window)
- Infer intent via LLM (Claude or OpenAI) or commit message parsing
- Create ReasonNodes with
source: "inferred",confidence: 0.6-0.8 - Extract symbols from changed files, create CREATES edges
- Run duplicate detection against existing ReasonNodes
Quality note: Inferred intents are marked low-confidence. Review and promote high-value ones manually.
Contract Predicates
Predicates are structured assertions over codebase state:
Contracts can be:
- Hand-authored for high-risk ReasonNodes
- LLM-inferred via
icpg create --infer-contracts - Heuristic (scope → file_exists, test → test_exists)
Anti-Patterns
| Anti-Pattern | Do This Instead | |
|---|---|---|
| Coding without stating intent | icpg create before every non-trivial change | |
| Assuming your change is isolated | icpg query constraints + icpg query risk first | |
| Rebuilding what already exists | icpg query prior to check for prior work | |
| Leaving intent in 'executing' forever | Update status to 'fulfilled' when done | |
| Ignoring drift events | icpg drift check weekly, resolve or create new intents | |
| Storing full source in symbols | Store signature + checksum only — read source from files | |
| Skipping bootstrap on existing repos | icpg bootstrap --days 90 to build initial graph |
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/icpg/SKILL.md
Popularity
- Repository stars
- 701
- Repository forks
- 55
- 7-day trend score
- 33
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alinaqi/maggy/icpg)