Canonical Data Directory Map
OpenClaw Greek Accounting System — v1.1
Setup
This skill is a reference document — it defines the directory structure and naming conventions used by all other Greek accounting skills. No binaries or credentials required.
CODEBLOCK0
This document defines the complete file system architecture for the OpenClaw Greek Accounting system. It is the authoritative reference for all path decisions. No skill may introduce a new top-level directory or deviate from the naming conventions defined here without a version update to this document.
v1.1 change: Added /data/memory/ — agent episodic memory, failure logs, pattern store, GitHub proposal queue, and rate-limit state. Owner: memory-feedback (Skill 19, Phase 4). All Phase 3B+ skills must include episode and failure log hooks that write into this tree.
Root Structure
CODEBLOCK1
1. /data/incoming/ — Raw Input
All documents entering the system land here first, regardless of source (email attachment, manual drop, scanner, bank download). Nothing in /data/incoming/ is processed yet.
CODEBLOCK2
Naming convention for incoming files:
Files dropped here may arrive with any name. The system must NOT rename them on arrival — the original filename is preserved for audit purposes. The system assigns a canonical name only when moving to /data/processing/.
2. /data/processing/ — In-Flight Pipeline
Temporary working space. Files here are mid-pipeline and may be incomplete. No other skill should read from /data/processing/ as a final source — always read from /data/clients/ or /data/compliance/ for canonical data.
CODEBLOCK3
Cleanup policy: Files in /data/processing/ are deleted or archived after the pipeline completes successfully. They are never the canonical record.
3. /data/clients/ — Client Master Records
The single source of truth for all client data. Every other skill that needs client information reads from here. Only the client-data-management skill writes to this tree.
CODEBLOCK4
AFM format: Always EL + 9 digits, uppercase. Example: EL123456789. Never store without the EL prefix. Never use the 9-digit-only form as a directory name.
4. /data/compliance/ — Government Filings
Stores the actual submission files (XML, PDF) generated for government platforms. The filing record lives in /data/clients/{AFM}/compliance/filings.json — this directory holds the file artefacts themselves.
CODEBLOCK5
Naming convention: {AFM}_{period}_{type}.{ext} — always lowercase type, always ISO period format (YYYYMM or YYYY), always the full AFM with EL prefix.
5. /data/banking/ — Bank Statement Pipeline
CODEBLOCK6
Note: /data/alpha-bank/, /data/nbg-statements/, /data/eurobank/, /data/piraeus-bank/ used in earlier skill versions are deprecated. All bank imports go through /data/banking/imports/{bank}/.
6. /data/ocr/ — OCR Processing Pipeline
CODEBLOCK7
Note: /data/scanned-documents/ used in earlier skill versions is deprecated. All scanned input goes to /data/ocr/incoming/scanned/.
7. /data/efka/ — EFKA Processing Pipeline
CODEBLOCK8
8. /data/reports/ — Generated Reports
Human-readable reports. These are outputs, not inputs to other skills.
CODEBLOCK9
Note: /data/reports/monthly-expenses.json (used in Skill 1) is deprecated. Expense data belongs in /data/clients/{AFM}/compliance/ or exported via /data/exports/.
9. /data/exports/ — Data Leaving the System
Files generated for external consumption (Excel exports, CSV downloads, accounting software imports).
CODEBLOCK10
10. /data/imports/ — Bulk Data Entering the System
Structured bulk imports (spreadsheets of client lists, employee rosters, etc.) — not raw documents (those go to /data/incoming/).
CODEBLOCK11
11. /data/dashboard/ — Dashboard State
CODEBLOCK12
12. /data/auth/ — Authentication & Access Control
CODEBLOCK13
13. /data/backups/ — Encrypted Backups
CODEBLOCK14
Naming convention: Always include date and time in backup filename. Always .enc extension for encrypted files. Encryption keys are stored outside /data/ — never adjacent to backup files.
14. /data/gdpr-exports/ — GDPR Subject Access Exports
CODEBLOCK15
15. /data/system/ — System Files
CODEBLOCK16
16. /data/memory/ — Agent Memory & Feedback
The agent's episodic memory, failure capture, pattern learning store, GitHub proposal queue, and rate-limit state. Written to by all skills (episode and failure hooks) and managed by the memory-feedback skill (Skill 19). No skill other than memory-feedback reads from this tree for decision-making — it is strictly write-on-event, read-by-Skill-19.
CODEBLOCK17
Episode logging trigger: Any agent action that makes a decision, produces output, or interacts with a government system. Trivial reads are not logged.
Failure logging trigger: Any error, intent misread, missing data condition, or human correction. Always includes what_should_have_happened field.
Pattern scan schedule: Once daily at 02:00 Athens time. Never during business hours. Maximum 3 proposals per day. Maximum 2 GitHub PRs per day.
Storage limits (defaults):
- - Episodes: 500 MB max — auto-archive after 90 days
- Failures: 200 MB max
- Patterns: 50 MB max
- Proposals: 50 MB max
- Total
/data/memory/: 2 GB hard ceiling — system halts memory writes at 90% capacity
GitHub integration: When a failure pattern reaches confidence threshold (≥0.85, ≥3 occurrences), memory-feedback creates a branch on GitHub and opens a pull request against the relevant SKILL.md file. Human must review and merge. Agent never pushes directly to main. Rejected PRs are logged — the same change is never re-proposed.
Rate limit tokens: Memory and reflection operations are budgeted separately from accounting operations. Default: 5,000 tokens/day for all memory processes combined.
Global Naming Conventions
Identifiers
| Identifier | Format | Example | Notes |
|---|
| AFM (VAT) | INLINECODE48 + 9 digits | INLINECODE49 | Always uppercase EL prefix. Never 9-digit-only. |
| EFKA employer ID |
8 digits |
12345678 | No prefix |
| GEMI | 9€“12 digits |
012345678 | May have leading zeros — preserve them |
| Contact ID |
C + 3 digits |
C001 | Per-client sequential |
| Filing ID |
{type}-{AFM}-{YYYY}-{MM} |
VAT-EL123456789-2026-01 | |
| Document ID |
D + 6 digits |
D000123 | Global sequential |
| Audit event ID |
AUD-{YYYYMMDD}-{6digits} |
AUD-20260218-001234 | |
| Backup ID |
{type}_{YYYYMMDD}_{HHMMSS} |
clients_20260218_143022 | |
| Episode ID |
EP-{YYYYMMDD}-{3digits} |
EP-20260218-001 | Global sequential per day |
| Failure ID |
FAIL-{YYYYMMDD}-{3digits} |
FAIL-20260218-003 | Global sequential per day |
| Pattern ID |
PAT-{YYYYMMDD}-{3digits} |
PAT-20260218-007 | Assigned at detection |
| Correction ID |
COR-{YYYYMMDD}-{3digits} |
COR-20260218-001 | Human-assigned |
| Session ID |
S{YYYYMMDD}-{3digits} |
S20260218-001 | Per user session |
Date & Time Formats
| Context | Format | Example | Notes |
| File names | YYYYMMDD | 20260218 | No separators in filenames |
| File names with time | YYYYMMDD_HHMMSS | 20260218_143022 | |
| Period references | YYYY-MM | 2026-01 | Monthly periods |
| ISO timestamps (JSON) | YYYY-MM-DDTHH:MM:SSZ | 2026-02-18T14:30:00Z | Always UTC in storage |
| Display to users | DD/MM/YYYY | 18/02/2026 | Greek date format |
| CLI arguments --date | YYYY-MM-DD | 2026-02-18 | ISO for CLI args |
| CLI arguments --period | YYYY-MM | 2026-01 | |
Currency
| JSON storage | Numeric, 2dp | 12500.00 | Never include € symbol in stored values |
| File names | No currency | 12500 | Integer amounts only in filenames |
| Display to users | €XX,XXX.XX | €12,500.00 | Standard EU format |
| CLI output | EUR XX,XXX.XX | EUR 12,500.00 | ASCII-safe for terminal |
File Naming Pattern
Pattern: INLINECODE94
Examples:
- - INLINECODE95
- INLINECODE96
- INLINECODE97
- INLINECODE98
Rules:
- - Lowercase type and detail segments
- Hyphens within segments (not underscores)
- Underscores between segments
- No spaces anywhere in file names
- No Greek characters in file names — use Latin transliteration for employee names
- No special characters except hyphens and underscores
Employee Name Slugs (for file names)
Greek names in file names must be transliterated to ASCII lowercase with hyphens:
- -
Îίκος Παπαδόπουλος → INLINECODE100 - INLINECODE101 → INLINECODE102
- INLINECODE103 → INLINECODE104
Deprecated Paths — Do Not Use
These paths appear in earlier skill versions and must not be used in any new skill. When encountered in existing commands, treat as aliases that redirect to the canonical paths.
| Deprecated | Canonical Replacement |
|---|
| INLINECODE105 | INLINECODE106 |
| INLINECODE107 |
/data/banking/imports/nbg/ |
|
/data/eurobank/ |
/data/banking/imports/eurobank/ |
|
/data/piraeus-bank/ |
/data/banking/imports/piraeus/ |
|
/data/bank-imports/ |
/data/banking/imports/ |
|
/data/scanned-documents/ |
/data/ocr/incoming/scanned/ |
|
/data/email-attachments |
/data/incoming/ (classified) |
|
/data/email-imports/ |
/data/incoming/ |
|
/data/invoices |
/data/incoming/invoices/ (if raw) or
/data/clients/{AFM}/documents/ (if processed) |
|
/data/processed/invoices/ |
/data/clients/{AFM}/documents/ + registry entry |
|
/data/processed/receipts/ |
/data/clients/{AFM}/documents/ + registry entry |
|
/data/processed/E1_2025.pdf |
/data/compliance/e1/EL{AFM}_2025_e1_form.xml |
|
/data/processing/classification |
/data/processing/classification/ |
|
/data/processing/extraction |
/data/processing/ocr/extracted/ |
|
/data/processing/validation |
/data/processing/ocr/validated/ |
|
/data/reports/monthly-expenses.json |
/data/clients/{AFM}/compliance/ or
/data/exports/ |
|
/data/payroll/monthly.xlsx |
/data/efka/payroll/input/ or
/data/clients/{AFM}/payroll/ |
|
/data/export/accounting-software |
/data/exports/accounting-software/ |
|
/data/aade-downloads/ |
/data/incoming/government/ |
|
/data/aade-outputs/ |
/data/reports/ or
/data/compliance/ (by type) |
|
/data/aade-processing/ |
/data/processing/compliance/ |
|
/data/compliance-updates/ |
/data/incoming/government/ |
Skill Responsibility Matrix
Which skill owns (writes to) each top-level directory:
| Directory | Owner Skill | Other Skills May Read |
|---|
| INLINECODE153 | INLINECODE154 | All skills |
| INLINECODE155 |
Pipeline skill handling the job | None as final source |
|
/data/clients/ |
client-data-management | All skills (read only) |
|
/data/compliance/ |
greek-compliance-aade |
aade-api-monitor,
efka-api-integration,
dashboard |
|
/data/banking/ |
greek-banking-integration |
accounting-workflows,
dashboard |
|
/data/ocr/ |
greek-document-ocr |
accounting-workflows,
greek-email-processor |
|
/data/efka/ |
efka-api-integration |
greek-compliance-aade,
dashboard |
|
/data/reports/ |
dashboard-greek-accounting | All skills (read) |
|
/data/reports/analytics/ |
analytics-and-advisory-intelligence |
conversational-ai-assistant,
dashboard-greek-accounting |
|
/data/reports/system/ |
system-integrity-and-backup |
dashboard-greek-accounting (read) |
|
/data/clients/{AFM}/financial-statements/ |
greek-financial-statements |
conversational-ai-assistant,
client-communication-engine,
analytics-and-advisory-intelligence |
|
/data/clients/{AFM}/correspondence/ |
client-communication-engine |
conversational-ai-assistant,
analytics-and-advisory-intelligence |
|
/data/processing/comms/ |
client-communication-engine | Ephemeral drafts only — cleared after send |
|
/data/backups/ |
system-integrity-and-backup | All skills trigger event-driven snapshots via meta-skill |
|
/data/system/integrity/ |
system-integrity-and-backup | All skills write hash on canonical file write |
|
/data/exports/ | Any skill (with
--export) | External consumers |
|
/data/imports/ |
client-data-management |
efka-api-integration |
|
/data/dashboard/ |
dashboard-greek-accounting |
user-authentication-system |
|
/data/auth/ |
user-authentication-system | All skills (auth check) |
|
/data/gdpr-exports/ |
client-data-management | None |
|
/data/system/ | OpenClaw system | All skills (read) |
|
/data/memory/ |
memory-feedback (Skill 19) | All skills write episode/failure hooks; only Skill 19 reads for analysis |
Enforcement Rules for All Skills
- 1. Never introduce a new top-level directory under
/data/ without updating this document first. - Never write processed/canonical data to
/data/processing/ — it is temporary only. - Never write client data outside
/data/clients/{AFM}/ — client-data-management is the only writer. - Always use the full AFM with EL prefix in all paths, filenames, and JSON keys.
- Always use ISO date format (
YYYY-MM-DD or YYYYMMDD) in file names and JSON — never DD/MM/YYYY in stored data. - Never use Greek characters in file names or directory names — only in JSON values and display output.
- Currency values in JSON are always numeric — never strings with € symbols.
- All timestamps in JSON are UTC — display conversion to
Europe/Athens happens at the output layer only. - The
/data/processing/ tree is ephemeral — never reference it as the source of truth from another skill. - Deprecated paths are read-only legacy — redirect to canonical paths, never create new files at deprecated locations.
Unified Audit Event Schema
Every skill must log significant actions using this single JSON schema. Audit events are written to /data/system/logs/audit/ and are the authoritative record for regulatory inspection.
CODEBLOCK18
Required fields for all events: event_id, timestamp, skill, action, category, user.username, user.role, result.
Optional fields: client, details, before_state, after_state, approval, data_classification.
Event categories:
- -
government_submission — any filing sent to AADE, EFKA, myDATA - INLINECODE238 — create, update, or delete of client records
- INLINECODE239 — login, logout, session activity, access denial
- INLINECODE240 — OCR, classification, extraction, validation
- INLINECODE241 — statement generation, amendment, report creation
- INLINECODE242 — client correspondence sent
- INLINECODE243 — backup, integrity check, schema migration
- INLINECODE244 — lockout, 2FA failure, session revocation, permission change
Storage: /data/system/logs/audit/{YYYY-MM-DD}_audit.jsonl (one JSON object per line, append-only).
Retention: Audit logs are retained for 10 years per Greek tax law and EU regulatory requirements.
Encryption-at-Rest Specification
Directories containing sensitive data must be encrypted at rest in production deployments. This is required for GDPR compliance (EU Regulation 2016/679, implemented in Greece by Law 4624/2019).
Directories Requiring Encryption
| Directory | Classification | Encryption Required | Rationale |
|---|
| INLINECODE246 | Restricted | Mandatory | Credential hashes, session data, 2FA secrets |
| INLINECODE247 |
Confidential |
Mandatory | Financial records, PII (names, AFMs, IBANs) |
|
/data/compliance/ | Confidential |
Mandatory | Tax filings containing financial data |
|
/data/efka/ | Confidential |
Mandatory | Employee PII, salary data, social security numbers |
|
/data/banking/ | Confidential |
Recommended | Bank statements, account numbers |
|
/data/backups/ | Confidential |
Already encrypted | AES-256 via Skill 17 |
|
/data/gdpr-exports/ | Confidential |
Mandatory | Subject access request data |
|
/data/processing/ | Internal | Optional | Ephemeral — deleted after pipeline |
|
/data/reports/ | Internal | Recommended | May contain client financial summaries |
|
/data/system/ | Internal | Optional | Logs and operational data |
Implementation
CODEBLOCK19
Data Classification Labels
Every JSON record stored in encrypted directories should include a data_classification field:
CODEBLOCK20
Valid values: public, internal, confidential, restricted.
This field enables rapid scoping during GDPR breach notification (72-hour requirement) — you can quickly determine what classification of data was exposed.
Professional Liability Disclaimer Template
Every client-facing document generated by the system must include this disclaimer. Skills that produce client-visible output (Skills 15, 16, 18) must append this to their output templates.
Standard Disclaimer (Greek)
CODEBLOCK21
Standard Disclaimer (English)
CODEBLOCK22
Usage Rules
- - Financial statements (Skill 15): Include both Greek and English disclaimers in PDF footer
- Client correspondence (Skill 16): Include Greek disclaimer in email footer
- Advisory reports (Skill 18): Include English disclaimer in internal reports, Greek in client-facing
- Government submissions: Disclaimer is NOT included in filings sent to AADE/EFKA (these are formal submissions, not advisory documents)
Input Validation Rules
All skills must validate incoming data against these rules before processing. Invalid input must be rejected with a clear error message — never silently accepted.
Identifier Validation
CODEBLOCK23
Financial Value Validation
CODEBLOCK24
Date and Time Validation
CODEBLOCK25
String Validation
CODEBLOCK26
规范数据目录映射
OpenClaw 希腊会计系统 — v1.1
设置
本技能是一份参考文档——它定义了所有其他希腊会计技能所使用的目录结构和命名规范。无需二进制文件或凭证。
bash
设置数据目录(所有技能均读取此变量)
export OPENCLAW
DATADIR=/data
初始化完整目录结构
mkdir -p $OPENCLAW
DATADIR/{incoming/{invoices,receipts,statements,government},processing,clients,compliance/{vat,efka,mydata,e1,e3},banking/{imports/{alpha,nbg,eurobank,piraeus},processing,reconciliation},ocr/{incoming,output},reports,auth,system/{logs,process-locks},backups}
本文档定义了 OpenClaw 希腊会计系统的完整文件系统架构。它是所有路径决策的权威参考。未经本文档版本更新,任何技能不得引入新的顶级目录或偏离此处定义的命名规范。
v1.1 变更: 新增 /data/memory/ 目录——用于存储代理情景记忆、失败日志、模式存储、GitHub 提案队列和速率限制状态。所有者:memory-feedback(技能 19,第 4 阶段)。所有第 3B+ 阶段的技能必须包含写入此目录树的情景和失败日志钩子。
根目录结构
/data/
╔══ incoming/ # 所有原始输入——进入系统的文档
╔══ processing/ # 临时工作空间——管道中的文件
╔══ clients/ # 规范客户记录——事实来源
╔══ compliance/ # 政府申报和提交
╔══ banking/ # 银行对账单处理管道
╔══ ocr/ # OCR 处理管道
╔══ efka/ # EFKA/社保处理管道
╔══ reports/ # 为人工查阅生成的报告
╔══ exports/ # 离开系统的数据导出
╔══ imports/ # 进入系统的批量数据导入
╔══ dashboard/ # 仪表板状态、配置、缓存、历史记录
╔══ auth/ # 身份验证和访问控制
╔══ backups/ # 加密的系统备份
╔══ gdpr-exports/ # GDPR 主体访问请求导出
╔══ memory/ # 代理情景记忆、失败日志、学习模式、提案
└══ system/ # 系统级文件:日志、模式版本、锁
1. /data/incoming/ — 原始输入
所有进入系统的文档首先存放在此处,无论来源如何(电子邮件附件、手动拖放、扫描仪、银行下载)。/data/incoming/ 中的任何内容均尚未处理。
/data/incoming/
╔══ invoices/ # 供应商发票(PDF、图片)
╔══ receipts/ # 收据(PDF、图片、手机照片)
╔══ statements/ # 银行对账单(PDF、CSV、OFX)
╔══ government/ # AADE/EFKA 通知和文件
╔══ payroll/ # 工时表、员工文件
╔══ tax-documents/ # 税务证明、雇主证明(βεβαιώσεις)
╔══ contracts/ # 合同和法律文件
└══ other/ # 未分类——分类后路由
传入文件的命名规范:
放入此处的文件可能带有任何名称。系统不得在到达时重命名它们——保留原始文件名用于审计目的。系统仅在将文件移动到 /data/processing/ 时分配规范名称。
2. /data/processing/ — 进行中管道
临时工作空间。此处的文件处于管道处理中,可能不完整。其他技能不应将 /data/processing/ 作为最终来源读取——始终从 /data/clients/ 或 /data/compliance/ 读取规范数据。
/data/processing/
╔══ ocr/ # OCR 进行中
╚ ╔══ queued/ # 等待 OCR
╚ ╔══ enhanced/ # 图像预处理完成
╚ ╔══ extracted/ # 文本已提取,尚未验证
╚ └══ validated/ # OCR 输出已验证,准备路由
╔══ classification/ # 文档类型识别进行中
╔══ reconciliation/ # 银行对账工作文件
╚ ╔══ matching/ # 交易匹配进行中
╚ └══ flagged/ # 需要人工审核的项目
╔══ compliance/ # 申报准备工作文件
╚ ╔══ vat/ # VAT 申报准备
╚ ╔══ efka/ # EFKA 申报准备
╚ └══ mydata/ # myDATA 提交准备
└══ imports/ # 批量导入验证进行中
清理策略: 管道成功完成后,/data/processing/ 中的文件将被删除或归档。它们绝不是规范记录。
3. /data/clients/ — 客户主记录
所有客户数据的唯一事实来源。任何其他需要客户信息的技能都从此处读取。只有 client-data-management 技能写入此目录树。
/data/clients/
╔══ _index.json # 全局客户索引(名称、AFM、状态、负责人)
╔══ _audit-log.json # 所有客户的所有访问和变更事件
╔══ _schema-version.json # 用于迁移跟踪的当前模式版本
└══ {AFM}/ # 每个客户一个目录,以 AFM 为键(例如 EL123456789)
╔══ profile.json # 主客户记录
╔══ identifiers.json # AFM、GEMI、EFKA 雇主 ID、IBAN
╔══ contacts.json # 联系人
╔══ notes.json # 关系备注和会议日志
╔══ compliance/
╚ ╔══ filings.json # 所有已完成的申报(VAT、EFKA、E1 等)
╚ ╔══ obligations.json # 定期义务时间表
╚ └══ gaps.json # 缺失/逾期申报日志
╔══ documents/
╚ ╔══ registry.json # 该客户所有文档的元数据索引
╚ ╔══ pending.json # 等待处理或审核的文档
╚ └══ archive-index.json # 已归档文档的引用
╔══ correspondence/
╚ └══ {YYYYMMDD}{type}{draft-id}_sent.json # 不可变的已发送通信记录
╔══ comms-preferences.json # 客户特定的称呼、联系方式、语言覆盖
╔══ payroll/
╚ └══ {YYYY-MM}/ # 每个工资周期一个文件夹
╚ ╔══ hours-input.csv # 原始工时数据
╚ ╔══ calculations.json # 计算出的工资数据
╚ └══ {employee-slug}_payslip.pdf # 生成的工资单
╔══ financial-statements/
╚ ╔══ index.json # 所有生成的报表、版本、期间、状态
╚ ╔══ {YYYY-MM}plv{N}.json # 损益表(机器可读)
╚ ╔══ {YYYY-MM}balance-sheetv{N}.json # 资产负债表(机器可读)
╚ ╔══ {YYYY-MM}cash-flowv{N}.json # 现金流量表(机器可读)
╚ └══ {YYYY-MM}vat-summaryv{N}.json # VAT 摘要(机器可读)
└══ gdpr/
╔══ consent.json # 同意记录
╔══ retention-policy.json # 此客户的保留计划
└══ deletion-log.json # 执行的任何删除记录
AFM 格式: 始终为 EL + 9 位数字,大写。示例:EL123456789。切勿存储不带 EL 前缀的格式。切勿使用仅 9 位数字的形式作为目录名称。
4. /data/compliance/ — 政府申报
存储为政府平台生成的实际提交文件(XML、PDF)。申报记录位于 /data/clients/{AFM}/compliance/filings.json 中——此目录保存的是文件工件本身。
/data/compliance/
╔══ vat/
╚ └══ {AFM}{YYYY}{MM}vat_return.xml # 用于 TAXIS 的 VAT 申报 XML
╔══ mydata/
╚