{"id":50902377,"url":"https://github.com/jagmarques/company-skill","last_synced_at":"2026-06-16T04:01:06.540Z","repository":{"id":363089987,"uuid":"1203666546","full_name":"jagmarques/company-skill","owner":"jagmarques","description":"Fable 5 / Mythos style orchestration: a multi-agent company that verifies its own work and cannot stop until every criterion passes.","archived":false,"fork":false,"pushed_at":"2026-06-14T13:12:41.000Z","size":2478,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T13:21:09.173Z","etag":null,"topics":["agent-orchestration","agentic-workflow","ai-agents","autonomous-agents","claude-code","claude-fable","claude-mythos","claude-skills","fable","llm-orchestration","model-agnostic","multi-agent","mythos","stop-hook"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jagmarques.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-07T08:54:21.000Z","updated_at":"2026-06-14T13:12:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jagmarques/company-skill","commit_stats":null,"previous_names":["jagmarques/company-skill"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jagmarques/company-skill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagmarques%2Fcompany-skill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagmarques%2Fcompany-skill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagmarques%2Fcompany-skill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagmarques%2Fcompany-skill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jagmarques","download_url":"https://codeload.github.com/jagmarques/company-skill/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jagmarques%2Fcompany-skill/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34390052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-orchestration","agentic-workflow","ai-agents","autonomous-agents","claude-code","claude-fable","claude-mythos","claude-skills","fable","llm-orchestration","model-agnostic","multi-agent","mythos","stop-hook"],"created_at":"2026-06-16T04:01:01.706Z","updated_at":"2026-06-16T04:01:06.518Z","avatar_url":"https://github.com/jagmarques.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# /company\n\n[![npm](https://img.shields.io/npm/v/company-skill)](https://www.npmjs.com/package/company-skill) [![npm downloads](https://img.shields.io/npm/dw/company-skill)](https://www.npmjs.com/package/company-skill) [![CI](https://github.com/jagmarques/company-skill/actions/workflows/check.yml/badge.svg)](https://github.com/jagmarques/company-skill/actions/workflows/check.yml) [![license](https://img.shields.io/npm/l/company-skill)](LICENSE)\n\n**The agent company that can't stop until the work is verified done**\n\nYour agent stops when it feels done. This makes it stop only when the work is actually done.\n\ncompany-skill is a Claude Code skill for multi-agent orchestration. It runs your agents as a company with a verification gate, so a `/company` run cannot stop until every acceptance criterion is reproduced.\n\n## What it is\n\nYou give it a goal. It splits the work across sub-agents, runs them in dependency waves, and keeps going across cycles until the result is proven instead of just claimed. It runs unattended. Each cycle re-runs every check, a reviewer attacks anything marked passing, and a stop guard blocks exit while any criterion still fails. Sub-agents get scoped delegation contracts rather than the whole problem. A digest writer compresses each finished cycle so the orchestrator stays under its context window, and work is split across models to keep cost down. Nothing is done until it is verified.\n\n## Who it's for\n\nReach for it when \"looks done\" is not good enough and you want the loop to finish the job on its own:\n\n- Build a REST API and prove the tests pass before it stops.\n- Run an overnight refactor that won't quit half-done.\n- Ship a feature where every acceptance criterion is reproduced, not asserted.\n- Hand off a long task and come back to verified output instead of a half-finished draft.\n\nCompared to a single agent or a plain prompt loop, the difference is the gate. A single agent stops when it decides it is finished. A company of agents keeps running, re-checking its own claims each cycle, until the evidence is there. It does not invent work outside the goal, and it tells you plainly when it is blocked.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/dashboard.png\" alt=\"Company dashboard showing a tokens box and a separate cost box with a model-policy toggle, a horizontal cycles-and-memory row, context gauge, active agents, the delegation tree, and criteria\" width=\"900\"\u003e\n  \u003cbr\u003e\n  \u003cem\u003eLive dashboard: a tokens box and a separate cost box (cache savings, hit rate and cycles live with the dollars), a horizontal cycles-and-memory row, context gauge, agent table, delegation tree, and criteria checklist - auto-starts with every /company run.\u003c/em\u003e\n\u003c/p\u003e\n\n```bash\nnpx company-skill install\n```\n\n```\n/company \"Build a REST API for user management with tests\"\n```\n\nOptionally define your team first in `COMPANY.md` (skip it and a minimal company is created):\n\n```markdown\n## Engineering\n- Backend Lead, API design and database architecture\n- Frontend Dev, React components and state management\n```\n\n\n## How it works\n\nEvery criterion starts failing. Workers run in dependency waves under delegation contracts. At the end of each cycle, the Internal Reviewer re-runs every VERIFY-WITH command and the Devil's Advocate attacks everything marked passing. The stop guard physically blocks exit until every criterion has `passes: true` with reproduced evidence. Once done, `STATUS.md` and a `playbook.md` update are written for the next session.\n\n```mermaid\nflowchart TD\n    GOAL --\u003e THINK\n    THINK --\u003e EXECUTE[\"EXECUTE (parallel waves)\"]\n    EXECUTE --\u003e VERIFY\n    VERIFY --\u003e|all criteria pass| DONE[\"Done (STATUS.md + playbook)\"]\n    VERIFY --\u003e|not done| COMPRESS\n    COMPRESS --\u003e NEXT[\"THINK (next cycle)\"]\n    NEXT --\u003e EXECUTE\n```\n\n**Roles:** CEO orchestrator, Internal Reviewer, Devil's Advocate, Digest Writer. The orchestrator reads `COMPANY.md`, activates only the roles the goal needs, and writes delegation contracts in dependency order. Workers append FINDING + SOURCE lines to findings files. The Digest Writer compresses each finished cycle into the next cycle's briefing so the orchestrator never carries raw worker output in its own context.\n\n\n## Dashboard\n\nThe dashboard starts automatically when you run `/company` and prints its URL in the cycle banner and the Claude Code status line. Each session gets its own port (7000-7999, derived from the session id). Open it in any browser.\n\n```\nhttp://127.0.0.1:7421   \u003c- your session's link, printed at startup and in the status bar\n```\n\nA per-session identity header sits at the top: the project, the session id, the active model, and an \"All projects\" link to the cross-project roll-up. The project name is read from your `.company` directory, so two companies launched from the same folder stay labelled apart.\n\nEvery block is a card with the same tile look, so cost, cycles, agents, and criteria all read the same way. What you see, panel by panel:\n\n**Cost and usage** - two stacked bands so dollars never interleave with token counts. The Tokens band shows the volumes (input, output, cache-write, this session) as plain counts. The Cost band shows every dollar figure together (today, this session, and \"Saved by cheaper models vs all-opus\"), with the list-price \"not billed\" note attached only to the dollars. The dollars come from ccusage at public list prices and are notional on a subscription plan, which the card says plainly. A model-policy toggle sits on the savings tile, reusing the same Apple-style pill as the auto-restart control: off is adaptive (cheaper models run sub-tasks for more savings), on forces the best model everywhere. It writes `.company/MODEL_POLICY` (`TIERED` or `FORCE_BEST`), the file the orchestrator reads at the start of each cycle, so the change applies next cycle.\n\n**Context fill** - the live fill percentage, computed with the same formula the context-guard uses. When the session hits the restart threshold (default 50%), the gauge marks the gate before it fires. Next to it sits an Apple-style auto-restart pill, locked on - the restart block is always enforced and the toggle cannot turn it off.\n\n**Delegation tree** - SVG tree of orchestrator, department leads, and workers, showing only the agents running right now. COMPANY.md is the source pool and the activated roster decides which departments are eligible, but a role node paints only when a currently-active agent maps to it, and a department appears only when at least one of its roles is live, so a finished or stale agent leaves no node behind. The orchestrator (CEO) root always shows. Long role names wrap inside their node instead of spilling out. Click any node to expand its current task and status. Zoom only with the pill-shaped +/- buttons, or use the expand button to blow the tree up to fill the screen and the contract button to bring it back. Drag to pan. A refresh resets the tree to its default view. Zero external JS libraries.\n\n**Cycles and memory** - a savings card that shows cycle and memory counts plus the cache-read volume and the dollars saved by prompt caching, marked approximate. The model-tiering saving lives in the Cost band above, next to the policy toggle.\n\n**Active agents** - centered live table of every agent the orchestrator has spawned this session, with model, status, and token count.\n\n**Criteria** - compact progress view with a click-to-expand toggle for the full pass/fail list and reproduced evidence.\n\n**All projects** - the \"All projects\" link near the session header opens `/all`, a cross-project roll-up. It reads `~/.claude/company-dashboards.json`, a small index every dashboard writes itself into, and shows aggregate cost, tokens, and cache reuse grouped by project. It lists only dashboards seen in the last 5 minutes, costs come from ccusage and are notional on a subscription plan, and a session whose usage row is missing shows `?` rather than zero. Each row links back to that session's own dashboard. A dashboard whose owning session has ended drops itself from the index, so `/all` never lists a stale one.\n\nThe dashboard binds 127.0.0.1 only, reads local files, and sends nothing anywhere. Override the port with `COMPANY_DASHBOARD_PORT`.\n\n**You get this automatically.** Installing company-skill (npm or the install script) copies `dashboard.js` and `statusline.js` alongside the rest of the skill. Running `/company` then starts the dashboard for you and prints its localhost URL at startup and in the status line. No extra setup.\n\n### Status line\n\n`scripts/statusline.js` appends a labelled link to the per-session dashboard so the URL is one glance away on every turn. The appended segment is `📊 company dashboard \u003curl\u003e`.\n\nWith no status line of your own configured, it also renders the model and context fill. The context fill draws as a progress bar using Claude's native used_percentage so the number matches the session indicator, so the full line reads:\n\n```\nOpus 4.8 (1M context)  |  [████░░░░░░] 25%  |  📊 company dashboard http://127.0.0.1:7421\n```\n\nIf you already have a status line, the setup step stores your prior command in `.company/statusline-base.json` and runs it first. Your line leads, the script appends only the link, and it does not re-print model or context since your own line owns those:\n\n```\n\u003cyour status line\u003e  |  📊 company dashboard http://127.0.0.1:7421\n```\n\n\n## Unattended auto-restart loop\n\n`scripts/company-autoloop.js` runs `/company` unattended across many sessions. It restarts into a fresh context automatically when a work session approaches the context threshold, so a long goal keeps going without a human pasting the restart prompt each time.\n\nA script is needed because a fully unattended fresh-context restart cannot be done with Claude Code native features alone. Hooks cannot run `/clear` or start a fresh turn, a Stop-hook block keeps the same context, and auto-compaction only summarizes. The supervisor is the external driver that owns the restart decision. This is the validated finding.\n\nEach turn runs a headless `claude -p` session while the supervisor watches the session context fill. At the threshold it drives `/company restart` to emit the `NEXT.md` continuation, then launches a fresh session seeded from it.\n\n```bash\nnode scripts/company-autoloop.js --max-turns 100 \"/company GOAL: \u003cyour goal\u003e\"\n```\n\nKey flags and env:\n\n- `--project-dir \u003cpath\u003e` the project the run targets (default: current dir)\n- `--company-dir \u003cpath\u003e` override the `.company` dir (default: `\u003cproject-dir\u003e/.company`)\n- `--max-turns \u003cn\u003e` hard cap on work turns across all sessions (default: 100)\n- `--restart-timeout-secs \u003cn\u003e` max wait for the restart markers (default: 420)\n- `COMPANY_CONTEXT_THRESHOLD` fill fraction or percent that triggers a restart (default: 0.50, set a low value for testing)\n\nIt runs with `--permission-mode bypassPermissions` for the autonomy an unattended loop needs. The threshold is configurable, so you can drop it low to exercise the restart path during testing.\n\n\n## Cost and quality\n\nMulti-agent orchestration buys quality with tokens. /company's answer to the token cost: spend strong-model tokens only where they buy quality, and report the bill every cycle.\n\n**Tiered model delegation** - each delegation contract carries a `MODEL: cheap|mid|strong` tag. The orchestrator maps the tag to a model at spawn time. Effort scales with both ROI and stakes - high-stakes or high-value work gets heavier spawn. Override every sub-agent with `CLAUDE_CODE_SUBAGENT_MODEL` at launch, or write `FORCE_BEST` into `.company/MODEL_POLICY` mid-run.\n\n**Per-cycle cost reporting** - every cycle produces a `COST:` line in the briefing and a `cycles/cycle-{N}-cost.json` artifact.\n\n**Prompt caching** - agent prompts are laid out stable-first so repeated spawns hit a shared cache prefix.\n\n**Fable 5 / adaptive thinking** - on models that support adaptive thinking (Fable 5 and later), the orchestrator and verify layers run with thinking enabled. No `budget_tokens` param - reflection depth is model-controlled.\n\n\n## Key features\n\n**Stop guard** - blocks session exit until every criterion has `passes: true` and reproduced evidence. Malformed state blocks rather than fails open. Deleting a hard criterion blocks instead of unlocking. [42-check test](tests/stop-guard.test.js).\n\n**Context-fill guard** - a second Stop hook forces `/company restart` once context reaches the threshold (default 50%). Reads the model id from the transcript to detect the context window. The restart block is always on and the dashboard shows it as a locked Apple-style pill toggle. [63-check test](tests/context-guard.test.js).\n\n**Delegation contracts** - a task does not exist without a filled contract. `check-contracts.js` rejects missing fields, vacuous VERIFY-WITH commands, invalid MODEL tiers, and cyclic dependencies. [29-check test](tests/check-contracts.test.js).\n\n**Multi-level verification** - the Internal Reviewer re-runs every VERIFY-WITH command independently. The Devil's Advocate attacks everything marked passing. For criteria tagged `stakes: \"high\"` in `criteria.json` (irreversible action, security surface, or public-facing claim), the critic runs in three fresh contexts with distinct lenses - correctness, security, reproducibility - and unanimous ACCEPT is required. Normal criteria keep the single critic. The completeness probe enumerates every surface the GOAL names and auto-rejects any unchecked one.\n\n**Design judge-panel** - for criteria tagged `kind: design`, the lead may emit up to three contracts from materially different angles plus one synthesis contract, reserved for genuine design forks.\n\n**Git isolation** - workers never push to main and never merge. Every code change lands as a draft PR. The merge gate is yours.\n\n**Pre-push secret scan** - workers run `scripts/secret-scan.js` before any `git push`. Exit 1 blocks the push.\n\n**Codebase graph** - on repos with \u003e200 tracked files, `scripts/codegraph.js` builds a commit-keyed ranked symbol map into `.company/codegraph/` for lead prompts.\n\n**Status-line link** - `scripts/statusline.js` appends a labelled `📊 company dashboard \u003curl\u003e` segment to the Claude Code status bar, enforced idempotently on every `/company` run. The link resolves in any session through a cwd-independent global registry, with an `/all` fallback. It chains any status line you already have and never re-prints model or context when one is present. See [Status line](#status-line).\n\n\n## Commands\n\n```\n/company \"Build X\"      Run until X is done\n/company                Run using COMPANY.md priorities\n/company restart        Emit a verified continuation prompt for a fresh session\n/company:status         Show last status\n/company:resume         Continue from last session\n```\n\n\n## What gets created\n\nState lives in `./.company/` (relocate with `COMPANY_DIR`):\n\n```\n.company/\n  GOAL.md          criteria.json     criteria.lock\n  playbook.md      active-roster.md  active-tasks.md\n  STATUS.md        OWNER             MODEL_POLICY\n  CANCEL                             (persistent human exit)\n  cycles/          per-cycle briefing, contracts, review, cost\n  {dept}/          per-employee findings, persist across sessions\n  codegraph/       commit-keyed symbol map (large repos only)\n```\n\n\n## Examples\n\n[`startup.md`](examples/startup.md), [`research-lab.md`](examples/research-lab.md), [`dev-team.md`](examples/dev-team.md).\n\n\n## Contributing\n\n```bash\nbash scripts/check.sh\n```\n\nCI runs the same script on every pull request. Pull requests welcome. Every change lands as a draft PR.\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjagmarques%2Fcompany-skill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjagmarques%2Fcompany-skill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjagmarques%2Fcompany-skill/lists"}