contextos-agents 1.6.1 → 1.7.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.
Files changed (86) hide show
  1. package/.agents/AGENTS.md +5 -0
  2. package/.agents/adapters/aider/export.js +4 -2
  3. package/.agents/adapters/copilot/export.js +4 -2
  4. package/.agents/adapters/cursor/export.js +48 -12
  5. package/.agents/adapters/zed/export.js +53 -14
  6. package/.agents/core/skills/adapters/skill.yaml +6 -0
  7. package/.agents/core/skills/architecture-diagrams/skill.yaml +4 -0
  8. package/.agents/core/skills/brutalist-design/skill.yaml +4 -0
  9. package/.agents/core/skills/context-manager/references/context-rules.md +59 -0
  10. package/.agents/core/skills/context-manager/skill.yaml +7 -0
  11. package/.agents/core/skills/context-os/skill.yaml +11 -0
  12. package/.agents/core/skills/database/skill.yaml +6 -0
  13. package/.agents/core/skills/ddd/skill.yaml +7 -0
  14. package/.agents/core/skills/decisions/skill.yaml +6 -0
  15. package/.agents/core/skills/docker/skill.yaml +6 -0
  16. package/.agents/core/skills/engineering-workflow/SKILL.md +1 -1
  17. package/.agents/core/skills/engineering-workflow/skill.yaml +6 -0
  18. package/.agents/core/skills/fastapi/skill.yaml +7 -0
  19. package/.agents/core/skills/gemini-precision/SKILL.md +4 -0
  20. package/.agents/core/skills/gemini-precision/skill.yaml +4 -0
  21. package/.agents/core/skills/generators/skill.yaml +15 -0
  22. package/.agents/core/skills/graphify/SKILL.md +2 -2
  23. package/.agents/core/skills/graphify/skill.yaml +6 -1
  24. package/.agents/core/skills/gstack-roles/SKILL.md +3 -1
  25. package/.agents/core/skills/gstack-roles/skill.yaml +6 -0
  26. package/.agents/core/skills/impeccable-design/skill.yaml +6 -0
  27. package/.agents/core/skills/interview-me/skill.yaml +4 -0
  28. package/.agents/core/skills/microservices/skill.yaml +7 -0
  29. package/.agents/core/skills/minimalist-design/skill.yaml +4 -0
  30. package/.agents/core/skills/nestjs/skill.yaml +7 -0
  31. package/.agents/core/skills/nextjs/skill.yaml +7 -0
  32. package/.agents/core/skills/node/skill.yaml +7 -0
  33. package/.agents/core/skills/performance/skill.yaml +7 -0
  34. package/.agents/core/skills/ponytail-mindset/skill.yaml +6 -0
  35. package/.agents/core/skills/react/skill.yaml +7 -0
  36. package/.agents/core/skills/react-best-practices/skill.yaml +4 -0
  37. package/.agents/core/skills/redesign-audit/skill.yaml +4 -0
  38. package/.agents/core/skills/security/skill.yaml +7 -0
  39. package/.agents/core/skills/soft-design/skill.yaml +4 -0
  40. package/.agents/core/skills/state-management/skill.yaml +6 -0
  41. package/.agents/core/skills/subagent-orchestrator/SKILL.md +17 -0
  42. package/.agents/core/skills/subagent-orchestrator/skill.yaml +4 -0
  43. package/.agents/core/skills/system-design/skill.yaml +7 -0
  44. package/.agents/core/skills/testing/skill.yaml +6 -0
  45. package/.agents/core/skills/typescript/skill.yaml +7 -0
  46. package/.agents/core/skills/ui-design/skill.yaml +7 -0
  47. package/.agents/core/skills/ui-ux-pro/skill.yaml +6 -0
  48. package/.agents/core/skills/ux-design/skill.yaml +7 -0
  49. package/.agents/core/skills/vercel-optimize/scripts/collect-signals.mjs +131 -0
  50. package/.agents/core/skills/vercel-optimize/scripts/gate-investigations.mjs +142 -0
  51. package/.agents/core/skills/vercel-optimize/scripts/merge-signals.mjs +143 -0
  52. package/.agents/core/skills/vercel-optimize/scripts/scan-codebase.mjs +174 -0
  53. package/.agents/core/skills/vercel-optimize/skill.yaml +8 -0
  54. package/.agents/core/skills/web-accessibility/skill.yaml +7 -0
  55. package/.agents/ctx.js +14 -1
  56. package/.agents/doctor.js +193 -4
  57. package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +1 -1
  58. package/.agents/generated/claude/skills/gemini-precision/SKILL.md +4 -0
  59. package/.agents/generated/claude/skills/graphify/SKILL.md +1 -1
  60. package/.agents/generated/claude/skills/gstack-roles/SKILL.md +3 -1
  61. package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +17 -0
  62. package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +1 -1
  63. package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +4 -0
  64. package/.agents/generated/gemini/skills/graphify/SKILL.md +2 -2
  65. package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +3 -1
  66. package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +17 -0
  67. package/.agents/plugins/contextos/hooks.json +25 -0
  68. package/.agents/plugins/contextos/plugin.json +19 -0
  69. package/.agents/plugins.js +180 -20
  70. package/.agents/profiles.js +26 -0
  71. package/.agents/resolver.js +150 -30
  72. package/.agents/stats.js +22 -9
  73. package/.agents/validate.js +99 -13
  74. package/bin/commands/uninstall.js +207 -0
  75. package/bin/commands/update.js +262 -0
  76. package/bin/commands.js +305 -0
  77. package/bin/index.js +203 -83
  78. package/bin/lib/detector.js +106 -0
  79. package/bin/lib/lockfile.js +251 -0
  80. package/bin/lib/safe-writer.js +259 -0
  81. package/package.json +5 -6
  82. package/registry.json +13 -5
  83. package/registry.schema.json +3 -1
  84. package/.agents/mcp/runtime.py +0 -470
  85. package/.agents/mcp/server.mjs +0 -189271
  86. package/benchmarks/gemini-issues.js +0 -533
