بنقرة واحدة
speckit-memorylint-audit
Spec-kit workflow command: speckit-memorylint-audit
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Spec-kit workflow command: speckit-memorylint-audit
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when a GitHub Pull Request has unresolved review threads, pending reviews, stale/outdated threads, local findings ingestion, or needs mandatory final-gate proof in one PR-scoped session.
Optional after-specify refinement gate. Bridges an installed obra/superpowers brainstorming skill into the active Spec Kit spec.md without creating a second design document or replacing speckit.specify.
Diagnose the five Superpowers disciplines used by Superb and report the focused hook and standalone-command contract.
Read-only implementation critique against active Spec Kit artifacts.
Apply systematic root-cause investigation to the current failing task.
Complete branch handoff after Spec Kit convergence and fresh checks.
| name | speckit-memorylint-audit |
| description | Spec-kit workflow command: speckit-memorylint-audit |
| compatibility | Requires spec-kit project structure with .specify/ directory |
| metadata | {"author":"github-spec-kit","source":"memorylint:commands/audit.md"} |
$ARGUMENTS
You are a rigorous Instruction Drift Auditor. Scan the current workspace, catalogue long-lived instruction rules, bind every finding to evidence, and produce a deterministic MemoryLint Drift Report.
You MUST NOT modify any file during this audit. This command is strictly
read-only. All mutations happen only through speckit.memorylint.apply.
boundary, reality, conflict, and
redundancy drift.memorylint-report.json artifact.Scan the workspace root only. Include at least these source families when they exist:
| Source | Path Pattern |
|---|---|
| Agent rules | AGENTS.md, **/AGENTS.md |
| Constitution | .specify/memory/constitution.md, **/.specify/memory/constitution.md |
| Claude rules | CLAUDE.md, **/CLAUDE.md |
| Cursor rules | .cursor/rules/*, **/.cursor/rules/* |
| Root README | README.md |
| Per-extension README | **/README.md |
| Workflow files | .github/workflows/*.yml, **/.github/workflows/*.yml |
| Test scripts | tests/*, **/tests/* |
| Extension manifests | extension.yml, **/extension.yml |
For every source that exists, extract rules and record:
rule_id: sequential R-001, R-002, ...source: relative file pathline_range: source line or line rangesummary: plain-English rule summarycategory: see Step 2Missing optional files do not fail the audit. Record absence as evidence only when it creates real drift.
Classify every rule into exactly one primary category:
| Category | Meaning |
|---|---|
infrastructure | CI, release mechanics, build/test commands, packaging |
architecture | Module boundaries, design patterns, structural code rules |
workflow | Git hygiene, review process, PR conventions, commit style |
domain | Product behaviour, Spec Kit hook semantics, extension contracts |
tooling | CLI tools, runtimes, editor-specific tooling |
personal_preference | Style choices that do not affect correctness |
obsolete | References something that no longer exists in the repo |
conflict | Contradicts another rule |
If a rule could fit multiple categories, pick the primary owner and describe the secondary concern in the finding detail.
Use this matrix to decide canonical ownership and recommended_destination:
| Category | Canonical Owner | Secondary / Contextual Sources |
|---|---|---|
architecture | .specify/memory/constitution.md | editor rules may restate, but do not own |
domain | .specify/memory/constitution.md | manifests and docs may reflect, but do not own |
infrastructure | root AGENTS.md | nested AGENTS.md, CLAUDE.md, workflows may scope or mirror |
workflow | root AGENTS.md | nested AGENTS.md, CLAUDE.md may restate |
tooling | root AGENTS.md | tool-specific editor files may add local context |
personal_preference | root AGENTS.md | editor files may restate for agent ergonomics |
Additional precedence rules:
AGENTS.md outranks nested/editor files for shared workflow/tooling/infrastructure guidance.README.md, workflows, tests, and manifests are evidence-bearing sources, not canonical owners of shared guidance.Every finding must cite direct evidence:
Confidence levels:
| Level | Criteria |
|---|---|
high | Direct file or command evidence confirms the finding |
medium | Partial match or heuristic inference |
low | No direct evidence; heuristic only |
If evidence is missing, explicitly mark confidence: low. The report must
include the phrase confidence: low when a low-confidence finding appears.
Detect every drift instance and classify it:
| Drift Type | Description |
|---|---|
boundary | Rule lives in the wrong canonical file |
reality | Rule references a missing or stale file, script, command, or hook |
conflict | Two rules are mutually exclusive |
redundancy | Same rule appears in multiple places and risks divergence |
For each finding determine:
severity: critical, warning, or infoconfidence: high, medium, or lowsuggested_action: keep, move, delete, merge, or rewriterecommended_destination: canonical owner path or N/AWhen a boundary finding says a rule belongs in the constitution:
.specify/memory/constitution.mdmanual_handoff object that identifies:
target_pathtarget_sectionrule_textmerge_rationalerequires_human_reviewWhen a finding can be safely rewritten or deleted, include an edits array with
precise file-level operations. Each edit includes:
pathactionstart_lineend_linereplacementreasonProduce the Drift Report as Markdown with exactly these sections:
Instruction MapFindingsSummaryMetricsSource MetadataMachine-Readable Report| rule_id | source | line_range | summary | category | status |
|---|
status is one of ok, boundary_drift, reality_drift, conflict,
redundant, or obsolete.
For each finding:
#### ML-001
- **drift_type**: boundary | reality | conflict | redundancy
- **severity**: critical | warning | info
- **confidence**: high | medium | low
- **source**: file path and line range
- **evidence**: what proves this finding
- **recommended_destination**: target file (or N/A)
- **suggested_action**: keep | move | delete | merge | rewrite
- **detail**: brief explanation of the problem and recommendation
- **manual_handoff**: {...} # only when constitution handoff is required
| Drift Type | Critical | Warning | Info | Total |
|---|---|---|---|---|
| boundary | ||||
| reality | ||||
| conflict | ||||
| redundancy | ||||
| Total |
Report these operational metrics:
| Metric | Value |
|---|---|
| Total instruction sources scanned | |
| Total rules catalogued | |
| Total findings | |
| High-confidence findings | |
| Medium-confidence findings | |
| Low-confidence findings | |
| Files that would be modified by suggested actions |
| File Path | Content Hash (SHA-256) |
|---|
Also include the same result as a fenced JSON artifact named
memorylint-report.json. This artifact is the authoritative input for
speckit.memorylint.apply.
{
"schema_version": "1.0",
"workspace_root": "/path/to/workspace",
"source_metadata": [
{
"path": "AGENTS.md",
"sha256": "<sha256>"
}
],
"instruction_map": [
{
"rule_id": "R-001",
"source": "AGENTS.md",
"line_range": "10",
"summary": "<rule summary>",
"category": "infrastructure",
"status": "ok"
}
],
"findings": [
{
"id": "ML-001",
"drift_type": "boundary",
"severity": "warning",
"confidence": "high",
"source": "AGENTS.md:15",
"evidence": "<direct evidence>",
"recommended_destination": ".specify/memory/constitution.md",
"suggested_action": "move",
"detail": "<finding detail>",
"manual_handoff": {
"target_path": ".specify/memory/constitution.md",
"target_section": "Imported rules",
"rule_text": "<rule text>",
"merge_rationale": "<why this belongs there>",
"requires_human_review": true
}
}
],
"metrics": {
"total_instruction_sources_scanned": 0,
"total_rules_catalogued": 0,
"total_findings": 0,
"high_confidence_findings": 0,
"medium_confidence_findings": 0,
"low_confidence_findings": 0,
"files_that_would_be_modified": []
},
"summary": {}
}
confidence: low.speckit.memorylint.apply can parse it.