.cursor/skills/rulecoder-workflow/SKILL.md
Oracle-first development workflow for the Rulecoder MCP server. Use when the AI-prolog-rulecoder MCP is registered, when working with .rulecoder/ fact files, when the user mentions state machines, invariants, sm_ tools, or architectural modeling. Enforces privacy guardrails, tool usage order, and regression detection.
npx skillsauth add davidcarma/MarkdownViewer-web-pro rulecoder-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
transition(auth_flow, idle, active)).sm_suggest_facts analyzes source locally in your context window. Only .pl fact proposals reach the server.Follow this order every session. Do not skip steps.
.rulecoder/ on connect. Confirm with sm_health.sm_diagram to visualise the current topology (show it to the user), then sm_simulate_execution to enumerate reachable paths, then sm_diff to capture current finding state..rulecoder/*.pl facts BEFORE writing implementation.sm_predicate_guidance before using any predicate. Never guess names or arities.sm_add_facts (batch) / sm_remove_fact / sm_init_machine. Do not hand-edit .pl files.sm_diff once. NEW unacknowledged findings = regression. Do not claim done.sm_baseline snapshots findings as known-good.sm_expect with ticket and expiry.Before making ANY fact changes:
sm_diagram — visualise the current topology. Show the diagram to the user.sm_simulate_execution — enumerate all reachable paths at current depth.sm_propose_transition (for state/transition changes).sm_add_facts call (not repeated sm_add_fact).sm_diff ONCE at the end. NEW findings = regression. Stop and reassess.Never do this:
sm_add_fact → sm_check_invariants → sm_remove_fact → sm_add_fact → repeat.
This is reactive guessing. It wastes tokens, converges slowly, and produces noisy audit logs.| Tool | When to use |
|------|-------------|
| sm_health | Start of session — verify server and loaded files |
| sm_diagram | Visualise a machine as a Mermaid stateDiagram — call before any mutation, show to user |
| sm_simulate_execution | Enumerate all reachable paths — use to plan changes, not just debug |
| sm_audit | Check encoding coverage — what's modeled, what's missing |
| sm_report | Full colorized findings report (RED/ORANGE/PURPLE/GREEN). Use format=diagram for Mermaid output |
| sm_check_invariants | Raw finding list for all invariant checks |
| sm_diff | Before and after every change — detect regressions |
| sm_baseline | Snapshot current findings as known-good |
| sm_export_metrics | Lean delta vs baseline (new + resolved only by default) |
| sm_predicate_guidance | Before using any predicate — find the right one |
| sm_add_fact / sm_add_facts | Add validated facts to .pl files. Prefer sm_add_facts (batch) |
| sm_remove_fact | Remove a fact (auto re-runs invariants) |
| sm_init_machine | Scaffold a new state machine |
| sm_propose_transition | Dry-run impact of a proposed change |
| sm_suggest_facts | Analyze source in context, get fact proposals |
| sm_batch_check | Run invariant checks for multiple machines in one call |
| sm_load_plugin | Load session-scoped custom Prolog rules |
| sm_expect | Suppress a known finding with ticket + expiry |
| sm_query | Ad-hoc Prolog query for debugging |
sm_predicate_guidance or sm_list_predicates first.knowledge/invariants.pl. Use sm_suggest_invariant to propose new rules.X, _) or placeholders (TODO) are blocked..rulecoder/*.pl — project-specific, contain no source code, describe structure only.development
Deploy MarkdownViewer-web-pro to production on GitHub Pages (markdownpro.eyesondash.com). Use when the user says /remotedeploy, asks to deploy, push to production, or publish changes.
development
Serve MarkdownViewer-web-pro locally for testing. Use when the user says /localdeploy, asks to test locally, run a local server, or preview before pushing.
tools
Use the GCP MCP server to call any Google Cloud REST API (Resource Manager, Vertex AI, Compute, Storage, IAM, etc.) via convenience tools or the generic gcp_request. Use when the user asks about Google Cloud Console, GCP projects, Vertex AI, or wants to inspect or change GCP resources without opening the browser.
devops
Generic GitHub Pages deployment workflow. Use when the user says /deploy, asks to deploy, push to production, or publish changes.