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,161 @@
|
|
|
1
|
+
# gemini-precision
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
Activate whenever:
|
|
10
|
+
|
|
11
|
+
- Executing non-trivial code modifications, refactoring, bug fixes, or architecture design.
|
|
12
|
+
- The user requires maximum rigor, reliability, and precision from Gemini.
|
|
13
|
+
- Handling complex multi-file changes where accidental side-effects must be zero.
|
|
14
|
+
|
|
15
|
+
## Rules & Patterns
|
|
16
|
+
|
|
17
|
+
### 1. The Read-Before-Write Invariant (Zero Assumptions)
|
|
18
|
+
|
|
19
|
+
**Never write code based on assumptions about the codebase.**
|
|
20
|
+
|
|
21
|
+
- Before modifying a function or creating an integration, **always inspect the actual files** using `view_file` or `grep_search`.
|
|
22
|
+
- 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.
|
|
23
|
+
- Verify imported symbol names and parameter signatures directly from source files.
|
|
24
|
+
|
|
25
|
+
### 2. The Zero-Placeholder Invariant (Complete Code Only)
|
|
26
|
+
|
|
27
|
+
**Never produce lazy, incomplete, or stubbed output.**
|
|
28
|
+
|
|
29
|
+
- ❌ **Forbidden**:
|
|
30
|
+
- `// TODO: implement logic here`
|
|
31
|
+
- `// ... rest of existing code ...`
|
|
32
|
+
- `// ... existing imports ...`
|
|
33
|
+
- Mock stub returns when real integration is required
|
|
34
|
+
- ✅ **Mandatory**:
|
|
35
|
+
- Provide **100% complete, fully-implemented, compilable, and drop-in ready** code.
|
|
36
|
+
- When replacing a block of code, include all necessary imports, type definitions, and edge-case handling.
|
|
37
|
+
|
|
38
|
+
### 3. The Proof-of-Work Invariant (Verification Before Completion)
|
|
39
|
+
|
|
40
|
+
**Never claim a task is complete without tool-verified evidence.**
|
|
41
|
+
|
|
42
|
+
- When modifying code or configuration:
|
|
43
|
+
1. Run the project validator or compiler (`node .agents/ctx.js validate`, `tsc --noEmit`, etc.).
|
|
44
|
+
2. Run unit and integration tests (`npm test`, `pytest`, etc.).
|
|
45
|
+
3. Run linter and formatting checks (`npm run lint:md`, `eslint`, etc.).
|
|
46
|
+
- If a test or validation fails, do not guess: read the exact error trace, fix the root cause, and re-run until green.
|
|
47
|
+
|
|
48
|
+
### 4. Surgical Blast Radius Containment
|
|
49
|
+
|
|
50
|
+
**Modify ONLY what is strictly necessary.**
|
|
51
|
+
|
|
52
|
+
- Keep edits isolated to the exact lines, functions, and files specified in the plan.
|
|
53
|
+
- Do not reformat, reorder, or alter indentation of unrelated code blocks.
|
|
54
|
+
- Preserve existing comments, docstrings, and project conventions unless explicitly asked to change them.
|
|
55
|
+
|
|
56
|
+
### 5. Ponytail Minimalism (YAGNI)
|
|
57
|
+
|
|
58
|
+
- Prioritize native platform APIs (standard library, browser built-ins) over new npm/pip packages.
|
|
59
|
+
- Follow the "Rule of Three": inline on first use, duplicate cleanly on second, abstract only on third.
|
|
60
|
+
- Keep solutions obvious to a mid-level developer without requiring multi-layered wrapper classes.
|
|
61
|
+
|
|
62
|
+
### 6. Targeted Tool-Specific Modifications
|
|
63
|
+
|
|
64
|
+
**Prevent accidental code loss during file updates.**
|
|
65
|
+
|
|
66
|
+
- For existing files requiring localized updates (< 50% change), always prefer surgical targeted replacement chunks over destructive full-file rewrites.
|
|
67
|
+
- Never discard unrelated file sections, existing comments, or helper utilities.
|
|
68
|
+
|
|
69
|
+
### 7. Persistent Context & Plan Tracking
|
|
70
|
+
|
|
71
|
+
**Prevent context drift during multi-step tasks.**
|
|
72
|
+
|
|
73
|
+
- When an operation requires more than 3 sequential steps, write and maintain a persistent plan or checklist on disk.
|
|
74
|
+
- Never rely exclusively on volatile conversational memory for tracking complex multi-file refactorings.
|
|
75
|
+
|
|
76
|
+
### 8. Progressive Step Narration (Transparent Pair Programming)
|
|
77
|
+
|
|
78
|
+
**Eliminate the "black box" by narrating technical decisions.**
|
|
79
|
+
|
|
80
|
+
- Avoid executing long, silent chains of tool calls without user visibility.
|
|
81
|
+
- Provide a concise 1–2 sentence transparent status update before key operations:
|
|
82
|
+
- State what was inspected or verified from the code.
|
|
83
|
+
- State the architectural decision made and the immediate next action.
|
|
84
|
+
- Keep narration crisp and actionable without excessive verbosity.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Code Examples
|
|
89
|
+
|
|
90
|
+
### Bad (Lazy Model Output) vs Good (Precision Model Output)
|
|
91
|
+
|
|
92
|
+
**❌ Bad (Lazy AI Output)**:
|
|
93
|
+
|
|
94
|
+
```javascript
|
|
95
|
+
// user.service.js
|
|
96
|
+
export async function updateUser(id, data) {
|
|
97
|
+
// ... existing auth check ...
|
|
98
|
+
// TODO: validate data with zod
|
|
99
|
+
return await db.user.update({ where: { id }, data });
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**✅ Good (Gemini Precision Output)**:
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
// user.service.js
|
|
107
|
+
import { z } from 'zod';
|
|
108
|
+
import { db } from '../lib/db.js';
|
|
109
|
+
import { ValidationError, UnauthorizedError } from '../errors/index.js';
|
|
110
|
+
|
|
111
|
+
const UpdateUserSchema = z.object({
|
|
112
|
+
name: z.string().min(1).max(100).optional(),
|
|
113
|
+
email: z.string().email().optional(),
|
|
114
|
+
}).strict();
|
|
115
|
+
|
|
116
|
+
export async function updateUser(id, data, session) {
|
|
117
|
+
if (!session?.userId || session.userId !== id) {
|
|
118
|
+
throw new UnauthorizedError('Access denied: cannot update another user');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const parsed = UpdateUserSchema.safeParse(data);
|
|
122
|
+
if (!parsed.success) {
|
|
123
|
+
throw new ValidationError('Invalid update payload', parsed.error.format());
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return await db.user.update({
|
|
127
|
+
where: { id },
|
|
128
|
+
data: parsed.data,
|
|
129
|
+
select: { id: true, name: true, email: true, updatedAt: true }
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Validation Checklist
|
|
137
|
+
|
|
138
|
+
- [ ] Inspected active codebase files before writing code.
|
|
139
|
+
- [ ] Delivered 100% complete code with zero `// TODO` or `// ...` placeholders.
|
|
140
|
+
- [ ] Ran automated tests and validation with green status.
|
|
141
|
+
- [ ] Confined changes to the minimal required blast radius.
|
|
142
|
+
- [ ] Preserved existing code via targeted edits rather than full-file overwrites.
|
|
143
|
+
- [ ] Persisted multi-step task state and milestones to disk.
|
|
144
|
+
- [ ] Narrated progress with concise, transparent step-by-step updates.
|
|
145
|
+
- [ ] Reported final status with verifiable evidence.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Common Mistakes
|
|
150
|
+
|
|
151
|
+
- **Assuming API contracts**: Guessing function parameters without opening the file.
|
|
152
|
+
- **Premature completion**: Declaring "fixed" without running the test suite.
|
|
153
|
+
- **Uncontrolled refactoring**: Rewriting adjacent components while fixing a 1-line bug.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Integration Notes
|
|
158
|
+
|
|
159
|
+
- Pairs with `engineering-workflow` to enforce the 6-phase pipeline.
|
|
160
|
+
- Enforces the 7-rung ladder of `ponytail-mindset`.
|
|
161
|
+
- Acts as the baseline behavioral guardrail across all Gemini and Antigravity operations.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# document-generator
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Automated technical documentation generator. Transforms initial project ideas and specs into comprehensive PRDs, architecture schemas, API contracts, database ERDs, and roadmap task breakdowns.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
Activate during project kickoff (ctx init), new service scaffolding, or when generating baseline technical specs from high-level user requirements.
|
|
10
|
+
|
|
11
|
+
## Rules & Patterns
|
|
12
|
+
|
|
13
|
+
You generate project documentation from a user's idea. Use the templates in `templates/` as the structure for each document.
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
### `ctx init`
|
|
18
|
+
|
|
19
|
+
Full project initialization. From one user prompt, generate ALL documents:
|
|
20
|
+
|
|
21
|
+
1. Ask clarifying questions (see Context OS SKILL.md)
|
|
22
|
+
2. Select profile and skill pack
|
|
23
|
+
3. Generate documents in this order:
|
|
24
|
+
- `docs/PRD.md` — Product Requirements (from template)
|
|
25
|
+
- `docs/ARCHITECTURE.md` — System Architecture
|
|
26
|
+
- `docs/DATABASE.md` — Database Schema
|
|
27
|
+
- `docs/API.md` — API Specification
|
|
28
|
+
- `docs/UI.md` — UI/UX Specification
|
|
29
|
+
- `docs/ROADMAP.md` — Development Roadmap
|
|
30
|
+
- `docs/TASKS.md` — Task Breakdown
|
|
31
|
+
- `docs/PROJECT_GRAPH.md` — Project Graph
|
|
32
|
+
4. Create `docs/decisions/` directory for future ADRs
|
|
33
|
+
5. Generate agent config via Adapters skill
|
|
34
|
+
|
|
35
|
+
### `ctx update`
|
|
36
|
+
|
|
37
|
+
Incremental update. When requirements change:
|
|
38
|
+
|
|
39
|
+
1. Identify which documents are affected
|
|
40
|
+
2. Update only affected documents
|
|
41
|
+
3. Show diff of changes
|
|
42
|
+
4. Ask user to confirm
|
|
43
|
+
5. Update Project Graph if structure changed
|
|
44
|
+
|
|
45
|
+
### `ctx plan`
|
|
46
|
+
|
|
47
|
+
Generate development plan from existing PRD:
|
|
48
|
+
|
|
49
|
+
1. Read `docs/PRD.md`
|
|
50
|
+
2. Break into modules (Project Graph)
|
|
51
|
+
3. Break modules into features
|
|
52
|
+
4. Break features into tasks
|
|
53
|
+
5. Estimate complexity (S/M/L/XL)
|
|
54
|
+
6. Output to `docs/TASKS.md`
|
|
55
|
+
|
|
56
|
+
## Template Usage
|
|
57
|
+
|
|
58
|
+
Each template contains:
|
|
59
|
+
|
|
60
|
+
- **Section headers** — required sections for the document
|
|
61
|
+
- **Placeholder prompts** — `{{description}}` markers that guide content generation
|
|
62
|
+
- **Examples** — sample content to illustrate the expected format
|
|
63
|
+
- **Validation rules** — what must be present for the document to be valid
|
|
64
|
+
|
|
65
|
+
When generating a document:
|
|
66
|
+
|
|
67
|
+
1. Read the template
|
|
68
|
+
2. Fill in each section based on the user's idea and clarifying answers
|
|
69
|
+
3. Replace all `{{placeholders}}` with real content
|
|
70
|
+
4. Remove the template comments (lines starting with `<!-- -->`)
|
|
71
|
+
5. Validate: ensure all required sections are present
|
|
72
|
+
|
|
73
|
+
## Document Dependencies
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
PRD.md
|
|
77
|
+
├── ARCHITECTURE.md
|
|
78
|
+
│ ├── DATABASE.md
|
|
79
|
+
│ ├── API.md
|
|
80
|
+
│ └── DEPLOYMENT.md
|
|
81
|
+
├── UI.md
|
|
82
|
+
├── ROADMAP.md
|
|
83
|
+
│ └── TASKS.md
|
|
84
|
+
└── PROJECT_GRAPH.md
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
When updating a parent document, check if child documents need updates too.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## Code Examples
|
|
91
|
+
|
|
92
|
+
See `EXAMPLES.md` for detailed code examples.
|
|
93
|
+
|
|
94
|
+
## Validation Checklist
|
|
95
|
+
|
|
96
|
+
What to verify during the review phase before completing the task.
|
|
97
|
+
|
|
98
|
+
## Common Mistakes
|
|
99
|
+
|
|
100
|
+
Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
|
|
101
|
+
|
|
102
|
+
## Integration Notes
|
|
103
|
+
|
|
104
|
+
How this skill interacts with other skills.
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# generators Examples — Anti-patterns vs ContextOS Standard
|
|
108
|
+
|
|
109
|
+
## Example 1: Technical Documentation Generation
|
|
110
|
+
|
|
111
|
+
### Anti-pattern: Scaffolding from Scratch Without Templates
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
Agent drafts a 2-paragraph "architecture overview" missing databases, security, and hosting models.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Best practice: ContextOS Standard (ctx init Template Generation)
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
Generates complete engineering suite:
|
|
121
|
+
- PRD.md (User personas, in-scope, out-of-scope, acceptance criteria)
|
|
122
|
+
- ARCHITECTURE.md (C4 model, data flow, scaling boundaries)
|
|
123
|
+
- DATABASE.md (ERD, indexing strategy, migration plans)
|
|
124
|
+
- API.md (OpenAPI 3.1 endpoints, error codes, authentication)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
# generators Troubleshooting & Common Mistakes
|
|
128
|
+
|
|
129
|
+
## 1. Generic Boilerplate Generation
|
|
130
|
+
|
|
131
|
+
- **Symptom**: Generated documentation contains placeholders like [Insert DB Name here].
|
|
132
|
+
- **Root Cause**: Generating docs before clarifying core project constraints.
|
|
133
|
+
- **Fix**: Run the interview-me protocol before generating technical documentation.
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# graphify
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
**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`).
|
|
6
|
+
|
|
7
|
+
This skill instructs agents how to build, query, and maintain codebase graphs to navigate complex architectures with near-zero token overhead.
|
|
8
|
+
|
|
9
|
+
## When to Use
|
|
10
|
+
|
|
11
|
+
Activate whenever:
|
|
12
|
+
|
|
13
|
+
- Working in large repositories (10k+ LOC) where full-file reads cause context overflow.
|
|
14
|
+
- Performing cross-module refactorings and needing to determine exact dependency **blast radius**.
|
|
15
|
+
- Onboarding onto an unfamiliar codebase or mapping legacy service boundaries.
|
|
16
|
+
- The user asks to "map the codebase", "show dependency graph", "find central components", or "run graphify".
|
|
17
|
+
- Working alongside `context-manager` to supply an automated `PROJECT_GRAPH.md` / `graph.json`.
|
|
18
|
+
|
|
19
|
+
## Rules & Patterns
|
|
20
|
+
|
|
21
|
+
### 1. The Graph-First Navigation Protocol
|
|
22
|
+
|
|
23
|
+
Before opening and reading arbitrary source files in a large project:
|
|
24
|
+
|
|
25
|
+
1. **Check for Existing Artifacts**:
|
|
26
|
+
- Inspect if `graph.json` or `GRAPH_REPORT.md` exists in the project root or `.graphify/`.
|
|
27
|
+
- If present, query `graph.json` or read `GRAPH_REPORT.md` first to locate target modules.
|
|
28
|
+
2. **Deterministic CLI Execution**:
|
|
29
|
+
- If missing or stale, generate the graph using the Python package (`pip install graphifyy`):
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
graphify run .
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- For live development sessions, run in watch mode:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
graphify watch .
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
3. **Inspect God Nodes**:
|
|
42
|
+
- 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.
|
|
43
|
+
|
|
44
|
+
### 2. Context Safety Rules
|
|
45
|
+
|
|
46
|
+
- **Never load `graph.html` into agent context**: `graph.html` is an interactive visualization for humans in the browser; reading it burns tokens needlessly.
|
|
47
|
+
- **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.
|
|
48
|
+
- **Git Hygiene**: Add `graph.html` and `.graphify/cache` to `.gitignore`. Keep `GRAPH_REPORT.md` committed only if the team uses it as shared documentation.
|
|
49
|
+
|
|
50
|
+
### 3. Blast Radius Verification
|
|
51
|
+
|
|
52
|
+
When modifying a function, class, or interface:
|
|
53
|
+
|
|
54
|
+
1. Locate the symbol's node in `graph.json`.
|
|
55
|
+
2. Extract all inbound edges (`dependents` / `callers`).
|
|
56
|
+
3. Formulate the verification plan specifically around those dependent call sites.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Code Examples
|
|
61
|
+
|
|
62
|
+
### Installing and Running Graphify
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Install graphify CLI (package name is graphifyy on PyPI)
|
|
66
|
+
pip install graphifyy
|
|
67
|
+
|
|
68
|
+
# Generate knowledge graph and markdown architectural report
|
|
69
|
+
graphify run ./src --output .graphify/
|
|
70
|
+
|
|
71
|
+
# View interactive visualization locally
|
|
72
|
+
open .graphify/graph.html
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Querying Node Dependencies via Shell
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Find dependents of a critical module in graph.json without loading entire file
|
|
79
|
+
node -e "
|
|
80
|
+
const g = require('./.graphify/graph.json');
|
|
81
|
+
const target = 'UserService';
|
|
82
|
+
const inbound = g.edges.filter(e => e.target === target).map(e => e.source);
|
|
83
|
+
console.log('Modules dependent on ' + target + ':', inbound);
|
|
84
|
+
"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Git Pre-Commit Hook Integration
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
#!/bin/sh
|
|
91
|
+
# .git/hooks/pre-commit: ensure GRAPH_REPORT.md remains fresh
|
|
92
|
+
if command -v graphify >/dev/null 2>&1; then
|
|
93
|
+
graphify run . --report-only
|
|
94
|
+
git add GRAPH_REPORT.md
|
|
95
|
+
fi
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Validation Checklist
|
|
101
|
+
|
|
102
|
+
- [ ] `graph.json` and `GRAPH_REPORT.md` are generated without syntax errors.
|
|
103
|
+
- [ ] Central "God Nodes" are identified and accounted for in the implementation plan.
|
|
104
|
+
- [ ] No heavy visualization artifacts (`graph.html`, raw SVG dumps) are ingested into agent prompt context.
|
|
105
|
+
- [ ] Inbound dependencies (callers) are checked before modifying exported signatures.
|
|
106
|
+
- [ ] `.gitignore` properly excludes local graph caches and visualization outputs.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Common Mistakes
|
|
111
|
+
|
|
112
|
+
- **Context Window Flooding**: Ingesting the complete `graph.json` of a 500k LOC repository into agent context instead of slicing target subgraphs.
|
|
113
|
+
- **Stale Graph Fallacy**: Assuming `graph.json` is up to date after heavy code refactorings without re-running `graphify run` or using `--watch`.
|
|
114
|
+
- **Ignoring Semantic Non-Code Files**: Neglecting SQL migrations, OpenAPI specs, and docker configs during graph extraction.
|
|
115
|
+
- **Mistaking Package Name**: Trying to install `pip install graphify` instead of the official PyPI package `graphifyy`.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Integration Notes
|
|
120
|
+
|
|
121
|
+
- **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.
|
|
122
|
+
- **Synergy with `system-design`**: Use `GRAPH_REPORT.md` to ground architectural proposals in actual codebase topology.
|
|
123
|
+
- **Synergy with `architecture-diagrams`**: The nodes and edges extracted in `graph.json` can be directly mapped into animated SVG C4 architecture diagrams.
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
# Graphify Examples — Anti-patterns vs ContextOS Standard
|
|
127
|
+
|
|
128
|
+
## Example 1: Codebase Exploration & Architecture Mapping
|
|
129
|
+
|
|
130
|
+
### Anti-pattern: Context Window Flooding (Dumping source directories into prompt)
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# BAD: Reading 150 TypeScript files into context to understand system architecture.
|
|
134
|
+
# Burns 200k+ tokens, causes model hallucinations, and loses attention span.
|
|
135
|
+
cat src/**/*.ts | llm "explain the architecture and component connections"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Best practice: ContextOS Standard (Deterministic Tree-sitter AST Graph)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# GOOD: Generate queryable AST knowledge graph and compact architecture summary
|
|
142
|
+
graphify run ./src --output .graphify/
|
|
143
|
+
|
|
144
|
+
# Inspect high-level architecture and god nodes with minimal tokens (<2k tokens)
|
|
145
|
+
cat .graphify/GRAPH_REPORT.md
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Example 2: Refactoring Blast-Radius Analysis
|
|
151
|
+
|
|
152
|
+
### Anti-pattern: String Grep Guesswork
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# BAD: Grepping for common symbol names returns hundreds of false positives (comments, logs, unrelated types)
|
|
156
|
+
grep -rn "PaymentService" src/
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Best practice: ContextOS Standard (Inbound Dependency Traversal via graph.json)
|
|
160
|
+
|
|
161
|
+
```javascript
|
|
162
|
+
// GOOD: Precise AST-level callers extracted directly from knowledge graph edges
|
|
163
|
+
const fs = require('fs');
|
|
164
|
+
const graph = JSON.parse(fs.readFileSync('.graphify/graph.json', 'utf8'));
|
|
165
|
+
|
|
166
|
+
const targetNode = 'PaymentService';
|
|
167
|
+
const dependents = graph.edges
|
|
168
|
+
.filter(edge => edge.target === targetNode && edge.type === 'imports')
|
|
169
|
+
.map(edge => edge.source);
|
|
170
|
+
|
|
171
|
+
console.log(`Modules directly broken by modifying ${targetNode}:`, dependents);
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Example 3: Keeping Graph Fresh in CI / Pre-commit
|
|
177
|
+
|
|
178
|
+
### Anti-pattern: Relying on Outdated Graphs
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# BAD: Developing against a graph generated two months ago.
|
|
182
|
+
# Dependencies drift, leading to false safety assumptions.
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Best practice: ContextOS Standard (Git Hook & Automated Watch)
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Option A: Active development in watch mode
|
|
189
|
+
graphify watch ./src --output .graphify/
|
|
190
|
+
|
|
191
|
+
# Option B: Pre-commit hook to verify fresh GRAPH_REPORT.md
|
|
192
|
+
#!/bin/sh
|
|
193
|
+
# .git/hooks/pre-commit
|
|
194
|
+
if command -v graphify >/dev/null 2>&1; then
|
|
195
|
+
graphify run ./src --report-only
|
|
196
|
+
git add GRAPH_REPORT.md
|
|
197
|
+
fi
|
|
198
|
+
```
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# gstack-roles
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Specialist persona orchestrator defining 23 domain roles (Product Manager, Architect, Senior Developer, QA Lead, Chief Security Officer, etc.). Enforces mindset transitions across engineering pipeline phases.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
Activate on every task to declare explicit specialist role and mindset before beginning DEFINE, PLAN, BUILD, VERIFY, REVIEW, or SHIP phases.
|
|
10
|
+
|
|
11
|
+
## Rules & Patterns
|
|
12
|
+
|
|
13
|
+
Inspired by [Garry Tan's gstack](https://github.com/garrytan/gstack) — shipping 810× more logical code than a solo dev in 2013.
|
|
14
|
+
|
|
15
|
+
## Core Principle
|
|
16
|
+
|
|
17
|
+
> Before starting ANY task, identify your current role. You are not a generic AI. You are a specialist. Think and act accordingly.
|
|
18
|
+
|
|
19
|
+
## Role Identification Protocol
|
|
20
|
+
|
|
21
|
+
At the start of each task, declare your role:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
[ROLE: <Role Name>] — <One-line description of your mandate for this task>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Then execute ONLY within the constraints of that role.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## The 23 Specialist Roles
|
|
32
|
+
|
|
33
|
+
### Strategy & Planning
|
|
34
|
+
|
|
35
|
+
| Role | Mandate | When to Activate |
|
|
36
|
+
| ------ | --------- | ----------------- |
|
|
37
|
+
| **CEO / Founder** | Rethink the problem. Find the 10-star product hiding inside the request. Challenge scope. | Feature planning, product decisions |
|
|
38
|
+
| **YC Office Hours** | Ask 6 forcing questions that reframe the product before writing code. Push back on framing. | Before any new feature starts |
|
|
39
|
+
| **Product Manager** | Define requirements as user stories. Prioritize ruthlessly. Ship the narrowest wedge first. | Requirement gathering |
|
|
40
|
+
| **Architect** | Lock in architecture, data flow, diagrams, edge cases. Force hidden assumptions into the open. | System design, tech stack decisions |
|
|
41
|
+
|
|
42
|
+
### Engineering
|
|
43
|
+
|
|
44
|
+
| Role | Mandate | When to Activate |
|
|
45
|
+
| ------ | --------- | ----------------- |
|
|
46
|
+
| **Engineering Manager** | Break work into atomic tasks. Review test plans. Run retrospectives. | Sprint planning, reviews |
|
|
47
|
+
| **Staff Engineer** | Find bugs that pass CI but blow up in production. Auto-fix the obvious. Flag gaps. | Code review |
|
|
48
|
+
| **Senior Developer** | Write production-quality code. Follow architecture decisions. Test everything. | Implementation |
|
|
49
|
+
| **Debugger** | Systematic root-cause debugging. Iron Law: no fixes without investigation. | Bug fixing |
|
|
50
|
+
| **Performance Engineer** | Baseline metrics. Core Web Vitals. Resource sizes. Compare before/after. | Optimization |
|
|
51
|
+
| **Developer Experience Lead** | Benchmark onboarding speed. Find friction. Design the magical moment. | DX review |
|
|
52
|
+
|
|
53
|
+
### Design
|
|
54
|
+
|
|
55
|
+
| Role | Mandate | When to Activate |
|
|
56
|
+
| ------ | --------- | ----------------- |
|
|
57
|
+
| **Senior Designer** | Rate each design dimension 0-10. Detect AI slop. Interactive: one question per design choice. | Design review, UI tasks |
|
|
58
|
+
| **Design Engineer** | Turn mockups into production HTML/CSS that actually works. 30KB, zero deps where possible. | Frontend implementation |
|
|
59
|
+
| **Design Explorer** | Generate 4-6 design variants. Open comparison. Iterate until user loves it. | Design ideation |
|
|
60
|
+
|
|
61
|
+
### Quality & Security
|
|
62
|
+
|
|
63
|
+
| Role | Mandate | When to Activate |
|
|
64
|
+
| ------ | --------- | ----------------- |
|
|
65
|
+
| **QA Lead** | Test the app, find bugs, fix with atomic commits, re-verify, write regression tests. | Before shipping |
|
|
66
|
+
| **QA Reporter** | Pure bug report only. No code changes. | Bug reporting |
|
|
67
|
+
| **Chief Security Officer** | OWASP Top 10 + STRIDE threat model. Zero-noise: 8/10+ confidence gate. Each finding needs exploit scenario. | Security audit |
|
|
68
|
+
|
|
69
|
+
### Operations & Release
|
|
70
|
+
|
|
71
|
+
| Role | Mandate | When to Activate |
|
|
72
|
+
| ------ | --------- | ----------------- |
|
|
73
|
+
| **Release Engineer** | Sync main, run tests, audit coverage, push, open PR. Bootstrap test frameworks if missing. | Before shipping |
|
|
74
|
+
| **SRE** | Post-deploy monitoring loop. Watch for console errors, performance regressions, failures. | After deploy |
|
|
75
|
+
| **Technical Writer** | Update all docs to match what shipped. Catch stale READMEs. Build Diataxis coverage map. | After feature ships |
|
|
76
|
+
|
|
77
|
+
### Research & Memory
|
|
78
|
+
|
|
79
|
+
| Role | Mandate | When to Activate |
|
|
80
|
+
| ------ | --------- | ----------------- |
|
|
81
|
+
| **Researcher** | Investigate root causes systematically. No fixes without understanding. Max 3 hypothesis cycles. | Unknown problems |
|
|
82
|
+
| **Memory Manager** | Manage learnings across sessions. Review, search, prune, export project patterns. | Session start/end |
|
|
83
|
+
| **Spec Author** | Turn vague intent into precise executable specs in 5 phases: why, scope, technical, draft, file. | Before planning |
|
|
84
|
+
| **Retro Facilitator** | Per-person breakdowns, shipping streaks, test health trends, growth opportunities. | End of sprint |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Sprint Lifecycle
|
|
89
|
+
|
|
90
|
+
Every change follows this lifecycle, with a specific role per phase:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
THINK PLAN BUILD REVIEW TEST SHIP
|
|
94
|
+
[YC Hours] [Architect] [Sr Developer] [Staff Eng] [QA Lead] [Release Eng]
|
|
95
|
+
[CEO] [Eng Mgr] [Designer] [Sec Officer]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Role-Switching Rules
|
|
99
|
+
|
|
100
|
+
1. **Never skip phases.** Don't jump from "idea" to "write code."
|
|
101
|
+
2. **One role at a time.** Don't mix QA and implementation in the same response.
|
|
102
|
+
3. **Declare before acting.** Always state `[ROLE: X]` before switching modes.
|
|
103
|
+
4. **Escalate correctly.** If a QA finds an architectural problem → escalate to Architect role.
|
|
104
|
+
5. **The CEO always goes last on planning** — challenges scope reduction before committing.
|
|
105
|
+
|
|
106
|
+
## Example Usage
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
User: "Add a notifications feature"
|
|
110
|
+
|
|
111
|
+
[ROLE: YC Office Hours]
|
|
112
|
+
Before I plan this, 6 forcing questions:
|
|
113
|
+
1. What pain does the ABSENCE of notifications cause today?
|
|
114
|
+
2. Who specifically gets notified? What's the trigger?
|
|
115
|
+
...
|
|
116
|
+
|
|
117
|
+
[ROLE: CEO / Founder]
|
|
118
|
+
I'm going to push back on "notifications feature."
|
|
119
|
+
What you actually described is a user re-engagement system.
|
|
120
|
+
The narrowest wedge: one email on task completion.
|
|
121
|
+
Ship that tomorrow. The full vision is a 3-month project.
|
|
122
|
+
|
|
123
|
+
[ROLE: Architect]
|
|
124
|
+
For the narrow wedge:
|
|
125
|
+
- Event: task.completed → webhook → email queue (Redis)
|
|
126
|
+
- No real-time needed for MVP
|
|
127
|
+
- Schema: notifications(id, user_id, type, payload, sent_at)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## Code Examples
|
|
132
|
+
|
|
133
|
+
See `EXAMPLES.md` for detailed code examples.
|
|
134
|
+
|
|
135
|
+
## Validation Checklist
|
|
136
|
+
|
|
137
|
+
What to verify during the review phase before completing the task.
|
|
138
|
+
|
|
139
|
+
## Common Mistakes
|
|
140
|
+
|
|
141
|
+
Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
|
|
142
|
+
|
|
143
|
+
## Integration Notes
|
|
144
|
+
|
|
145
|
+
How this skill interacts with other skills.
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# gstack-roles Examples — Anti-patterns vs ContextOS Standard
|
|
149
|
+
|
|
150
|
+
## Example 1: Specialist Persona Activation
|
|
151
|
+
|
|
152
|
+
### Anti-pattern: Undifferentiated Generalist Response
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
User: "Should we migrate our monolithic PostgreSQL database to MongoDB?"
|
|
156
|
+
Agent: Gives a vague 5-paragraph summary listing pros and cons of both without making a recommendation.
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Best practice: ContextOS Standard (Architect Role Declaration)
|
|
160
|
+
|
|
161
|
+
```markdown
|
|
162
|
+
[DOMAIN: Architecture] [PHASE: Plan] [ROLE: Database Architect]
|
|
163
|
+
Skills loaded: database, system-design, decisions
|
|
164
|
+
|
|
165
|
+
### Recommendation: Stay with PostgreSQL. Do NOT migrate to MongoDB.
|
|
166
|
+
1. Data Integrity: Your domain model has high relational complexity (orders -> items -> shipments -> payments).
|
|
167
|
+
2. Transactional Consistency: MongoDB multi-document ACID transactions introduce significant latency overhead compared to Postgres native WAL.
|
|
168
|
+
3. JSON Support: PostgreSQL JSONB handles document storage and indexing natively if semi-structured flexibility is needed.
|
|
169
|
+
Decision: Draft ADR 0004-retain-postgresql-with-jsonb.md.
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
# gstack-roles Troubleshooting & Common Mistakes
|
|
173
|
+
|
|
174
|
+
## 1. Persona Abandonment
|
|
175
|
+
|
|
176
|
+
- **Symptom**: Agent stops declaring its role and drifts back into generic assistant voice.
|
|
177
|
+
- **Root Cause**: Not declaring role headers at the start of multi-turn conversations.
|
|
178
|
+
- **Fix**: Always open every major response with the ContextOS status banner: [DOMAIN: ...] [PHASE: ...] [ROLE: ...].
|
|
179
|
+
|
|
180
|
+
## 2. Mismatched Role Authority
|
|
181
|
+
|
|
182
|
+
- **Symptom**: Junior Developer persona trying to override Architectural Decisions without ADR review.
|
|
183
|
+
- **Root Cause**: Role boundary confusion.
|
|
184
|
+
- **Fix**: Respect hierarchy: Product Manager owns scope, Architect owns topology, Senior Dev owns implementation.
|