White search icon
News
Startups

The Legal Code Goes Digital: Spain's Legislation as Git Repository

A groundbreaking initiative turns Spanish law into a version-controlled system, allowing for transparency and easier tracking of legal reforms.

28-03-2026 |


A groundbreaking initiative turns Spanish law into a version-controlled system, allowing for transparency and easier tracking of legal reforms.

The Spanish government has taken an innovative step by transforming its entire legal framework into a digital ecosystem. Every piece of legislation is now stored as a Markdown file within a Git repository, with each amendment recorded as a commit in the codebase history. This approach not only streamlines access to current laws but also provides unparalleled transparency and traceability for lawmakers, citizens, and businesses alike.

How It Works

The initiative leverages data from the official BOE (Boletín Oficial del Estado) API, which contains over 8,600 pieces of legislation dating back to 1960. Each law is meticulously documented with YAML frontmatter at the beginning of its respective file, detailing key metadata such as classification and source information.

Reforms are tracked through individual commits in this Git repository, each tagged with a specific date corresponding to when the change was officially published. The commit message includes relevant identifiers for easy reference and links back to official sources where necessary. This ensures that every version of any law can be accessed and verified at will.

The project is spearheaded by Enrique Lopez, who has developed an open-source platform called Legalize.dev aimed at making this vast repository accessible via a user-friendly API interface. Users can search for specific laws or filter through different categories to find relevant information quickly. Additionally, the system allows users to compare versions of legislation over time and receive notifications when changes occur.

Transparency and Accountability

This digital transformation significantly enhances transparency in governance by providing a clear audit trail of all legislative actions. For instance, if there is ever any dispute about whether certain provisions were included or modified during the drafting process, this Git history serves as irrefutable evidence.

Citizens can now easily verify the accuracy and authenticity of laws they are required to follow without relying solely on printed copies that may be outdated or contain errors. Businesses operating in Spain also benefit from having real-time access to updated regulations which could impact their operations, thereby reducing compliance risks associated with lagging information.

Moreover, this approach facilitates collaboration among lawmakers and stakeholders by enabling them to contribute feedback directly through the platform's issue tracker feature. Any discrepancies or missing reforms can be flagged immediately for correction, ensuring that only accurate versions remain in circulation.

Potential Challenges

While undoubtedly beneficial, there are potential downsides worth considering as well. One major challenge lies in maintaining consistency across multiple repositories and ensuring all changes get properly integrated into the main codebase without conflicts arising. Another concern is security; while Git provides robust protection mechanisms against unauthorized access or tampering, it still requires stringent measures to prevent accidental deletions or modifications.

Furthermore, although the text of laws themselves are in public domain due to their nature as government publications, the metadata and tooling used for version control might be subject to different licensing terms. Users must carefully review these conditions before integrating Legalize.dev into existing workflows or systems that handle sensitive data.


An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.