Target harness

The files MARS adds to your repo.

MARS adds .harness/, AGENTS.md, docs, tickets, guardrails, roles, and release files to a target repo. You can read them, review them, change them, update them, commit them, or remove them.

Used by agents: target harness files are not just docs for humans. They route agent context, tools, guardrails, goals, BDD contracts, tickets, and release discipline. Use documentation map to find canonical source records.

Directory Structure

mars init creates a target-owned harness plus durable planning, delivery, quality, and release artifacts. For the full ownership, local state, and cleanup map, use the Files And State Reference.

.
|-- AGENTS.md
|-- VERSION
|-- CHANGELOG.md
|-- .harness/
|   |-- manifest.yaml
|   |-- metadata.yaml
|   |-- roles/
|   |-- skills/
|   |-- guardrails/
|   +-- knowledge/
+-- docs/
    |-- goals/
    |-- features/
    |-- tickets/
    |-- exec-plans/
    |-- design-docs/
    |-- references/
    +-- QUALITY_SCORE.md
SurfaceUser purposeUpgrade behavior
AGENTS.mdCompact first-read map for agents and humans.Preserved after init.
.harness/manifest.yamlExecutable role, model, tool, trigger, guardrail, and context routing config.Preserved after init.
.harness/metadata.yamlGenerated harness version drift signal.Harness-owned.
.harness/roles/Editable role prompts.Existing prompts are preserved.
.harness/skills/Reusable compact procedures.Existing skills are preserved.
.harness/guardrails/Hard and advisory safety rules.User-owned.
.harness/knowledge/Context routes into repo docs.User-owned.
docs/features/BDD contracts and business logic.User-owned source of truth.
docs/tickets/Work item lifecycle.User-owned source of truth.
VERSION, CHANGELOG.mdSemantic version and generated patch notes.User-owned release state.

Manifest

.harness/manifest.yaml is the entrypoint for executable agent behavior. It names roles, prompts, canonical domains, modes, model tiers, tool allowlists, guardrails, knowledge routes, and triggers. For exact field validation, routing modes, schedules, generated defaults, and manifest troubleshooting, open the Bundle And Manifest Reference.

name: my-project
description: MARS bundle for my-project

roles:
  engineer:
    prompt: roles/engineer.md
    domain: engineer
    mode: ticket-delivery
    model: coding
    tools:
      - file_read
      - file_write
      - shell_exec
      - grep
      - mars_cli
    guardrails:
      - guardrails/safety.yaml
    knowledge:
      - knowledge/context-glossary.yaml
    triggers:
      - ticket.assigned
FieldMeaningUser guidance
nameBundle identifier.Keep stable unless renaming the target harness.
descriptionHuman-readable bundle description.Use domain-specific language for your project.
rolesMap of executable role keys.Role keys are what you pass to mars run <role>.
promptRole prompt file path relative to .harness/.Keep prompts focused and route longer context through knowledge files.
domainCanonical operating domain.Use planner, engineer, reviewer, maintainer, end-to-end-tester, or orchestrator vocabulary.
modeLower-kebab-case reason the role runs.Examples: ticket-delivery, quality-review, pipeline-repair.
modelModel tier or hint.Prefer fast, reasoning, or coding for tier routing.
toolsAllowed tool names.Grant the smallest tool set that can do the role's job.
guardrailsGuardrail YAML files.Attach role-specific policies instead of making every rule global.
knowledgeRoute files for contextual docs.Point to docs; avoid stuffing long content into the manifest.
triggersEvents or schedules that enqueue work.Use explicit triggers for automation and manual mars run for one-off work.

Roles

Roles are executable personas with prompts, tools, guardrails, knowledge routes, model tiers, trust levels, scores, and triggers. Generated roles are starter defaults. Target owners should tune them to their product domain and risk tolerance.

Planner domain

Strategy, goals, plans, architecture fit, scenario schedules, and tradeoffs.

Engineer domain

Ticket-bound implementation through the next thin, verifiable slice.

Reviewer domain

Quality review, regression risk, missing tests, and completion truth.

Maintainer domain

Dependency, release, docs, housekeeping, and sustained repo health.

End-to-End Tester domain

Reproducible user-path validation and evidence collection.

Orchestrator domain

Routing ambiguous follow-up, respecting active plans and work state.

Knowledge Routes

