README | CHANGELOG | TODO | docs/USAGE.md
SUMD (Structured Unified Markdown Descriptor) is a semantic project descriptor format in Markdown that defines intent, structure, execution entry points, and mental model of a system for both humans and LLMs.
SUMD is part of a four-layer system:
┌─────────────────────────────────────────────────────────────┐
│ SUMD (opis) │
│ Structured Unified Markdown Descriptor │
│ Project description, intent, architecture │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ DOQL (wykonanie) │
│ Declarative Object Query Language │
│ Data manipulation and execution │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ Taskfile (runtime) │
│ Task runner and workflow execution │
│ Automation and orchestration │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ TESTQL (weryfikacja) │
│ Test Query Language - Token-Oriented │
│ API contracts, integration & E2E tests │
└─────────────────────────────────────────────────────────────┘
- SUMD → opis (description): Defines what the system is and how it should work
- DOQL → wykonanie (execution): Provides the language to manipulate and execute operations
- Taskfile → runtime: Manages the actual execution of workflows and tasks
- TESTQL → weryfikacja (verification): Provides AI-friendly test scenarios, API contracts, and end-to-end validation
SUMD documents can reference DOQL queries, Taskfile workflows, and TESTQL scenarios to provide complete system documentation.
TESTQL provides the verification layer that bridges SUMD descriptions with executable test scenarios:
| Feature | Purpose | Format |
|---|---|---|
| API Tests | HTTP endpoint validation | *.testql.toon.yaml |
| GUI Tests | Browser automation (Playwright) | *.testql.toon.yaml |
| Encoder Tests | Hardware interface validation | *.testql.toon.yaml |
| Contract Tests | OpenAPI schema validation | Auto-generated |
| Project Echo | AI context generator | testql echo --json |
## Test Scenarios
The system includes the following test suites defined in TESTQL:
- Smoke Tests: `testql/test-api-health.testql.toon.yaml`
- Integration Tests: `testql-scenarios/*.testql.toon.yaml`
- Hardware Tests: `testql/test-hardware-*.testql.toon.yaml`
Run with: `testql suite smoke` or `task test`TESTQL can generate AI-friendly project metadata via testql echo:
testql echo --toon-path testql-scenarios/ --doql-path app.doql.less --format jsonThis produces:
- API Contract Layer: Endpoints, methods, status codes, assertions
- System Model Layer: Entities, workflows, interfaces from DOQL
- Unified Context: Combined metadata for LLM consumption
SUMD documents can be converted to and from multiple structured formats for interoperability:
- Markdown (
.md): Native SUMD format - JSON (
.json): Structured data for API consumption - YAML (
.yaml): Human-readable configuration format - TOML (
.toml): Configuration file format
# Export SUMD to different formats
sumd export SUMD.md --format json --output sumd.json
sumd export SUMD.md --format yaml --output sumd.yaml
sumd export SUMD.md --format toml --output sumd.toml
sumd export SUMD.md --format markdown --output sumd.md
# Generate SUMD from structured format
sumd generate sumd.json --format json --output SUMD.md
sumd generate sumd.yaml --format yaml --output SUMD.md
sumd generate sumd.toml --format toml --output SUMD.mdWhen exporting to structured formats, SUMD documents follow this schema:
{
"project_name": "string",
"description": "string",
"sections": [
{
"name": "string",
"type": "string",
"content": "string",
"level": "number"
}
]
}A SUMD document is a Markdown file with structured sections using specific headers and syntax patterns.
- Default:
SUMD.mdorsumd.md - Alternative:
PROJECT_SUMD.md,app.sumd.md - Extension:
.md(Markdown)
# [Project Name]
[Project description]
## Section Name
[Content]# [Project Name]
[One-line description of the project]Rules:
- Must be the first line (H1)
- Project name should be kebab-case or PascalCase
- Description should be concise (1-2 sentences)
## Metadata
- **Version**: [semantic version]
- **Status**: [alpha|beta|stable|deprecated]
- **Author**: [name or organization]
- **License**: [SPDX identifier]## Intent
[What the project aims to achieve, its purpose, and goals]Purpose: Defines the "why" of the project for both humans and LLMs.
## Architecture
### System Overview
[High-level system description]
### Components
- **[Component Name]**: [Description]
- **[Component Name]**: [Description]
### Data Flow
[Description of how data moves through the system]## Interfaces
### API
- **Endpoint**: [HTTP method] [path]
- **Description**: [What it does]
- **Parameters**: [Request parameters]
- **Response**: [Response format]
### CLI
- **Command**: `[command]`
- **Description**: [What it does]
- **Usage**: `[command] [options]`
- **Examples**: [Example usage]## Workflows
### [Workflow Name]
- **Trigger**: [manual|automatic|event]
- **Steps**:
1. [Step description]
2. [Step description]
- **Dependencies**: [Required tools/services]## Configuration
### Environment Variables
- **[VAR_NAME]**: [Description] (default: [value])
### Settings
- **[setting]**: [Description] (default: [value])## Dependencies
### Runtime
- [Dependency] ([version])
### Development
- [Dependency] ([version])## Deployment
### Environments
- **[env]**: [Description]
### Requirements
- [Requirement 1]
- [Requirement 2]- Use H1 (
#) for project name only - Use H2 (
##) for main sections - Use H3 (
###) for subsections - Use H4 (
####) for nested items (rare)
- Use bullet points (
-) for unordered lists - Use numbered lists (
1.) for sequences - Nested lists should use 2-space indentation
- Use fenced code blocks with language identifier
- For configuration examples, use appropriate language (yaml, json, etc.)
key: value- Use bold for key terms and section headers within content
- Use
codefor technical terms, commands, and variable names - Use italics for emphasis sparingly
- Use descriptive link text:
[text](url) - For internal references, use anchor links:
[Section](#section)
- Use clear, descriptive section names
- Maintain consistent hierarchy
- Provide context before details
- Include intent and architecture early
- Define mental model explicitly
- Use consistent terminology
Always provide examples for:
- API endpoints
- CLI commands
- Configuration
- Workflows
# doql
Declarative Object Query Language for structured data manipulation.
## Metadata
- **Version**: 1.0.0
- **Status**: stable
- **Author**: Tom Sapletta
- **License**: Apache-2.0
## Intent
doql provides a declarative language for querying and manipulating structured data sources. It aims to simplify data operations by abstracting implementation details behind a unified syntax.
## Architecture
### System Overview
doql consists of a parser, interpreter, and multiple backend adapters for different data sources.
### Components
- **Parser**: Converts doql syntax into AST
- **Interpreter**: Executes AST against data sources
- **Adapters**: Interface to specific data backends (SQL, API, files)
### Data Flow
1. Parse doql query into AST
2. Validate AST against schema
3. Execute via appropriate adapter
4. Return formatted results
## Interfaces
### API
- **Endpoint**: POST /api/v1/query
- **Description**: Execute doql query
- **Parameters**: `{ "query": "string", "source": "string" }`
- **Response**: `{ "results": [...], "metadata": {...} }`
### CLI
- **Command**: `doql query [file]`
- **Description**: Execute doql query from file
- **Usage**: `doql query data.doql --format json`
- **Examples**: `doql query users.doql --output results.json`
## Workflows
### Query Execution
- **Trigger**: manual
- **Steps**:
1. Parse query file
2. Connect to data source
3. Execute query
4. Format output
- **Dependencies**: Python 3.10+, required adapter
## Configuration
### Environment Variables
- **DOQL_SOURCE**: Default data source (default: sqlite://db.sqlite)
- **DOQL_FORMAT**: Default output format (default: json)
## Deployment
### Environments
- **Development**: Local execution with file-based sources
- **Production**: Server mode with persistent connections
### Requirements
- Python 3.10+
- Required database adapters- Be concise but complete: Provide enough context without overwhelming detail
- Maintain consistency: Use similar structure across sections
- Think in layers: Start with high-level, drill down to specifics
- Include examples: Show, don't just tell
- Keep it current: Update as project evolves
- Use semantic naming: Section names should be self-explanatory
- Optimize for AI: Structure for LLM context injection
- v1.0 (2026-04-18): Initial specification
- Defined core structure
- Established required and optional sections
- Documented syntax rules
- v1.1 (2026-04-18): Format conversion support
- Added multi-format export (markdown, json, yaml, toml)
- Added generate command for creating SUMD from structured formats
- Documented conversion schema and CLI commands