receiving-code-review
OBobra/superpowers298k近 7 天新增 2,631 个 star
Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation rounds, and generate only after evaluation reaches zero errors. Use for KSML modeling, seven-language TeaQL generation, generated assist APIs, auditable business logic, application verification, or parallel human review.
Turn a business requirement into a KSML contract and a verified TeaQL application. Never run model evaluation before the first complete KSML model has been written and saved.
Do not reorder these stages:
AGENTS.md.swift-lib-core target for
a generated Swift package with local SQLite and TFP client support. C++,
Dart, Ruby, and other unlisted smaller language ecosystems are not supported.Do not load a full KSML rule catalog before modeling. Use
references/golden-example.xml as the grammar
example and adapt its structure—not its pet-clinic concepts—to the domain.
The golden example exists only to demonstrate KSML syntax. Never carry over its
domain names (clinic, pet, appointment, species, microchipped) or its
organizational structure into a different business domain.
Create and save a complete KSML model before running any TeaQL command. Do not evaluate an absent, empty, or placeholder model target.
If the model is large (e.g., more than 15 objects), you MAY split it into
multiple module files using <_include file="module.xml" />, but this is
optional. The system supports dynamic output limits so a single-file model
will also work.
For a split model, follow the complete
multi-file-golden-example.
Every included file MUST be a well-formed XML document with exactly one
top-level <root> element. Put all module objects inside that <root>.
Never write multiple bare top-level objects in an included file. Only the
entry file's <root> carries service-level attributes such as name, org,
data_service, and _module_key; an included module normally uses plain
<root>...</root>.
Incorrect included file:
<customer_account ... />
<sales_order ... />
Correct included file:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<customer_account ... />
<sales_order ... />
</root>
bonus_type instead of type,
move_order instead of move, leave_type instead of type). Do not use
bare single words like type or move as entity or field names.Apply this minimal contract:
name the sole model name, in lowercase kebab-case ending with
-service.org="example" when the user does not specify an organization.<root> or within the included module files._name, _module, and _module_key.target_object().id on business objects.<_value> children.<_value> must explicitly provide every declared
data field, including id, name, code, and additional fields such as
display_order, color, or progress. Nullable declarations still require
a concrete representative value. Do not repeat _... model metadata,
version, Fix-managed createTime()/updateTime() fields, or the domain-root
relationship injected from context in each <_value>.createTime() only for their intended
semantics.These are the most common first-attempt failures. Avoiding them saves multiple repair rounds:
Non-empty attribute values. EVERY attribute MUST have a non-empty
representative value. Never write attr="" or attr=" ". Use a realistic
example (e.g., email="[email protected]", url="https://example.com/doc.pdf").
Language keyword avoidance. Entity and field names must not collide with
programming language keywords (Rust: move, type, match, self, ref,
mod, box, trait, impl, use, let, fn, async, yield;
Java/C#: class, new, import, public, default, return;
Go: type, map, range, go, select, interface;
Swift: class, struct, protocol, extension, actor, associatedtype,
inout, some, any, Self, init, deinit, subscript, operator;
Python: class, def, from, import, lambda, yield;
Kotlin/JVM application code: object, when, is, fun, val, var;
TypeScript: class, interface, function, import, export, typeof;
SQL: select, table, transaction). When a natural business concept is a
single keyword (e.g., "move"), always use a two-word compound name instead
(e.g., move_order, move_task, type_code, match_record).
Privacy audit masking. Person-like objects (user, customer, employee,
driver, etc.) that hold sensitive fields (password, password_hash,
token, magic_link_token, api_key, secret, ssn, id_card,
mobile_phone) MUST declare _audit_mask_fields listing those fields.
Example: <user _audit_mask_fields="password_hash,magic_link_token" .../>
No circular reference chains. If A references B, B references C, and C references A, the parser may fail at depth limit. Keep reference chains short and acyclic.
Audit log user field. Logging/audit objects (audit_log, change_log,
etc.) MUST include a recognizable user/operator field (e.g.,
operator="user()", actor="user()").
No isolated entities (Disconnected Graphs). To avoid KSML-DOMAIN-ROOT-002, ensure that ALL entities are connected via relationships (references) to the main graph. Do not leave any entity as an isolated island. Every object should either reference another object or be referenced by another object in the domain model.
No XML special characters in attribute values. Never use &, <, >,
" directly in attribute values. Use and instead of & (e.g.,
_module="Operations and Logistics" not _module="Operations & Logistics").
Complete constant value records. Every <_value> must provide every
declared constant data field. A nullable type declaration does not permit a
value record to omit that business field. Version, Fix-managed
createTime()/updateTime() fields, and the domain-root relationship are
runtime managed and omitted from each row.
<school_type platform="platform()" id="id()" name="string()"
code="string()" display_order="number()" color="string()?"
_constant="true" _identifier="code">
<_value id="1001" name="Primary" code="PRIMARY"
display_order="1" color="blue"/>
<_value id="1002" name="Secondary" code="SECONDARY"
display_order="2" color="green"/>
</school_type>
When you finish the model generation phase and evaluation passes with zero errors, output <phase-complete>model_generation</phase-complete>.
Now—and only now—load
references/toolchains.md. Verify the installed
client against the exact version required by the target repository or that
reference. Stop and report a mismatch.
Submit the complete model target to the repository's Generation Service evaluation command. For Rust, every model-derived operation must include:
cargo teaql --input <model-file-or-directory> evaluate
IMPORTANT: If your model is split into multiple files in a directory (e.g., models/), you MUST pass the directory path (e.g., --input models/), NOT the main entry file (main.xml). Passing only the main file will cause the evaluator to fail with missing included files.
Repair from the Markdown evaluation report:
sed -n '1,300p') in an endless loop to read the entire file. Use targeted grep (e.g., grep -A 15 -B 5 "Error" or grep -A 10 -B 10 "error:") or read only the head/tail to quickly isolate and fix issues without wasting context.Do not generate from a model with errors.
Run at most 5 evaluation–repair rounds by default. If errors remain after 5 rounds, stop and present the current evaluation report to the user with a summary of what was fixed and what still fails. Ask the user to provide additional guidance or model corrections before continuing. Do not loop indefinitely.
On small-context models, keep the zero-error evaluation gate. Read the summary and only the reported error locations needed for the current repair round; do not stream the complete report into context. If the remaining errors cannot be resolved within the repair or context budget, stop with the current report. Never proceed to generation with evaluation errors.
As soon as evaluation reaches zero errors, notify the user without pausing:
Model Ready
- Model: <absolute model path>
- Evaluation: passed — <errors>, <warnings>, <suggestions>
Continue working. Human model or application review is asynchronous, not an approval gate. Incorporate review feedback when it arrives, then re-evaluate and regenerate if the domain contract changed.
CRITICAL: Do NOT output <phase-complete>evaluate_repair</phase-complete> if there are ANY ❌ Errors (Must Fix) listed in the text output of your evaluation command, even if the command execution returned success=true (which can happen if you pipe to tee). You MUST open the corresponding XML files and fix the errors (e.g., renaming fields that conflict with Rust keywords) before outputting the phase-complete tag.
When you finish the repair phase and reach zero errors, output <phase-complete>evaluate_repair</phase-complete>.
Generate only the outputs requested by the user.
Use the exact language target and verification guidance in
references/toolchains.md. Generate only targets actually advertised by the
Generation Service; never manufacture a target name.
IMPORTANT: If your model is split into multiple files in a directory (e.g., models/), you MUST pass the directory path (e.g., --input models/), NOT the main entry file (main.xml) to the generation commands. Passing only the main file will cause the generation to fail with missing included files.
CRITICAL: Do NOT output <phase-complete>codegen</phase-complete> if ANY generation command returns an error or success=false. You MUST fix the command (e.g., incorrect directory paths) and retry until it succeeds.
WARNING: When chaining commands, do NOT use cd dir && cmd && cd dir && cmd. The second cd will fail because you are already in dir. Instead, use cd dir && cmd1 && cmd2 or use subshells (cd dir && cmd1) && (cd dir && cmd2).
--cwd is the base directory for every relative --output path. When both
flags are present, pass the workspace directory once: use an absolute
--cwd /path/to/app-playground together with a child-only output such as
--output rust-lib-core. Never repeat the cwd suffix in output (for example,
do not combine --cwd app-playground with
--output app-playground/rust-lib-core), because that creates
app-playground/app-playground/rust-lib-core.
Before generation, resolve the intended output path conceptually as
<cwd>/<relative-output> and confirm it equals the requested destination. An
absolute --output is also valid and is not joined to --cwd, but do not mix
the two styles within one generation run.
When generation commands complete successfully with success=true, output <phase-complete>codegen</phase-complete>.
AGENTS.md before business code. If an
expected generated application guide is missing, stop and report it.<language>-assist-query/<entity> using the exact
KSML entity name. This returns the executable base query and a compact field
index. Before using a field-specific select, filter, order, group, facet, or
aggregate method, request
<language>-assist-query/<entity>.<field> using the exact case-sensitive
KSML field name from that index. Do not translate snake_case KSML into a
language member name in the Assist location, and do not request nested paths
such as order.customer.name. Query Assist is intentionally progressive so
the agent does not load every combinatorial field API into context.MISSING_ASSIST with the language, entity, action, missing operation, and
exact compiler diagnostic when available.Enforce the API constraint harness:
Compile, test, and smoke-test the requested result. Repair model-derived problems at the model level and regenerate.
Do not edit a generated dependency declaration to switch between a local
runtime checkout and a published runtime. If the target repository contains
teaql-workspace.yaml, run the repository's teaql_workspace.py verify
before compiling and retain its output as evidence.
workspace mode, the config must resolve each selected runtime to a Git
repository. Record its absolute path, commit, and dirty state. Apply the
language's native workspace override outside the generated domain library.release mode, every runtime must declare a package and version; local
path, patch, replace, editable install, or project-reference overrides are
forbidden.Use ../../examples/teaql-workspace.workspace.yaml
as the seven-language workspace configuration example.
Load
references/work-complete.md only after the
requested result—not evaluation alone—is complete. Report actual evidence:
Never invent token savings, harness evidence, or verification results.
OBobra/superpowers298k近 7 天新增 2,631 个 star
OBobra/superpowers298k近 7 天新增 2,631 个 star
OBobra/superpowers298k近 7 天新增 2,631 个 star
MAmattpocock/skills288k近 7 天新增 10,178 个 star
MAmattpocock/skills288k近 7 天新增 10,178 个 star
MAmattpocock/skills288k近 7 天新增 10,178 个 star