spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

[Feature]: verify that [X]-marked tasks were actually implemented

Open davesharpe13 opened this issue 8 months ago • 3 comments

Problem Statement

The completed task list is not cross-referenced against the actual codebase after /speckit.implement.

After ~770 structured tasks using spec-kit /implement were completed, I found 2 tasks marked [X] complete where the corresponding code was not completed. Each was discovered only when the feature misbehaved during testing. The point is not to review the implementation, but to verify the tasks were ever really done.

The two examples:

  1. A task specified "Create outcome classification types in outcomeTypes.ts." The file was never created. The types were silently folded into a different module.
  2. A task specified "Modify patternDetector.ts to filter out turns with operationalFailures." The file was never modified. The filtering was applied elsewhere but never extended to pattern detection.

I'm calling these phantom completions: the agent marks a task done because the [X] token is the statistically favored continuation in a list of completed tasks, not because it verified the work completed in the filesystem.

Proposed Solution

Similar to analyze, an optional command after implement to /speckit.verify-tasks. The command would verify [X]-marked tasks for file existence, git diffs, and expected patterns in the codebase, flagging gaps before they reach code review or production. Produce a verify-tasks-report.md in the specs branch directory, and iterates the report to Fix, Skip, or Investigate any unverified completed tasks.

I'm building this as a spec-kit extension (https://github.com/datastone-inc/speckit-verify-tasks). Detailed writeup of the Phantom Creation phenomenon and its causes: (https://datastone.ca/blog/task-phantom-completions-ai-assisted-development/).

Alternatives Considered

No response

Component

Specify CLI (initialization, commands)

AI Agent (if applicable)

None

Use Cases

Valuable for improving the quality of long running projects with lots of tasks being implemented.

Acceptance Criteria

The [X] completed tasks are verified as backed by real implementation.

Additional Context

There are some other issues and extensions "circling" this issue, but I think this feature drills down to a specific, real gap:

  • https://github.com/ismaelJimenez/spec-kit-verify - broader scope verification that can miss phantom completions
  • https://github.com/github/spec-kit/issues/1745 sounds like it is resolved by above extension
  • https://github.com/github/spec-kit/issues/847 - Context-window degradation causing guardrails to be skipped (related but different mechanism). BTW, this is partially addressed in the verify-tasks by suggesting to run with clear context (see my repo).
  • https://github.com/github/spec-kit/issues/442 - Post-implementation debugging workflow (addresses visible failures, not silent phantom completions)

davesharpe13 avatar Mar 16 '26 12:03 davesharpe13

Phantom completions happen when the same agent marks its own work done. A separate verification agent that checks actual code against the spec catches this. https://github.com/Koroqe/claude-code-sdlc has dedicated build verification and code review stages that are independent from the implementer.

Koroqe avatar Mar 19 '26 11:03 Koroqe

@davesharpe13 Do any of the published community extensions work for your needs? See https://github.com/github/spec-kit/tree/main/extensions#available-community-extensions

mnriem avatar Mar 19 '26 12:03 mnriem

Yes @Koroqe it is a great idea to separate verification from implementation. BTW, the community extension command verify-tasks does do that (but only by way of a suggestion). Your method of using separate agents is better in that regard, but it is tightly coupled with Claude.

@mnriem the Verify Extension comes close, but a phantom completion will likely pass verify (the code that exists is fine) that will be caught by verify-tasks (the specific task's file was never created or modified). I opened PR 1871 to add verify-tasks as a new community extension. As I understand it, that has passed review.

davesharpe13 avatar Mar 19 '26 12:03 davesharpe13