From quantum-loop
Audits quantum-loop pipelines for intent drift by comparing immutable user intent in quantum.json against design.md, PRD, ACs, and implementation. Flags divergences with file:line evidence before merges.
npx claudepluginhub andyzengmath/quantum-loop --plugin quantum-loopThis skill is limited to using the following tools:
Long pipelines (brainstorm → spec → plan → execute → review) paraphrase. Each stage re-reads an upstream artifact and rewrites it in its own format. Over 5 stages and 20+ agent invocations, the user's original intent can drift significantly — ACs silently reinterpreted, non-goals forgotten, constraints softened.
Orchestrates two-stage code review: spec compliance against story acceptance criteria first, then code quality. For quantum-loop pipeline after implementation or standalone via git diffs.
Verifies implementation matches spec via rule coverage, undocumented dependencies, and architecture compliance checks. Writes verification report and drift debt after /ctdd.
Share bugs, ideas, or general feedback.
Long pipelines (brainstorm → spec → plan → execute → review) paraphrase. Each stage re-reads an upstream artifact and rewrites it in its own format. Over 5 stages and 20+ agent invocations, the user's original intent can drift significantly — ACs silently reinterpreted, non-goals forgotten, constraints softened.
Academic backing:
ql-intent-check operationalizes a lean version of SCF's Drift Monitor for quantum-loop's pipeline.
The first time /ql-brainstorm runs, it MUST store the user's verbatim first-message text at quantum.json.userIntent:
{
"userIntent": {
"text": "<verbatim first-message text from user>",
"timestamp": "<ISO 8601>",
"source_message_id": "<optional session ID>"
}
}
This field is immutable — it is written once and never updated. Subsequent clarifications live in userClarifications[] (append-only). The snapshot is the ground-truth anchor for drift detection.
If quantum.json.userIntent is missing, this skill emits a WARNING and degrades to "compare stage-to-stage" mode (less precise but still useful).
userIntent.text vs docs/plans/<date>-<topic>-design.md.tasks/prd-<feature>.md.quantum.json.stories[].acceptanceCriteria.ql-review output.At each stage, compute:
An object present in the user's first message that does NOT appear in any downstream artifact is a potential drop. Check against an explicit "de-scoped" list (should live in PRD §5 Non-goals). If not listed as de-scoped, emit a MEDIUM finding.
Numeric thresholds or hard constraints present in intent but weakened downstream. E.g., user says "must complete in under 100ms"; PRD AC says "target 200ms". Emit a HIGH finding unless explicitly re-negotiated (a userClarifications[] entry rewrites the constraint).
An object present in the PRD or quantum.json that appears nowhere upstream. Often the sign of an implementer inventing scope. Emit a MEDIUM finding; user confirms whether scope-expansion was intentional.
PRD §5 non-goals list vs actual commit files. If a commit touches a path explicitly marked non-goal, emit a CRITICAL finding.
Every PRD acceptance-criterion (AC-N) should appear verbatim (or with trivial lexical variation) in a quantum.json.stories[].acceptanceCriteria[] entry. Lexical mismatch above a threshold → HIGH finding.
Every AC should map to at least one test (file + symbol) that explicitly exercises it. Missing mapping → MEDIUM finding. The AC itself must also specify the verification command per the quantum-loop testFirst convention.
Commit diffs touching files outside the PRD-declared files_changed whitelist. Two sub-cases:
quantum.json (must exist; userIntent field is preferred but optional).--since-commit=<sha> to scope to a recent window.Emits JSON at quantum.intentDrift[<feature-id>]:
{
"timestamp": "<ISO 8601>",
"base_sha": "<first-commit>",
"head_sha": "<last-commit>",
"has_immutable_intent": true,
"stages_audited": ["intent→design", "design→prd", "prd→plan", "plan→impl"],
"findings": [
{
"id": "DRIFT-001",
"rule": "Rule 2 — Constraint softened",
"severity": "high",
"original": "must complete in under 100ms",
"source": "userIntent.text",
"downstream": "target 200ms",
"downstream_location": "tasks/prd-feature.md:44",
"clarification_id_if_any": null,
"suggested_action": "Either (a) add a userClarifications entry explaining the re-negotiation, or (b) tighten PRD AC to ≤100ms and re-plan."
}
],
"summary": {
"critical": 0,
"high": 1,
"medium": 3,
"low": 0,
"info": 0
},
"verdict": "DRIFT_DETECTED_REVIEW_REQUIRED"
}
Verdicts:
NO_DRIFT — zero findings.MINOR_DRIFT — only low/info findings.DRIFT_DETECTED_REVIEW_REQUIRED — any medium or higher.CRITICAL_DRIFT_BLOCKS_MERGE — ≥1 critical.| The agent says… | The truth is… |
|---|---|
| "The user's intent is implicit in the PRD" | No. PRD is a paraphrase of the intent. Keep the verbatim intent separately and audit against it. |
| "Scope-creep is a feature, the user will appreciate it" | Rule 3 explicitly requires user confirmation. Silently expanded scope is expanded review burden and possible rework. |
| "Non-goals are aspirational, violating them isn't critical" | Non-goals are contracts. Violating them is a CRITICAL finding by Rule 4. |
| "AC paraphrase is fine, they mean the same thing" | If they truly mean the same thing, the original should pass the AC. If they don't quite, the paraphrase hides a semantic slip. Rule 5 applies. |
/quantum-loop:ql-intent-check
Optional arguments:
/quantum-loop:ql-intent-check --feature=<prd-id>
/quantum-loop:ql-intent-check --since-commit=<sha>
/quantum-loop:ql-intent-check --fail-on=high # exit non-zero if any high-or-above finding
ql-brainstorm: MUST write quantum.json.userIntent on first run (immutable). Schema extension below.ql-spec: MUST preserve the PRD §5 Non-goals section verbatim.ql-plan: MUST preserve AC text verbatim into quantum.json.stories[].acceptanceCriteria.ql-execute: optionally runs this skill mid-pipeline (after every N merged stories) to detect drift early.ql-deep-review: consumes the intent-drift signal as its risk-score input.Propose the following additive fields:
{
"userIntent": {
"text": "<verbatim>",
"timestamp": "<ISO 8601>",
"source_message_id": "<session ref>"
},
"userClarifications": [
{
"id": "CLAR-001",
"timestamp": "<ISO 8601>",
"text": "<verbatim>",
"re-negotiates": ["<intent sentence>" or "AC-3"]
}
],
"intentDrift": {
"<feature-id>": { /* output from this skill */ }
}
}
These additions are optional for existing quantum.json files (backward-compatible), but REQUIRED for new plans after this skill is in production.
noqa-style annotations on legitimate cross-cut commits.