agentleFS
max-roguemax-rogue/Stackmoss/AGENTS.md

Stackmoss

AGENTS.md4 starsChanged 8 months agoMITView on GitHub

StackMoss is a CLI pipeline that generates and maintains agent team configurations for AI coding assistants. It creates roles, governance, and skill files so every AI agent shares project context. Every command MUST call validateState() before executing. Compiled outputs are generated — do NOT edit them manually. Edit team.md instead. No git add . — stage files explicitly by path.

  • Deletes or force-pushes
  • Commits and pushes
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,542 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 repository6 other files it gives its agents.

The file

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

8 rules. About 1 is common, 2 are distinctive, and 5 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    MIGRATING: Read-only on repo, write only to .agents/, no code execution

    line 24
  2. Very specific:

    Every command MUST call validateState() before executing.

    line 27
  3. Very specific:

    Always run npm test after modifying TypeScript files.

    line 64
  4. Very specific:

    Run npm run build before committing to verify compilation.

    line 65
  5. Very specific:

    Use npm (not yarn, not pnpm) for dependency management.

    line 66
  6. Distinctive:

    Ask for confirmation before adding new production dependencies.

    line 67
  7. Distinctive:

    Atomic writes: All file generation uses temp→rename pattern.

    line 73
  8. Common:

    Secret hygiene: Never persist tokens, passwords, API keys, credentials, or private keys in config, generated instructions, logs, or patch …

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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

AGENTS.md — StackMoss

Project Overview

StackMoss is a CLI pipeline that generates and maintains agent team configurations for AI coding assistants. It creates roles, governance, and skill files so every AI agent shares project context.

  • Runtime: Node.js ≥18 · TypeScript (strict, ES2022)
  • Package manager: npm
  • Test framework: Vitest
  • CLI framework: Commander.js
  • Entry point: src/bin/stackmoss.ts
  • Authority: runtime behavior must stay aligned across src/, generated outputs, and tests.

State Machine (BRD §6)

GLOBAL ──[inject]──▶ MIGRATING ──[resolve + promote]──▶ OPERATIONAL
                                                              │
                                                    [upgrade] CONSTITUTION-only merge
                                                    [patch apply] replace-only + budget gate
  • GLOBAL: Template-only, no project knowledge
  • MIGRATING: Read-only on repo, write only to .agents/, no code execution
  • OPERATIONAL: Research locked, learn from operational experience only

Every command MUST call validateState() before executing.

CLI Commands (BRD §7)

CommandPhaseState Required
stackmoss new <name>AAny
stackmoss injectBGLOBAL
stackmoss resolveBMIGRATING
stackmoss promote --confirmBMIGRATING
stackmoss run <alias>COPERATIONAL
stackmoss checkCOPERATIONAL
stackmoss patch apply/rejectCOPERATIONAL
stackmoss upgradeCOPERATIONAL

BRD Roles → Agent Mapping

BRD RoleCodex AgentTrigger
[TL] Tech Leadtech-leadArchitecture, feature breakdown, review, CONTEXT.md/FEATURES.md
[DEV] DeveloperdevImplementation, env commands, debug
[QA] Quality AssuranceqaTests, acceptance criteria, regression, word budget
[SEC] Security-litesecurity-auditorAuth, PII, financial data features

Compile Targets (BRD §15)

TargetSplit LevelOutput Path
Claude CodeRole-level (1 role = 1 file).claude/skills/
Cursor / RooRole-level.cursor/skills/, .roo/skills/
CodexRole-level + repo guidanceAGENTS.md + .agents/skills/
AntigravityRole-level + shared rules/workflows.agent/{skills,rules,workflows}

Compiled outputs are generated — do NOT edit them manually. Edit team.md instead.

Working Agreements

  • Always run npm test after modifying TypeScript files.
  • Run npm run build before committing to verify compilation.
  • Use npm (not yarn, not pnpm) for dependency management.
  • Ask for confirmation before adding new production dependencies.

Architecture Rules (BRD §3)

  1. Deterministic logic only: Pack/role selection, persona detection — never LLM.
  2. Replace-only + word budget: Config never grows. Team total max: 1800 words.
  3. Atomic writes: All file generation uses temp→rename pattern.
  4. No silent assumptions: Unknown → OPEN_QUESTIONS.md. Never infer critical decisions.
  5. Safe by default: Suggest-only mode. Forbid rm -rf, drop table, git push --force.
  6. Secret hygiene: Never persist tokens, passwords, API keys, credentials, or private keys in config, generated instructions, logs, or patch proposals.

Commit Hygiene (A/B/C Layers)

LayerScopePrefix
AFeature code (src/, tests/)feat():, fix():, refactor():
BReports / logschore(report):, test(result):
CDocuments (*.md, .agents/)docs():

No git add . — stage files explicitly by path.

Language Boundary

ContextLanguage
Human-facing communicationVietnamese
Code, CLI output, commit messagesEnglish
BRD, FEATURES.md, NORTH_STAR.mdVietnamese
SKILL.md, workflow instructionsEnglish

Source Structure

src/
├── bin/stackmoss.ts       # CLI entry (shebang)
├── commands/              # new, inject, resolve, promote, run, check, patch, upgrade
├── intake/                # Fast (7Q) + Interview (13Q) modes
├── templates/             # 7 output file generators
├── compile/               # ClaudeCode, Cursor, Antigravity, Codex, VS Code compile targets
├── scanner/               # Repo scanner + migration report
├── patch/                 # Patch proposal engine
├── budgets.ts             # Canonical word budget source (BRD §12.4)
├── config.ts              # Config schema + factory
└── state-machine.ts       # 3-state machine + validation

Skills

Skills in .agents/skills/, each with SKILL.md + agents/openai.yaml + references/:

  • cli-pipeline — CLI commands, state machine, pipeline orchestration
  • intake-engine — Onboarding questionnaire, pack selection, completeness gates
  • template-engine — Output file generation, compile layer, schema validation
  • stretch-testing — Adversarial QA, BRD mismatch detection, edge case probing

Workflows

In .agents/workflows/, invoke with /slash-command:

  • /feature-cycle — Full feature cycle from TODO to DONE
  • /new-command — Scaffold a new CLI command
  • /new-template — Create or update an output template
  • /qa-check — QA verification checklist

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.