### Install Quint Code Binary Source: https://github.com/m0n0x41d/quint-code/blob/main/README.md Installs the Quint Code binary using a curl script. This is the quickest way to get started with the tool. ```bash curl -fsSL https://raw.githubusercontent.com/m0n0x41d/quint-code/main/install.sh | bash ``` -------------------------------- ### Install and Initialize Quint Code Source: https://context7.com/m0n0x41d/quint-code/llms.txt Installs Quint Code using a curl script or by building from source. Initializes the project with a .quint/ directory structure and MCP server configuration. Supports platform-specific initialization for Claude Code, Cursor, and Gemini CLI. ```bash # Install via curl curl -fsSL https://raw.githubusercontent.com/m0n0x41d/quint-code/main/install.sh | bash # Or build from source git clone https://github.com/m0n0x41d/quint-code.git cd quint-code/src/mcp go build -o quint-code . sudo mv quint-code /usr/local/bin/ # Initialize in your project cd /path/to/your/project quint-code init # Initialize with platform-specific options quint-code init --claude # Default: Claude Code quint-code init --cursor # Cursor quint-code init --gemini # Gemini CLI quint-code init --all # All platforms quint-code init --local # Project-local commands instead of global # Created structure: # .quint/ # ├── knowledge/ # │ ├── L0/ # Unverified hypotheses # │ ├── L1/ # Logically verified # │ ├── L2/ # Empirically validated # │ └── invalid/ # Disproved claims # ├── evidence/ # Test results, research # ├── decisions/ # Design Rationale Records # ├── context.md # Bounded context # └── quint.db # SQLite database ``` -------------------------------- ### Quint Check Decay Command Examples Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q-decay.md Provides examples of using the `quint_check_decay` tool for various maintenance and review tasks within the Quint Code project. ```bash # See what's stale /q-decay ``` ```bash # Check for stale decisions before release /q-decay ``` ```bash # See what's affected after a major change /q-decay ``` -------------------------------- ### Declare Dependencies with Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q1-hypothesize.md This example shows how to declare dependencies for a proposed system using `quint_propose`. The `depends_on` field lists required components, and the `dependency_cl` parameter can specify the dependency level. Relations are also established. ```quint # Hypothesis that depends on existing holons [quint_propose( title="API Gateway with Auth", kind="system", depends_on=["auth-module", "rate-limiter"], dependency_cl=3 )] → Created: api-gateway-with-auth → Relations: auth-module --componentOf--> api-gateway-with-auth rate-limiter --componentOf--> api-gateway-with-auth # Now WLNK applies: # api-gateway-with-auth.R_eff ≤ min(auth-module.R_eff, rate-limiter.R_eff) ``` -------------------------------- ### Quint Code Slash Commands Reference Source: https://context7.com/m0n0x41d/quint-code/llms.txt This section outlines the available slash commands for interacting with Quint Code tools, categorized into main reasoning cycle commands and utility commands. It also provides an example of a full workflow, demonstrating the sequence of commands for a typical decision-making process. ```bash # Main Cycle (numbered for sequence) /q0-init # Phase 0: Initialize context /q1-hypothesize # Phase 1: Generate hypotheses (Abduction) /q1-add # Phase 1: Manually add hypothesis /q2-verify # Phase 2: Verify logic (Deduction) /q3-validate # Phase 3: Gather evidence (Induction) /q4-audit # Phase 4: Audit trust scores /q5-decide # Phase 5: Finalize decision # Utility Commands /q-status # Show current phase and counts /q-query # Search knowledge base /q-decay # Check evidence freshness /q-actualize # Reconcile with code changes /q-reset # Discard current cycle # Example full workflow /q0-init # AI scans project, calls quint_init and quint_record_context /q1-hypothesize "How should we implement user authentication?" # AI generates 3-5 hypotheses, calls quint_propose for each /q2-verify # AI checks each L0 hypothesis, calls quint_verify with PASS/FAIL/REFINE /q3-validate # AI runs tests or research, calls quint_test for each L1 hypothesis /q4-audit # AI calculates R_eff via quint_calculate_r, shows comparison /q5-decide # User selects winner, AI calls quint_decide to create DRR ``` -------------------------------- ### Waive Evidence Example Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q-decay.md Illustrates how to temporarily waive evidence that is stale, accepting the risk until a specified date. This action is recorded with a rationale and audit trail. ```text User: We're launching Tuesday. Waive the security audit until the 15th, we have a re-audit scheduled for the 20th. Agent: Waiver recorded: - Evidence: ev-security-audit-2024-03 - Waived until: 2025-01-15 - Rationale: Launch deadline. Re-audit scheduled for the 20th. ⚠️ This evidence returns to EXPIRED status after 2025-01-15. ``` -------------------------------- ### Quint Code CLI Commands Source: https://github.com/m0n0x41d/quint-code/blob/main/README.md A list of essential Quint Code commands for initiating and managing a reasoning cycle. These commands guide the AI through hypothesis generation, verification, validation, and decision-making. ```bash /q0-init # Initialize knowledge base /q1-hypothesize "Your problem..." # Generate hypotheses ``` -------------------------------- ### Add Concerns to CI/CD Strategy Hypothesis with Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/docs/workflow_example/cicd-strategy.md Allows for the refinement of the CI/CD strategy by adding specific concerns or sub-hypotheses to the existing AI-generated options. This is useful for exploring trade-offs, such as blast radius in a Docker Swarm setup. ```bash $ /q1-add "concerned about blast radius — all services on one Swarm node?" ``` -------------------------------- ### Initialize a Quint Code Project Source: https://github.com/m0n0x41d/quint-code/blob/main/README.md Initializes a new Quint Code project in the current directory. This command sets up the necessary configuration files and directories for Quint Code to operate. ```bash cd /path/to/your/project quint-code init ``` -------------------------------- ### Get Quint Status (MCP Tool Call) Source: https://context7.com/m0n0x41d/quint-code/llms.txt Retrieves the current FPF phase and session state of the Quint reasoning cycle. ```APIDOC ## POST /tools/call (MCP Tool Call) ### Description Returns the current FPF phase and session state. This is useful for understanding the progress within the reasoning cycle. ### Method POST ### Endpoint /tools/call ### Parameters #### Request Body - **jsonrpc** (string) - Required - Specifies the JSON-RPC version, should be "2.0". - **method** (string) - Required - The method to call, should be "tools/call". - **params** (object) - Required - Parameters for the tool call. - **name** (string) - Required - The name of the tool to call, should be "quint_status". - **arguments** (object) - Required - Arguments for the `quint_status` tool. This object should be empty. - **id** (integer) - Required - A unique identifier for the request. ### Request Example ```json { "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "quint_status", "arguments": {} }, "id": 17 } ``` ### Response #### Success Response (200) - **result** (object) - Contains the result of the tool call. - **content** (array) - An array of content objects. - **type** (string) - The type of content, e.g., "text". - **text** (string) - The current phase of the FPF cycle (e.g., "INDUCTION"). #### Response Example ```json { "result": { "content": [{"type": "text", "text": "INDUCTION"}] } } ``` ### Phases `IDLE -> ABDUCTION (q1) -> DEDUCTION (q2) -> INDUCTION (q3) -> DECISION (q4/q5) -> IDLE` ``` -------------------------------- ### Deprecate Decision Example Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q-decay.md Demonstrates how to deprecate a decision, moving it down a level and initiating a re-evaluation process. This action is logged in the audit trail. ```text User: AWS announced they're deprecating this service. Deprecate our decision to use it. Agent: Deprecated: hypothesis-aws-service L2 → L1 This decision now requires re-evaluation. Next step: Run /q1-hypothesize to explore alternatives. ``` -------------------------------- ### Build Quint Code from Source Source: https://github.com/m0n0x41d/quint-code/blob/main/README.md Builds the Quint Code binary from its source code using Go. This method is useful for developers who want to modify or contribute to the project. ```bash git clone https://github.com/m0n0x41d/quint-code.git cd quint-code/src/mcp go build -o quint-code . sudo mv quint-code /usr/local/bin/ ``` -------------------------------- ### Propose Competing Alternatives with Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q1-hypothesize.md This snippet demonstrates how to use `quint_propose` to establish a decision context and then propose multiple alternatives grouped under that context. It's useful for exploring different options for a given problem. ```quint # First, create the decision context [quint_propose(title="Caching Strategy Decision", kind="episteme", ...)] → Created: caching-strategy-decision # Then, propose alternatives grouped under it [quint_propose( title="Use Redis", kind="system", decision_context="caching-strategy-decision" )] → Created: use-redis (MemberOf caching-strategy-decision) [quint_propose( title="Use CDN Edge Cache", kind="system", decision_context="caching-strategy-decision" )] → Created: use-cdn-edge-cache (MemberOf caching-strategy-decision) ``` -------------------------------- ### Query CI/CD Architecture Decision with Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/docs/workflow_example/cicd-strategy.md Allows querying Quint for specific decisions, such as the CI/CD architecture. This provides a summary of the decision, key evidence, and conditions under which the decision should be revisited. ```bash $ /q-query "CICD architecture decision" ``` -------------------------------- ### Blocked quint_test Call (Hypothesis Not Found) Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q3-validate.md Example of a `quint_test` call being blocked because the specified hypothesis ID was not found in L1 or L2. This indicates the hypothesis may have been skipped in Phase 2 or already promoted. ```shell quint_test(hypothesis_id="command-prompts-as-contracts", test_type="internal", verdict="PASS", result="Research complete") → BLOCKED: "hypothesis not found in L1" ``` -------------------------------- ### Hypothesize CI/CD Strategy with Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/docs/workflow_example/cicd-strategy.md Initiates the CI/CD strategy selection process by asking Quint to generate competing approaches based on defined requirements. This step involves specifying constraints like 'no k8s', 'cost-effective', and 'idempotent'. ```bash $ /q1-hypothesize "CICD strategy for new service - no k8s, cost-effective, idempotent" ``` -------------------------------- ### Verify CI/CD Strategy Constraints with Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/docs/workflow_example/cicd-strategy.md Uses Quint to verify the feasibility of generated CI/CD approaches against specific constraints. This step filters out options that do not meet requirements such as idempotency, cost, or specific technology dependencies. ```bash $ /q2-verify ``` -------------------------------- ### Get Current FPF Phase and Session State with quint_status Source: https://context7.com/m0n0x41d/quint-code/llms.txt The `quint_status` tool retrieves the current FPF phase and session state, which is useful for understanding the progress within the reasoning cycle. It can be called via a slash command or as an MCP tool call with empty arguments. The response indicates the current phase, such as 'INDUCTION'. ```bash # Via slash command /q-status ``` ```json # MCP tool call { "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "quint_status", "arguments": {} }, "id": 17 } ``` -------------------------------- ### Initialize Quint Project Structure Source: https://context7.com/m0n0x41d/quint-code/llms.txt Initializes the First Principles Framework (FPF) project structure by creating the .quint/ directory hierarchy and the SQLite database. This command must be executed before any other FPF operations. ```bash # Via slash command in AI assistant /q0-init ``` ```json { "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "quint_init", "arguments": {} }, "id": 1 } ``` ```json { "jsonrpc": "2.0", "result": { "content": [{"type": "text", "text": "Initialized. Phase: ABDUCTION"}] }, "id": 1 } ``` -------------------------------- ### Explicit command-line waiving of evidence Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q-decay.md Demonstrates the explicit command-line syntax for waiving evidence using the q-decay tool. This method requires specifying the evidence ID, the waiver end date, and the rationale directly as arguments. It offers a more structured alternative to natural language interaction. ```bash /q-decay --waive ev-benchmark-2024-06-15 --until 2025-02-01 --rationale "Migration pending" ``` -------------------------------- ### Decide on CI/CD Strategy with Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/docs/workflow_example/cicd-strategy.md Finalizes the CI/CD strategy decision using Quint's output. This step involves outlining the chosen architecture, including staging and production environments, registry, and CI tools, along with the rationale behind the decision. ```bash $ /q5-decide ``` -------------------------------- ### Success Path for Quint Propose Calls Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q1-hypothesize.md Illustrates a successful execution flow where multiple `quint_propose` calls are made, each resulting in a 'Success' status and creating new hypotheses. This indicates that the decision-making process is proceeding as expected. ```quint User: "How should we handle caching?" [Call quint_propose(title="Use Redis", kind="system", ...)] → Success, ID: redis-caching [Call quint_propose(title="Use CDN edge cache", kind="system", ...)] → Success, ID: cdn-edge [Call quint_propose(title="In-memory LRU", kind="system", ...)] → Success, ID: lru-cache Result: 3 L0 hypotheses created, ready for Phase 2. ``` -------------------------------- ### Validate CI/CD Strategy with Evidence using Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/docs/workflow_example/cicd-strategy.md Employs Quint to research and gather evidence for validating the proposed CI/CD strategies. This involves collecting data from documentation, pricing pages, and community discussions to assess effectiveness and reliability. ```bash $ /q3-validate ``` -------------------------------- ### Visualize Assurance Tree Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q-query.md Visualizes the assurance tree for a given holon, showing its dependencies and their respective R-scores and CL levels. This helps in understanding the structure of assurance. ```bash # Tool: quint_audit_tree # Description: Visualizes the assurance tree. # Arguments: # - holon_id: The root holon to audit. # Returns: # - ASCII tree with R-scores, CL levels, and penalty warnings. ``` -------------------------------- ### Search Knowledge Base and Display Holon Details Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q-query.md Searches the `.quint/knowledge` and `.quint/decisions` directories based on a user query. For each found holon, it displays basic information, R_eff (if layer >= L1) by calling `quint_calculate_r`, and dependency graphs (if dependencies exist) by calling `quint_audit_tree`. Results are presented in a table format. ```shell # Example: Search by keyword /q-query caching # Example: Query specific holon /q-query redis-caching # Example: Query decisions /q-query DRR ``` -------------------------------- ### Audit CI/CD Strategy Decision with Quint Source: https://github.com/m0n0x41d/quint-code/blob/main/docs/workflow_example/cicd-strategy.md Conducts an audit of the CI/CD strategy decision-making process using Quint. This includes checking for biases, calculating trust scores based on evidence, and performing cost analysis to arrive at a final recommendation. ```bash $ /q4-audit ``` -------------------------------- ### Hypothesis Generation (Abduction) Source: https://github.com/m0n0x41d/quint-code/blob/main/src/mcp/cmd/commands/q1-hypothesize.md This endpoint allows for the generation of new hypotheses using the `quint_propose` tool. It requires detailed information about the hypothesis, its scope, kind, and rationale. Optional parameters allow for dependency modeling. ```APIDOC ## POST /quint/propose ### Description Generates and formalizes a new hypothesis (L0 holon) using the `quint_propose` tool. This is the core of the Abduction phase, creating queryable and auditable knowledge. ### Method POST ### Endpoint /quint/propose ### Parameters #### Request Body - **title** (string) - Required - A short, descriptive name for the hypothesis (e.g., "Use Redis for Caching"). - **content** (string) - Required - The Method or Recipe detailing how the hypothesis works. - **scope** (string) - Required - The Claim Scope (G), defining where the hypothesis applies (e.g., "High-load systems, Linux only, requires 1GB RAM."). - **kind** (string) - Required - The type of hypothesis: "system" (for code/architecture) or "episteme" (for process/docs). - **rationale** (JSON string) - Required - Explains the "Why" behind the hypothesis. Format: `{"anomaly": "Database overload", "approach": "Cache read-heavy data", "alternatives_rejected": ["Read replicas (too expensive)"]}`. - **decision_context** (string) - Optional - The ID of a parent decision or problem holon. Used to group related alternatives. - **depends_on** (array of strings) - Optional - An array of holon IDs that this hypothesis depends on. Creates `ComponentOf` or `ConstituentOf` relations. - **dependency_cl** (integer) - Optional - Congruence level for dependencies (1-3, default: 3). Affects R_eff calculation. ### Request Example ```json { "title": "Implement JWT Authentication", "content": "Replace session-based authentication with JSON Web Tokens for stateless authentication.", "scope": "All user-facing APIs, stateless environments.", "kind": "system", "rationale": "{\"anomaly\": \"Scalability issues with session state management\", \"approach\": \"Stateless JWT authentication\", \"alternatives_rejected\": [\"Sticky sessions (limits scalability)\"]}", "decision_context": "auth-strategy-decision", "depends_on": ["crypto-library"], "dependency_cl": 2 } ``` ### Response #### Success Response (200) - **holon_id** (string) - The unique identifier of the newly created hypothesis. - **message** (string) - Confirmation message. #### Response Example ```json { "holon_id": "jwt-authentication-v1", "message": "Hypothesis 'Implement JWT Authentication' created successfully." } ``` #### Error Response (400) - **error** (string) - Description of the error (e.g., missing required fields, invalid format). #### Error Response Example ```json { "error": "Missing required field: title" } ``` ```