AGENT SKILL

implement-loop

Implement a ticket or request as a tested vertical slice. Use when work is ready for implementation. Profile rules control architecture and verification.

License 许可
MIT
最近更新
2026-10-17
Stars
★ 1
Forks
0

01 前言 Front Matter

name
implement-loop
description
Implement a ticket or request as a tested vertical slice. Use when work is ready for implementation. Profile rules control architecture and verification.

03 SKILL.md 正文

Work runs in three phases: prep, build, wrap-up.

Prep

  1. Read the request or run bd show <id> for a bead. List observable acceptance criteria. Report missing behavior before starting.
  2. List acceptance criteria and pending verification, review, and authorized commit steps in conversation. Use beads for durable issue state when configured, not a separate todo tool or TODO file. If beads is unavailable, continue direct requests in conversation; stop ticket-specific operations and report the missing prerequisite.
  3. Pin the fixed point: git rev-parse HEAD.
  4. Read .ai/rules/index.md and every rule file that matches the paths you will edit.

Done when every criterion and pending completion step is listed and the fixed point is recorded.

Build

Read tdd for test design and seam selection. Profile verification policy controls execution. Take one criterion at a time:

  1. Document new named types and meaningful method contracts according to .ai/rules/php-docblocks.md. If a contract is hard to state, redesign the interface.
  2. Write one regression or acceptance test at a recorded seam. Take expected values from the request or ticket. The verification chain executes it.
  3. For each operation with side effects, add a runs-twice test: run it twice with the same input and assert identical state. If the operation cannot be idempotent, state the reason in its docblock.
  4. Write the least code that satisfies the criterion. Verification runs the tests in wrap-up.
  5. Mark implementation done, keeping verification pending.

Idempotency techniques, in order: unique key with upsert or updateOrCreate backed by a database constraint; idempotency key for external calls; unique or state-guarded jobs; state check before a transition.

Code style lives in .ai/rules/php-style.md.

Toolbench

Trigger Tool
A Laravel API, config, or version-specific behavior Boost search-docs, before writing code
Writing a migration or model Boost database-schema
Any other library Docs fallthrough in docs/agents/docs-retrieval.md
Entering an area of the code laravel skill and the matching rule files
Finding a symbol or its callers codebase_index, following docs/agents/codebase-index.md
Finding or changing a code shape across files ast-grep
A test fails and its output hides the cause Laravel Pail
A problem outside the ticket Record it on a bead when configured, otherwise report it in conversation. Leave the code alone.

Wrap-up

  1. Inspect the diff, stage only task-owned paths, then run composer verify.
  2. Read the result.
    • Gates: Pest with arch tests, and type coverage at 80%.
    • Reports: docs-coverage, Pint, Deptrac with layer coverage, PHPStan, LSP, mutation, CRAP, PHPMetrics, and audit.
    • FAILED GATES: identifies gate failures. REPORT ERRORS: identifies nonzero report exits, not every advisory finding.
  3. Fix rounds, three at most. Fix task-caused failures, restage task-owned paths, then run composer verify.
  4. Inspect advisory findings separately. Fix relevant defects within scope or record unresolved findings and their reasons. Reports remain advisory.
  5. Run /self-review once with the fixed point and the ticket. It checks spec fit, runs-twice tests, one-way doors, docblock quality, and seam choice. A fix from the review uses a round and ends with one composer verify.
  6. Commit when requested or authorized by the ticket workflow. State irreversible effects in the commit body.
  7. Close the bead when this work resolves it. Direct requests need no ticket solely for this workflow.

Done when gates pass, report and review findings are addressed or recorded, and the requested workflow is complete.

Red after round three

Stop. Do not commit. Leave the work staged. Reply with the red gates, what each round tried, and your best guess at the cause.

04 同仓库更多 Skills