Skip to main content

appgrammar_decompile

Axiom: I — Compression | Category: Creation

Multi-turn operation

This tool uses a multi-turn protocol. The initial call returns a prompt and token. Run the prompt on your LLM, then submit the structured output via appgrammar_tool_submit (or the tool-specific submit variant) to advance the operation.

Decompile an existing codebase into an appgrammar. Send a codebase snapshot and the server runs a 5-step reverse-analysis session to extract architecture, design system, task DAG, file registry, and enriched descriptions.

The output is a fully executable appgrammar identical in structure to one created by appgrammar_create. Use appgrammar_start to execute it.

Decompilation pipeline:

  1. Architecture extraction from source code
  2. Design system extraction from CSS/config
  3. Reconstruction task DAG
  4. File registry with exact exports
  5. Step enrichment with compressed specifications

Returns the first step prompt (architecture extraction) with codebase context embedded. Submit results via appgrammar_decompile_submit using the returned token.

Parameters

ParameterTypeRequiredDescription
descriptionstringYesBrief description of the codebase being decompiled (minimum 10 characters).
codebase_snapshotobjectYesCodebase snapshot containing: files (array of {path, content, language, size}), tree (directory tree string), optional package_json and tsconfig, total_files (positive integer), total_lines (non-negative integer).
mode"prototype" | "production"NoBuild mode for the resulting appgrammar.
language"typescript" | "python"NoPrimary programming language of the codebase.
frameworkstringNoFramework name detected in the codebase.
database"sqlite" | "postgresql" | "mysql" | "mongodb"NoDatabase engine used by the codebase.

Example

{
"method": "tools/call",
"params": {
"name": "appgrammar_decompile",
"arguments": {
"description": "A SaaS invoicing app with Stripe integration and PDF export",
"codebase_snapshot": {
"files": [
{
"path": "src/index.ts",
"content": "import express from \"express\";",
"language": "typescript",
"size": 30
}
],
"tree": "src/\n index.ts",
"total_files": 1,
"total_lines": 1
}
}
}
}