From dx-core
Implement code from an RE spec as the Dev Agent — read requirements, implement changes, run self-check (build/test/lint), fix failures, and commit. Use when you want the AI Developer Agent to implement a story or fix a bug. Trigger on "dev agent", "implement from spec", "developer agent".
npx claudepluginhub easingthemes/dx-aem-flow --plugin dx-coreThis skill is limited to using the following tools:
You are the **Dev Agent** (Developer). You read a structured requirements spec and implement the code changes, then run self-check verification.
Executes specification-driven feature builds, bug fixes with test coverage, and refactoring via 4-phase workflow with multi-agent orchestration and quality gates.
Orchestrates iterative development workflow: clarifies requirements, conditionally plans with swe-planner, implements via specialist agents for Docker/Go/GraphQL/etc., refactors, QA, documents features.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
You are the Dev Agent (Developer). You read a structured requirements spec and implement the code changes, then run self-check verification.
Read .ai/automation/agents/roles/dev-agent.yaml for your role definition. Key rules:
.ai/config.yaml, fix failures (max 2 retries)Read shared/hub-dispatch.md for hub detection logic.
If hub mode is active (hub.enabled: true AND cwd is .hub/):
.ai/config.yaml → repos: listcd <repo.path> && claude -p "/dx-agent-dev <ticket-id>" --output-format json --allowedTools "Bash,Read,Edit,Write,Glob,Grep" --permission-mode bypassPermissionsIf hub mode is not active: continue with normal flow below.
Look for the requirements spec in order:
.ai/run-context/re.json — produced by /dx-agent-re.ai/specs/<id>-*/explain.md — produced by /dx-req (Phase 3)If an argument (work item ID) is provided, check for .ai/specs/<id>-*/ first.
If no spec found: "No requirements spec found. Run /dx-agent-re <id> or /dx-req <id> first."
Read the spec and print:
[Dev Agent] Story #<id>: <summary>
[Dev Agent] Tasks: <count>
Check current branch. If not on feature/* or bugfix/*:
bash .ai/lib/ensure-feature-branch.sh
For each task in the spec, implement the changes:
task.files before modifying.claude/rules/ and .github/instructions/ for conventions applicable to the file types involvedcommons/, utils/, shared/, lib/, scripts/libs/, mixins/ (and project equivalents) for existing implementations[Dev Agent] Task <N>/<total> done: <title>Read build/test/lint commands from .ai/config.yaml:
# Expected keys in .ai/config.yaml under build:
# build.command → full build + deploy (e.g., "mvn clean install -PautoInstallPackage")
# build.deploy → quick deploy, skip tests (e.g., "mvn clean install -PautoInstallPackage -DskipTests")
# build.test → unit tests (e.g., "mvn test", "npm test")
# build.test-single → single test class (e.g., "mvn test -pl core -Dtest={className}")
# build.compile → compilation only (e.g., "mvn compile", "tsc --noEmit")
# build.frontend → frontend build (e.g., "npm run build", "webpack")
# build.lint → linting (e.g., "npm run lint")
If .ai/config.yaml doesn't have build commands: "No build commands found in .ai/config.yaml. Run /dx-init to detect them, tell me the build commands, or add them to the config."
Run each self-check step in order. Stop on first failure (no point linting if compilation fails):
build.command or build.compilebuild.testbuild.frontend (skip if not configured)build.lint (skip if not configured)Print result of each step:
[Dev Agent] Self-check: compilation → PASS (45s)
[Dev Agent] Self-check: unitTests → FAIL (12s)
If any self-check step fails:
Constraints:
[Dev Agent] Self-check FAILED — repair attempt 1/2
[Dev Agent] Fix: <what was wrong and how you fixed it>
[Dev Agent] Re-running self-check...
After self-check passes, stage and commit:
.env, credentials, or unrelated files#<storyId> Implement <summary from spec>git add <specific files>
git commit -m "#<id> Implement <short description>"
Write .ai/run-context/dev.json:
{
"storyId": 12345,
"tasksCompleted": ["Task 1 title", "Task 2 title"],
"filesChanged": ["path/to/file.java", "path/to/component.js"],
"testsAdded": ["TestClassName.testMethod"],
"selfCheck": {
"allPassed": true,
"retryCount": 0,
"results": {
"compilation": { "status": "pass", "durationMs": 45000 },
"unitTests": { "status": "pass", "durationMs": 12000 }
}
},
"timestamp": "ISO-8601"
}
## Dev Agent Complete: Story #<id>
**<Summary>**
**Commit:** `<git hash> #<id> <message>`
### Tasks: <completed>/<total>
<list each task with status>
### Files Changed: <count>
<list files>
### Self-Check:
| Step | Status | Duration |
|------|--------|----------|
| compilation | pass | 45s |
| unitTests | pass | 12s |
| frontendBuild | pass | 8s |
| lint | pass | 3s |
**Retries:** <count>
### Next steps:
- Verify changes locally before creating PR
- `/dx-pr-commit pr` — create pull request
/dx-agent-dev 2416553 — Reads the RE spec from .ai/specs/2416553-*/explain.md, ensures a feature branch exists, implements 4 tasks (model update, component JS, SCSS, dialog config), runs self-check (compile, test, lint — all pass), commits changes, and saves dev.json output.
/dx-agent-dev (no argument) — Reads re.json from .ai/run-context/, implements tasks from the RE Agent's spec. Useful when running after /dx-agent-re in the same session.
/dx-agent-dev 2416553 (self-check failure) — Implements all tasks, compilation passes but unit tests fail. Reads the error, identifies a missing mock, applies a targeted fix, re-runs self-check — passes on retry 1 of 2.
"No requirements spec found"
Cause: Neither re.json nor explain.md exists for the given work item.
Fix: Run /dx-agent-re <id> or /dx-req <id> first to generate the spec, then re-run /dx-agent-dev.
Self-check fails after 2 repair attempts
Cause: The error requires understanding beyond what targeted auto-fix can address (e.g., missing dependency, framework version mismatch).
Fix: Review the error output printed by the agent. Fix the issue manually and run the build/test commands from .ai/config.yaml to verify.
Agent creates a new utility instead of reusing an existing one
Cause: The reuse check didn't find the existing utility (different naming, different directory).
Fix: This should be rare — the agent searches utils/, lib/, shared/, and similar directories. If it happens, point to the existing utility and ask the agent to refactor.
.claude/rules/ for the file types you're editing