Skip to content

refactor(bugfix): convert commands to skills, add CLAUDE.md, clean up#42

Draft
jwm4 wants to merge 11 commits intoambient-code:mainfrom
jwm4:feature/bugfix-workflow-skills-refactor
Draft

refactor(bugfix): convert commands to skills, add CLAUDE.md, clean up#42
jwm4 wants to merge 11 commits intoambient-code:mainfrom
jwm4:feature/bugfix-workflow-skills-refactor

Conversation

@jwm4
Copy link
Contributor

@jwm4 jwm4 commented Feb 10, 2026

Problem

The bugfix workflow had all process logic embedded directly in command files, a 600-line bundled agent persona (amber.md) that duplicated the systemPrompt identity, and several supplementary files that were no longer needed.

Changes

Commands → Skills Architecture

  • Created 5 skills in .claude/skills/{name}/SKILL.md — each contains the full process definition for a workflow phase (reproduce, diagnose, fix, test, document)
  • Rewrote 5 commands as thin wrappers that delegate to their corresponding skill, passing $ARGUMENTS and existing session context
  • Updated systemPrompt to reference skills alongside commands

Added CLAUDE.md

  • Extracted genuinely useful behavioral guidelines from amber.md: engineering discipline, safety guardrails, confidence levels, escalation criteria, PR template, quality standards
  • Skipped all ACP-platform-specific content (K8s, CRDs, architecture, autonomy levels, operating modes)
  • Added "Working With the Project" section so the workflow respects target project conventions

Cleanup

  • Deleted .claude/agents/amber.md — redundant with the Amber persona defined in systemPrompt; useful content extracted to CLAUDE.md
  • Deleted supplementary files: AMBER_RESEARCH.md, FIELD_REFERENCE.md, TEMPLATE_FEEDBACK.md
  • Updated README to reflect new directory structure, explain commands/skills relationship, and fix markdown lint issues

Net Impact

  • 851 insertions, 3,343 deletions — significant reduction in bloat
  • Cleaner separation: systemPrompt defines what to do, CLAUDE.md defines how to behave, skills contain detailed processes, commands are thin entry points

Testing

  • JSON validated (ambient.json parses correctly)
  • Markdown lint clean (0 errors)
  • All command → skill references verified

jwm4 added 11 commits February 10, 2026 15:36
- Convert all 5 commands (reproduce, diagnose, fix, test, document) into
  detailed skills in .claude/skills/{name}/SKILL.md
- Rewrite commands as thin wrappers that delegate to skills, passing
  arguments and session context
- Add CLAUDE.md with behavioral guidelines extracted from amber.md
  (engineering discipline, safety guardrails, quality standards)
- Remove .claude/agents/amber.md (redundant with systemPrompt persona)
- Remove supplementary files (AMBER_RESEARCH.md, FIELD_REFERENCE.md,
  TEMPLATE_FEEDBACK.md)
- Update systemPrompt to reference skills alongside commands
- Update README to reflect new structure
- Add .claude/skills/pr/SKILL.md with systematic fork-based PR workflow
- Add .claude/commands/pr.md thin wrapper
- Handles pre-flight checks, fork setup, branch/commit/push, and PR creation
- Includes error recovery for common failures (no push access, sandbox
  restrictions, missing fork)
- Update systemPrompt and startupPrompt to include /pr as phase 6
- Update README with PR phase documentation
Make CLAUDE.md self-contained by including workflow phases, commands,
skill locations, and artifact path directly instead of referencing
ambient.json (which is platform plumbing, not model-visible).

Also fix markdown lint warnings (emphasis-as-heading, code block language).
- Add .claude/skills/review/SKILL.md — critically evaluates fix and tests,
  issues verdict (inadequate fix / incomplete tests / solid), recommends
  next steps
- Add .claude/commands/review.md thin wrapper
- Update /test skill to report verification.md path and summarize results
  inline to the user
- Update systemPrompt, startupPrompt, CLAUDE.md, README with /review as
  optional phase 5 between test and document
- systemPrompt: add PHASE TRANSITIONS section requiring agent to stop
  and summarize at end of each phase instead of auto-advancing
- CLAUDE.md: add Flow Control section reinforcing pause behavior,
  trim to ~70 lines per best practices
- pr/SKILL.md: add placeholders table defining GH_USER, FORK_OWNER,
  UPSTREAM_OWNER/REPO, REPO, and BRANCH_NAME with sources
- pr/SKILL.md: rewrite Step 2 to ask user before creating fork,
  wait for confirmation, never silently skip ahead
- pr/SKILL.md: replace flat fallback with 4-rung fallback ladder,
  patch file is now absolute last resort
- ambient.json: remove rubric (deferred to future PR),
  remove startupPrompt and results fields
- Delete ambient.clean.json (no longer needed)
- AGENTS.md: add sandbox restrictions table
- All command wrappers now say 'Read the file ... now and follow it step
  by step' instead of 'Using the X skill from ...' which the agent was
  interpreting as conceptual guidance rather than a file-read instruction
- systemPrompt: add CRITICAL prefix to skill-reading instruction, explicitly
  say 'use the Read tool to open the referenced SKILL.md file'
- pr/SKILL.md: add 'IMPORTANT: Follow This Skill Exactly' section at top
  with anti-improvisation rules
- pr/SKILL.md: add pre-flight summary checkpoint between Steps 1 and 2
- pr/SKILL.md: upgrade 'no fork' path from 'STOP' to 'HARD STOP' with
  explicit instructions to wait for user twice (before fork attempt,
  after fork attempt fails)
- pr/SKILL.md: add fork verification command before proceeding to Step 3
- Add critical rules: never attempt gh repo fork without asking user first,
  never fall back to patch files without exhausting all other options
- systemPrompt: add step to tell user which skill is being invoked
  before reading it, so user can correct if wrong phase was picked
- CLAUDE.md: reinforce skill announcement policy
- Step 1a: don't dead-end on missing gh auth — continue pre-flight to
  gather info from git, then present options
- Step 1b: add fallback git config when gh is unavailable
- Step 1d: add git-remote-based fallback for upstream repo identification
- Add decision point after pre-flight: present 3 clear options to user
  (set up auth, provide fork URL, or prepare for manual push) and WAIT
  for response instead of dumping all manual instructions at once
Every skill now ends with a 'When This Phase Is Done' section that:
- Tells the agent to summarize findings to the user
- Recommends the natural next step in the workflow
- Explicitly says to stop and wait for the user

This reinforces the phase-transition pause from the systemPrompt and
CLAUDE.md at the skill level, so the agent gets the instruction to stop
regardless of whether it's following the systemPrompt guidance or
reading the skill directly.

Next-step recommendations follow the natural flow:
reproduce → diagnose → fix → test → review → document → pr
- New /assess phase (phase 1): reads the bug report, presents understanding,
  identifies gaps, proposes reproduction plan, and waits for user confirmation
  before taking any action. No code execution or cloning in this phase.
- systemPrompt: updated to 8-phase flow starting with ASSESS, added explicit
  instruction to start with assess when user provides a bug report
- CLAUDE.md: updated phase list to include assess
- pr/SKILL.md: clarified that 'never push to upstream' applies even to org
  bots and GitHub Apps — no exceptions based on account type
- pr/SKILL.md: added reminder at pre-flight summary not to skip Step 2
- systemPrompt: scope 'start with ASSESS' to initial bug report only
- systemPrompt: add 'INTERPRETING USER RESPONSES' section so agent
  maps phase names and confirmations to the correct next phase
- assess skill: allow cloning and reading code (but not executing)
- assess skill: add Step 2 to check for repo and clone if missing,
  read referenced PRs/files to inform assessment
- assess skill: update output to note repo is cloned for later phases
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