agentleFS
numman-alinumman-ali/cc-mirror/AGENTS.md

cc-mirror

AGENTS.md2.3k starsChanged 6 months agoMITView on GitHub

Location: <bin-dir>/<variant> (macOS/Linux) or <bin-dir>/<variant>.cmd (Windows)

  • Reads credentials
  • Installs packages

Trending

Quiet since February.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 3 mentionsFeb 2026: 1 mentionMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the numman-ali/cc-mirror repository that our weekly crawl found: only 4 in all, so this is a hint, not a trend. There is no adoption data for this file yet.
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    TypeScript + ESM: Use import/export, avoid CommonJS

    line 73
  2. Very specific:

    New files: Place in relevant src/<area>/ folder

    line 76
  3. Very specific:

    Default <bin-dir> is ~/.local/bin on macOS/Linux and ~/.cc-mirror/bin on Windows.

    line 99
  4. Very specific:

    Only minimal mode supported (maximal deprecated)

    line 150
  5. Very specific:

    Verify .claude.json has hasCompletedOnboarding + theme

    line 231
  6. Distinctive:

    Run wrapper in TTY and confirm splash + no onboarding prompt

    line 232
  7. Very specific:

    Use npx cc-mirror update test-zai to validate update flow

    line 233
  8. Distinctive:

    When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively.

    line 268
  9. Distinctive:

    Only use skills listed in <available_skills> below

    line 279
  10. Distinctive:

    Do not invoke a skill that is already loaded in your context

    line 280

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Repository Guidelines

Project Structure

src/
├── cli/                    # CLI entrypoint and commands
│   ├── index.ts           # Main CLI entry
│   ├── commands/          # create, update, remove, doctor, etc.
│   └── args.ts            # Argument parsing
├── tui/                    # Ink-based TUI wizard
│   ├── app.tsx            # Main TUI application
│   ├── screens/           # Individual screen components
│   ├── components/        # Reusable UI components
│   ├── hooks/             # React hooks for business logic
│   ├── state/             # State types and management
│   └── router/            # Screen navigation
├── core/                   # Core variant management
│   ├── index.ts           # Public API (createVariant, updateVariant, etc.)
│   ├── variant-builder/   # Step-based variant creation
│   │   ├── VariantBuilder.ts
│   │   ├── VariantUpdater.ts
│   │   ├── steps/         # Build steps (PrepareDirectories, InstallNative, etc.)
│   │   └── update-steps/  # Update steps
│   ├── prompt-pack/       # System prompt overlays
│   │   ├── providers/     # Per-provider overlays (zai.ts, minimax.ts)
│   │   ├── overlays.ts    # Overlay resolution
│   │   └── targets.ts     # Target file mapping
│   └── *.ts               # Utils (paths, fs, tweakcc, skills, etc.)
├── providers/              # Provider templates
│   └── index.ts           # Provider definitions and defaults
├── brands/                 # TweakCC brand presets
│   ├── index.ts           # Brand resolution
│   ├── types.ts           # TweakCC config types
│   ├── zai.ts             # Z.ai theme + blocked tools
│   ├── minimax.ts         # MiniMax theme + blocked tools
│   └── *.ts               # Other brand configs

test/                       # Node test runner tests
├── e2e/                   # End-to-end tests
├── tui/                   # TUI component tests
├── unit/                  # Unit tests
└── helpers/               # Test utilities

repos/                      # Upstream reference copies (vendor data, history)
├── anthropic-claude-code-*/       # Claude Code versions for comparison/reference
├── claude-code-system-prompts/    # System prompt changelog and sources
└── tweakcc/                       # TweakCC repo (prompt patching tool)

notes/                      # Research notes and deep dive documentation
├── CLI-VERSIONS.md               # Version comparison notes
├── *-DEEP-DIVE.md                # Feature research and analysis
└── RECONSTRUCTION-LEDGER.md      # Project state and decisions

docs/                       # User documentation
dist/                       # Build output (generated)

Build, Test, and Development Commands

npm install          # Install dependencies
npm run dev          # Run CLI from TypeScript sources
npm run tui          # Launch TUI wizard
npm test             # Run all tests
npm run typecheck    # TypeScript check without emit
npm run bundle       # Build dist/cc-mirror.mjs
npm run render:tui-svg  # Regenerate docs/cc-mirror-tree.svg

Coding Conventions

  • TypeScript + ESM: Use import/export, avoid CommonJS
  • Formatting: 2-space indent, single quotes, semicolons
  • Tests: Name as *.test.ts, place in test/ mirroring src/ structure
  • New files: Place in relevant src/<area>/ folder

Runtime Layout & Config Flow

Variant Directory Structure

~/.cc-mirror/<variant>/
├── config/
│   ├── settings.json       # Env overrides (API keys, base URLs, model defaults)
│   ├── .claude.json        # API-key approvals + onboarding/theme + MCP servers
├── tweakcc/
│   ├── config.json         # Brand preset + theme list + toolsets
│   └── system-prompts/     # Prompt-pack overlays (after tweakcc apply)
├── native/
│   └── claude              # Native Claude Code binary (or claude.exe on Windows)
└── variant.json            # Metadata

Wrapper Script

Location: <bin-dir>/<variant> (macOS/Linux) or <bin-dir>/<variant>.cmd (Windows)

Default <bin-dir> is ~/.local/bin on macOS/Linux and ~/.cc-mirror/bin on Windows.

  • Sets CLAUDE_CONFIG_DIR to variant config
  • Loads settings.json into env at runtime
  • Shows provider splash ASCII art when TTY and CC_MIRROR_SPLASH != 0
  • Auto-update disable: DISABLE_AUTOUPDATER=1 in settings.json env

Provider Auth Modes

ProviderAuth ModeKey Variable
customAPI KeyANTHROPIC_API_KEY
zai, minimax, kimiAuth TokenANTHROPIC_AUTH_TOKEN
openrouter, vercel, nanogpt, gatewayzAuth TokenANTHROPIC_AUTH_TOKEN
ollamaAuth TokenANTHROPIC_AUTH_TOKEN + ANTHROPIC_API_KEY
ccrouterOptionalplaceholder token
mirrorNoneuser authenticates normally

Model Mapping (env vars)

  • ANTHROPIC_DEFAULT_SONNET_MODEL
  • ANTHROPIC_DEFAULT_OPUS_MODEL
  • ANTHROPIC_DEFAULT_HAIKU_MODEL
  • Optional: ANTHROPIC_SMALL_FAST_MODEL, ANTHROPIC_MODEL, CLAUDE_CODE_SUBAGENT_MODEL

Provider Blocked Tools

