Skip to content

Dianel555/DSkills / skills/capability-evolver

capability-evolver

Verified

Self-evolution workflow for the agent. Before substantive work, recall past outcomes from evolution memory; while editing, detect improvement signals; at task end, record the outcome; when reusable, distill or search the EvoMap network for proven genes/capsules. Use when the user starts non-trivial work (a feature, a fix, a refactor) or asks the agent to "evolve", "learn from this", or "remember how this went".

FileKindSize
README.mdmarkdown3.3 KB
SKILL.mdskill md9.6 KB
docs/skill-advanced.mdmarkdown9.5 KB
docs/skill-distillation.mdmarkdown15.8 KB
docs/skill-evolver.mdmarkdown16.1 KB
docs/skill-main.mdmarkdown35.1 KB
docs/skill-platform.mdmarkdown26.3 KB
docs/skill-protocol.mdmarkdown14.0 KB
docs/skill-structures.mdmarkdown17.6 KB
docs/skill-tasks.mdmarkdown18.6 KB
docs/skill-troubleshooting.mdmarkdown30.8 KB
scripts/README.mdmarkdown8.0 KB
scripts/build-bundle.jsscript3.6 KB
scripts/test-bundle-example.jsonconfig3.4 KB
scripts/validate-bundle.jsscript13.3 KB
scripts/validate-interactive.jsscript14.0 KB

scripts/build-bundle.js

View on GitHub
#!/usr/bin/env node

/**
 * EvoMap Bundle Builder
 *
 * Computes content-addressable asset_ids and assembles a GEP-A2A publish
 * envelope from a spec file. Complements validate-bundle.js (which only checks
 * hashes — nothing else computes them).
 *
 * The canonicalJSON below is byte-identical to validate-bundle.js and the Hub.
 *
 * Spec file: { "gene": {...}, "capsule": {...}, "event": {...} } with NO asset_id
 * fields. Cross-references are derived automatically (content-addressed):
 *   capsule.gene      = <gene asset_id>
 *   event.capsule_id  = <capsule asset_id>
 *   event.genes_used  = [<gene asset_id>]
 *
 * Usage: node build-bundle.js <spec.json> [--out bundle.json] [--node-id node_xxx]
 * node-id falls back to $A2A_NODE_ID. Then validate: node validate-bundle.js <out>
 */

const fs = require('fs');
const path = require('path');
const crypto = require('crypto');

// Canonical JSON for asset ID computation: recursive key sort, compact
// separators, ensure_ascii=False -- byte-identical to the Hub's serialization.
function canonicalJSON(obj) {
  if (obj === null || typeof obj !== 'object') return JSON.stringify(obj);
  if (Array.isArray(obj)) return '[' + obj.map(canonicalJSON).join(',') + ']';
  return '{' + Object.keys(obj).sort()
    .map(k => JSON.stringify(k) + ':' + canonicalJSON(obj[k])).join(',') + '}';
}

function computeAssetId(asset) {
  const payload = { ...asset };
  delete payload.asset_id;
  return 'sha256:' + crypto.createHash('sha256').update(canonicalJSON(payload), 'utf8').digest('hex');
}

function buildBundle(spec, nodeId) {
  const gene = spec.gene;
  const capsule = spec.capsule;
  const event = spec.event;
  if (!gene || !capsule) throw new Error('spec must contain at least a gene and a capsule');

  gene.asset_id = computeAssetId(gene);

  capsule.gene = gene.asset_id;            // derived cross-reference
  capsule.asset_id = computeAssetId(capsule);

  const assets = [gene, capsule];
  if (event) {
    event.capsule_id = capsule.asset_id;   // derived cross-references
    event.genes_used = [gene.asset_id];
    event.asset_id = computeAssetId(event);
    assets.push(event);
  }

  return {
    protocol: 'gep-a2a',
    protocol_version: '1.0.0',
    message_type: 'publish',
    message_id: 'msg_' + Date.now(),
    sender_id: nodeId,
    timestamp: new Date().toISOString(),
    payload: { assets },
  };
}

function main() {
  const args = process.argv.slice(2);
  const specPath = args.find(a => !a.startsWith('--'));
  const outArg = args.find(a => a.startsWith('--out='));
  const nodeArg = args.find(a => a.startsWith('--node-id='));
  const out = outArg ? outArg.slice('--out='.length) : 'bundle.json';
  const nodeId = nodeArg ? nodeArg.slice('--node-id='.length) : (process.env.A2A_NODE_ID || '');

  if (!specPath) {
    console.log('Usage: node build-bundle.js <spec.json> [--out bundle.json] [--node-id node_xxx]');
    console.log('Spec: { "gene": {...}, "capsule": {...}, "event": {...} } with no asset_id fields.');
    process.exit(1);
  }
  if (!nodeId) {
    console.error('ERROR: no node id — pass --node-id=node_xxx or set $A2A_NODE_ID');
    process.exit(1);
  }

  const spec = JSON.parse(fs.readFileSync(path.resolve(specPath), 'utf8'));
  const bundle = buildBundle(spec, nodeId);
  fs.writeFileSync(path.resolve(out), JSON.stringify(bundle, null, 2), 'utf8');

  for (const a of bundle.payload.assets) console.log(`${a.type.padEnd(15)} ${a.asset_id}`);
  console.log('wrote ' + path.resolve(out));
  console.log('next: node validate-bundle.js ' + out);
}

if (require.main === module) main();

module.exports = { buildBundle, computeAssetId, canonicalJSON };
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall