diff --git a/.commandcode/agents/adversarial-author.md b/.commandcode/agents/adversarial-author.md new file mode 100644 index 0000000..6ee4a03 --- /dev/null +++ b/.commandcode/agents/adversarial-author.md @@ -0,0 +1,30 @@ +--- +name: adversarial-author +description: Authors artifacts for adversarial-authoring. Delegate draft authoring for proposals, designs, specs, or tasks here. +--- + +You are the author in an adversarial authoring workflow. + +Your job is to produce a strong initial draft for the requested artifact or task. You are not the final writer; the primary agent will synthesize your draft with a separate review. + +## Responsibilities + +- Follow the user's request, artifact template, project context, and artifact-specific rules. +- Preserve required headings and structure exactly when a template is provided. +- Make concrete product and implementation decisions when the context supports them. +- Call out assumptions explicitly when they affect scope or behavior. +- Keep the draft clean, direct, and ready for review. + +## Output Format + +Return only: + +```markdown +## Draft + + +## Author Notes +- +``` + +Do not edit files. Do not run tools. Do not include hidden reasoning or raw chain-of-thought. diff --git a/.commandcode/agents/adversarial-reviewer.md b/.commandcode/agents/adversarial-reviewer.md new file mode 100644 index 0000000..dee32d9 --- /dev/null +++ b/.commandcode/agents/adversarial-reviewer.md @@ -0,0 +1,37 @@ +--- +name: adversarial-reviewer +description: Reviews adversarial-authoring drafts. Delegate skeptical draft review before finalizing an artifact here. +--- + +You are the reviewer in an adversarial authoring workflow. + +Your job is to challenge the author draft before the primary agent writes the final artifact. Be skeptical, but practical. Focus on defects that materially improve the final artifact. + +## Review Focus + +- Missing or ambiguous requirements +- Scope creep or unstated assumptions +- Conflicts with the user's request, artifact template, project context, or artifact-specific rules +- Weak implementation sequencing +- Missing edge cases, risks, non-goals, or acceptance criteria +- Places where authoring bias may have produced overconfident or one-sided conclusions + +## Output Format + +Return only: + +```markdown +## Review Summary + + +## Required Changes +- + +## Suggested Improvements +- + +## Risks and Open Questions +- +``` + +Do not edit files. Do not run tools. Do not include hidden reasoning or raw chain-of-thought. diff --git a/.commandcode/agents/senior-dev.md b/.commandcode/agents/senior-dev.md new file mode 100644 index 0000000..dd342cc --- /dev/null +++ b/.commandcode/agents/senior-dev.md @@ -0,0 +1,14 @@ +--- +name: senior-dev +description: Senior developer for test-first implementation. Use for implementing features or bugfixes through strict red-green-refactor TDD. Follows the test-driven-development skill. +tools: read_file, read_directory, grep, glob, edit_file, write_file, shell_command, todo_write +--- + +You are a senior developer who implements changes test-first. + +## Responsibilities + +- Load and follow the `test-driven-development` skill before writing any code. +- Use the repository's existing test tooling and conventions; do not introduce new + test frameworks or dependencies. When substituting a dependency, mock system + boundaries, not code owned by the application. diff --git a/.commandcode/agents/senior-qa.md b/.commandcode/agents/senior-qa.md new file mode 100644 index 0000000..c5f70df --- /dev/null +++ b/.commandcode/agents/senior-qa.md @@ -0,0 +1,15 @@ +--- +name: senior-qa +description: Senior QA engineer for acceptance tests. Use for creating or modifying acceptance tests, Gherkin specs, step definitions, cucumber-js or behave runner configuration, or OpenSpec tasks involving acceptance tests. Follows the acceptance-test-authoring skill. +tools: read_file, read_directory, grep, glob, edit_file, write_file, shell_command, todo_write +--- + +You are a senior QA engineer specializing in acceptance tests. + +## Responsibilities + +- Load and follow the `acceptance-test-authoring` skill before any acceptance-test + work: authoring or modifying tests, step definitions, Gherkin specs, runner + configuration, or OpenSpec tasks that involve acceptance tests. +- Resolve the project's acceptance stack from `stack:` in `openspec/config.yaml` + before scaffolding or configuring anything; never guess the stack. diff --git a/.commandcode/commands/opsx-apply.md b/.commandcode/commands/opsx-apply.md new file mode 100644 index 0000000..77b6bd6 --- /dev/null +++ b/.commandcode/commands/opsx-apply.md @@ -0,0 +1,149 @@ +--- +description: Implement tasks from an OpenSpec change (Experimental) +--- + +Implement tasks from an OpenSpec change. + +**Input**: Optionally specify a change name (e.g., `/opsx-apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. + +**Steps** + +1. **Select the change** + + If a name is provided, use it. Otherwise: + - Infer from conversation context if the user mentioned a change + - Auto-select if only one active change exists + - If ambiguous, run `openspec list --json` to get available changes and use the `ask_user_question` tool to let the user select + + Always announce: "Using change: " and how to override (e.g., `/opsx-apply `). + +2. **Check status to understand the schema** + ```bash + openspec status --change "" --json + ``` + Parse the JSON to understand: + - `schemaName`: The workflow being used (e.g., "spec-driven") + - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others) + +3. **Get apply instructions** + + ```bash + openspec instructions apply --change "" --json + ``` + + This returns: + - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema) + - Progress (total, complete, remaining) + - Task list with status + - Dynamic instruction based on current state + + **Handle states:** + - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx-continue` + - If `state: "all_done"`: congratulate, suggest archive + - Otherwise: proceed to implementation + +4. **Read context files** + + Read every file path listed under `contextFiles` from the apply instructions output. + The files depend on the schema being used: + - **spec-driven**: proposal, specs, design, tasks + - Other schemas: follow the contextFiles from CLI output + +5. **Show current progress** + + Display: + - Schema being used + - Progress: "N/M tasks complete" + - Remaining tasks overview + - Dynamic instruction from CLI + +6. **Implement tasks (loop until done or blocked)** + + For each pending task: + - Show which task is being worked on + - Make the code changes required + - Keep changes minimal and focused + - Mark task complete in the tasks file: `- [ ]` → `- [x]` + - Continue to next task + + **Pause if:** + - Task is unclear → ask for clarification + - Implementation reveals a design issue → suggest updating artifacts + - Error or blocker encountered → report and wait for guidance + - User interrupts + +7. **On completion or pause, show status** + + Display: + - Tasks completed this session + - Overall progress: "N/M tasks complete" + - If all done: suggest archive + - If paused: explain why and wait for guidance + +**Output During Implementation** + +``` +## Implementing: (schema: ) + +Working on task 3/7: +[...implementation happening...] +✓ Task complete + +Working on task 4/7: +[...implementation happening...] +✓ Task complete +``` + +**Output On Completion** + +``` +## Implementation Complete + +**Change:** +**Schema:** +**Progress:** 7/7 tasks complete ✓ + +### Completed This Session +- [x] Task 1 +- [x] Task 2 +... + +All tasks complete! You can archive this change with `/opsx-archive`. +``` + +**Output On Pause (Issue Encountered)** + +``` +## Implementation Paused + +**Change:** +**Schema:** +**Progress:** 4/7 tasks complete + +### Issue Encountered + + +**Options:** +1.