Skip to content

feat(framework): Phase v1 PR 5 — devtrail-audit-execute skill (3 platforms)#107

Merged
montfort merged 1 commit intomainfrom
feat/audit-execute-skill
May 5, 2026
Merged

feat(framework): Phase v1 PR 5 — devtrail-audit-execute skill (3 platforms)#107
montfort merged 1 commit intomainfrom
feat/audit-execute-skill

Conversation

@montfort
Copy link
Copy Markdown
Contributor

@montfort montfort commented May 5, 2026

Summary

Fifth of 8 PRs implementing the integrated v1 audit-skills iteration. Introduces the new auditor-side skill that closes the zero-copy/paste loop: the operator now invokes 3 skills total (`/devtrail-audit-prompt` → `/devtrail-audit-execute` × N → `/devtrail-audit-review`) instead of pasting prompts and responses between the IDE and external chats.

What the skill does

`devtrail-audit-execute` runs inside an auditor-side CLI (gemini-cli, claude-cli, copilot-cli, codex-cli, or any agent runtime with read access to the repo). It:

  1. Resolves the Charter via the optional argument or auto-discovery (D14): scans `.devtrail/audits/*/audit-prompt.md` for prompts without a `report-.md` from this auditor.
  2. Detects model identifier from the runtime and produces a filesystem-safe slug (D14).
  3. Reads the unified audit prompt at the canonical path.
  4. Audits with tool use, citing `path:line` of files actually opened (discipline from the prompt's REGLA ABSOLUTA).
  5. Writes the report to `.devtrail/audits//report-.md` with v1 frontmatter (`audit_role: auditor`, `evidence_citations`).
  6. Emits the wait warning at completion: "do NOT return to the main agent for `/devtrail-audit-review` yet unless ALL audits you commissioned have completed." Load-bearing for parallel-CLI workflows.

Files added

  • `dist/.claude/skills/devtrail-audit-execute/SKILL.md` — frontmatter with `allowed-tools` (covers Go, Rust, Node, Python verification commands).
  • `dist/.gemini/skills/devtrail-audit-execute/SKILL.md` — same body, no `allowed-tools` (Gemini schema).
  • `dist/.agent/workflows/devtrail-audit-execute.md` — same body, description-only frontmatter (generic agent).

Tests

4 new fixture tests in `cli/tests/audit_skill_test.rs`:

  • Per-platform frontmatter shape (Claude with `allowed-tools`, Gemini without, agent description-only).
  • Cross-platform parity asserts canonical paths, D14 elements (auto-discovery + model-slug detection), the wait warning, and the discipline carriers (`path:line` + read-only).

Test plan

  • `cargo test --test audit_skill_test` → 12/12 green (8 existing + 4 new)
  • `cargo test` (full suite) → all suites green
  • No version bump (lands with PRs 6-8 in integrated v1 release)

Phase v1 progress

PR Title Status
1 R10 resolver fix merged (#103)
2 `git_range` default → `origin/main..HEAD` merged (#104)
3 Unified `audit-prompt.md` template merged (#105)
4 CLI subcommand refactor + canonical paths merged (#106)
5 New skill `devtrail-audit-execute` (3 platforms) this PR
6 Updated `audit-prompt` and `audit-review` skills pending
7 Adopter docs (3 langs) pending
8 Bump `fw-4.9.0` / `cli-3.10.0` + CHANGELOG + tag release pending

🤖 Generated with Claude Code

…forms)

Introduces the new auditor-side skill that closes the cero-copy/paste
loop in the v1 audit flow. The operator now invokes 3 skills total
(audit-prompt → audit-execute × N → audit-review) instead of pasting
prompts and responses between IDE and external chats.

devtrail-audit-execute runs INSIDE an auditor-side CLI (gemini-cli,
claude-cli, copilot-cli, codex-cli, or any agent runtime configured
with read access to the adopter's repo). It:

  1. Resolves the Charter via the optional argument or auto-discovery
     (D14): scans .devtrail/audits/*/audit-prompt.md for prompts that
     do not yet have a report-<self-model-slug>.md from this auditor.
  2. Detects this auditor's model identifier from the runtime and
     produces a filesystem-safe slug.
  3. Reads the unified audit prompt at the canonical path.
  4. Audits with tool use, citing path:line of files actually opened
     (carrying the discipline from the prompt's REGLA ABSOLUTA section).
  5. Writes the report to .devtrail/audits/<id>/report-<slug>.md with
     the v1 frontmatter (audit_role: auditor, evidence_citations).
  6. Emits the wait warning at completion: "do NOT return to the main
     agent for /devtrail-audit-review yet unless ALL audits you
     commissioned have completed." This is load-bearing for parallel-
     CLI workflows where the operator might otherwise invoke review
     after the first audit finishes.

Files added (3 platforms per devtrail skill convention):

  - dist/.claude/skills/devtrail-audit-execute/SKILL.md — frontmatter
    has allowed-tools (Read, Write, Glob, Grep, Bash with allowlists
    for go/cargo/npm/pytest verification commands across the common
    stacks).
  - dist/.gemini/skills/devtrail-audit-execute/SKILL.md — same body,
    no allowed-tools (Gemini schema).
  - dist/.agent/workflows/devtrail-audit-execute.md — same body,
    description-only frontmatter (generic agent runtime).

Tests added (4 fixture tests in cli/tests/audit_skill_test.rs):

  - devtrail_audit_execute_claude_skill_exists_and_has_allowed_tools
    (asserts the build/test allowlist covers Go, Rust, Node, Python).
  - devtrail_audit_execute_gemini_skill_exists_without_allowed_tools.
  - devtrail_audit_execute_agent_workflow_exists_with_description_only.
  - devtrail_audit_execute_three_platforms_share_core_guidance —
    asserts on every platform: canonical paths (.devtrail/audits/,
    audit-prompt.md, report-<self-model-slug>.md), D14 elements
    (auto-discovery, model-slug detection), the wait warning ("ALL
    audits ... complete"), and the discipline carriers (path:line
    citation, read-only).

Test plan:
  - cargo test --test audit_skill_test → 12/12 green (8 existing for
    audit-prompt + audit-review, 4 new for audit-execute).
  - cargo test (full suite) → all suites green, no regressions.
  - No version bump (lands together with PRs 6-8 in the integrated
    v1 release per Propuesta/devtrail-audit-cli-flow.md v0.2 §5).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant