Skip to content

tt-a1i/archify / .agents/skills/archify-tuning

archify-tuning

Verified

Improve Archify diagram accuracy, visual quality and complete authoring speed with fewer repairs. Use for generation experiments or evaluating changes to layout, routing, diagnostics, authoring instructions and acceptance rules against actual diagrams and agent traces.

FileKindSize
SKILL.mdskill md8.9 KB
references/experiment-design.mdmarkdown4.1 KB
references/trace-export.mdmarkdown2.2 KB
references/trace-signals.mdmarkdown4.8 KB
scripts/collect.mjsscript13.2 KB
scripts/lib.mjsscript7.8 KB
scripts/replay.mjsscript6.2 KB
scripts/round.mjsscript4.5 KB
scripts/shots.mjsscript5.6 KB

scripts/round.mjs

View on GitHub
#!/usr/bin/env node
// Usage: node round.mjs <project-path> [--types architecture,workflow,...] [--archify <archify-dir>] [--name <round>]
//
// Prepares <tuning-home>/rounds/<round>/<type>/ for one generation round,
// records the project and Archify revisions, and writes prompts.json: one
// {type, title, task} per diagram type, each to be run as its own subagent.
import { execFileSync } from 'node:child_process';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { DIAGRAM_TYPES, TYPE_NAMES_ZH, tuningHome } from './lib.mjs';

const args = process.argv.slice(2);
const option = (name, fallback) => {
  const index = args.indexOf(name);
  return index === -1 ? fallback : args[index + 1];
};
const here = path.dirname(fileURLToPath(import.meta.url));
const project = args[0] && !args[0].startsWith('--') ? path.resolve(args[0]) : null;
const archify = path.resolve(option('--archify', path.join(here, '../../../../archify')));
const types = (option('--types', DIAGRAM_TYPES.join(','))).split(',').map((type) => type.trim()).filter(Boolean);
const git = (cwd, ...command) => execFileSync('git', ['-C', cwd, ...command], { encoding: 'utf8' }).trim();
if (!project || !fs.existsSync(path.join(archify, 'bin/archify.mjs')) || types.some((type) => !DIAGRAM_TYPES.includes(type))) {
  console.error(`Usage: node round.mjs <project-path> [--types ${DIAGRAM_TYPES.join(',')}] [--archify <archify-dir>] [--name <round>]`);
  process.exit(2);
}

const rounds = path.join(tuningHome(), 'rounds');
fs.mkdirSync(rounds, { recursive: true });
const next = 1 + Math.max(0, ...fs.readdirSync(rounds).map((name) => Number((name.match(/^r(\d+)-/) || [])[1]) || 0));
const name = option('--name', `r${String(next).padStart(2, '0')}-${path.basename(project)}`);
const root = path.join(rounds, name);
if (fs.existsSync(root)) {
  console.error(`Round ${root} already exists; choose another --name.`);
  process.exit(2);
}

const dirty = git(project, 'status', '--porcelain').split('\n').filter(Boolean).map((line) => line.slice(3));
const archifyDirty = git(archify, 'status', '--porcelain', '--', '.').split('\n').filter(Boolean);
const record = {
  name,
  created: new Date().toISOString(),
  project: { path: project, revision: git(project, 'rev-parse', 'HEAD'), origin: (() => { try { return git(project, 'remote', 'get-url', 'origin'); } catch { return null; } })(), dirty },
  archify: { path: archify, revision: git(archify, 'rev-parse', 'HEAD'), dirty: archifyDirty },
  types,
};
const ignore = dirty.length
  ? `ignore its pre-existing uncommitted files (${dirty.join(', ')}) and do not cite them`
  : 'it has no uncommitted files';
const prompts = types.map((type) => {
  const workdir = path.join(root, type);
  fs.mkdirSync(workdir, { recursive: true });
  return {
    type,
    title: `${name} ${TYPE_NAMES_ZH[type]}`,
    task: `画 ${project} 这个项目的${TYPE_NAMES_ZH[type]}。

Use the Archify skill located at ${archify} (read ${archify}/SKILL.md first and follow it exactly, including the references it tells you to read). Do NOT install, update, or copy Archify anywhere; use the CLI directly as \`node ${archify}/bin/archify.mjs ...\`.

Constraints:
- Your working directory for all Archify commands and outputs is ${workdir} (cd there; the skill's \`.archify/<type>-<slug>-<timestamp>/\` folder must be created under it, not inside the project).
- ${project} is read-only source evidence. Do not create, modify, or delete any file in it (${ignore}). Pass it as \`--repo-root\` where the skill requires.
- Do not modify anything under ${archify}.
- Follow the skill's repair loop until finalize passes or the skill tells you to stop.

When done, reply concisely with: diagram type, absolute path of the final candidate JSON and final HTML, whether finalize passed (key status lines), and every repair iteration (diagnostic code + what you changed). Also list any point where the skill docs or CLI messages were unclear, contradictory, or sent you the wrong way.`,
  };
});
fs.writeFileSync(path.join(root, 'round.json'), `${JSON.stringify(record, null, 2)}\n`);
fs.writeFileSync(path.join(root, 'prompts.json'), `${JSON.stringify(prompts, null, 2)}\n`);
console.log(`round ${name}: ${types.length} prompts in ${path.join(root, 'prompts.json')}`);
if (archifyDirty.length) console.log(`warning: ${archify} has uncommitted changes; commit them or the round will not be reproducible.`);
console.log('Run each prompt as its own background subagent, and do not edit the Archify tree until every subagent has finished.');
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: 463kUpdated Claude CodeCodexVerifiedInstall
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: 463kUpdated Claude CodeCodexVerifiedInstall
discernment-nudgeanthropics/skillsAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.Stars: 195kUpdated Claude CodeCodexVerifiedInstall
internal-commsanthropics/skillsA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).Stars: 195kUpdated Claude CodeCodexVerifiedInstall