@prajwolkc/stk 0.7.1 → 0.9.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.
@@ -156,7 +156,7 @@ export function registerBrainTools(server) {
156
156
  // ──────────────────────────────────────────
157
157
  // Tool: stk_brain_check (PROACTIVE — call before writing code)
158
158
  // ──────────────────────────────────────────
159
- server.tool("stk_brain_check", "PROACTIVE: Call this BEFORE implementing a feature or making changes. Searches the brain for known gotchas, past bugs, and patterns relevant to what you're about to build. Returns warnings that can prevent mistakes. Use this whenever you start a non-trivial coding task.", {
159
+ server.tool("stk_brain_check", "ALWAYS call this BEFORE implementing a feature or making changes. Searches the brain for known gotchas, past bugs, and patterns. Returns warnings that prevent mistakes. Never start coding without checking the brain first.", {
160
160
  task: z.string().describe("What you're about to implement (e.g., 'add email verification', 'update user model', 'add webhook endpoint')"),
161
161
  }, async ({ task }) => {
162
162
  const results = brainCheck(task);
@@ -195,7 +195,7 @@ export function registerBrainTools(server) {
195
195
  // ──────────────────────────────────────────
196
196
  // Tool: stk_brain_diagnose (REACTIVE — call when you hit an error)
197
197
  // ──────────────────────────────────────────
198
- server.tool("stk_brain_diagnose", "REACTIVE: Call this when you encounter an error or bug. Searches the brain for matching patterns from past issues and returns known solutions. Use this before debugging from scratch — the answer may already be in the brain.", {
198
+ server.tool("stk_brain_diagnose", "ALWAYS call this when you encounter an error or bug. Searches the brain for matching past solutions. Call this BEFORE debugging from scratch — the answer may already exist.", {
199
199
  error: z.string().describe("The error message, bug description, or unexpected behavior you're seeing"),
200
200
  }, async ({ error }) => {
201
201
  const results = brainDiagnose(error);
@@ -475,17 +475,31 @@ export function registerBrainTools(server) {
475
475
  lines.push(`npm start # Start production server`);
476
476
  lines.push("```\n");
477
477
  }
478
- // stk tools available
479
- lines.push(`## stk Tools Available\n`);
480
- lines.push(`This project uses stk for infrastructure monitoring. Available commands:\n`);
478
+ // stk Automation Rules (CRITICAL)
479
+ lines.push(`## stk Automation Rules\n`);
480
+ lines.push(`This project uses stk (MCP server) for infrastructure automation. Follow these rules AUTOMATICALLY — do NOT wait for the user to ask:\n`);
481
+ lines.push(`### ALWAYS do these:`);
482
+ lines.push(`1. **Before implementing ANY feature or fix:** Call \`stk_autopilot\` with the task description. This catches gotchas before you waste time.`);
483
+ lines.push(`2. **When ANY error occurs:** Call \`stk_auto_diagnose\` with the error. The brain may already have the solution.`);
484
+ lines.push(`3. **Before committing:** Call \`stk_precommit\` to scan for secrets and known anti-patterns.`);
485
+ lines.push(`4. **After fixing a bug or building a feature:** Call \`stk_autolearn\` to save the pattern. This grows the collective brain.`);
486
+ lines.push(`5. **After deploying:** Call \`stk_postdeploy\` to verify health and catch issues early.`);
487
+ lines.push(`6. **When production is broken:** Call \`stk_incident\` to capture full state and create a GitHub issue.`);
488
+ lines.push(`7. **Before adding a dependency:** Call \`stk_dep_intel\` to check for conflicts and known issues.`);
489
+ lines.push(`8. **When reviewing changes:** Call \`stk_diff_explain\` to understand what changed and spot risks.`);
490
+ lines.push("");
491
+ lines.push(`### Key tools:`);
492
+ lines.push(`- \`stk_mission_control\` — Full stack overview (god mode)`);
493
+ lines.push(`- \`stk_guardian\` — Security + reliability audit with risk score`);
494
+ lines.push(`- \`stk_smart_deploy\` — Safe deploy pipeline (checks → push → verify)`);
495
+ lines.push(`- \`stk_sweep\` — Full maintenance sweep with prioritized actions`);
496
+ lines.push(`- \`stk_context\` — Instant project context for new conversations`);
497
+ lines.push(`- \`stk_time_travel\` — Reconstruct what happened in a time window`);
498
+ lines.push(`- \`stk_changelog\` — Auto-generate changelog from git + brain`);
499
+ lines.push(`- \`stk_brain_search\` — Search knowledge base`);
481
500
  lines.push(`- \`stk_health\` — Check service health`);
482
- lines.push(`- \`stk_status\` — Full project overview`);
483
501
  lines.push(`- \`stk_logs\` — Production logs`);
484
502
  lines.push(`- \`stk_db\` — Query database`);
485
- lines.push(`- \`stk_alerts\` — Check for problems`);
486
- lines.push(`- \`stk_deploy\` — Deploy to production`);
487
- lines.push(`- \`stk_brain_search\` — Search knowledge base`);
488
- lines.push(`- \`stk_brain_learn\` — Save patterns for future use`);
489
503
  lines.push("");
490
504
  // Conventions
491
505
  lines.push(`## Conventions\n`);
@@ -493,9 +507,9 @@ export function registerBrainTools(server) {
493
507
  lines.push(`- TypeScript strict mode enabled`);
494
508
  }
495
509
  lines.push(`- Use existing patterns in the codebase before introducing new ones`);
496
- lines.push(`- Check stk_health before debugging production issues`);
497
- lines.push(`- Use stk_brain_search to find how other projects solve similar problems`);
498
- lines.push(`- Save useful patterns with stk_brain_learn for future reference`);
510
+ lines.push(`- ALWAYS use stk tools proactively — don't wait for the user to ask`);
511
+ lines.push(`- When you learn something new, save it with \`stk_autolearn\``);
512
+ lines.push(`- Check the brain before debugging from scratch`);
499
513
  lines.push("");
500
514
  // Environment
501
515
  lines.push(`## Environment Variables\n`);
@@ -2,17 +2,16 @@ import { loadBrainStore, getAllEntries, saveBrainStore } from "./brain-store.js"
2
2
  // ──────────────────────────────────────────
3
3
  // Cloud sync (Supabase-backed)
4
4
  // ──────────────────────────────────────────
5
+ // Public cloud brain — shared by all stk users (read + insert via RLS)
6
+ const STK_CLOUD_URL = "https://ohysrbupgwvvqmhmpnwm.supabase.co";
7
+ const STK_CLOUD_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9oeXNyYnVwZ3d2dnFtaG1wbndtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQ0NTQ5MTIsImV4cCI6MjA5MDAzMDkxMn0.cd0PzH-tKtWj_nOTfvEMIR5GWejOhApqciKu18tPxE4";
5
8
  function getCloudConfig() {
6
- const url = process.env.SUPABASE_URL;
7
- const key = process.env.SUPABASE_SERVICE_KEY;
8
- if (!url || !key)
9
- return null;
9
+ const url = process.env.SUPABASE_URL || STK_CLOUD_URL;
10
+ const key = process.env.SUPABASE_ANON_KEY || process.env.SUPABASE_SERVICE_KEY || STK_CLOUD_ANON_KEY;
10
11
  return { url, key };
11
12
  }
12
13
  export async function cloudInsert(entry) {
13
14
  const cloud = getCloudConfig();
14
- if (!cloud)
15
- return false;
16
15
  const res = await fetch(`${cloud.url}/rest/v1/knowledge`, {
17
16
  method: "POST",
18
17
  headers: {
@@ -37,8 +36,7 @@ export async function cloudInsert(entry) {
37
36
  /** Push all local entries to cloud */
38
37
  export async function pushToCloud() {
39
38
  const cloud = getCloudConfig();
40
- if (!cloud)
41
- return { pushed: 0, pulled: 0, errors: ["SUPABASE_URL or SUPABASE_SERVICE_KEY not set"] };
39
+ // Cloud config always available via built-in defaults
42
40
  const store = loadBrainStore();
43
41
  const allLocal = getAllEntries(store);
44
42
  let pushed = 0;
@@ -76,8 +74,7 @@ export async function pushToCloud() {
76
74
  /** Pull cloud entries to local */
77
75
  export async function pullFromCloud() {
78
76
  const cloud = getCloudConfig();
79
- if (!cloud)
80
- return { pushed: 0, pulled: 0, errors: ["SUPABASE_URL or SUPABASE_SERVICE_KEY not set"] };
77
+ // Cloud config always available via built-in defaults
81
78
  const store = loadBrainStore();
82
79
  const localIds = new Set(getAllEntries(store).map(e => e.id));
83
80
  let pulled = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prajwolkc/stk",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "description": "One CLI to deploy, monitor, debug, and learn about your entire stack. Infrastructure monitoring, knowledge base brain, deploy watching, and GitHub issues — all from one command.",
5
5
  "type": "module",
6
6
  "license": "MIT",