agentsclimarketplace

Mental debug

Skill lubochka/xiigen-mvp-engine/.agents/skills/mental-debug

Self-building AI code generation engine that generates application flows instead of implementing them. AGPL-3.0.

Install
npx -y skills add lubochka/xiigen-mvp-engine --skill mental-debug

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 16 days oldThe repository was created 16 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Runtime debugging discipline for the XIIGen engine. 14 rules covering pattern recognition, execution tracing, boundary analysis, loop bugs, error handling gaps, and XIIGen-specific failure modes (fabric resolution, tenant scope leaks, sibling guard gaps, generated service compliance).

SKILL.md

4.5 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

Mental Debug Skill v2.0

When to Invoke

  • When a bug is observed but the root cause is unclear
  • When tests fail and the failure message points to a symptom, not a cause
  • When code looks correct but produces wrong output
  • After code-examination-skill has mapped the call chain and a hypothesis is formed

The 14 Rules

#RuleWhat it catches
1pattern-recognition-verdictsMisidentifying what kind of bug this is
2contextual-gapMissing context that the code assumes exists
3mental-executionWrong mental model of how code actually runs
4boundary-data-lifecycleData shape changes at component boundaries
5boundary-message-mapEvent/queue message schema mismatches
6loop-off-by-oneOff-by-one errors in iteration
7loop-state-deltaState mutation inside loops producing wrong accumulation
8error-silent-catchErrors swallowed silently, no signal to caller
9sibling-guard-parityGuard exists in one station/provider but not its sibling
10_sectionsReference: debugging session structure
11async-local-storageAsyncLocalStorage not propagated across async boundaries
12generated-service-auditGenerated .ts files contain DNA violations
13fabric-resolution-traceWrong provider selected due to fabricType case mismatch
14tenant-scope-leaktenantId lost in Promise.all() or concurrent execution

Diagnostic Routing

Apply this table when observing a symptom. Start with the first rule; if not resolved, apply the second.

SymptomApply FirstThen
Generated code has DNA violationpattern-recognition-verdictscontextual-gapgenerated-service-audit
Fabric returns wrong resultboundary-data-lifecyclefabric-resolution-traceasync-local-storage
Tenant isolation brokentenant-scope-leakboundary-data-lifecycleloop-state-delta
AF pipeline quality flatlinescontextual-gap (skill blocks missing?)mental-execution on feedback→rag chain
BFA false positiveboundary-message-maploop-state-deltasibling-guard-parity
Silent wrong output (no error raised)error-silent-catchmental-executioncontextual-gap
Cross-tenant data visibletenant-scope-leakasync-local-storageboundary-data-lifecycle
Provider returns wrong shape silentlyfabric-resolution-traceerror-silent-catchboundary-data-lifecycle

Debugging Session Structure

See rules/_sections.md for the full session template.

Short form:

1. Observe: what is the actual output vs expected output?
2. Isolate: which component boundary is the divergence point?
3. Hypothesize: what assumption does the code make that is wrong?
4. Route: which mental-debug rule applies?
5. Verify: does the rule's checklist confirm the hypothesis?
6. Fix: engine-level fix (not output patch) — see retroactive-development
7. Test: 3-level verification (see bug-to-tests + three-level-verification)

XIIGen-Specific Failure Patterns

Fabric Resolution (Rule 13: fabric-resolution-trace)

The engine resolves a fabric provider by matching fabricType string against the provider registry. Case matters: "ELASTICSEARCH" does NOT match "elasticsearch". Silent fallback to in-memory provider.

Tenant Scope (Rule 14: tenant-scope-leak)

AsyncLocalStorage context does NOT propagate into Promise.all() children in Node 18. Any concurrent operation must receive tenantId explicitly or use nestjs-cls ClsService.

Sibling Guard Parity (Rule 9)

If DNA-3 is checked in af1-genesis.ts, it must also be checked in af11-feedback.ts — they process the same task output. A guard in one station but not its sibling creates a coverage gap.

Generated Service Audit (Rule 12)

When AF-1 or AF-7 generates a TypeScript service file, run the DNA-1–9 checklist against the output before committing. Generated code has no IDE warnings.


Reference

Rules are in rules/ subdirectory. See each rule file for full checklist and worked examples.

What ships with it: 16 files

47.3 KB alongside SKILL.md

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.