agentleFS
max-roguemax-rogue/Stackmoss/.agents/skills/cli-pipeline/SKILL.md

cli-pipeline

Skill4 starsChanged 8 months agoMITView on GitHub

StackMoss CLI architecture — command scaffolding, state machine transitions, and pipeline orchestration. Use when working on CLI commands, state logic, or the core pipeline.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is 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.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

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

    line 26
  2. Distinctive:

    Every CLI command MUST follow this structure:

    line 30
  3. Distinctive:

    No critical hypothesis with confidence < 80%

    line 43
  4. Distinctive:

    Never recommend pushing or committing secret-bearing diffs.

    line 48
  5. Distinctive:

    Use LLM for any logic/routing decisions (deterministic only)

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

CLI Pipeline Skill

When to Use

  • Implementing or modifying a CLI command (new, inject, resolve, promote, run, check, patch apply, upgrade)
  • Working on the 3-state machine (GLOBAL → MIGRATING → OPERATIONAL)
  • Designing command argument parsing or validation
  • Building the Patch Proposal pipeline

Architecture Rules

State Machine (3 states)

GLOBAL ──[inject]──▶ MIGRATING ──[resolve + promote]──▶ OPERATIONAL
                                                              │
                                                    [upgrade] merge CONSTITUTION only
                                                    [patch apply] replace-only + budget gate

Each state has strict permission boundaries:

  • GLOBAL: Template-only, no project knowledge
  • MIGRATING: Read-only on repo, write only to .agents/, no code execution
  • OPERATIONAL: Research locked, learn only from operational experience

Command Pattern

Every CLI command MUST follow this structure:

src/commands/<name>.ts
├── parseArgs()     → validate CLI arguments
├── checkState()    → verify current state allows this command
├── execute()       → main logic
└── report()        → user-facing output

Promote Criteria (hard gates)

promote --confirm only succeeds when ALL true:

  1. MIGRATION_REPORT.md has zero open questions
  2. At least 1 command in [DEV-ENV] verified
  3. No critical hypothesis with confidence < 80%
  4. User typed --confirm flag explicitly

Secret Handling

  • Redact tokens, passwords, API keys, credentials, and private keys before persisting command output or stderr into patch proposals or repo files.
  • Never recommend pushing or committing secret-bearing diffs.

Authority Sources (read before implementing)

  • BRD §6: State Machine definitions → BRD
  • BRD §7: CLI Commands (full list)
  • BRD §12: Patch Proposal Flow + Trigger Rules
  • BRD §13: Phase B Migration
  • BRD §14: Upgrade isolation

Do NOT

  • Skip state validation before executing a command
  • Allow promote without hard criteria being met
  • Use LLM for any logic/routing decisions (deterministic only)
  • Auto-execute destructive operations
  • Persist raw secrets from stderr, env dumps, or commands into .stackmoss/, team.md, or generated instructions

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.