contextos-agents 1.5.0
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/.agents/AGENTS.md +421 -0
- package/.agents/adapters/aider/export.js +137 -0
- package/.agents/adapters/claude/export.js +55 -0
- package/.agents/adapters/copilot/export.js +107 -0
- package/.agents/adapters/cursor/export.js +210 -0
- package/.agents/adapters/gemini/export.js +115 -0
- package/.agents/adapters/shared.js +119 -0
- package/.agents/adapters/zed/export.js +111 -0
- package/.agents/core/profiles/backend.yaml +47 -0
- package/.agents/core/profiles/enterprise.yaml +46 -0
- package/.agents/core/profiles/frontend.yaml +46 -0
- package/.agents/core/profiles/hackathon.yaml +45 -0
- package/.agents/core/profiles/mvp.yaml +43 -0
- package/.agents/core/profiles/startup.yaml +48 -0
- package/.agents/core/skills/adapters/EXAMPLES.md +19 -0
- package/.agents/core/skills/adapters/SKILL.md +105 -0
- package/.agents/core/skills/adapters/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/adapters/VALIDATION.json +12 -0
- package/.agents/core/skills/adapters/skill.yaml +10 -0
- package/.agents/core/skills/architecture-diagrams/SKILL.md +108 -0
- package/.agents/core/skills/architecture-diagrams/VALIDATION.json +12 -0
- package/.agents/core/skills/architecture-diagrams/skill.yaml +8 -0
- package/.agents/core/skills/brutalist-design/SKILL.md +150 -0
- package/.agents/core/skills/brutalist-design/VALIDATION.json +12 -0
- package/.agents/core/skills/brutalist-design/skill.yaml +8 -0
- package/.agents/core/skills/context-manager/EXAMPLES.md +19 -0
- package/.agents/core/skills/context-manager/SKILL.md +126 -0
- package/.agents/core/skills/context-manager/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/context-manager/VALIDATION.json +12 -0
- package/.agents/core/skills/context-manager/skill.yaml +10 -0
- package/.agents/core/skills/context-os/EXAMPLES.md +21 -0
- package/.agents/core/skills/context-os/SKILL.md +169 -0
- package/.agents/core/skills/context-os/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/context-os/VALIDATION.json +12 -0
- package/.agents/core/skills/context-os/packs.yaml +59 -0
- package/.agents/core/skills/context-os/references/context-rules.md +68 -0
- package/.agents/core/skills/context-os/references/pipeline.md +119 -0
- package/.agents/core/skills/context-os/references/project-graph.md +103 -0
- package/.agents/core/skills/context-os/rules.yaml +135 -0
- package/.agents/core/skills/context-os/skill.yaml +10 -0
- package/.agents/core/skills/database/EXAMPLES.md +74 -0
- package/.agents/core/skills/database/SKILL.md +101 -0
- package/.agents/core/skills/database/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/database/VALIDATION.json +11 -0
- package/.agents/core/skills/database/skill.yaml +25 -0
- package/.agents/core/skills/ddd/EXAMPLES.md +42 -0
- package/.agents/core/skills/ddd/SKILL.md +247 -0
- package/.agents/core/skills/ddd/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ddd/VALIDATION.json +12 -0
- package/.agents/core/skills/ddd/ddd.md +178 -0
- package/.agents/core/skills/ddd/skill.yaml +10 -0
- package/.agents/core/skills/decisions/EXAMPLES.md +35 -0
- package/.agents/core/skills/decisions/SKILL.md +90 -0
- package/.agents/core/skills/decisions/TROUBLESHOOTING.md +13 -0
- package/.agents/core/skills/decisions/VALIDATION.json +12 -0
- package/.agents/core/skills/decisions/skill.yaml +10 -0
- package/.agents/core/skills/docker/EXAMPLES.md +56 -0
- package/.agents/core/skills/docker/SKILL.md +63 -0
- package/.agents/core/skills/docker/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/docker/VALIDATION.json +11 -0
- package/.agents/core/skills/docker/skill.yaml +23 -0
- package/.agents/core/skills/engineering-workflow/EXAMPLES.md +57 -0
- package/.agents/core/skills/engineering-workflow/SKILL.md +343 -0
- package/.agents/core/skills/engineering-workflow/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/engineering-workflow/VALIDATION.json +12 -0
- package/.agents/core/skills/engineering-workflow/skill.yaml +13 -0
- package/.agents/core/skills/fastapi/EXAMPLES.md +36 -0
- package/.agents/core/skills/fastapi/SKILL.md +148 -0
- package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/fastapi/VALIDATION.json +12 -0
- package/.agents/core/skills/fastapi/fastapi.md +112 -0
- package/.agents/core/skills/fastapi/skill.yaml +10 -0
- package/.agents/core/skills/gemini-precision/SKILL.md +169 -0
- package/.agents/core/skills/gemini-precision/VALIDATION.json +12 -0
- package/.agents/core/skills/gemini-precision/skill.yaml +9 -0
- package/.agents/core/skills/generators/EXAMPLES.md +19 -0
- package/.agents/core/skills/generators/SKILL.md +112 -0
- package/.agents/core/skills/generators/TROUBLESHOOTING.md +7 -0
- package/.agents/core/skills/generators/VALIDATION.json +12 -0
- package/.agents/core/skills/generators/skill.yaml +10 -0
- package/.agents/core/skills/generators/templates/API.md +77 -0
- package/.agents/core/skills/generators/templates/ARCHITECTURE.md +70 -0
- package/.agents/core/skills/generators/templates/DATABASE.md +42 -0
- package/.agents/core/skills/generators/templates/DECISION.md +46 -0
- package/.agents/core/skills/generators/templates/PRD.md +67 -0
- package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +56 -0
- package/.agents/core/skills/generators/templates/ROADMAP.md +51 -0
- package/.agents/core/skills/generators/templates/TASKS.md +43 -0
- package/.agents/core/skills/generators/templates/UI.md +73 -0
- package/.agents/core/skills/graphify/EXAMPLES.md +73 -0
- package/.agents/core/skills/graphify/SKILL.md +130 -0
- package/.agents/core/skills/graphify/VALIDATION.json +12 -0
- package/.agents/core/skills/graphify/skill.yaml +13 -0
- package/.agents/core/skills/gstack-roles/EXAMPLES.md +23 -0
- package/.agents/core/skills/gstack-roles/SKILL.md +152 -0
- package/.agents/core/skills/gstack-roles/TROUBLESHOOTING.md +13 -0
- package/.agents/core/skills/gstack-roles/VALIDATION.json +12 -0
- package/.agents/core/skills/gstack-roles/skill.yaml +12 -0
- package/.agents/core/skills/impeccable-design/EXAMPLES.md +26 -0
- package/.agents/core/skills/impeccable-design/SKILL.md +201 -0
- package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/impeccable-design/VALIDATION.json +12 -0
- package/.agents/core/skills/impeccable-design/skill.yaml +14 -0
- package/.agents/core/skills/interview-me/SKILL.md +97 -0
- package/.agents/core/skills/interview-me/VALIDATION.json +12 -0
- package/.agents/core/skills/interview-me/skill.yaml +8 -0
- package/.agents/core/skills/microservices/EXAMPLES.md +38 -0
- package/.agents/core/skills/microservices/SKILL.md +164 -0
- package/.agents/core/skills/microservices/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/microservices/VALIDATION.json +12 -0
- package/.agents/core/skills/microservices/microservices.md +119 -0
- package/.agents/core/skills/microservices/skill.yaml +10 -0
- package/.agents/core/skills/minimalist-design/SKILL.md +113 -0
- package/.agents/core/skills/minimalist-design/VALIDATION.json +12 -0
- package/.agents/core/skills/minimalist-design/skill.yaml +8 -0
- package/.agents/core/skills/nestjs/EXAMPLES.md +40 -0
- package/.agents/core/skills/nestjs/SKILL.md +139 -0
- package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/nestjs/VALIDATION.json +12 -0
- package/.agents/core/skills/nestjs/nestjs.md +103 -0
- package/.agents/core/skills/nestjs/skill.yaml +10 -0
- package/.agents/core/skills/nextjs/EXAMPLES.md +40 -0
- package/.agents/core/skills/nextjs/SKILL.md +163 -0
- package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/nextjs/VALIDATION.json +12 -0
- package/.agents/core/skills/nextjs/nextjs.md +67 -0
- package/.agents/core/skills/nextjs/skill.yaml +10 -0
- package/.agents/core/skills/node/EXAMPLES.md +80 -0
- package/.agents/core/skills/node/SKILL.md +128 -0
- package/.agents/core/skills/node/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/node/VALIDATION.json +12 -0
- package/.agents/core/skills/node/node.md +87 -0
- package/.agents/core/skills/node/skill.yaml +10 -0
- package/.agents/core/skills/performance/EXAMPLES.md +30 -0
- package/.agents/core/skills/performance/SKILL.md +75 -0
- package/.agents/core/skills/performance/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/performance/VALIDATION.json +12 -0
- package/.agents/core/skills/performance/performance.md +52 -0
- package/.agents/core/skills/performance/skill.yaml +10 -0
- package/.agents/core/skills/ponytail-mindset/EXAMPLES.md +45 -0
- package/.agents/core/skills/ponytail-mindset/SKILL.md +193 -0
- package/.agents/core/skills/ponytail-mindset/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ponytail-mindset/VALIDATION.json +12 -0
- package/.agents/core/skills/ponytail-mindset/skill.yaml +14 -0
- package/.agents/core/skills/react/EXAMPLES.md +79 -0
- package/.agents/core/skills/react/SKILL.md +132 -0
- package/.agents/core/skills/react/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/react/VALIDATION.json +12 -0
- package/.agents/core/skills/react/react.md +93 -0
- package/.agents/core/skills/react/skill.yaml +10 -0
- package/.agents/core/skills/react-best-practices/SKILL.md +155 -0
- package/.agents/core/skills/react-best-practices/VALIDATION.json +12 -0
- package/.agents/core/skills/react-best-practices/skill.yaml +10 -0
- package/.agents/core/skills/redesign-audit/SKILL.md +117 -0
- package/.agents/core/skills/redesign-audit/VALIDATION.json +12 -0
- package/.agents/core/skills/redesign-audit/skill.yaml +8 -0
- package/.agents/core/skills/security/EXAMPLES.md +64 -0
- package/.agents/core/skills/security/SKILL.md +158 -0
- package/.agents/core/skills/security/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/security/VALIDATION.json +12 -0
- package/.agents/core/skills/security/security.md +106 -0
- package/.agents/core/skills/security/skill.yaml +10 -0
- package/.agents/core/skills/soft-design/SKILL.md +108 -0
- package/.agents/core/skills/soft-design/VALIDATION.json +12 -0
- package/.agents/core/skills/soft-design/skill.yaml +8 -0
- package/.agents/core/skills/state-management/EXAMPLES.md +56 -0
- package/.agents/core/skills/state-management/SKILL.md +48 -0
- package/.agents/core/skills/state-management/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/state-management/VALIDATION.json +11 -0
- package/.agents/core/skills/state-management/skill.yaml +22 -0
- package/.agents/core/skills/subagent-orchestrator/SKILL.md +100 -0
- package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +12 -0
- package/.agents/core/skills/subagent-orchestrator/skill.yaml +8 -0
- package/.agents/core/skills/system-design/EXAMPLES.md +75 -0
- package/.agents/core/skills/system-design/SKILL.md +419 -0
- package/.agents/core/skills/system-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/system-design/VALIDATION.json +12 -0
- package/.agents/core/skills/system-design/skill.yaml +13 -0
- package/.agents/core/skills/system-design/system-design.md +112 -0
- package/.agents/core/skills/testing/EXAMPLES.md +71 -0
- package/.agents/core/skills/testing/SKILL.md +70 -0
- package/.agents/core/skills/testing/TROUBLESHOOTING.md +18 -0
- package/.agents/core/skills/testing/VALIDATION.json +11 -0
- package/.agents/core/skills/testing/skill.yaml +26 -0
- package/.agents/core/skills/typescript/EXAMPLES.md +64 -0
- package/.agents/core/skills/typescript/SKILL.md +112 -0
- package/.agents/core/skills/typescript/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/typescript/VALIDATION.json +12 -0
- package/.agents/core/skills/typescript/skill.yaml +10 -0
- package/.agents/core/skills/typescript/typescript.md +71 -0
- package/.agents/core/skills/ui-design/EXAMPLES.md +21 -0
- package/.agents/core/skills/ui-design/SKILL.md +124 -0
- package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ui-design/VALIDATION.json +12 -0
- package/.agents/core/skills/ui-design/skill.yaml +10 -0
- package/.agents/core/skills/ui-design/ui.md +88 -0
- package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +62 -0
- package/.agents/core/skills/ui-ux-pro/SKILL.md +375 -0
- package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ui-ux-pro/VALIDATION.json +12 -0
- package/.agents/core/skills/ui-ux-pro/skill.yaml +13 -0
- package/.agents/core/skills/ux-design/EXAMPLES.md +36 -0
- package/.agents/core/skills/ux-design/SKILL.md +116 -0
- package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/ux-design/VALIDATION.json +12 -0
- package/.agents/core/skills/ux-design/skill.yaml +10 -0
- package/.agents/core/skills/ux-design/ux.md +80 -0
- package/.agents/core/skills/vercel-optimize/SKILL.md +83 -0
- package/.agents/core/skills/vercel-optimize/VALIDATION.json +12 -0
- package/.agents/core/skills/vercel-optimize/skill.yaml +10 -0
- package/.agents/core/skills/web-accessibility/EXAMPLES.md +39 -0
- package/.agents/core/skills/web-accessibility/SKILL.md +170 -0
- package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +19 -0
- package/.agents/core/skills/web-accessibility/VALIDATION.json +12 -0
- package/.agents/core/skills/web-accessibility/accessibility.md +63 -0
- package/.agents/core/skills/web-accessibility/skill.yaml +10 -0
- package/.agents/ctx.js +370 -0
- package/.agents/generated/claude/skills/adapters/SKILL.md +126 -0
- package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +101 -0
- package/.agents/generated/claude/skills/brutalist-design/SKILL.md +145 -0
- package/.agents/generated/claude/skills/context-manager/SKILL.md +147 -0
- package/.agents/generated/claude/skills/context-os/SKILL.md +191 -0
- package/.agents/generated/claude/skills/database/SKILL.md +191 -0
- package/.agents/generated/claude/skills/ddd/SKILL.md +305 -0
- package/.agents/generated/claude/skills/decisions/SKILL.md +134 -0
- package/.agents/generated/claude/skills/docker/SKILL.md +135 -0
- package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +414 -0
- package/.agents/generated/claude/skills/fastapi/SKILL.md +200 -0
- package/.agents/generated/claude/skills/gemini-precision/SKILL.md +161 -0
- package/.agents/generated/claude/skills/generators/SKILL.md +133 -0
- package/.agents/generated/claude/skills/graphify/SKILL.md +198 -0
- package/.agents/generated/claude/skills/gstack-roles/SKILL.md +184 -0
- package/.agents/generated/claude/skills/impeccable-design/SKILL.md +241 -0
- package/.agents/generated/claude/skills/interview-me/SKILL.md +90 -0
- package/.agents/generated/claude/skills/microservices/SKILL.md +218 -0
- package/.agents/generated/claude/skills/minimalist-design/SKILL.md +108 -0
- package/.agents/generated/claude/skills/nestjs/SKILL.md +195 -0
- package/.agents/generated/claude/skills/nextjs/SKILL.md +219 -0
- package/.agents/generated/claude/skills/node/SKILL.md +224 -0
- package/.agents/generated/claude/skills/performance/SKILL.md +121 -0
- package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +252 -0
- package/.agents/generated/claude/skills/react/SKILL.md +227 -0
- package/.agents/generated/claude/skills/react-best-practices/SKILL.md +146 -0
- package/.agents/generated/claude/skills/redesign-audit/SKILL.md +112 -0
- package/.agents/generated/claude/skills/security/SKILL.md +237 -0
- package/.agents/generated/claude/skills/soft-design/SKILL.md +103 -0
- package/.agents/generated/claude/skills/state-management/SKILL.md +120 -0
- package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +93 -0
- package/.agents/generated/claude/skills/system-design/SKILL.md +507 -0
- package/.agents/generated/claude/skills/testing/SKILL.md +157 -0
- package/.agents/generated/claude/skills/typescript/SKILL.md +192 -0
- package/.agents/generated/claude/skills/ui-design/SKILL.md +161 -0
- package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +451 -0
- package/.agents/generated/claude/skills/ux-design/SKILL.md +168 -0
- package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +76 -0
- package/.agents/generated/claude/skills/web-accessibility/SKILL.md +225 -0
- package/.agents/generated/gemini/skills/adapters/SKILL.md +135 -0
- package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +107 -0
- package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +151 -0
- package/.agents/generated/gemini/skills/context-manager/SKILL.md +156 -0
- package/.agents/generated/gemini/skills/context-os/SKILL.md +200 -0
- package/.agents/generated/gemini/skills/database/SKILL.md +200 -0
- package/.agents/generated/gemini/skills/ddd/SKILL.md +314 -0
- package/.agents/generated/gemini/skills/decisions/SKILL.md +143 -0
- package/.agents/generated/gemini/skills/docker/SKILL.md +144 -0
- package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +423 -0
- package/.agents/generated/gemini/skills/fastapi/SKILL.md +209 -0
- package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +167 -0
- package/.agents/generated/gemini/skills/generators/SKILL.md +142 -0
- package/.agents/generated/gemini/skills/graphify/SKILL.md +205 -0
- package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +193 -0
- package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +250 -0
- package/.agents/generated/gemini/skills/interview-me/SKILL.md +96 -0
- package/.agents/generated/gemini/skills/microservices/SKILL.md +227 -0
- package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +114 -0
- package/.agents/generated/gemini/skills/nestjs/SKILL.md +204 -0
- package/.agents/generated/gemini/skills/nextjs/SKILL.md +298 -0
- package/.agents/generated/gemini/skills/node/SKILL.md +323 -0
- package/.agents/generated/gemini/skills/performance/SKILL.md +185 -0
- package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +261 -0
- package/.agents/generated/gemini/skills/react/SKILL.md +332 -0
- package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +152 -0
- package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +118 -0
- package/.agents/generated/gemini/skills/security/SKILL.md +355 -0
- package/.agents/generated/gemini/skills/soft-design/SKILL.md +109 -0
- package/.agents/generated/gemini/skills/state-management/SKILL.md +129 -0
- package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +99 -0
- package/.agents/generated/gemini/skills/system-design/SKILL.md +631 -0
- package/.agents/generated/gemini/skills/testing/SKILL.md +166 -0
- package/.agents/generated/gemini/skills/typescript/SKILL.md +275 -0
- package/.agents/generated/gemini/skills/ui-design/SKILL.md +170 -0
- package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +460 -0
- package/.agents/generated/gemini/skills/ux-design/SKILL.md +177 -0
- package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +82 -0
- package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +300 -0
- package/.agents/mcp/runtime.py +454 -0
- package/.agents/mcp/server.mjs +189373 -0
- package/.agents/plugins.js +574 -0
- package/.agents/profiles.js +267 -0
- package/.agents/resolver.js +336 -0
- package/.agents/skills-index.json +200 -0
- package/.agents/skills.json +6 -0
- package/.agents/validate.js +500 -0
- package/LICENSE +21 -0
- package/README.md +415 -0
- package/benchmarks/gemini-issues.js +533 -0
- package/bin/index.js +458 -0
- package/package.json +70 -0
- package/registry.json +53 -0
- package/registry.schema.json +32 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gemini-precision
|
|
3
|
+
description: >
|
|
4
|
+
High-precision engineering and execution guardrails optimized for Google Gemini models. Enforces zero-assumption file inspection, complete non-lazy implementations, surgical blast-radius containment, and mandatory proof-of-work execution.
|
|
5
|
+
---
|
|
6
|
+
# gemini-precision
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
High-precision operational standard designed specifically to harness the high speed and expansive context window of Google Gemini models while eliminating common LLM failure modes: hasty assumptions, partial code placeholders (`// ...`), unverified assertions, and scope creep.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
Activate whenever:
|
|
15
|
+
|
|
16
|
+
- Executing non-trivial code modifications, refactoring, bug fixes, or architecture design.
|
|
17
|
+
- The user requires maximum rigor, reliability, and precision from Gemini.
|
|
18
|
+
- Handling complex multi-file changes where accidental side-effects must be zero.
|
|
19
|
+
|
|
20
|
+
## Rules & Patterns
|
|
21
|
+
|
|
22
|
+
### 1. The Read-Before-Write Invariant (Zero Assumptions)
|
|
23
|
+
|
|
24
|
+
**Never write code based on assumptions about the codebase.**
|
|
25
|
+
|
|
26
|
+
- Before modifying a function or creating an integration, **always inspect the actual files** using `view_file` or `grep_search`.
|
|
27
|
+
- Check the exact runtime, framework version, and installed dependencies (e.g. React 19 vs 18, Next.js 15 vs 14, Tailwind v4 vs v3, Zod vs Joi) in `package.json` or config files before generating code.
|
|
28
|
+
- Verify imported symbol names and parameter signatures directly from source files.
|
|
29
|
+
|
|
30
|
+
### 2. The Zero-Placeholder Invariant (Complete Code Only)
|
|
31
|
+
|
|
32
|
+
**Never produce lazy, incomplete, or stubbed output.**
|
|
33
|
+
|
|
34
|
+
- ❌ **Forbidden**:
|
|
35
|
+
- `// TODO: implement logic here`
|
|
36
|
+
- `// ... rest of existing code ...`
|
|
37
|
+
- `// ... existing imports ...`
|
|
38
|
+
- Mock stub returns when real integration is required
|
|
39
|
+
- ✅ **Mandatory**:
|
|
40
|
+
- Provide **100% complete, fully-implemented, compilable, and drop-in ready** code.
|
|
41
|
+
- When replacing a block of code, include all necessary imports, type definitions, and edge-case handling.
|
|
42
|
+
|
|
43
|
+
### 3. The Proof-of-Work Invariant (Verification Before Completion)
|
|
44
|
+
|
|
45
|
+
**Never claim a task is complete without tool-verified evidence.**
|
|
46
|
+
|
|
47
|
+
- When modifying code or configuration:
|
|
48
|
+
1. Run the project validator or compiler (`node .agents/ctx.js validate`, `tsc --noEmit`, etc.).
|
|
49
|
+
2. Run unit and integration tests (`npm test`, `pytest`, etc.).
|
|
50
|
+
3. Run linter and formatting checks (`npm run lint:md`, `eslint`, etc.).
|
|
51
|
+
- If a test or validation fails, do not guess: read the exact error trace, fix the root cause, and re-run until green.
|
|
52
|
+
|
|
53
|
+
### 4. Surgical Blast Radius Containment
|
|
54
|
+
|
|
55
|
+
**Modify ONLY what is strictly necessary.**
|
|
56
|
+
|
|
57
|
+
- Keep edits isolated to the exact lines, functions, and files specified in the plan.
|
|
58
|
+
- Do not reformat, reorder, or alter indentation of unrelated code blocks.
|
|
59
|
+
- Preserve existing comments, docstrings, and project conventions unless explicitly asked to change them.
|
|
60
|
+
|
|
61
|
+
### 5. Ponytail Minimalism (YAGNI)
|
|
62
|
+
|
|
63
|
+
- Prioritize native platform APIs (standard library, browser built-ins) over new npm/pip packages.
|
|
64
|
+
- Follow the "Rule of Three": inline on first use, duplicate cleanly on second, abstract only on third.
|
|
65
|
+
- Keep solutions obvious to a mid-level developer without requiring multi-layered wrapper classes.
|
|
66
|
+
|
|
67
|
+
### 6. Targeted Tool-Specific Modifications
|
|
68
|
+
|
|
69
|
+
**Prevent accidental code loss during file updates.**
|
|
70
|
+
|
|
71
|
+
- For existing files requiring localized updates (< 50% change), always prefer surgical targeted replacement chunks over destructive full-file rewrites.
|
|
72
|
+
- Never discard unrelated file sections, existing comments, or helper utilities.
|
|
73
|
+
|
|
74
|
+
### 7. Persistent Context & Plan Tracking
|
|
75
|
+
|
|
76
|
+
**Prevent context drift during multi-step tasks.**
|
|
77
|
+
|
|
78
|
+
- When an operation requires more than 3 sequential steps, write and maintain a persistent plan or checklist on disk.
|
|
79
|
+
- Never rely exclusively on volatile conversational memory for tracking complex multi-file refactorings.
|
|
80
|
+
|
|
81
|
+
### 8. Progressive Step Narration (Transparent Pair Programming)
|
|
82
|
+
|
|
83
|
+
**Eliminate the "black box" by narrating technical decisions.**
|
|
84
|
+
|
|
85
|
+
- Avoid executing long, silent chains of tool calls without user visibility.
|
|
86
|
+
- Provide a concise 1–2 sentence transparent status update before key operations:
|
|
87
|
+
- State what was inspected or verified from the code.
|
|
88
|
+
- State the architectural decision made and the immediate next action.
|
|
89
|
+
- Keep narration crisp and actionable without excessive verbosity.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Code Examples
|
|
94
|
+
|
|
95
|
+
### Bad (Lazy Model Output) vs Good (Precision Model Output)
|
|
96
|
+
|
|
97
|
+
**❌ Bad (Lazy AI Output)**:
|
|
98
|
+
|
|
99
|
+
```javascript
|
|
100
|
+
// user.service.js
|
|
101
|
+
export async function updateUser(id, data) {
|
|
102
|
+
// ... existing auth check ...
|
|
103
|
+
// TODO: validate data with zod
|
|
104
|
+
return await db.user.update({ where: { id }, data });
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**✅ Good (Gemini Precision Output)**:
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
// user.service.js
|
|
112
|
+
import { z } from 'zod';
|
|
113
|
+
import { db } from '../lib/db.js';
|
|
114
|
+
import { ValidationError, UnauthorizedError } from '../errors/index.js';
|
|
115
|
+
|
|
116
|
+
const UpdateUserSchema = z.object({
|
|
117
|
+
name: z.string().min(1).max(100).optional(),
|
|
118
|
+
email: z.string().email().optional(),
|
|
119
|
+
}).strict();
|
|
120
|
+
|
|
121
|
+
export async function updateUser(id, data, session) {
|
|
122
|
+
if (!session?.userId || session.userId !== id) {
|
|
123
|
+
throw new UnauthorizedError('Access denied: cannot update another user');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const parsed = UpdateUserSchema.safeParse(data);
|
|
127
|
+
if (!parsed.success) {
|
|
128
|
+
throw new ValidationError('Invalid update payload', parsed.error.format());
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return await db.user.update({
|
|
132
|
+
where: { id },
|
|
133
|
+
data: parsed.data,
|
|
134
|
+
select: { id: true, name: true, email: true, updatedAt: true }
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Validation Checklist
|
|
142
|
+
|
|
143
|
+
- [ ] Inspected active codebase files before writing code.
|
|
144
|
+
- [ ] Delivered 100% complete code with zero `// TODO` or `// ...` placeholders.
|
|
145
|
+
- [ ] Ran automated tests and validation with green status.
|
|
146
|
+
- [ ] Confined changes to the minimal required blast radius.
|
|
147
|
+
- [ ] Preserved existing code via targeted edits rather than full-file overwrites.
|
|
148
|
+
- [ ] Persisted multi-step task state and milestones to disk.
|
|
149
|
+
- [ ] Narrated progress with concise, transparent step-by-step updates.
|
|
150
|
+
- [ ] Reported final status with verifiable evidence.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Common Mistakes
|
|
155
|
+
|
|
156
|
+
- **Assuming API contracts**: Guessing function parameters without opening the file.
|
|
157
|
+
- **Premature completion**: Declaring "fixed" without running the test suite.
|
|
158
|
+
- **Uncontrolled refactoring**: Rewriting adjacent components while fixing a 1-line bug.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Integration Notes
|
|
163
|
+
|
|
164
|
+
- Pairs with `engineering-workflow` to enforce the 6-phase pipeline.
|
|
165
|
+
- Enforces the 7-rung ladder of `ponytail-mindset`.
|
|
166
|
+
- Acts as the baseline behavioral guardrail across all Gemini and Antigravity operations.
|
|
167
|
+
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generators
|
|
3
|
+
description: >
|
|
4
|
+
Generates complete project documentation (PRD, Architecture, Database, API, UI, Roadmap, Tasks) from ideas and templates with incremental update support.
|
|
5
|
+
---
|
|
6
|
+
# document-generator
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Automated technical documentation generator. Transforms initial project ideas and specs into comprehensive PRDs, architecture schemas, API contracts, database ERDs, and roadmap task breakdowns.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
Activate during project kickoff (ctx init), new service scaffolding, or when generating baseline technical specs from high-level user requirements.
|
|
15
|
+
|
|
16
|
+
## Rules & Patterns
|
|
17
|
+
|
|
18
|
+
You generate project documentation from a user's idea. Use the templates in `templates/` as the structure for each document.
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
### `ctx init`
|
|
23
|
+
|
|
24
|
+
Full project initialization. From one user prompt, generate ALL documents:
|
|
25
|
+
|
|
26
|
+
1. Ask clarifying questions (see Context OS SKILL.md)
|
|
27
|
+
2. Select profile and skill pack
|
|
28
|
+
3. Generate documents in this order:
|
|
29
|
+
- `docs/PRD.md` — Product Requirements (from template)
|
|
30
|
+
- `docs/ARCHITECTURE.md` — System Architecture
|
|
31
|
+
- `docs/DATABASE.md` — Database Schema
|
|
32
|
+
- `docs/API.md` — API Specification
|
|
33
|
+
- `docs/UI.md` — UI/UX Specification
|
|
34
|
+
- `docs/ROADMAP.md` — Development Roadmap
|
|
35
|
+
- `docs/TASKS.md` — Task Breakdown
|
|
36
|
+
- `docs/PROJECT_GRAPH.md` — Project Graph
|
|
37
|
+
4. Create `docs/decisions/` directory for future ADRs
|
|
38
|
+
5. Generate agent config via Adapters skill
|
|
39
|
+
|
|
40
|
+
### `ctx update`
|
|
41
|
+
|
|
42
|
+
Incremental update. When requirements change:
|
|
43
|
+
|
|
44
|
+
1. Identify which documents are affected
|
|
45
|
+
2. Update only affected documents
|
|
46
|
+
3. Show diff of changes
|
|
47
|
+
4. Ask user to confirm
|
|
48
|
+
5. Update Project Graph if structure changed
|
|
49
|
+
|
|
50
|
+
### `ctx plan`
|
|
51
|
+
|
|
52
|
+
Generate development plan from existing PRD:
|
|
53
|
+
|
|
54
|
+
1. Read `docs/PRD.md`
|
|
55
|
+
2. Break into modules (Project Graph)
|
|
56
|
+
3. Break modules into features
|
|
57
|
+
4. Break features into tasks
|
|
58
|
+
5. Estimate complexity (S/M/L/XL)
|
|
59
|
+
6. Output to `docs/TASKS.md`
|
|
60
|
+
|
|
61
|
+
## Template Usage
|
|
62
|
+
|
|
63
|
+
Each template contains:
|
|
64
|
+
|
|
65
|
+
- **Section headers** — required sections for the document
|
|
66
|
+
- **Placeholder prompts** — `{{description}}` markers that guide content generation
|
|
67
|
+
- **Examples** — sample content to illustrate the expected format
|
|
68
|
+
- **Validation rules** — what must be present for the document to be valid
|
|
69
|
+
|
|
70
|
+
When generating a document:
|
|
71
|
+
|
|
72
|
+
1. Read the template
|
|
73
|
+
2. Fill in each section based on the user's idea and clarifying answers
|
|
74
|
+
3. Replace all `{{placeholders}}` with real content
|
|
75
|
+
4. Remove the template comments (lines starting with `<!-- -->`)
|
|
76
|
+
5. Validate: ensure all required sections are present
|
|
77
|
+
|
|
78
|
+
## Document Dependencies
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
PRD.md
|
|
82
|
+
├── ARCHITECTURE.md
|
|
83
|
+
│ ├── DATABASE.md
|
|
84
|
+
│ ├── API.md
|
|
85
|
+
│ └── DEPLOYMENT.md
|
|
86
|
+
├── UI.md
|
|
87
|
+
├── ROADMAP.md
|
|
88
|
+
│ └── TASKS.md
|
|
89
|
+
└── PROJECT_GRAPH.md
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
When updating a parent document, check if child documents need updates too.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## Code Examples
|
|
96
|
+
|
|
97
|
+
See `EXAMPLES.md` for detailed code examples.
|
|
98
|
+
|
|
99
|
+
## Validation Checklist
|
|
100
|
+
|
|
101
|
+
What to verify during the review phase before completing the task.
|
|
102
|
+
|
|
103
|
+
## Common Mistakes
|
|
104
|
+
|
|
105
|
+
Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
|
|
106
|
+
|
|
107
|
+
## Integration Notes
|
|
108
|
+
|
|
109
|
+
How this skill interacts with other skills.
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<!-- Source: EXAMPLES.md -->
|
|
113
|
+
|
|
114
|
+
# generators Examples — Anti-patterns vs ContextOS Standard
|
|
115
|
+
|
|
116
|
+
## Example 1: Technical Documentation Generation
|
|
117
|
+
|
|
118
|
+
### Anti-pattern: Scaffolding from Scratch Without Templates
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
Agent drafts a 2-paragraph "architecture overview" missing databases, security, and hosting models.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Best practice: ContextOS Standard (ctx init Template Generation)
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
Generates complete engineering suite:
|
|
128
|
+
- PRD.md (User personas, in-scope, out-of-scope, acceptance criteria)
|
|
129
|
+
- ARCHITECTURE.md (C4 model, data flow, scaling boundaries)
|
|
130
|
+
- DATABASE.md (ERD, indexing strategy, migration plans)
|
|
131
|
+
- API.md (OpenAPI 3.1 endpoints, error codes, authentication)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
<!-- Source: TROUBLESHOOTING.md -->
|
|
135
|
+
|
|
136
|
+
# generators Troubleshooting & Common Mistakes
|
|
137
|
+
|
|
138
|
+
## 1. Generic Boilerplate Generation
|
|
139
|
+
|
|
140
|
+
- **Symptom**: Generated documentation contains placeholders like [Insert DB Name here].
|
|
141
|
+
- **Root Cause**: Generating docs before clarifying core project constraints.
|
|
142
|
+
- **Fix**: Run the interview-me protocol before generating technical documentation.
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: graphify
|
|
3
|
+
description: >
|
|
4
|
+
Codebase knowledge graph generator via Tree-sitter AST parsing and semantic indexing. Minimizes token consumption and maps dependency blast radius.
|
|
5
|
+
---
|
|
6
|
+
# graphify
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
**Graphify** is a codebase mapping and context optimization engine. Instead of feeding raw directory trees or entire source files into an agent's context window, Graphify leverages local **Tree-sitter** AST parsing to construct a deterministic, queryable knowledge graph (`graph.json`, `GRAPH_REPORT.md`, `graph.html`).
|
|
11
|
+
|
|
12
|
+
This skill instructs agents how to build, query, and maintain codebase graphs to navigate complex architectures with near-zero token overhead.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
Activate whenever:
|
|
17
|
+
|
|
18
|
+
- Working in large repositories (10k+ LOC) where full-file reads cause context overflow.
|
|
19
|
+
- Performing cross-module refactorings and needing to determine exact dependency **blast radius**.
|
|
20
|
+
- Onboarding onto an unfamiliar codebase or mapping legacy service boundaries.
|
|
21
|
+
- The user asks to "map the codebase", "show dependency graph", "find central components", or "run graphify".
|
|
22
|
+
- Working alongside `context-manager` to supply an automated `PROJECT_GRAPH.md` / `graph.json`.
|
|
23
|
+
|
|
24
|
+
## Rules & Patterns
|
|
25
|
+
|
|
26
|
+
### 1. The Graph-First Navigation Protocol
|
|
27
|
+
|
|
28
|
+
Before opening and reading arbitrary source files in a large project:
|
|
29
|
+
|
|
30
|
+
1. **Check for Existing Artifacts**:
|
|
31
|
+
- Inspect if `graph.json` or `GRAPH_REPORT.md` exists in the project root or `.graphify/`.
|
|
32
|
+
- If present, query `graph.json` or read `GRAPH_REPORT.md` first to locate target modules.
|
|
33
|
+
2. **Deterministic CLI Execution**:
|
|
34
|
+
- If missing or stale, generate the graph using the Python package (`pip install graphifyy`):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
graphify run .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- For live development sessions, run in watch mode:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
graphify watch .
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
3. **Inspect God Nodes**:
|
|
47
|
+
- Always check the "God Nodes" section of `GRAPH_REPORT.md`. These represent high-centrality modules (e.g., core configs, base models, central dispatchers). Changes to god nodes have the highest blast radius.
|
|
48
|
+
|
|
49
|
+
### 2. Context Safety Rules
|
|
50
|
+
|
|
51
|
+
- **Never load `graph.html` into agent context**: `graph.html` is an interactive visualization for humans in the browser; reading it burns tokens needlessly.
|
|
52
|
+
- **Selective JSON Querying**: Do not dump the entire `graph.json` into prompt context if it exceeds 50KB. Use targeted grep/jq queries to extract specific node neighbors.
|
|
53
|
+
- **Git Hygiene**: Add `graph.html` and `.graphify/cache` to `.gitignore`. Keep `GRAPH_REPORT.md` committed only if the team uses it as shared documentation.
|
|
54
|
+
|
|
55
|
+
### 3. Blast Radius Verification
|
|
56
|
+
|
|
57
|
+
When modifying a function, class, or interface:
|
|
58
|
+
|
|
59
|
+
1. Locate the symbol's node in `graph.json`.
|
|
60
|
+
2. Extract all inbound edges (`dependents` / `callers`).
|
|
61
|
+
3. Formulate the verification plan specifically around those dependent call sites.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Code Examples
|
|
66
|
+
|
|
67
|
+
### Installing and Running Graphify
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Install graphify CLI (package name is graphifyy on PyPI)
|
|
71
|
+
pip install graphifyy
|
|
72
|
+
|
|
73
|
+
# Generate knowledge graph and markdown architectural report
|
|
74
|
+
graphify run ./src --output .graphify/
|
|
75
|
+
|
|
76
|
+
# View interactive visualization locally
|
|
77
|
+
open .graphify/graph.html
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Querying Node Dependencies via Shell
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Find dependents of a critical module in graph.json without loading entire file
|
|
84
|
+
node -e "
|
|
85
|
+
const g = require('./.graphify/graph.json');
|
|
86
|
+
const target = 'UserService';
|
|
87
|
+
const inbound = g.edges.filter(e => e.target === target).map(e => e.source);
|
|
88
|
+
console.log('Modules dependent on ' + target + ':', inbound);
|
|
89
|
+
"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Git Pre-Commit Hook Integration
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
#!/bin/sh
|
|
96
|
+
# .git/hooks/pre-commit: ensure GRAPH_REPORT.md remains fresh
|
|
97
|
+
if command -v graphify >/dev/null 2>&1; then
|
|
98
|
+
graphify run . --report-only
|
|
99
|
+
git add GRAPH_REPORT.md
|
|
100
|
+
fi
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Validation Checklist
|
|
106
|
+
|
|
107
|
+
- [ ] `graph.json` and `GRAPH_REPORT.md` are generated without syntax errors.
|
|
108
|
+
- [ ] Central "God Nodes" are identified and accounted for in the implementation plan.
|
|
109
|
+
- [ ] No heavy visualization artifacts (`graph.html`, raw SVG dumps) are ingested into agent prompt context.
|
|
110
|
+
- [ ] Inbound dependencies (callers) are checked before modifying exported signatures.
|
|
111
|
+
- [ ] `.gitignore` properly excludes local graph caches and visualization outputs.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Common Mistakes
|
|
116
|
+
|
|
117
|
+
- **Context Window Flooding**: Ingesting the complete `graph.json` of a 500k LOC repository into agent context instead of slicing target subgraphs.
|
|
118
|
+
- **Stale Graph Fallacy**: Assuming `graph.json` is up to date after heavy code refactorings without re-running `graphify run` or using `--watch`.
|
|
119
|
+
- **Ignoring Semantic Non-Code Files**: Neglecting SQL migrations, OpenAPI specs, and docker configs during graph extraction.
|
|
120
|
+
- **Mistaking Package Name**: Trying to install `pip install graphify` instead of the official PyPI package `graphifyy`.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Integration Notes
|
|
125
|
+
|
|
126
|
+
- **Synergy with `context-manager`**: Graphify serves as the automated backend engine for `context-manager`. Instead of manually maintaining `docs/PROJECT_GRAPH.md`, run Graphify to keep `graph.json` current.
|
|
127
|
+
- **Synergy with `system-design`**: Use `GRAPH_REPORT.md` to ground architectural proposals in actual codebase topology.
|
|
128
|
+
- **Synergy with `architecture-diagrams`**: The nodes and edges extracted in `graph.json` can be directly mapped into animated SVG C4 architecture diagrams.
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
<!-- Source: EXAMPLES.md -->
|
|
132
|
+
|
|
133
|
+
# Graphify Examples — Anti-patterns vs ContextOS Standard
|
|
134
|
+
|
|
135
|
+
## Example 1: Codebase Exploration & Architecture Mapping
|
|
136
|
+
|
|
137
|
+
### Anti-pattern: Context Window Flooding (Dumping source directories into prompt)
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# BAD: Reading 150 TypeScript files into context to understand system architecture.
|
|
141
|
+
# Burns 200k+ tokens, causes model hallucinations, and loses attention span.
|
|
142
|
+
cat src/**/*.ts | llm "explain the architecture and component connections"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Best practice: ContextOS Standard (Deterministic Tree-sitter AST Graph)
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# GOOD: Generate queryable AST knowledge graph and compact architecture summary
|
|
149
|
+
graphify run ./src --output .graphify/
|
|
150
|
+
|
|
151
|
+
# Inspect high-level architecture and god nodes with minimal tokens (<2k tokens)
|
|
152
|
+
cat .graphify/GRAPH_REPORT.md
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Example 2: Refactoring Blast-Radius Analysis
|
|
158
|
+
|
|
159
|
+
### Anti-pattern: String Grep Guesswork
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# BAD: Grepping for common symbol names returns hundreds of false positives (comments, logs, unrelated types)
|
|
163
|
+
grep -rn "PaymentService" src/
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Best practice: ContextOS Standard (Inbound Dependency Traversal via graph.json)
|
|
167
|
+
|
|
168
|
+
```javascript
|
|
169
|
+
// GOOD: Precise AST-level callers extracted directly from knowledge graph edges
|
|
170
|
+
const fs = require('fs');
|
|
171
|
+
const graph = JSON.parse(fs.readFileSync('.graphify/graph.json', 'utf8'));
|
|
172
|
+
|
|
173
|
+
const targetNode = 'PaymentService';
|
|
174
|
+
const dependents = graph.edges
|
|
175
|
+
.filter(edge => edge.target === targetNode && edge.type === 'imports')
|
|
176
|
+
.map(edge => edge.source);
|
|
177
|
+
|
|
178
|
+
console.log(`Modules directly broken by modifying ${targetNode}:`, dependents);
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Example 3: Keeping Graph Fresh in CI / Pre-commit
|
|
184
|
+
|
|
185
|
+
### Anti-pattern: Relying on Outdated Graphs
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# BAD: Developing against a graph generated two months ago.
|
|
189
|
+
# Dependencies drift, leading to false safety assumptions.
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Best practice: ContextOS Standard (Git Hook & Automated Watch)
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Option A: Active development in watch mode
|
|
196
|
+
graphify watch ./src --output .graphify/
|
|
197
|
+
|
|
198
|
+
# Option B: Pre-commit hook to verify fresh GRAPH_REPORT.md
|
|
199
|
+
#!/bin/sh
|
|
200
|
+
# .git/hooks/pre-commit
|
|
201
|
+
if command -v graphify >/dev/null 2>&1; then
|
|
202
|
+
graphify run ./src --report-only
|
|
203
|
+
git add GRAPH_REPORT.md
|
|
204
|
+
fi
|
|
205
|
+
```
|