# Setup Graphify

> Trigger: set up graphify, add graphify, configure graphify, integrate graphify. Installs graphifyy, injects a marker-delimited Graphify section into every agent-instruction file present in the project (AGENTS.md always; CLAUDE.md, .github/copilot-instructions.md, GEMINI.md, Cursor rules, and others only if they already exist), adds graphify-out/ to all ignore files, installs post-commit + post-checkout git hooks, and runs the initial knowledge graph build. No hidden hook directories are created. Requires Python 3.12+.

- Skill: `pabloviniegra/setup-graphify` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add pabloviniegra/setup-graphify`
- Raw SKILL.md: https://api.skillmd.com/api/skills/pabloviniegra/setup-graphify/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- License: Apache-2.0
- Author: PabloViniegra (https://skillmd.com/u/pabloviniegra)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/pabloviniegra/setup-graphify

---


## Activation Contract

Use when asked to set up, add, configure, or integrate Graphify in a project. Do not use unless explicitly requested.

## Hard Rules

- **Never invoke `graphify` directly as a CLI command.** On Windows the executable may not be on PATH. Always use `python -m graphify`.
- **Never run `graphify <platform> install` commands** (e.g. `graphify codex install`, `graphify claude install`). These create hidden hook directories (`.codex/`, `.claude/settings.json`, etc.) that the user has not requested. Instruction injection is handled by `setup.py` with hand-rolled, marker-delimited sections.
- **Incremental update syntax is `python -m graphify . --update`**, not `graphify update .`.

## Execution Steps

1. Copy `assets/setup.py` from this skill to the project root.
2. Run from the project root:

```bash
python setup.py
# or with a custom root:
python setup.py --project-root /path/to/project
# skip the slow initial build on large repos:
python setup.py --skip-build
```

The script executes all steps in order:

1. `pip install graphifyy`
2. Inject a strict, mandatory `<!-- graphify:start --> … <!-- graphify:end -->` section that requires agents to use Graphify before inspecting or searching source files:
   - `AGENTS.md` — always (created if missing)
   - `CLAUDE.md`, `.github/copilot-instructions.md`, `GEMINI.md`, `.cursor/rules/graphify.mdc`, `.windsurfrules`, `.clinerules`, `WARP.md` — injected **only if the file already exists**
   - Re-runs are idempotent: markers are replaced, not duplicated
3. Creates `.graphifyignore` (code-only exclusions, no API key needed)
4. Adds `graphify-out/` to `.gitignore`, `.gcloudignore`, and `deployables/*/gcloudignore-gae`
5. Installs git hooks:
   - Tries `python -m graphify hook install` (post-commit + post-checkout, cross-platform)
   - Falls back to hand-rolled `post-commit` if the subcommand is unavailable or a non-graphify hook already exists (existing hook body is preserved)
6. Adds a `## Graphify` section to `README.md`
7. Runs `python -m graphify .` for the initial build (skip with `--skip-build`)

### After `git pull` — each teammate runs once:

```bash
pip install graphifyy
python -m graphify .
```

## Output Contract

- `AGENTS.md` at project root with the strict, mandatory Graphify section
- Any pre-existing agent files (`CLAUDE.md`, `.github/copilot-instructions.md`, etc.) updated with the same section — idempotently
- **No `.codex/`, `.claude/settings.json`, `.gemini/`, or any other hidden hook directories are created**
- `.graphifyignore` at project root
- `graphify-out/` entry in all discovered ignore files
- `## Graphify` section added to `README.md`
- `.git/hooks/post-commit` (and `post-checkout` when native install succeeds) installed and executable, using `python -m graphify . --update`

## References

- `assets/setup.py` — full automated setup script