Knowledge routes are compact YAML maps that tell MARS which repo docs to include when a role needs specific context. They are the antidote to giant prompts: keep instructions small and route the right durable docs only when relevant.

routes:
  - when: project terminology, domain concepts, architecture vocabulary, naming, or unclear intent
    paths: AGENTS.md, docs/design-docs/context-glossary.md, docs/design-docs/index.md
User rule: If a role keeps rediscovering the same concept, add or improve a knowledge route before bloating the role prompt.

Guardrails

Guardrails are YAML rules that constrain file writes and tool use. Hard rules block operations; advisory rules become prompt guidance.

rules:
  - id: no-hardcoded-secrets
    name: No hardcoded secrets
    severity: hard
    scope: global
    pattern: '(?i)(password|secret|api_key|token)\s*[:=]\s*["''][^"'']{8,}'
    message: Do not hardcode secrets. Use environment variables or a secrets manager.
    stale_days: -1
FieldUse
idStable unique rule ID shown in violations.
severityhard blocks; advisory informs.
scopeglobal or a role key.
patternRegex matched against content.
file_patternOptional file glob to narrow the rule.
messageActionable explanation for the agent and human reviewer.
stale_daysReview cadence; use -1 only for permanent rules.

Skills

Skills are compact reusable workflows in .harness/skills/<name>/SKILL.md. They guide an agent through recurring judgment-heavy procedures without granting new tool authority. Use skills when a human recovery step repeats, when a process is easy to forget, or when the role prompt would otherwise grow too large.

Good skill candidates

Release publication, private release auth, persona design, validation replay, recurring dependency update checks.

Poor skill candidates

One-off project facts, secrets, raw data dumps, or behavior that should be enforced mechanically by a tool or guardrail.

Operating Model Artifacts

ArtifactWhat users put thereWhy it matters
docs/goals/active.mdCurrent user-visible priorities.Prevents agents from optimizing for stale chat context.
docs/exec-plans/active/The one active plan and evidence schedule.Keeps delivery order explicit.
docs/features/BDD feature contracts and business logic.Defines done before implementation claims.
docs/tickets/Backlog, in-progress, review, and done tickets.Scopes the next walking-skeleton slice.
docs/design-docs/Architecture and product decisions.Gives future agents rationale, not just final code.
docs/references/Research and external context.Keeps evidence durable and linkable.

Business Logic Rule

Product rules, state transitions, validations, permissions, scoring/trust behavior, routing rules, release classification, and user-visible outcomes belong in BDD feature contracts before or alongside implementation.

Quality, Scores, Trust, And Release State

Quality score

docs/QUALITY_SCORE.md is refreshed from live score, telemetry, ticket, dogfood, guardrail, check, no-op, and human follow-up evidence.

Trust levels

observer, contributor, and autonomous determine progressive role permission inside the independently selected execution profile. Mutation also requires acknowledged host execution; target config cannot grant it.

Semantic release

VERSION and CHANGELOG.md are generated release state in both MARS source and initialized target repos.

Traceability

Completion claims should link to tests, traces, commits, docs, release notes, and validation evidence.

Customization Checklist

  1. Rename and describe roles for your domain

    Keep role keys stable once automation depends on them.

  2. Tune tool allowlists

    Grant mutation only where the role's job requires it.

  3. Attach focused guardrails

    Prefer scoped rules over broad global blocks.

  4. Add knowledge routes

    Route architecture, API, domain, and style guidance from durable docs.

  5. Choose model routing deliberately

    Use local by default, cloud when configured, and overrides for explicit repo or role needs.

  6. Keep generated docs alive

    When behavior changes, update the owning docs in the same change.

Upgrade And Eject Behavior

Upgrade preserves user-owned files

mars update harness --repo ~/my-project

Missing defaults are filled, but local prompts, manifests, guardrails, knowledge routes, tickets, plans, references, and target docs are preserved. For init, register, start, run, scan, upgrade, and eject behavior, open the Target Lifecycle Reference.

Compare new defaults deliberately

To adopt changed starter prompts, initialize a temporary repo with the new binary and copy only the changes you want.

Eject is dry-run first

mars eject --repo ~/my-project
mars eject --repo ~/my-project --apply --confirm my-project

Removal deletes working-tree harness artifacts and the associated database unless you pass --keep-db. It does not rewrite git history.