package/.agents/AGENTS.md CHANGED
@@ -22,6 +22,10 @@ State your answers explicitly:
22
22
  Skills loaded: react, typescript, ui-ux-pro, ponytail-mindset
23
23
  ```
24
24
 
25
+ > **Anti-Spam Invariant**:
26
+ > Declare `[DOMAIN: ...] [PHASE: ...] [ROLE: ...]` **strictly once** at the beginning of a user task or when transitioning between major phases (`DEFINE → PLAN → BUILD → VERIFY → REVIEW → SHIP`).
27
+ > **NEVER** prefix intermediate tool calls, file reads, grep searches, or step updates with this header.
28
+
25
29
  ---
26
30
 
27
31
  ## Skill Architecture (Context Efficiency)
@@ -372,6 +376,7 @@ These rules apply regardless of which skills are loaded:
372
376
 
373
377
  ### Engineering
374
378
  - No code before spec + plan are approved in interactive development (proceed directly to BUILD when standalone/benchmark code is requested)
379
+ - **Fast-Track Exception**: For routine maintenance, operational tasks (git commands, version bump, lint fix, typo, single-line config tweaks, diagnostics, and direct questions), proceed directly without blocking on full `/spec` and `/plan` approval rituals.
375
380
  - Blast radius limited to files in current task's plan
376
381
  - One atomic commit per task
377
382
 
@@ -92,12 +92,14 @@ function run() {
92
92
  `\n---\n\n## Project Rules\n\n` +
93
93
  `### Step 0 — Identify Before Acting\n\n` +
94
94
  `Before writing a single line of code or plan, state:\n` +
95
- `\`\`\`\n1. WHAT DOMAIN? → Frontend / Backend / Architecture / Full-Stack / DevOps\n2. WHAT PHASE? → Define / Plan / Build / Verify / Review / Ship\n3. WHAT ROLE? → Declare specialist role for this phase\n\`\`\`\n\n` +
95
+ `\`\`\`\n1. WHAT DOMAIN? → Frontend / Backend / Architecture / Full-Stack / DevOps\n2. WHAT PHASE? → Define / Plan / Build / Verify / Review / Ship\n3. WHAT ROLE? → Declare specialist role for this phase\n\`\`\`\n` +
96
+ `> **Anti-Spam Invariant**: Declare this strictly once at the start of a task or phase. Never repeat before intermediate tool calls or step updates.\n\n` +
96
97
  `### Non-Negotiable Rules\n\n` +
97
98
  `- **Zero-Assumption Investigation**: Never guess file paths or signatures. Inspect before modifying.\n` +
98
99
  `- **Zero-Placeholder Production Code**: Never emit lazy stubs, \`// TODO\`, or partial code.\n` +
99
100
  `- **Mandatory Proof-of-Work Verification**: Always run tests and validators before claiming completion.\n` +
100
- `- **Surgical Blast Radius**: Modify only files strictly within scope.\n`
101
+ `- **Surgical Blast Radius**: Modify only files strictly within scope.\n` +
102
+ `- **Fast-Track Exception**: Routine maintenance, git commands, version bumps, typo fixes, and diagnostics skip spec/plan ceremonies.\n`
101
103
  );
102
104
 
103
105
  // Skills Router Table
