Skip to content

tjl8787/mycodex-skills / skills/tgtool

tgtool

Verified

Use when the user wants the agent to choose, combine, and actively use the best available local skills for a task.

FileKindSize
SKILL.mdskill md36.6 KB
agents/openai.yamlconfig294 B
scripts/build_skills_index.jsscript2.5 KB
scripts/context_guard.jsexecutablescript3.4 KB
skills-index.jsonconfig18.7 KB

scripts/build_skills_index.js

View on GitHub
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');

const repoRoot = path.resolve(__dirname, '../../..');
const skillsRoot = path.join(repoRoot, 'skills');
const outputPath = path.join(repoRoot, 'skills', 'tgtool', 'skills-index.json');

function readFileSafe(p) {
  try {
    return fs.readFileSync(p, 'utf8');
  } catch {
    return null;
  }
}

function extractFrontmatter(content) {
  if (!content || !content.startsWith('---\n')) return {};
  const end = content.indexOf('\n---\n', 4);
  if (end === -1) return {};
  const block = content.slice(4, end);
  const out = {};
  for (const line of block.split('\n')) {
    const m = line.match(/^([A-Za-z0-9_-]+):\s*(.*)$/);
    if (!m) continue;
    const key = m[1].trim();
    let value = m[2].trim();
    if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
      value = value.slice(1, -1);
    }
    out[key] = value;
  }
  return out;
}

function deriveTags(skillDirName, description) {
  const tags = new Set();
  skillDirName.split(/[-_:]+/).filter(Boolean).forEach((t) => tags.add(t.toLowerCase()));
  if (description) {
    for (const t of ['aws', 'debug', 'plan', 'review', 'test', 'security', 'memory', 'orchestration', 'openai', 'github']) {
      if (description.toLowerCase().includes(t)) tags.add(t);
    }
  }
  return [...tags].sort();
}

const entries = fs.readdirSync(skillsRoot, { withFileTypes: true })
  .filter((d) => d.isDirectory())
  .map((d) => d.name)
  .filter((name) => !name.startsWith('.'))
  .sort();

const skills = [];
for (const dir of entries) {
  const skillMd = path.join(skillsRoot, dir, 'SKILL.md');
  const raw = readFileSafe(skillMd);
  if (!raw) continue;

  const frontmatter = extractFrontmatter(raw);
  const name = frontmatter.name || dir;
  const description = frontmatter.description || '';

  const triggers = [];
  if (description) {
    const lower = description.toLowerCase();
    if (lower.includes('use when')) triggers.push('description:use-when');
    if (lower.includes('must use')) triggers.push('description:must-use');
  }

  skills.push({
    skill_id: name,
    path: `skills/${dir}/SKILL.md`,
    summary: description,
    tags: deriveTags(dir, description),
    triggers,
  });
}

const payload = {
  schema_version: '1.0.0',
  generated_at: new Date().toISOString(),
  mode_default: 'lazy',
  fallback_mode: 'full',
  total_skills: skills.length,
  skills,
};

fs.writeFileSync(outputPath, `${JSON.stringify(payload, null, 2)}\n`, 'utf8');
console.log(`Wrote ${skills.length} skills -> ${outputPath}`);
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: 472kUpdated 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