Providers block tools via settings.json permissions.deny entries (written during variant creation/update). Tool lists are defined in src/brands/*.ts.

zai blocked tools:

export const ZAI_BLOCKED_TOOLS = [
  'mcp__4_5v_mcp__analyze_image', // Server-injected
  'mcp__milk_tea_server__claim_milk_tea_coupon',
  'mcp__web_reader__webReader',
  'WebSearch', // Use zai-cli search
  'WebFetch', // Use zai-cli read
];

minimax blocked tools:

export const MINIMAX_BLOCKED_TOOLS = [
  'WebSearch', // Use mcp__MiniMax__web_search
];

Prompt Pack

  • Only minimal mode supported (maximal deprecated)
  • Per-provider overlays in src/core/prompt-pack/providers/
  • Applied to tweakcc/system-prompts/ via TweakCC
  • Overlays are sanitized to strip backticks (tweakcc template literal issue)

Common Development Tasks

TaskLocation
Add/update providersrc/providers/index.ts
Add/update brand themesrc/brands/*.ts
Add blocked toolssrc/brands/zai.ts or minimax.ts → *_BLOCKED_TOOLS
Modify prompt pack overlayssrc/core/prompt-pack/providers/*.ts
Add build stepsrc/core/variant-builder/steps/
Add TUI screensrc/tui/screens/ + app.tsx + router/routes.ts

Debugging & Verification

Config Inspection

# Variant config
cat ~/.cc-mirror/<variant>/config/settings.json
cat ~/.cc-mirror/<variant>/config/.claude.json
cat ~/.cc-mirror/<variant>/variant.json

# TweakCC config
cat ~/.cc-mirror/<variant>/tweakcc/config.json

# Wrapper script
cat <bin-dir>/<variant>

Health Check

npx cc-mirror doctor

Reference Files

  • Upstream CLI references: repos/anthropic-claude-code-*/cli.js (multiple versions for comparison)
  • System prompt sources: repos/claude-code-system-prompts/ (includes CHANGELOG.md)
  • Research notes: notes/ (deep dives, version analysis, design decisions)
  • Applied prompts: ~/.cc-mirror/<variant>/tweakcc/system-prompts/
  • Debug logs: ~/.cc-mirror/<variant>/config/debug/*.txt

CLI Feature Gates

# Native installs don't have cli.js on disk. Use tweakcc to unpack first:
npx tweakcc unpack /tmp/claude-code.js ~/.cc-mirror/<variant>/native/claude
rg "tengu_prompt_suggestion|promptSuggestionEnabled" /tmp/claude-code.js

# Check cached gates
cat ~/.cc-mirror/<variant>/config/.claude.json | jq '.statsig'

ZAI CLI (for Z.ai variants)

# Available commands
npx zai-cli --help
npx zai-cli vision --help
npx zai-cli search --help
npx zai-cli read --help
npx zai-cli repo --help

# Examples
npx zai-cli search "React 19 new features" --count 5
npx zai-cli read https://docs.example.com/api
npx zai-cli vision analyze ./screenshot.png "What errors?"
npx zai-cli repo search facebook/react "server components"

Requires Z_AI_API_KEY in environment.

Manual Debug Flow (Create Variant)

  1. Run: npm run dev -- create --provider zai --name test-zai --api-key <key>
  2. Verify variant.json exists
  3. Verify .claude.json has hasCompletedOnboarding + theme
  4. Run wrapper in TTY and confirm splash + no onboarding prompt
  5. Use npx cc-mirror update test-zai to validate update flow

Testing

npm test                                    # All tests
npm test -- --test-name-pattern="E2E"      # E2E tests only
npm test -- --test-name-pattern="TUI"      # TUI tests only

Key test files:

  • test/e2e/creation.test.ts - Variant creation for all providers
  • test/e2e/blocked-tools.test.ts - Provider blocked tools
  • test/tui/*.test.tsx - TUI component tests

Architecture Notes

  • Step-based builds: Each step is isolated, can be sync or async
  • Build order: PrepareDirectories → InstallNative → WriteConfig → BrandTheme → Tweakcc → Wrapper → ShellEnv → SkillInstall → Finalize

Documentation

  • README.md - User-facing documentation
  • DESIGN.md - Architecture design document
  • docs/features/mirror-claude.md - Mirror provider guide
  • docs/architecture/overview.md - Architecture overview
  • docs/RECONSTRUCTION-LEDGER.md - Current state + decisions

<skills_system priority="1">

Available Skills

<!-- SKILLS_TABLE_START --><usage> When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.

How to use skills:

  • Invoke: npx openskills read <skill-name> (run in your shell)
    • For multiple: npx openskills read skill-one,skill-two
  • The skill content will load with detailed instructions on how to complete the task
  • Base directory provided in output for resolving bundled resources (references/, scripts/, assets/)

Usage notes:

  • Only use skills listed in <available_skills> below
  • Do not invoke a skill that is already loaded in your context
  • Each skill invocation is stateless </usage>

<available_skills>

<skill> <name>open-source-maintainer</name> <description>End-to-end GitHub repository maintenance for open-source projects. Use when asked to triage issues, review PRs, analyze contributor activity, generate maintenance reports, or maintain a repository. Triggers include "triage", "maintain", "review PRs", "analyze issues", "repo maintenance", "what needs attention", "open source maintenance", or any request to understand and act on GitHub issues/PRs. Supports human-in-the-loop workflows with persistent memory across sessions.</description> <location>project</location> </skill>

</available_skills>

<!-- SKILLS_TABLE_END -->

</skills_system>

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.