@@ -59,12 +59,14 @@ function run() {
59
59
  lines.push(`## Project Rules\n\n`);
60
60
  lines.push(`### Step 0 — Identify Before Acting\n\n`);
61
61
  lines.push(`Before writing a single line of code or plan, state:\n`);
62
- lines.push(`\`\`\`\n1. WHAT DOMAIN? → Frontend / Backend / Architecture / Full-Stack / DevOps\n2. WHAT PHASE? → Define / Plan / Build / Verify / Review / Ship\n3. WHAT ROLE? → Declare specialist role for this phase\n\`\`\`\n\n`);
62
+ lines.push(`\`\`\`\n1. WHAT DOMAIN? → Frontend / Backend / Architecture / Full-Stack / DevOps\n2. WHAT PHASE? → Define / Plan / Build / Verify / Review / Ship\n3. WHAT ROLE? → Declare specialist role for this phase\n\`\`\`\n`);
63
+ lines.push(`> **Anti-Spam Invariant**: Declare this strictly once at the start of a task or phase. Never repeat before intermediate tool calls or step updates.\n\n`);
63
64
  lines.push(`### Non-Negotiable Rules\n\n`);
64
65
  lines.push(`- **Zero-Assumption Investigation**: Never guess file paths or signatures. Inspect before modifying.\n`);
65
66
  lines.push(`- **Zero-Placeholder Production Code**: Never emit lazy stubs, \`// TODO\`, or partial code.\n`);
66
67
  lines.push(`- **Mandatory Proof-of-Work Verification**: Always run tests and validators before claiming completion.\n`);
67
- lines.push(`- **Surgical Blast Radius**: Modify only files strictly within scope.\n\n`);
68
+ lines.push(`- **Surgical Blast Radius**: Modify only files strictly within scope.\n`);
69
+ lines.push(`- **Fast-Track Exception**: Routine maintenance, git commands, version bumps, typo fixes, and diagnostics skip spec/plan ceremonies.\n\n`);
68
70
  lines.push(`---\n`);
69
71
 
70
72
  // ── Skills ───────────────────────────────────────────────────────────────────
@@ -133,6 +133,12 @@ ${body}
133
133
  function run() {
134
134
  console.log('Starting Cursor adapter export...');
135
135
 
136
+ const outputFile = path.join(process.cwd(), '.cursorrules');
137
+ const cursorRulesDir = path.join(process.cwd(), '.cursor', 'rules');
138
+ const agentsMdPath = fs.existsSync(path.join(process.cwd(), '.agents', 'AGENTS.md'))
139
+ ? path.join(process.cwd(), '.agents', 'AGENTS.md')
140
+ : AGENTS_MD_PATH;
141
+
136
142
  const sections = [];
137
143
 
138
144
  // ── Header ──────────────────────────────────────────────────────────────────
@@ -146,14 +152,14 @@ function run() {
146
152
  );
147
153
 
148
154
  // Prepare .cursor/rules directory
149
- fs.mkdirSync(CURSOR_RULES_DIR, { recursive: true });
155
+ fs.mkdirSync(cursorRulesDir, { recursive: true });
150
156
 
151
157
  let count = 0;
152
158
  let mdcCount = 0;
153
159
 
154
160
  // Write 00-project-rules.mdc
155
- if (fs.existsSync(AGENTS_MD_PATH)) {
156
- const agentsMd = fs.readFileSync(AGENTS_MD_PATH, 'utf8');
161
+ if (fs.existsSync(agentsMdPath)) {
162
+ const agentsMd = fs.readFileSync(agentsMdPath, 'utf8');
157
163
  const projectMdc = `---
158
164
  description: "ContextOS core project rules and role orchestration"
159
165
  globs: ""
@@ -164,7 +170,7 @@ alwaysApply: true
164
170
 
165
171
  ${agentsMd}
166
172
  `;
167
- fs.writeFileSync(path.join(CURSOR_RULES_DIR, '00-project-rules.mdc'), projectMdc);
173
+ fs.writeFileSync(path.join(cursorRulesDir, '00-project-rules.mdc'), projectMdc);
168
174
  mdcCount++;
169
175
  }
170
176
 
@@ -185,23 +191,53 @@ ${agentsMd}
185
191
  if (mdc) {
186
192
  const mdcFileName = `${mdc.skillName}.mdc`;
187
193
  activeMdcFiles.add(mdcFileName);
188
- fs.writeFileSync(path.join(CURSOR_RULES_DIR, mdcFileName), mdc.mdcContent);
194
+ fs.writeFileSync(path.join(cursorRulesDir, mdcFileName), mdc.mdcContent);
189
195
  mdcCount++;
190
196
  }
191
197
  }
192
198
 
193
- // Clean up stale .mdc rules from uninstalled skills/plugins
194
- if (fs.existsSync(CURSOR_RULES_DIR)) {
195
- for (const file of fs.readdirSync(CURSOR_RULES_DIR)) {
199
+ // Clean up stale .mdc rules from uninstalled skills/plugins safely (provenance-verified only)
200
+ if (fs.existsSync(cursorRulesDir)) {
201
+ const lockfilePath = path.join(process.cwd(), '.agents', 'contextos.lock.json');
202
+ let lockData = null;
203
+ try {
204
+ if (fs.existsSync(lockfilePath)) {
205
+ lockData = JSON.parse(fs.readFileSync(lockfilePath, 'utf8'));
206
+ }
207
+ } catch {}
208
+
209
+ for (const file of fs.readdirSync(cursorRulesDir)) {
196
210
  if (file.endsWith('.mdc') && !activeMdcFiles.has(file)) {
197
- fs.unlinkSync(path.join(CURSOR_RULES_DIR, file));
211
+ const fullFilePath = path.join(cursorRulesDir, file);
212
+ const relPath = path.relative(process.cwd(), fullFilePath).replace(/\\/g, '/');
213
+
214
+ // Deletion permitted ONLY if recorded in lockfile OR content carries explicit ContextOS provenance
215
+ const isManagedInLock = Boolean(lockData?.managedFiles?.[relPath]?.managed);
216
+ let hasContextosMarker = false;
217
+ try {
218
+ const content = fs.readFileSync(fullFilePath, 'utf8');
219
+ hasContextosMarker =
220
+ content.includes('<!-- Auto-generated by: node .agents/ctx.js export cursor -->') ||
221
+ content.includes('ContextOS rules for') ||
222
+ content.includes('ContextOS — Project Operating System Rules');
223
+ } catch {}
224
+
225
+ if (isManagedInLock || hasContextosMarker) {
226
+ fs.unlinkSync(fullFilePath);
227
+ if (lockData?.managedFiles?.[relPath]) {
228
+ delete lockData.managedFiles[relPath];
229
+ try {
230
+ fs.writeFileSync(lockfilePath, JSON.stringify(lockData, null, 2) + '\n', 'utf8');
231
+ } catch {}
232
+ }
233
+ }
198
234
  }
199
235
  }
200
236
  }
201
237
 
202
- fs.writeFileSync(OUTPUT_FILE, sections.join('\n'));
203
- console.log(`Generated .cursorrules (${count} skills) → ${OUTPUT_FILE}`);
204
- console.log(`Generated .cursor/rules/*.mdc (${mdcCount} rules) → ${CURSOR_RULES_DIR}`);
238
+ fs.writeFileSync(outputFile, sections.join('\n'));
239
+ console.log(`Generated .cursorrules (${count} skills) → ${outputFile}`);
240
+ console.log(`Generated .cursor/rules/*.mdc (${mdcCount} rules) → ${cursorRulesDir}`);
205
241
  }
206
242
 
207
243
  module.exports = { run };
@@ -46,15 +46,22 @@ function buildSkillSection(skillDir) {
46
46
  skillName,
47
47
  title,
48
48
  section: `\n### Skill: ${title}\n${descLine}${promptRef}`,
49
- prompt: `# ContextOS — ${title}\n\n${descLine}\n${body}\n`,
49
+ prompt: `<!-- Auto-generated by: node .agents/ctx.js export zed -->\n# ContextOS — ${title}\n\n${descLine}\n${body}\n`,
50
50
  };
51
51
  }
52
52
 
53
53
  function run() {
54
54
  console.log('Starting Zed IDE adapter export...');
55
55
 
56
- fs.mkdirSync(ZED_DIR, { recursive: true });
57
- fs.mkdirSync(PROMPTS_DIR, { recursive: true });
56
+ const zedDir = path.join(process.cwd(), '.zed');
57
+ const rulesFile = path.join(zedDir, 'rules.md');
58
+ const promptsDir = path.join(zedDir, 'prompts');
59
+ const agentsMdPath = fs.existsSync(path.join(process.cwd(), '.agents', 'AGENTS.md'))
60
+ ? path.join(process.cwd(), '.agents', 'AGENTS.md')
61
+ : AGENTS_MD_PATH;
62
+
63
+ fs.mkdirSync(zedDir, { recursive: true });
64
+ fs.mkdirSync(promptsDir, { recursive: true });
58
65
 
59
66
  const lines = [];
60
67
 
@@ -66,12 +73,15 @@ function run() {
66
73
  );
67
74
 
68
75
  // ── Project Rules ────────────────────────────────────────────────────────────
69
- if (fs.existsSync(AGENTS_MD_PATH)) {
70
- const agentsMd = fs.readFileSync(AGENTS_MD_PATH, 'utf8');
76
+ if (fs.existsSync(agentsMdPath)) {
77
+ const agentsMd = fs.readFileSync(agentsMdPath, 'utf8');
71
78
  lines.push(`## Project Rules (AGENTS.md)\n\n${agentsMd}\n\n---\n`);
72
79
 
73
80
  // Also write a master prompt in .zed/prompts/contextos.md
74
- fs.writeFileSync(path.join(PROMPTS_DIR, 'contextos.md'), `# ContextOS Master Prompt\n\n${agentsMd}\n`);
81
+ fs.writeFileSync(
82
+ path.join(promptsDir, 'contextos.md'),
83
+ `<!-- Auto-generated by: node .agents/ctx.js export zed -->\n# ContextOS Master Prompt\n\n${agentsMd}\n`
84
+ );
75
85
  }
76
86
 
77
87
  // ── Skills ───────────────────────────────────────────────────────────────────
@@ -88,24 +98,53 @@ function run() {
88
98
  lines.push(skillData.section);
89
99
  const promptFileName = `${skillData.skillName}.md`;
90
100
  activePromptFiles.add(promptFileName);
91
- fs.writeFileSync(path.join(PROMPTS_DIR, promptFileName), skillData.prompt);
101
+ fs.writeFileSync(path.join(promptsDir, promptFileName), skillData.prompt);
92
102
  count++;
93
103
  }
94
104
  }
95
105
 
96
- // Clean up stale prompts from uninstalled skills/plugins
97
- if (fs.existsSync(PROMPTS_DIR)) {
98
- for (const file of fs.readdirSync(PROMPTS_DIR)) {
106
+ // Clean up stale prompts from uninstalled skills/plugins safely (provenance-verified only)
107
+ if (fs.existsSync(promptsDir)) {
108
+ const lockfilePath = path.join(process.cwd(), '.agents', 'contextos.lock.json');
109
+ let lockData = null;
110
+ try {
111
+ if (fs.existsSync(lockfilePath)) {
112
+ lockData = JSON.parse(fs.readFileSync(lockfilePath, 'utf8'));
113
+ }
114
+ } catch {}
115
+
116
+ for (const file of fs.readdirSync(promptsDir)) {
99
117
  if (file.endsWith('.md') && !activePromptFiles.has(file)) {
100
- fs.unlinkSync(path.join(PROMPTS_DIR, file));
118
+ const fullFilePath = path.join(promptsDir, file);
119
+ const relPath = path.relative(process.cwd(), fullFilePath).replace(/\\/g, '/');
120
+
121
+ const isManagedInLock = Boolean(lockData?.managedFiles?.[relPath]?.managed);
122
+ let hasContextosMarker = false;
123
+ try {
124
+ const content = fs.readFileSync(fullFilePath, 'utf8');
125
+ hasContextosMarker =
126
+ content.includes('<!-- Auto-generated by: node .agents/ctx.js export zed -->') ||
127
+ content.includes('# ContextOS —') ||
128
+ content.includes('# ContextOS Master Prompt');
129
+ } catch {}
130
+
131
+ if (isManagedInLock || hasContextosMarker) {
132
+ fs.unlinkSync(fullFilePath);
133
+ if (lockData?.managedFiles?.[relPath]) {
134
+ delete lockData.managedFiles[relPath];
135
+ try {
136
+ fs.writeFileSync(lockfilePath, JSON.stringify(lockData, null, 2) + '\n', 'utf8');
137
+ } catch {}
138
+ }
139
+ }
101
140
  }
102
141
  }
103
142
  }
104
143
 
105
144
  // Write master .zed/rules.md
106
- fs.writeFileSync(RULES_FILE, lines.join(''));
107
- console.log(`Generated .zed/rules.md (${count} skills) → ${RULES_FILE}`);
108
- console.log(`Generated .zed/prompts/*.md (${count} prompts) → ${PROMPTS_DIR}`);
145
+ fs.writeFileSync(rulesFile, lines.join(''));
146
+ console.log(`Generated .zed/rules.md (${count} skills) → ${rulesFile}`);
147
+ console.log(`Generated .zed/prompts/*.md (${count} prompts) → ${promptsDir}`);
109
148
  }
110
149
 
111
150
  module.exports = { run };
@@ -1,4 +1,5 @@
1
1
  name: adapters
2
+ type: compiler
2
3
  description: >
3
4
  Generates agent-specific configuration files from unified ContextOS format.
4
5
  Produces configs for Claude, Gemini, Copilot, Cursor, Aider, Continue, and Zed.
@@ -8,3 +9,8 @@ tags:
8
9
  - configuration
9
10
  - devops
10
11
  version: 1.0.0
12
+ resources:
13
+ - EXAMPLES.md
14
+ - SKILL.md
15
+ - TROUBLESHOOTING.md
16
+ - VALIDATION.json
@@ -1,4 +1,5 @@
1
1
  name: architecture-diagrams
2
+ type: instruction-only
2
3
  description: Interactive, visual architecture and sequence diagrams as code. Generates beautiful, self-contained SVG/HTML diagrams with motion, clear component boundaries, and verifiable data flows.
3
4
  tags:
4
5
  - architecture
@@ -6,3 +7,6 @@ tags:
6
7
  - system-design
7
8
  - visualization
8
9
  version: 1.0.0
10
+ resources:
11
+ - SKILL.md
12
+ - VALIDATION.json
@@ -1,4 +1,5 @@
1
1
  name: brutalist-design
2
+ type: instruction-only
2
3
  description: Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics.
3
4
  tags:
4
5
  - ui
@@ -6,3 +7,6 @@ tags:
6
7
  - brutalist
7
8
  - typography
8
9
  version: 1.0.0
10
+ resources:
11
+ - SKILL.md
12
+ - VALIDATION.json
@@ -0,0 +1,59 @@
1
+ # Context Loading Rules
2
+
3
+ Guidelines and deterministic decision tables for selecting, prioritizing, and budgeting context during AI agent execution.
4
+
5
+ ## Task Type to Document Mapping
6
+
7
+ | Task Type | Level 1 (Always) | Level 2 (If exists) | Level 3 (Per task) |
8
+ | --- | --- | --- | --- |
9
+ | **New project** | PRD, ROADMAP | ARCHITECTURE, DATABASE, API | UI, TASKS, all relevant skills |
10
+ | **New feature** | PRD | ARCHITECTURE, API | PROJECT_GRAPH, relevant skills |
11
+ | **Frontend** | — | ARCHITECTURE, API | UI, frontend skills |
12
+ | **Backend** | — | ARCHITECTURE, DATABASE, API | backend skills |
13
+ | **Database** | — | ARCHITECTURE, DATABASE | — |
14
+ | **Bugfix** | — | — | PROJECT_GRAPH (affected module only) |
15
+ | **Refactor** | — | ARCHITECTURE | PROJECT_GRAPH, affected skills |
16
+ | **Review** | PRD | ARCHITECTURE | TASKS, all loaded skills |
17
+ | **Deploy** | — | ARCHITECTURE | DEPLOYMENT, infrastructure skills |
18
+
19
+ ## Skill Category to Document Mapping
20
+
21
+ | Skill Category | Required Documents | Optional Documents |
22
+ | --- | --- | --- |
23
+ | `frontend` | UI.md, API.md | ARCHITECTURE.md |
24
+ | `backend` | API.md, DATABASE.md | ARCHITECTURE.md |
25
+ | `design` | UI.md | PRD.md |
26
+ | `architecture` | ARCHITECTURE.md, DATABASE.md | PRD.md, API.md |
27
+ | `infrastructure` | ARCHITECTURE.md | — |
28
+ | `security` | ARCHITECTURE.md, API.md | DATABASE.md |
29
+ | `testing` | API.md | ARCHITECTURE.md |
30
+
31
+ ## Context Budgeting
32
+
33
+ To prevent context window saturation and retain maximum LLM reasoning capacity, adhere strictly to the following 4-tier token budget:
34
+
35
+ | Priority Level | Max Tokens | Contents |
36
+ | --- | --- | --- |
37
+ | 1 (Critical) | 2,000 | Current task description, active brief, and primary skill rules |
38
+ | 2 (Important) | 3,000 | System architecture and API contracts for affected modules |
39
+ | 3 (Context) | 2,000 | Architectural Decision Records (ADRs) and relevant graph nodes |
40
+ | 4 (Background) | 1,000 | PRD summary and global project conventions |
41
+
42
+ **Total target context budget: ~8,000 tokens per subtask.**
43
+
44
+ ### Degradation Strategy When Over Budget
45
+
46
+ If accumulated context exceeds the 8,000 token limit:
47
+
48
+ 1. **Trim Level 1 documents** to high-level executive summaries.
49
+ 2. **Slice Level 2 documents** to extract only sections matching touched module signatures.
50
+ 3. **Preserve Level 3 skills** at full fidelity, as they contain non-negotiable operational instructions and validation guardrails.
51
+
52
+ ## Module-Based Filtering via Dependency Graph
53
+
54
+ When `PROJECT_GRAPH.md` or `.graphify/graph.json` is present, traverse dependency edges to filter candidate documents:
55
+
56
+ 1. Identify the primary module for the task from the symbol/path mapping.
57
+ 2. Resolve immediate inbound and outbound dependencies (`dependencies` and `dependents`).
58
+ 3. Include documents solely for the identified module and its immediate dependencies.
59
+ 4. Exclude orthogonal domain documents (for example, omit database schemas during purely presentation-layer CSS/layout tasks).
@@ -1,4 +1,5 @@
1
1
  name: context-manager
2
+ type: instruction-only
2
3
  description: >
3
4
  Smart context selection engine. Analyzes the current task, consults the
4
5
  Project Graph, and returns only the documents and skills needed to prevent token overflow.
@@ -8,3 +9,9 @@ tags:
8
9
  - tokens
9
10
  - architecture
10
11
  version: 1.0.0
12
+ resources:
13
+ - EXAMPLES.md
14
+ - SKILL.md
15
+ - TROUBLESHOOTING.md
16
+ - VALIDATION.json
17
+ - references/context-rules.md
@@ -1,4 +1,5 @@
1
1
  name: context-os
2
+ type: compiler
2
3
  description: >
3
4
  AI Project Operating System context compiler that transforms user intent into
4
5
  minimal, relevant context for any AI agent across the full development lifecycle.
@@ -8,3 +9,13 @@ tags:
8
9
  - architecture
9
10
  - context
10
11
  version: 1.0.0
12
+ resources:
13
+ - EXAMPLES.md
14
+ - SKILL.md
15
+ - TROUBLESHOOTING.md
16
+ - VALIDATION.json
17
+ - packs.yaml
18
+ - references/context-rules.md
19
+ - references/pipeline.md
20
+ - references/project-graph.md
21
+ - rules.yaml
@@ -2,6 +2,7 @@ name: database
2
2
  description: Database architecture, schema design, Prisma, Drizzle ORM, indexing strategies, migrations, and N+1 query resolution.
3
3
  version: 1.0.0
4
4
  category: backend
5
+ type: instruction-only
5
6
  requires:
6
7
  - system-design
7
8
  - typescript
@@ -23,3 +24,8 @@ triggers:
23
24
  - "index"
24
25
  - "transaction"
25
26
  - "orm"
27
+ resources:
28
+ - EXAMPLES.md
29
+ - SKILL.md
30
+ - TROUBLESHOOTING.md
31
+ - VALIDATION.json
@@ -1,6 +1,7 @@
1
1
  id: ddd
2
2
  name: Domain-Driven Design
3
3
  category: architecture
4
+ type: instruction-only
4
5
  tags: [architecture, ddd, domain, bounded-context, aggregate]
5
6
  requires: []
6
7
  optional: [microservices, system-design]
@@ -8,3 +9,9 @@ conflicts: []
8
9
  weight: 6
9
10
  documents:
10
11
  - ddd.md
12
+ resources:
13
+ - EXAMPLES.md
14
+ - SKILL.md
15
+ - TROUBLESHOOTING.md
16
+ - VALIDATION.json
17
+ - ddd.md
@@ -1,4 +1,5 @@
1
1
  name: decisions
2
+ type: instruction-only
2
3
  description: >
3
4
  Architecture Decision Records (ADR) management. Creates, tracks, and queries
4
5
  architectural decisions so AI assistants understand why choices were made.
@@ -8,3 +9,8 @@ tags:
8
9
  - decisions
9
10
  - documentation
10
11
  version: 1.0.0
12
+ resources:
13
+ - EXAMPLES.md
14
+ - SKILL.md
15
+ - TROUBLESHOOTING.md
16
+ - VALIDATION.json
@@ -2,6 +2,7 @@ name: docker
2
2
  description: Docker containerization, multi-stage builds, non-root security, layer caching optimization, and docker-compose standards.
3
3
  version: 1.0.0
4
4
  category: devops
5
+ type: instruction-only
5
6
  requires:
6
7
  - security
7
8
  triggers:
@@ -21,3 +22,8 @@ triggers:
21
22
  - "image"
22
23
  - "kubernetes"
23
24
  - "k8s"
25
+ resources:
26
+ - EXAMPLES.md
27
+ - SKILL.md
28
+ - TROUBLESHOOTING.md
29
+ - VALIDATION.json
@@ -41,7 +41,7 @@ Inspired by [addyosmani/agent-skills](https://github.com/addyosmani/agent-skills
41
41
  ```
42
42
 
43
43
  **IRON RULE**: In interactive development, no phase can be skipped and no code is written before `/plan` is approved.
44
- **Direct Build Exception**: When the prompt/caller explicitly requests a standalone implementation, or declares `[PHASE: Build]`, execute the BUILD phase directly and deliver the complete, self-contained production code without conversational pauses.
44
+ **Direct Build & Fast-Track Exception**: When the prompt/caller explicitly requests a standalone implementation, declares `[PHASE: Build]`, or requests routine operational/maintenance tasks (git operations, version bumps, typo fixes, small config tweaks, diagnostic checks), proceed directly to execution without conversational approval pauses.
45
45
 
46
46
  ---
47
47
 
@@ -1,4 +1,5 @@
1
1
  name: engineering-workflow
2
+ type: instruction-only
2
3
  description: >
3
4
  Senior engineering workflow skill inspired by Addy Osmani's agent-skills.
4
5
  Enforces the full development lifecycle: spec → plan → build → test → review → ship.
@@ -11,3 +12,8 @@ tags:
11
12
  - review
12
13
  version: 1.0.0
13
14
  source: https://github.com/addyosmani/agent-skills
15
+ resources:
16
+ - EXAMPLES.md
17
+ - SKILL.md
18
+ - TROUBLESHOOTING.md
19
+ - VALIDATION.json
@@ -1,6 +1,7 @@
1
1
  id: fastapi
2
2
  name: FastAPI
3
3
  category: backend
4
+ type: instruction-only
4
5
  tags: [backend, python, api, async, pydantic]
5
6
  requires: []
6
7
  optional: [postgres, redis, docker]
@@ -8,3 +9,9 @@ conflicts: [nestjs, express]
8
9
  weight: 8
9
10
  documents:
10
11
  - fastapi.md
12
+ resources:
13
+ - EXAMPLES.md
14
+ - SKILL.md
15
+ - TROUBLESHOOTING.md
16
+ - VALIDATION.json
17
+ - fastapi.md
@@ -90,6 +90,10 @@ Activate whenever:
90
90
  - State what was inspected or verified from the code.
91
91
  - State the architectural decision made and the immediate next action.
92
92
  - Keep narration crisp and actionable without excessive verbosity.
93
+ - **Zero-Spam Constraint**:
94
+ - ❌ **Forbidden**: Starting every intermediate step, tool call, or status update with domain/phase/role tags (e.g. `[DOMAIN: ...] [PHASE: ...] [ROLE: ...]`).
95
+ - ✅ **Mandatory**: Declare role and phase strictly once at the start of a phase. Intermediate step updates must be clean, natural language sentences describing technical actions directly.
96
+ - Do not narrate routine micro-inspections (single line reads or basic greps). Announce only meaningful task phases and decisions.
93
97
 
94
98
  ---
95
99
 
@@ -1,4 +1,5 @@
1
1
  name: gemini-precision
2
+ type: instruction-only
2
3
  description: 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.
3
4
  tags:
4
5
  - gemini
@@ -7,3 +8,6 @@ tags:
7
8
  - workflow
8
9
  - antigravity
9
10
  version: 1.0.0
11
+ resources:
12
+ - SKILL.md
13
+ - VALIDATION.json
@@ -1,4 +1,5 @@
1
1
  name: generators
2
+ type: compiler
2
3
  description: >
3
4
  Generates complete project documentation (PRD, Architecture, Database, API, UI,
4
5
  Roadmap, Tasks) from ideas and templates with incremental update support.
@@ -8,3 +9,17 @@ tags:
8
9
  - architecture
9
10
  - templates
10
11
  version: 1.0.0
12
+ resources:
13
+ - EXAMPLES.md
14
+ - SKILL.md
15
+ - TROUBLESHOOTING.md
16
+ - VALIDATION.json
17
+ - templates/API.md
18
+ - templates/ARCHITECTURE.md
19
+ - templates/DATABASE.md
20
+ - templates/DECISION.md
21
+ - templates/PRD.md
22
+ - templates/PROJECT_GRAPH.md
23
+ - templates/ROADMAP.md
24
+ - templates/TASKS.md
25
+ - templates/UI.md
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: graphify
3
3
  description: >
4
- Transforms entire codebases into structured knowledge graphs via Tree-sitter AST parsing.
4
+ Codebase knowledge graph generator and architecture mapping guide.
5
5
  Eliminates context window burn, enables precise dependency mapping, and identifies architectural god nodes.
6
6
  ---
7
7
 
@@ -9,7 +9,7 @@ description: >
9
9
 
10
10
  ## Overview
11
11
 
12
- **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`).
12
+ **Graphify** is an instruction-only codebase mapping and context optimization guide. Instead of feeding raw directory trees or entire source files into an agent's context window, Graphify instructs agents on how to construct a deterministic, queryable knowledge graph (`graph.json`, `GRAPH_REPORT.md`, `graph.html`) using external companion analyzers (such as the TypeScript AST analyzer in `contextos-mcp` or the external `graphifyy` CLI), keeping the core package 100% zero-dependency without bundled native Tree-sitter binaries.
13
13
 
14
14
  This skill instructs agents how to build, query, and maintain codebase graphs to navigate complex architectures with near-zero token overhead.
15
15
 
@@ -1,5 +1,6 @@
1
1
  name: graphify
2
- description: Codebase knowledge graph generator via Tree-sitter AST parsing and semantic indexing. Minimizes token consumption and maps dependency blast radius.
2
+ type: instruction-only
3
+ description: Codebase knowledge graph generator and architecture mapping guide. Instructs agents on AST dependency extraction and blast radius analysis.
3
4
  tags:
4
5
  - knowledge-graph
5
6
  - ast
@@ -11,3 +12,7 @@ version: 1.0.0
11
12
  optional:
12
13
  - context-manager
13
14
  - system-design
15
+ resources:
16
+ - EXAMPLES.md
17
+ - SKILL.md
18
+ - VALIDATION.json
@@ -25,12 +25,14 @@ Inspired by [Garry Tan's gstack](https://github.com/garrytan/gstack) — shippin
25
25
 
26
26
  ## Role Identification Protocol
27
27
 
28
- At the start of each task, declare your role:
28
+ At the start of each task or major phase switch, declare your role:
29
29
 
30
30
  ```
31
31
  [ROLE: <Role Name>] — <One-line description of your mandate for this task>
32
32
  ```
33
33
 
34
+ > **Anti-Spam Invariant**: Declare this role **strictly once per phase**. Never prefix intermediate tool calls, file operations, or step updates with role tags.
35
+
34
36
  Then execute ONLY within the constraints of that role.
35
37
 
36
38
  ---
@@ -1,4 +1,5 @@
1
1
  name: gstack-roles
2
+ type: instruction-only
2
3
  description: >
3
4
  Role-based AI specialist system inspired by Garry Tan's gstack.
4
5
  Defines 23 specialist roles (CEO, Eng Manager, Designer, QA, Security etc.)
@@ -10,3 +11,8 @@ tags:
10
11
  - planning
11
12
  version: 1.0.0
12
13
  source: https://github.com/garrytan/gstack
14
+ resources:
15
+ - EXAMPLES.md
16
+ - SKILL.md
17
+ - TROUBLESHOOTING.md
18
+ - VALIDATION.json
@@ -1,4 +1,5 @@
1
1
  name: impeccable-design
2
+ type: instruction-only
2
3
  description: >
3
4
  Visual design quality skill based on pbakaus/impeccable.
4
5
  46 deterministic anti-pattern rules that prevent AI design slop.
@@ -12,3 +13,8 @@ tags:
12
13
  - anti-patterns
13
14
  version: 1.0.0
14
15
  source: https://github.com/pbakaus/impeccable
16
+ resources:
17
+ - EXAMPLES.md
18
+ - SKILL.md
19
+ - TROUBLESHOOTING.md
20
+ - VALIDATION.json