agentsclimarketplace

Dna compliance guard

Skill lubochka/xiigen-mvp-engine/.agents/skills/dna-compliance-guard

9 DNA guard patterns for the XIIGen engine. Each pattern has a detection command, example violation, fix pattern, and test template. Run pre-commit on any new or modified TypeScript files.From its SKILL.md

Install
npx -y skills add lubochka/xiigen-mvp-engine --skill dna-compliance-guard

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

  • 18 days oldThe repository was created 18 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.

SKILL.md

3.7 KB, 917 tokens by cl100k_base, as published. Nobody here has run it

DNA Compliance Guard Skill v1.0

When to Invoke

  • Before committing any new or modified TypeScript file in server/src/
  • After AF-1 Genesis or AF-7 RAG Update generates a .ts file
  • When generated-service-audit.md detects a potential violation
  • During Phase 11 code modifications (mandatory pre-commit gate)

The 9 DNA Guard Patterns

See dna-guard-patterns.md for full detection commands, violation examples, fix patterns, and test templates.

DNARuleDetection
DNA-1No entity-specific model classesgrep "class [A-Z].*{" server/src/ excl. kernel/, interfaces/
DNA-2No hardcoded field selectorsgrep "\.find({" server/src/
DNA-3No business logic in error handlersinspect catch blocks — must return DataProcessResult.failure() only
DNA-4All services extend MicroserviceBasegrep "class.*Service" server/src/ — check for extends
DNA-5tenantId from context, not parametergrep "tenantId" server/src/ — check if it's a param
DNA-6No entity-specific controllersgrep "@Controller(" server/src/ — check for entity specificity
DNA-7Event subscriptions have dedup IDgrep "@Subscribe(" server/src/ — check dedup field
DNA-8Document stored before queuedenqueue() calls — check storeDocument() precedes them
DNA-9CloudEvents wrapper on all eventsgrep "enqueue(" server/src/ — check CloudEvents wrapper

Pre-Commit Gate (run on every modified file)

FILE="<path-to-modified-file>"

# DNA-1
grep "class [A-Z].*{" $FILE | grep -v "extends\|interface\|abstract"

# DNA-2
grep "\.find({" $FILE

# DNA-4
grep "class.*Service" $FILE | grep -v "extends MicroserviceBase"

# DNA-5
grep -n "tenantId" $FILE
# If tenantId appears as a function parameter → violation

# DNA-6
grep "@Controller(" $FILE
# If controller maps to entity-specific route → review

# DNA-9
grep "enqueue(" $FILE
# Check each call — must pass CloudEvents-wrapped object

Expected: all sections empty for a clean file.


Quick Verdicts

ObservationDNA RuleClass
class OrderModel {} in new serviceDNA-1C (+ D if from generation)
.find({ userId: input.userId })DNA-2C
catch (e) { if (e.type) { ... } }DNA-3C
class OrderService {} (no extends)DNA-4C
async process(tenantId: string, ...)DNA-5C
@Controller('orders')DNA-6C
@Subscribe('order.completed') without dedupDNA-7C
enqueue(event) before storeDocument()DNA-8C
enqueue({ orderId, type }) (no CloudEvents)DNA-9C

When a Violation Is Found

  1. Do NOT commit the violating file
  2. Classify the bug (engine-qa-skill): CLASS C if violation in output; CLASS D if traceable to station choice
  3. If generated code: fix the AF station (af1-genesis.ts or af7-rag-update.ts) — not the generated file
  4. If hand-written code: fix directly
  5. Write 3 failing tests before fix (bug-to-tests-skill)
  6. Re-run pre-commit gate → must be clean

Integration

dna-compliance-guard
  → pre-commit gate → blocks violating commits
  → generated-service-audit (mental-debug Rule 12) → same checklist, different trigger
  → engine-qa (CLASS C or D classification)
  → bug-to-tests → 3 failing tests before fix

What ships with it: 3 files

12.1 KB alongside SKILL.md

Keep looking

Skills are one crate of 326,834. 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.