Skip to content

Standard interface for project-specific coding standards and mach6 execution defaults #274

Description

@Hrovatin

Note: I am not sure if there is a good way to do this already, so far all options I looked at seemed like hacks rather than real interface.

Summary

Projects have different coding standards, review preferences, and workflow defaults. There is currently no standard way to declare these per project so that dreb and mach6 skills pick them up automatically. Every project that needs this behavior must set up custom extensions or override skill files from scratch, with no shared convention or discoverable file format.

Current Behavior

There is no built-in standard for per-project coding standards or mach6 skill defaults. The following workarounds exist but all require custom setup that must be repeated per project:

  1. CONTRIBUTING.md / CLAUDE.md / AGENTS.md — mach6-plan reads these files for project conventions, but they are not automatically injected into mach6-implement or mach6-review agents. No structured section for coding standards is defined or expected by the tools.

  2. Extension + session_start — An extension can read a local file and call ctx.appendSystemContext() to inject standards into the session. This works but injects into the entire session context rather than targeting only mach6 workflow agents, and requires custom extension code with no standard file name or location.

  3. Extension intercepting subagent tool calls — An extension can listen for tool_call events where toolName === "subagent" and prepend standards to the task prompt for matching agent types. This is the most effective current workaround but requires non-trivial custom extension code per project with no standard convention.

  4. agentModels.models in .dreb/settings.json — Per-project model overrides for review agents are supported, but there is no equivalent for default review aspects, behavior flags, or standards content.

  5. Custom skill override in .dreb/skills/mach6-review/SKILL.md — The full built-in skill can be copied and modified to read defaults from settings. This works but requires maintaining a full copy of the skill file that diverges from upstream updates.

  6. registerCommand extension — A custom /review command can apply default aspects before delegating to the built-in skill. Works for aspects but does not integrate with the standard /skill:mach6-review syntax and requires custom code.

Proposed Behavior

1. Standard coding standards file

dreb auto-discovers .dreb/CODE_STANDARDS.md (or a configured path) in the project directory. When present, its content is automatically injected into the task prompt of mach6 workflow subagents (plan, implement, review agents) without any custom extension code.

2. Settings keys for mach6 skill defaults

New settings under a mach6 namespace in .dreb/settings.json:

{
  "mach6": {
    "codeStandardsFile": ".dreb/CODE_STANDARDS.md",
    "review": {
      "defaultAspects": ["code", "completeness"],
      "alwaysRunAspects": ["errors"]
    },
    "implement": {
      "batchSize": "moderate"
    }
  }
}
  • codeStandardsFile — path to a file whose contents are injected into plan/implement/review agent prompts
  • review.defaultAspects — which review agents run when none are specified on the command line (overrides the built-in default of all agents)
  • review.alwaysRunAspects — aspects that always run regardless of what is specified
  • implement.batchSize — default batch size hint for fix application ("simple", "moderate", "complex")

3. Command-line aspects still override defaults

Explicit aspects passed to /skill:mach6-review always take full precedence over defaultAspects. alwaysRunAspects are merged in regardless.

/skill:mach6-review 42              # uses defaultAspects + alwaysRunAspects
/skill:mach6-review 42 code         # uses: code + alwaysRunAspects
/skill:mach6-review 42 code errors  # uses: code, errors + alwaysRunAspects

4. Injection scope

Code standards are injected into:

  • subagents launched by mach6-plan (Explore agents doing codebase research)
  • subagents launched by mach6-implement (feature-dev agents)
  • review agents launched by mach6-review (code-reviewer, error-auditor, test-reviewer, completeness-checker, simplifier)

They are NOT injected into the main session context, keeping standards scoped to workflow execution.

Acceptance Criteria

  • .dreb/CODE_STANDARDS.md (or the path in mach6.codeStandardsFile) is automatically injected into mach6 plan/implement/review subagent task prompts when the file exists
  • mach6.review.defaultAspects sets which aspects run when none are specified in the command
  • mach6.review.alwaysRunAspects defines aspects that are always added regardless of user input
  • Explicit aspects on the command line fully override defaultAspects (but not alwaysRunAspects)
  • All new settings are documented in settings.md under a mach6 section
  • No custom extension code required — drop a file and/or set config
  • Works with both global (~/.dreb/agent/settings.json) and project-level (.dreb/settings.json) settings, with project settings taking precedence
  • If codeStandardsFile does not exist, skill execution is unaffected (silent no-op)
  • mach6.md documentation updated to describe standards injection and default aspect behavior

Technical Notes

Standards injection

The cleanest implementation path is within each mach6 skill file. Each skill reads .dreb/CODE_STANDARDS.md (resolved from CWD) and prepends it to subagent task strings before launching. This keeps the injection co-located with the workflow logic and avoids a cross-cutting extension mechanism.

Alternatively, a shared helper read by each skill avoids duplication.

Settings resolution

mach6.review.defaultAspects is read inside the mach6-review skill during Step 2 (parse input). If the user passed aspects, use those. If not, fall back to defaultAspects from settings. If settings has no value, use the current built-in default (all agents).

Relevant files

  • packages/coding-agent/skills/mach6-plan/SKILL.md — add standards injection step
  • packages/coding-agent/skills/mach6-implement/SKILL.md — add standards injection step
  • packages/coding-agent/skills/mach6-review/SKILL.md — add standards injection + default aspects resolution
  • packages/coding-agent/docs/settings.md — document mach6.* settings namespace
  • packages/coding-agent/docs/mach6.md — document standards file convention and default aspects behavior

Related issues / prior art

  • agentModels.models in settings is an existing precedent for per-project agent behavior configuration
  • Skill-level overrides via .dreb/skills/ are an existing precedent for project-level customization

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions