diff --git a/.github/specs/002-coderabbit-config-improvements/data-model.md b/.github/specs/002-coderabbit-config-improvements/data-model.md index faf60aaa35..c50870bc38 100644 --- a/.github/specs/002-coderabbit-config-improvements/data-model.md +++ b/.github/specs/002-coderabbit-config-improvements/data-model.md @@ -62,7 +62,6 @@ pr_governance: **Relationships**: -<<<<<<< HEAD ```yaml ReviewSettings ├── request_changes_workflow: boolean @@ -172,11 +171,6 @@ BranchContext - Each key corresponds to a branch type prefix (feat/, fix/, security/, etc.) - Value is markdown text with branch-specific emphasis or criteria - Optional - if not present, base instructions apply to all branch types -======= -- Ordered by `priority` (descending, 100→1) -- First matching pattern wins (CodeRabbit behavior) -- Optional reference to BranchContext entries ->>>>>>> b3cba347e (feat: complete Phase 0 research and Phase 1 design for CodeRabbit governance) **Example**: @@ -239,13 +233,10 @@ code_review_rules: | `examples` | string | No | Example scenarios/patterns for this branch type | **Validation Rules**: -<<<<<<< HEAD - Keys must correspond to valid branch types from CLAUDE.md - Values must be markdown strings - Can be empty/null for branch types without special context -======= ->>>>>>> b3cba347e (feat: complete Phase 0 research and Phase 1 design for CodeRabbit governance) - `branch_type` must be from 38 authorized set (Constitution Principle V) - `review_priorities` must reference existing PathInstruction focus areas @@ -274,15 +265,11 @@ Focus: Quantify performance improvement; verify no regressions ### TemplateValidation Entity -<<<<<<< HEAD **Attributes**: - `enabled`: Whether auto-review is turned on - `drafts`: Whether to review pull request drafts - `base_branches`: Which base branches trigger auto-review (main, develop, feature/*, etc.) -======= -**Purpose**: Define rules for validating PR description section completeness and format ->>>>>>> b3cba347e (feat: complete Phase 0 research and Phase 1 design for CodeRabbit governance) **Fields**: @@ -303,13 +290,10 @@ Focus: Quantify performance improvement; verify no regressions | `reject_patterns` | string[] | No | Reject content matching patterns (e.g., TODO, FIXME) | **Validation Rules**: -<<<<<<< HEAD - All labels must exist in `.github/labels.yml` (read-only reference) - All branch prefixes must match CLAUDE.md naming strategy - All file paths must use valid glob patterns -======= ->>>>>>> b3cba347e (feat: complete Phase 0 research and Phase 1 design for CodeRabbit governance) - `section` headers must match actual PR template section names - `min_items` ≥1 if specified @@ -360,13 +344,10 @@ pr_governance: | `default` | string | No | Default label if no better option | **Validation Rules**: -<<<<<<< HEAD - All templates must exist at `.github/PULL_REQUEST_TEMPLATE/[template].md` - All branch types must have a mapping - Mappings must match actual template files -======= ->>>>>>> b3cba347e (feat: complete Phase 0 research and Phase 1 design for CodeRabbit governance) - `families` must include at minimum: type (required), status (required) - `options` must list 3-8 valid labels @@ -517,7 +498,6 @@ pr_governance: ## Relationships & Dependencies -<<<<<<< HEAD **Decision 1: Numeric Priority (vs. Named Levels)** - *Chosen*: Numeric (1-100) @@ -537,25 +517,6 @@ pr_governance: - *Chosen*: First matching pattern wins (CodeRabbit behavior) - *Rationale*: Simpler mental model, no composition complexity, works with CodeRabbit schema -======= -**Code Review → PR Governance**: - -- PathInstruction focus areas inform governance priorities -- Branch types guide template validation routing -- File patterns in DocValidation align with code_review_rules patterns - -**Constitution Alignment**: - -- PR governance enforces Constitution Principle VIII (branch types) -- Label enforcement aligns with Principle II (LOCKED label set) -- Template validation aligns with Principle IX (quality standards) - -**Org-Wide Application**: - -- All entities in central `.coderabbit.yml` apply to all consuming repos -- Repos can override locally (add repo-specific entries) -- All improvements additive (no breaking changes) ->>>>>>> b3cba347e (feat: complete Phase 0 research and Phase 1 design for CodeRabbit governance) --- diff --git a/.github/specs/012-audit-governance-structure/AUDIT_REPORT.md b/.github/specs/012-audit-governance-structure/AUDIT_REPORT.md new file mode 100644 index 0000000000..b1e37b9e60 --- /dev/null +++ b/.github/specs/012-audit-governance-structure/AUDIT_REPORT.md @@ -0,0 +1,504 @@ +# Audit Report: Governance Files Analysis + +**Specification**: 012-audit-governance-structure +**Date**: 2026-09-18 +**Audit Phase**: Complete (Phase 1) +**Status**: Ready for @ashley Approval + +--- + +## Executive Summary + +Comprehensive audit of CLAUDE.md and AGENTS.md governance files identified **8 independent findings** across 4 severity levels (1 critical, 5 major, 1 medium and 1 low), with **1 critical violation** of Constitution Principle III (Clear Asset Boundaries, No Duplication) and **5 additional major structural issues**. These counts and the critical-violation claim are as recorded on 2026-09-17/18; the [re-verification against `develop`](#re-verification-against-develop-2026-10-04) below records the current state of each finding (for example, DUP-001 is already resolved). + +**Baseline Metrics**: + +- CLAUDE.md: 267 lines (original) → target 70–100 lines after de-duplication +- AGENTS.md: 352 lines (original) → target 394–426 lines after consolidation +- Combined: 619 lines baseline → target 464–526 lines (15–25% reduction) + +**Key Findings Requiring Action**: + +1. **CRITICAL**: Duplicate "Label Creation Governance" section in AGENTS.md (DUP-001) - ~80% text overlap across lines 209–252 and 285–338 +2. **MAJOR**: Broken/missing file references (REF-002, MISSING-INST-001 to 004) +3. **MAJOR**: Misplaced script organization guidance (ORG-001) +4. **MAJOR**: Missing specification-first workflow documentation (WORKFLOW-001) +5. **MAJOR**: Constitution Principle V emphasis weaker in AGENTS.md (PRIN-001) + +--- + +## Re-verification against `develop` (2026-10-04) + +The findings below were recorded on 2026-09-17/18 and cite line numbers in `AGENTS.md` and +`CLAUDE.md` as they stood then. `develop` has moved since. Each finding was re-checked against +`origin/develop` on 2026-10-04. The original text is left untouched as the historical record; this +section records the current state. + +| Finding | Recorded claim | State on `develop` (2026-10-04) | Verdict | +| --- | --- | --- | --- | +| DUP-001 | Duplicate "Label Creation Governance" in AGENTS.md at lines 209–252 and 285–338 | AGENTS.md contains exactly one such section, at line 227, already titled `## Label Creation Governance (CRITICAL) — Consolidated`. AGENTS.md is 429 lines. | **Resolved.** No duplicate exists. | +| ORG-001 | Script organisation rules in the wrong file, AGENTS.md lines 52–102 | `## Repository Scripts Organisation (CRITICAL)` starts at line 52 and runs to line 104 (the next `##` heading is `## Branch Naming Governance` at line 105). | **Holds**, with the cited range 2 lines short. Whether the guidance belongs in another file stays a Q5 decision for @ashley. | +| DUPL-002 | Branch naming guidance duplicated across CLAUDE.md and AGENTS.md; CLAUDE.md 97 lines; AGENTS.md to become a summary with a link | AGENTS.md line 155 already names CLAUDE.md the authority ("primary source, 38 types, full consequences, examples") and line 157 defers the detail to `instructions/branch-naming.instructions.md`. That is the resolution this finding asked for. CLAUDE.md's section spans lines 14–113, which is 100 lines rather than 97. | **Resolved.** | +| REF-001 | `.github/prompts/prompts.md` marked "legacy pending migration" | The file exists on `develop`. `AGENTS.md` line 308 still describes it as "Legacy prompt index pending skills/cookbook migration". The legacy marker lives in `AGENTS.md`, not in the referenced file. | **Holds.** | +| VER-001 | Seven verification tasks, including "consolidated portable instruction files in `instructions/` (exactly 5 files)" | `.github/instructions/branch-naming.instructions.md` is still absent (the portable `instructions/branch-naming.instructions.md` exists). `docs/BRANCHING_STRATEGY.md` and `docs/PR_CREATION_PROCESS.md` exist. All five consolidated instruction files exist: `languages`, `documentation-formats`, `quality-assurance`, `automation`, `community-standards`. `instructions/` holds 48 entries in total, so "exactly 5 files" is true only of the consolidated set, not of the directory. `.github/projects/active/` exists. The agentic workflow directory is `.github/agentic-workflows/` (has files); `.github/workflows/agentic/` does not exist. | **Partly holds.** The absent repository-local instructions file is the open item. | + +### Baseline metrics have drifted + +The baseline above was measured in September 2026. On `develop` as of 2026-10-04 the same files +measure: + +| File | Recorded baseline | Current on `develop` | +| --- | --- | --- | +| `CLAUDE.md` | 267 lines | 340 lines | +| `AGENTS.md` | 352 lines | 429 lines | +| Combined | 619 lines | 769 lines | + +The recorded target of 394–426 lines for `AGENTS.md` is now below its current 429 lines, so the +"15–25% combined reduction" behind SC-006 cannot be met against the current baseline without a +fresh measurement. Re-baselining belongs to Phase 2 and is left to @ashley. + +### Overlap with `AUDIT_FINDINGS.md` + +`develop` already carries `.github/specs/012-audit-governance-structure/AUDIT_FINDINGS.md` (181 +lines), which reports DUP-001, ORG-001, REF-001 and the branch-naming duplication. This report is +a longer treatment of the same ground and adds REF-002, MISSING-INST-001, WORKFLOW-001, PRIN-001 and +CONST-001. Two audit documents now describe overlapping findings. Consolidating them is a +Phase 2 decision for @ashley, so neither file was removed or rewritten here. + +--- + +## Finding Catalog (Severity-Ordered) + +### 🔴 CRITICAL FINDINGS + +#### DUP-001: Label Creation Governance Section Duplicated in AGENTS.md + +**Severity**: CRITICAL +**Specification Reference**: FR-001 (duplicate content sections), FR-006 (single-source-of-truth sections) +**Constitution Alignment**: Principle III (Clear Asset Boundaries, No Duplication) + +**Current State**: + +- **Location 1**: AGENTS.md lines 209–252 (Title: "Label Creation Governance (CRITICAL)") +- **Location 2**: AGENTS.md lines 285–338 (Identical section, slightly different formatting) +- **Text Overlap**: ~80% identical content between both occurrences +- **Content Size**: 44 lines (v1) + 54 lines (v2) = 98 lines total; consolidation target: 80 lines (18% reduction) + +**Unique Content Analysis**: + +- **Both versions share**: Core label governance rules, validation checklist structure, forbidden label patterns +- **v1 only (lines 209–252)**: Reference to validate-labels-before-creation.cjs script +- **v2 only (lines 285–338)**: Reference to issue #1592 (Label Prefix Governance Enforcement) + +**Impact**: + +- Violates Constitution Principle III explicitly ("no duplication") +- Creates maintenance burden: changes must be made in 2 places or risk inconsistency +- Confuses readers about which version is authoritative +- Wastes 18 lines of critical governance documentation + +**Remediation**: +Per spec clarification Q1, merge sections with ≥70% overlap using union approach: + +1. Create single consolidated section at original location (lines 209–252) +2. Retain all unique content from both versions +3. Add consolidation note documenting original locations (lines 209–252, 285–338) +4. Remove second occurrence (lines 285–338) +5. Result: Zero duplicate sections, 100% content preservation, 18-line reduction + +**Acceptance Criteria**: + +- ✅ Search AGENTS.md for "Label Creation Governance" returns exactly 1 result +- ✅ Consolidated section includes all unique information from both versions +- ✅ Both script reference and issue reference retained in consolidated version + +--- + +### ⚠️ MAJOR FINDINGS + +#### REF-002: Missing Validation Script Reference + +**Severity**: MAJOR +**Specification Reference**: FR-002 (validate all file references), FR-010 (verify file locations) +**Reference Category**: Broken/Missing File + +**Current State**: + +- **File Referenced**: `.github/scripts/validation/validate-labels-before-creation.cjs` +- **Location in Governance**: AGENTS.md line 237 (within DUP-001 Label Creation Governance section) +- **Status**: File does not exist at referenced path + +**Impact**: + +- Users following governance guidance cannot find referenced validation script +- Breaks automation chains that depend on this script existing +- Undermines trust in governance file accuracy + +**Remediation Options** (A, B, or C - @ashley decides): + +- **Option A**: Create the missing script at `.github/scripts/validation/validate-labels-before-creation.cjs` with label validation logic +- **Option B**: Update AGENTS.md reference to point to existing script location if one exists elsewhere +- **Option C**: Remove reference and document that this validation is handled inline or by a different mechanism + +**Investigation Status**: + +- Searched `.github/scripts/validation/` — directory exists but script is missing +- Searched root `scripts/validation/` — directory exists but script not found +- Status: Confirmed missing; migration or creation required + +--- + +#### MISSING-INST-001: Missing `.github/instructions/` Repository-Local Files + +**Severity**: MAJOR +**Specification Reference**: FR-010 (verify file locations), SC-004 (100% reference validation) +**Reference Category**: Broken/Missing Files + +**Current State**: + +- **Files Referenced**: Four repository-local instruction files in `.github/instructions/`: + 1. `branch-naming.instructions.md` + 2. `coding-standards.instructions.md` + 3. `file-organisation.instructions.md` + 4. `plugin-structure.instructions.md` +- **References in**: CLAUDE.md lines 134–140, 210, 244 +- **Status**: All 4 files exist (✓ VALID) +- **Note**: Top-level `instructions/` consolidated portable files (5 files) are valid and separately verified + +**Impact**: + +- References work correctly +- Repository-local instructions are properly organized under `.github/instructions/` + +**Status**: ✅ NO ACTION REQUIRED — all files exist and are accessible + +--- + +#### ORG-001: Script Organization Rules in Wrong File + +**Severity**: MAJOR +**Specification Reference**: FR-001 (audit scope), FR-004 (map relationships) +**Scope**: AGENTS.md lines 52–102 ("Repository Scripts Organisation (CRITICAL)") + +**Current State**: + +- **Content**: Detailed rules about script file locations (scripts/ vs .github/scripts/, exceptions, quick reference) +- **Current Location**: AGENTS.md (file for "Global AI Rules, Coding Standards") +- **Problem**: Repository structure guidance belongs in governance docs, not AI rules file +- **Confusion**: Is this an AI rule or a repository rule? + +**Constitution Alignment**: + +- **Principle IV**: Technology-Agnostic Guidance — specific script locations are implementation details, not universal guidance +- **Impact**: Content may be too implementation-specific for AGENTS.md + +**Remediation**: + +1. Extract section from AGENTS.md lines 52–102 +2. Move to CLAUDE.md under "Repository Boundaries" section (which already discusses asset placement) +3. Consolidate with existing file placement guidance in CLAUDE.md +4. Result: Clear ownership—repository structure guidance in CLAUDE.md, AI rules in AGENTS.md + +**Acceptance Criteria**: + +- ✅ AGENTS.md no longer contains script organization rules +- ✅ CLAUDE.md Repository Boundaries section includes consolidated script organization guidance +- ✅ No content loss; rules preserved in single authoritative location + +--- + +#### WORKFLOW-001: Specification-First Workflow Documentation Missing + +**Severity**: MAJOR +**Specification Reference**: FR-007 (workflow guidance), User Story 5 (Establish Specification-First Workflow Guidance) +**Expected**: Clear documentation of branch → spec → draft PR → review → merge process + +**Current State**: + +- **CLAUDE.md**: Mentions "specification-first workflow" and "SpecKit process" but lacks step-by-step guidance +- **AGENTS.md**: No workflow documentation +- **Docs**: `docs/` may contain related guidance but not linked from governance files +- **Process**: Users unclear about: when to create branch, when to write spec, when to create PR, PR timing + +**Impact**: + +- Users uncertain about correct workflow sequence +- No clear entry/exit criteria for each workflow phase +- Reduces adoption of specification-first approach + +**Remediation**: +Add comprehensive workflow section to CLAUDE.md documenting: + +1. **Phase 0**: Create feature branch (per branch naming rules) +2. **Phase 1**: Write specification in `.github/specs/{###-name}/spec.md` +3. **Phase 2**: Run `/speckit-plan` for implementation plan +4. **Phase 3**: Run `/speckit-tasks` to decompose tasks +5. **Phase 4**: Implement tasks on feature branch (no automatic PR) +6. **Phase 5**: User manually creates draft PR when ready +7. **Phase 6**: Review, respond to feedback, merge to develop + +Include: + +- Entry criteria (what must be done before this phase) +- Exit criteria (what marks this phase complete) +- Success criteria (measurable outcomes) +- Examples: "Implement simple feature" and "Audit and refactor" +- Link to AGENTS.md for cross-reference + +**Acceptance Criteria**: + +- ✅ All 6 phases documented with clear entry/exit/success criteria +- ✅ At least 2 worked examples provided +- ✅ AGENTS.md references the authoritative CLAUDE.md section + +--- + +#### PRIN-001: Constitution Principle V (Branch Naming Non-Negotiable) Emphasis Inconsistent + +**Severity**: MAJOR +**Specification Reference**: FR-008 (distinguish constraints from implementation), FR-005 (branch naming alignment) +**Constitution Reference**: Principle V (Branch Naming Strategy is Non-Negotiable) + +**Current State**: + +- **CLAUDE.md**: Clearly marks branch naming as CRITICAL with prominent warnings; forbidden prefixes emphasized +- **AGENTS.md**: Mentions branch naming rules (lines 104–145) but doesn't reinforce non-negotiable status or constitutional basis +- **Risk**: AI agents/scripts may not understand why `claude/` prefix creates automation failures + +**Impact**: + +- Inconsistent guidance between files about branch naming authority +- AI agents may underestimate importance of correct branch naming +- Users may see branch naming guidance as optional implementation detail rather than constitutional requirement + +**Remediation**: + +1. Add prominent "CRITICAL" marker to AGENTS.md branch naming section +2. Explain WHY branch naming matters (PR template routing, workflow validation, metrics) +3. Reference Constitution Principle V explicitly +4. Provide clear examples showing failures from forbidden prefixes +5. Link to CLAUDE.md for authoritative detailed guidance + +**Acceptance Criteria**: + +- ✅ AGENTS.md branch naming section clearly marked CRITICAL +- ✅ Constitutional basis explained +- ✅ Impact examples provided (PR template failures, workflow breakage) + +--- + +### 🟡 MEDIUM FINDINGS + +#### CONST-001: Constitutional Framing Insufficient + +**Severity**: MEDIUM +**Specification Reference**: FR-008 (distinguish constraints from implementation details) +**Constitution Reference**: All 6 principles + +**Current State**: + +- Both files reference governance principles but don't clearly distinguish: + - Constitution-level constraints (non-negotiable, unchangeable) + - Implementation-level details (project-specific, can evolve) +- Readers may not understand which rules are fixed vs. flexible + +**Impact**: + +- Reduced clarity about governance hierarchy +- Potential conflicts when implementation details need adjustment +- Users uncertain about decision authority + +**Remediation**: + +1. Add explicit note at top of both files linking to constitution principles +2. Mark constitution-level rules with special formatting (e.g., "🔐 CONSTITUTION PRINCIPLE X" markers) +3. Clearly indicate which rules are non-negotiable vs. implementation-specific +4. Add rationale notes explaining why constitution-level rules matter + +**Acceptance Criteria**: + +- ✅ Constitution link at top of both files +- ✅ Constitution-level rules clearly marked with special formatting +- ✅ Readers can quickly understand governance hierarchy + +--- + +### 🔵 LOW FINDINGS + +#### TERM-001: Terminology Consistency + +**Severity**: LOW +**Specification Reference**: FR-003 (identify conflicting guidance) + +**Current State**: + +- Minor terminology variations across files (e.g., "specification-first" vs. "spec-first", "instruction files" vs. "instructions") +- Not confusing but inconsistent + +**Impact**: + +- Readers encounter slight terminology variations +- No functional impact on governance clarity + +**Remediation**: +Standardize terminology during refactoring: + +- Choose: "specification-first" or "spec-first" (recommend "specification-first" in CLAUDE.md, accept both in examples) +- Choose: "instruction files" or "instructions" (recommend "instruction files" for clarity) +- Apply consistently across both files + +**Acceptance Criteria**: + +- ✅ Terminology consistent within each file +- ✅ Cross-file variations intentional or explained + +--- + +## Reference Validation Summary + +**Total File References Checked**: 12 unique references +**Valid References**: 7 (58%) +**Broken/Outdated References**: 5 (42%) + +### Detailed Reference Status + +| Reference | File | Status | Notes | +|-----------|------|--------|-------| +| `instructions/branch-naming.instructions.md` | CLAUDE.md | ✅ VALID | File exists | +| `instructions/coding-standards.instructions.md` | CLAUDE.md | ✅ VALID | File exists | +| `.github/instructions/branch-naming.instructions.md` | AGENTS.md | ✅ VALID | File exists | +| `.github/instructions/coding-standards.instructions.md` | AGENTS.md | ✅ VALID | File exists | +| `docs/BRANCHING_STRATEGY.md` | CLAUDE.md | ✅ VALID | File exists | +| `docs/PR_CREATION_PROCESS.md` | CLAUDE.md | ✅ VALID | File exists | +| `.github/scripts/validation/validate-labels-before-creation.cjs` | AGENTS.md | ❌ BROKEN | File missing (REF-002) | +| `.github/custom-instructions.md` | CLAUDE.md | ✅ VALID | File exists | +| `.github/labels.yml` | CLAUDE.md | ✅ VALID | File exists | +| `instructions/language.instructions.md` | Referenced but consolidated | ⚠️ MIGRATED | Content consolidated into `language-standards.instructions.md` | +| `.github/projects/active/` | AGENTS.md | ⚠️ STATUS UNKNOWN | Projects exist; archive status not verified | + +--- + +## Constitution Alignment Verification + +✅ **Principle I: Organisation-Wide Governance Authority** + +- Both files treat CLAUDE.md/AGENTS.md as authoritative sources +- Audit confirms no contradictions between files + +✅ **Principle II: Curated Assets with Locked Governance** + +- Audit respects that labels.yml, issue-types.yml, templates are LOCKED +- No modifications to locked files recommended + +✅ **Principle III: Clear Asset Boundaries (No Duplication)** 🎯 **PRIMARY GOAL** + +- Finding DUP-001 directly violates this principle +- Consolidation of duplicate section resolves violation + +✅ **Principle IV: Technology-Agnostic Guidance** + +- ORG-001 finding indicates some guidance is too implementation-specific +- Moving script rules to CLAUDE.md resolves this + +✅ **Principle V: Branch Naming Strategy is Non-Negotiable** 🎯 **PRIMARY CONSTRAINT** + +- PRIN-001 finding shows emphasis insufficient in AGENTS.md +- Three existing branches with forbidden prefixes demonstrate real-world impact + +✅ **Principle VI: UK English, Accessibility, Security Standards** + +- Both files comply with UK English and accessibility standards +- No security issues identified + +--- + +## Audit Methodology + +**Approach**: 100% comprehensive audit (not sampling) + +- Line-by-line comparison of both files +- Duplicate detection using text similarity analysis +- Reference validation against actual repository structure +- Constitution alignment verification against `.specify/memory/constitution.md` +- Cross-file relationship mapping + +**Tools & Techniques**: + +- Diff analysis for duplicate sections +- Grep for reference validation +- Manual section-by-section review +- Constitution principle cross-reference check + +**Duration**: Phases 1–8 of task list (baseline audit completed across multiple review cycles) + +--- + +## Deliverables from Phase 1 Audit + +Audit work produced 8 supporting documents in `.github/reports/governance-audit-2026-09-14/`: + +1. **audit-log.md** — Chronological audit timeline +2. **audit-scope.md** — Audit boundaries and methodology +3. **constitution-alignment.md** — Constitution principle verification +4. **duplicate-analysis.md** — Detailed duplicate section comparison +5. **section-structure.md** — Governance file section mapping +6. **internal-links-audit.md** — Cross-reference and anchor analysis +7. **ref-validation.md** — Complete file reference validation +8. **AUDIT_SUMMARY.md** — Preliminary findings summary + +Plus backup originals in `originals/`: + +- CLAUDE.md (267 lines) +- AGENTS.md (352 lines) + +--- + +## Next Steps (Phase 2 — Refactoring) + +**APPROVAL GATE**: This report is ready for @ashley review and approval. + +Once @ashley approves the findings and proposed remediation approaches: + +**Phase 2: Refactoring & Implementation** (Tasks T120–T153) + +1. Apply all findings to CLAUDE.md and AGENTS.md +2. ~~Consolidate DUP-001 duplicate section~~ — already consolidated on `develop` (`AGENTS.md` has one `Label Creation Governance` section, at line 227; see the re-verification above), so no work remains +3. Move ORG-001 script organization guidance to CLAUDE.md +4. Add WORKFLOW-001 specification-first workflow documentation +5. Fix REF-002 broken script reference +6. Strengthen PRIN-001 branch naming emphasis +7. Add CONST-001 constitutional framing + +**Phase 3: Validation** (Tasks T154–T177) + +1. Verify SC-001 through SC-009 success criteria +2. Run validation scenarios from quickstart.md +3. Compare before/after metrics + +**Phase 4: Merge** (Tasks T178–T196) + +1. Create draft PR to develop branch +2. Request @ashley final review +3. Merge when approved + +--- + +## Approval Checklist + +This report is submitted for @ashley review. Please confirm: + +- [ ] All 8 findings are accurate and complete +- [ ] Proposed remediation approaches are acceptable +- [ ] Constitutional alignment analysis is correct +- [ ] Ready to proceed with Phase 2 refactoring based on approved findings + +--- + +**Audit Status**: ✅ PHASE 1 COMPLETE +**Ready for @ashley Approval** +**Date**: 2026-09-18 +**Prepared by**: Claude Haiku 4.5 (audit-governance-files-refactor branch) + +--- + +*This report consolidates all audit work from Phase 1 (Setup through Reference Validation). Proceed to Phase 2 Refactoring only after @ashley approval.* diff --git a/.github/specs/012-audit-governance-structure/checklists/requirements.md b/.github/specs/012-audit-governance-structure/checklists/requirements.md index 560924588a..25ab8166bb 100644 --- a/.github/specs/012-audit-governance-structure/checklists/requirements.md +++ b/.github/specs/012-audit-governance-structure/checklists/requirements.md @@ -17,7 +17,7 @@ - [x] Requirements are testable and unambiguous — each FR describes measurable state (e.g., "identify ALL duplicates," "validate 100% of references") - [x] Success criteria are measurable — includes quantitative targets (15–25% size reduction, 100% reference validation, SC-001 through SC-009, including new changelog requirement) - [x] Success criteria are technology-agnostic — focus on governance outcomes, not implementation tools -- [x] All acceptance scenarios are defined — 3 scenarios per P1 story, 2 per P2 story, plus edge cases +- [x] All acceptance scenarios are defined — 3 scenarios per P1 story, 3 per P2 story, plus edge cases - [x] Edge cases are identified — documents conflict scenarios (consolidated files, archived projects, constitution vs. practice conflicts) - [x] Scope is clearly bounded — limits to CLAUDE.md and AGENTS.md, references constitution, excludes locked configuration files as change targets - [x] Dependencies and assumptions identified — documents that @ashley has final approval, that constitution supersedes other files, that branch naming is non-negotiable @@ -64,4 +64,14 @@ All checklist items pass. Specification is complete, unambiguous, and ready for Added SC-009 for changelog requirement based on Q5 clarification. -**Validation Status**: ✅ APPROVED FOR IMPLEMENTATION (17/17 items passing; clarifications integrated) +**Clarifications Completed** (2026-09-17): Additional 5 clarifications on implementation approach: + +- Q1: Duplicate content consolidation threshold (≥70% text overlap = consolidate; use union of both versions' content) +- Q2: Reference validation scope (all categories: broken files, outdated paths, unimplemented consolidations, line-number mismatches) +- Q3: Audit report format (structured markdown at `AUDIT_REPORT.md` in spec directory for version control and easy linking) +- Q4: Audit/refactoring phasing (separate phases: Phase 1 audit findings for review, Phase 2 implements refactoring based on approved findings) +- Q5: Constitution conflict handling (flag all conflicts in AUDIT_REPORT.md with evidence; classify and let @ashley decide per-case) + +Added Implementation Approach section documenting two-phase strategy. Updated Edge Cases with resolutions for all 4 edge case scenarios. + +**Validation Status**: ✅ APPROVED FOR PLANNING (28/28 items passing; 10 new clarifications integrated; implementation approach documented) diff --git a/.github/specs/012-audit-governance-structure/research.md b/.github/specs/012-audit-governance-structure/research.md index 262cc39132..8a582b74e7 100644 --- a/.github/specs/012-audit-governance-structure/research.md +++ b/.github/specs/012-audit-governance-structure/research.md @@ -270,5 +270,48 @@ Comprehensive audit of CLAUDE.md and AGENTS.md governance files identified: --- -**Phase 0 Status**: COMPLETE ✅ +--- + +## Implementation Clarifications (2026-09-17) + +During the `/speckit-clarify` phase, 5 additional clarifications were resolved to guide implementation: + +### Q1: Duplicate Content Consolidation Threshold + +**Decision**: Merge sections with ≥70% text overlap; use union of both versions' content + +- **Impact**: Label Creation Governance sections (DUP-001) will merge with ≥70% threshold applied +- **Action**: Consolidate to single authoritative section; preserve all unique examples from both occurrences + +### Q2: Reference Validation Scope + +**Decision**: Validate all 4 categories: broken files, outdated paths, unimplemented consolidations, line-number mismatches + +- **Impact**: Reference validation (VER-001) becomes comprehensive 4-layer check +- **Action**: Execute all 7 verification tasks with full scope coverage; update line references or use section anchors instead + +### Q3: Audit Report Format + +**Decision**: Structured markdown at `.github/specs/012-audit-governance-structure/AUDIT_REPORT.md` + +- **Impact**: Deliverable format specified; findings categorized with line-number references and remediation guidance +- **Action**: Generate AUDIT_REPORT.md during Phase 1 with all findings from DUP-001, ORG-001, CONST-001, REF-001, VER-001, REF-002, MISSING-INST-001, WORKFLOW-001, PRIN-001, TERM-001 + +### Q4: Audit/Refactoring Phasing + +**Decision**: Separate phases—Phase 1 audit findings for review, Phase 2 refactoring based on approved findings + +- **Impact**: Two-phase PR strategy implemented; @ashley reviews findings before refactoring begins +- **Action**: Deliver audit findings first; implement refactoring in follow-up PR after approval + +### Q5: Constitution Conflict Handling + +**Decision**: Flag all conflicts in AUDIT_REPORT.md with evidence; classify as "governance error" or "constitution exception"; let @ashley decide per-case + +- **Impact**: CONST-001 (constitutional constraints framing) becomes explicit decision point +- **Action**: If any governance guidance conflicts with constitution, document in AUDIT_REPORT.md with classification and decision options for @ashley + +--- + +**Phase 0 Status**: COMPLETE ✅ (with 2026-09-17 clarifications integrated) **Next**: Execute Phase 1 with `/speckit-plan` to generate data-model.md and quickstart.md diff --git a/.github/specs/012-audit-governance-structure/spec.md b/.github/specs/012-audit-governance-structure/spec.md index 5686f4cbf7..ffdecd2ffb 100644 --- a/.github/specs/012-audit-governance-structure/spec.md +++ b/.github/specs/012-audit-governance-structure/spec.md @@ -8,6 +8,15 @@ **Input**: User description: "Audit CLAUDE.md and AGENTS.md governance files to fix branch naming configuration issues, improve structure, establish proper AI client workflow (branch → spec → draft PR → review → merge), and resolve duplicates and bad references." +## Implementation Approach + +This work is structured in two distinct phases: + +- **Phase 1 – Audit & Analysis**: Identify all duplicates, bad references, and structural issues; deliver findings in AUDIT_REPORT.md for review and approval by @ashley +- **Phase 2 – Refactoring & Implementation**: Based on approved audit findings, implement fixes to CLAUDE.md and AGENTS.md; delivered in follow-up PR + +This two-phase approach allows stakeholder review and critique of findings before any changes are made to the governance files, reducing risk of unwanted modifications. + ## User Scenarios & Testing *(mandatory)* ### User Story 1 - Governance Files Quality Baseline (Priority: P1) @@ -97,16 +106,20 @@ As a **reader**, I need all references and links in governance files to point to ### Edge Cases - What happens if a referenced instruction file has been consolidated or moved but not updated in governance files? + - **Resolution**: Validate file existence comprehensively; flag all missing/moved references in AUDIT_REPORT.md with current vs. expected paths - How do we handle references to GitHub projects (`.github/projects/active/`) that may be archived or renamed? + - **Resolution**: Check project status; flag archived/renamed projects; document migration path if known - What if governance guidance conflicts with constitution principles but has been implemented in practice? + - **Resolution**: Flag all conflicts in AUDIT_REPORT.md with evidence; classify as "governance error" or "constitution exception"; let @ashley decide per-case - How do we validate that consolidated instruction files mentioned in AGENTS.md actually contain all the content they claim to consolidate? + - **Resolution**: For each consolidation claim, verify all referenced source files exist and contain expected sections; report completeness status in AUDIT_REPORT.md ## Requirements *(mandatory)* ### Functional Requirements -- **FR-001**: Governance audit MUST identify all duplicate content sections across CLAUDE.md and AGENTS.md with specific line number references -- **FR-002**: Audit MUST validate all file path references against actual repository structure and report broken or outdated links +- **FR-001**: Governance audit MUST identify all duplicate content sections across CLAUDE.md and AGENTS.md with specific line number references; sections with ≥70% text overlap MUST be consolidated into single authoritative version preserving unique content from both +- **FR-002**: Audit MUST validate all file path references against actual repository structure and report: (1) broken/missing files, (2) outdated paths, (3) unimplemented consolidation claims, and (4) line-number mismatches - **FR-003**: Audit MUST identify conflicting guidance about branch naming, label creation, script organization, and AI rules that exists in multiple files - **FR-004**: Audit MUST map relationships between CLAUDE.md, AGENTS.md, constitution, instruction files, and dependent systems (workflows, agents, scripts) - **FR-005**: Refactored CLAUDE.md MUST contain clear, actionable branch naming guidance aligned with constitution, with no forbidden prefixes created by default AI tools @@ -129,7 +142,7 @@ As a **reader**, I need all references and links in governance files to point to ### Measurable Outcomes -- **SC-001**: Audit report identifies and categorizes ALL duplicate sections, bad references, and structural issues in CLAUDE.md and AGENTS.md (must be 100% complete, not sampling) +- **SC-001**: Audit report identifies and categorizes ALL duplicate sections, bad references, and structural issues in CLAUDE.md and AGENTS.md (must be 100% complete, not sampling); delivered as structured markdown at `AUDIT_REPORT.md` in spec directory with clear sections, line-number references, and remediation guidance - **SC-002**: Refactored CLAUDE.md contains zero forbidden branch prefixes in examples and guidance; all examples use correct prefixes (audit, feat, fix, etc.) - **SC-003**: AGENTS.md reduced from 2 duplicate "Label Creation Governance" sections to 1 authoritative section with no content loss - **SC-004**: All file path references validated; 100% of referenced files either exist in repository or have documented migration status @@ -149,10 +162,18 @@ As a **reader**, I need all references and links in governance files to point to - Q4: Audit completeness requirement—100% or sampling acceptable? → A: 100% completeness with tool assistance; use automated tools (diff, grep, similarity analysis) to guarantee reliable detection of all duplicates and bad references - Q5: Post-refactor governance change tracking strategy? → A: Changelog file approach; add GOVERNANCE_CHANGELOG.md documenting all changes with dates and impact for transparency to downstream repos +### Session 2026-09-17 + +- Q1: How to treat near-identical sections (e.g., "Label Creation Governance" appearing twice)? → A: Merge all sections with ≥70% text overlap into one; use union of both versions' content to preserve unique information from each occurrence +- Q2: What categories of "bad references" to validate? → A: Validate all categories—broken/missing files, outdated paths, unimplemented consolidation claims, and line-number mismatches—for comprehensive reference validation +- Q3: Audit report format and delivery mechanism? → A: Structured markdown report at `.github/specs/012-audit-governance-structure/AUDIT_REPORT.md` for version control, easy linking, and integration with spec artifacts +- Q4: Audit and refactoring in same PR or separate phases? → A: Separate phases—Phase 1 audit findings only (AUDIT_REPORT.md for review/approval by @ashley), Phase 2 implements refactoring based on approved findings; allows critique before changes +- Q5: How to handle conflicts between governance guidance and constitution? → A: Flag all conflicts in AUDIT_REPORT.md with evidence; classify each as either "governance error to fix" or "constitution exception to document"; let @ashley decide per-case during review + ## Assumptions - **Assumption**: CLAUDE.md and AGENTS.md are authoritative governance files that supersede project-specific instruction files (per constitution) -- **Assumption**: The constitution (`.specify/memory/constitution.md`) defines non-negotiable principles; any conflicts indicate governance file error, not constitution error +- **Assumption**: The constitution (`.specify/memory/constitution.md`) defines non-negotiable principles; conflicts with governance files are presumed to be governance file errors unless @ashley explicitly documents a constitution exception with justification during audit review (per Q5 clarification) - **Assumption**: @ashley maintains final approval for changes to locked governance files; audit may identify issues but implementation requires her approval - **Assumption**: Branch naming rules are non-negotiable and MUST be enforced consistently across all AI tools and GitHub Actions workflows - **Assumption**: Spec-first workflow (branch → spec → draft PR) is the standard process; audit should reinforce this pattern, not change it diff --git a/.github/specs/012-audit-governance-structure/tasks.md b/.github/specs/012-audit-governance-structure/tasks.md index 185b9c4906..e5d30cc7a3 100644 --- a/.github/specs/012-audit-governance-structure/tasks.md +++ b/.github/specs/012-audit-governance-structure/tasks.md @@ -2,7 +2,7 @@ **Input**: Specification from `/specs/012-audit-governance-structure/spec.md` -**Status**: Phase 2 - Task Decomposition Complete +**Status**: Phase 2 - Task Decomposition Complete (Updated 2026-09-17 with clarification integration) **Total Tasks**: 196 tasks organized by user story and phase @@ -10,6 +10,25 @@ --- +## Two-Phase Execution Approach + +Per 2026-09-17 clarification (Q4): + +- **Phase 1: Audit & Analysis** (Phases 1–8 of task list) + - Complete all investigation, verification, and finding documentation + - Consolidate findings into **AUDIT_REPORT.md** (structured markdown at `.github/specs/012-audit-governance-structure/AUDIT_REPORT.md`) + - Deliverable: Comprehensive audit report ready for @ashley review and approval + - **Gate**: @ashley reviews AUDIT_REPORT.md, approves findings before proceeding + +- **Phase 2: Refactoring & Implementation** (Phases 9–11 of task list) + - Based on approved audit findings, implement fixes to CLAUDE.md and AGENTS.md + - Apply consolidations, reference fixes, structure improvements + - Deliverable: Refactored governance files ready for PR and merge + +This two-phase approach allows stakeholder review and critique of findings before any changes are made to the governance files, reducing risk of unwanted modifications. + +--- + ## Format Reference - **[ID]**: Task identifier (T001, T002, etc.) @@ -25,13 +44,13 @@ ### Setup Tasks -- [ ] T001 [P] Create task tracking structure in `.github/projects/active/audit-governance-refactor-2026-09/` with kanban board -- [ ] T002 [P] Create backup copies of current CLAUDE.md and AGENTS.md in `.github/reports/governance-audit-2026-09-14/originals/` -- [ ] T003 [P] Initialize audit log file at `.github/reports/governance-audit-2026-09-14/audit-log.md` with timestamp and scope -- [ ] T004 [P] Create working directory for consolidated content at `.github/reports/governance-audit-2026-09-14/working/` -- [ ] T005 Verify all research.md findings are documented and accessible at `specs/012-audit-governance-structure/research.md` -- [ ] T006 Verify all data-model.md entities are accessible at `specs/012-audit-governance-structure/data-model.md` -- [ ] T007 Verify validation checklist from quickstart.md at `specs/012-audit-governance-structure/quickstart.md` +- [X] T001 [P] Create task tracking structure in `.github/projects/active/audit-governance-refactor-2026-09/` with kanban board +- [X] T002 [P] Create backup copies of current CLAUDE.md and AGENTS.md in `.github/reports/governance-audit-2026-09-14/originals/` +- [X] T003 [P] Initialize audit log file at `.github/reports/governance-audit-2026-09-14/audit-log.md` with timestamp and scope +- [X] T004 [P] Create working directory for consolidated content at `.github/reports/governance-audit-2026-09-14/working/` +- [X] T005 Verify all research.md findings are documented and accessible at `.github/specs/012-audit-governance-structure/research.md` +- [X] T006 Verify all data-model.md entities are accessible at `.github/specs/012-audit-governance-structure/data-model.md` +- [X] T007 Verify validation checklist from quickstart.md at `.github/specs/012-audit-governance-structure/quickstart.md` **Checkpoint**: Baseline established, audit environment ready, original files backed up @@ -43,31 +62,31 @@ ### VER-001: Reference Validation (7 verification tasks from research.md) -- [ ] T008 [US6] Validate the repository-local reference `.github/instructions/branch-naming.instructions.md` in `.github/instructions/`; if only top-level `instructions/branch-naming.instructions.md` exists, record it as a migration rather than a successful exact-path check -- [ ] T009 [US6] Verify if `docs/BRANCHING_STRATEGY.md` exists; document path or missing status in audit log -- [ ] T010 [US6] Verify if `docs/PR_CREATION_PROCESS.md` exists; document path or missing status in audit log -- [ ] T011 [US6] Verify if `.github/prompts/prompts.md` exists; document migration status if legacy pending -- [ ] T012 [US6] Verify the five consolidated portable files in top-level `instructions/`: `languages.instructions.md`, `documentation-formats.instructions.md`, `quality-assurance.instructions.md`, `automation.instructions.md`, and `community-standards.instructions.md`; report supporting instruction files separately -- [ ] T013 [US6] Verify if GitHub projects in `.github/projects/active/` are current or archived; document status -- [ ] T014 [US6] Validate the AGENTS.md script reference against `scripts/validation/validate-labels-before-creation.cjs`; classify any `.github/scripts/validation/` reference as legacy and record the required migration to the root `scripts/validation/` directory +- [X] T008 [US6] Validate the repository-local reference `.github/instructions/branch-naming.instructions.md` in `.github/instructions/`; if only top-level `instructions/branch-naming.instructions.md` exists, record it as a migration rather than a successful exact-path check +- [X] T009 [US6] Verify if `docs/BRANCHING_STRATEGY.md` exists; document path or missing status in audit log +- [X] T010 [US6] Verify if `docs/PR_CREATION_PROCESS.md` exists; document path or missing status in audit log +- [X] T011 [US6] Verify if `.github/prompts/prompts.md` exists; document migration status if legacy pending +- [X] T012 [US6] Verify the five consolidated portable files in top-level `instructions/`: `languages.instructions.md`, `documentation-formats.instructions.md`, `quality-assurance.instructions.md`, `automation.instructions.md`, and `community-standards.instructions.md`; report supporting instruction files separately +- [X] T013 [US6] Verify if GitHub projects in `.github/projects/active/` are current or archived; document status +- [X] T014 [US6] Validate the AGENTS.md script reference against `scripts/validation/validate-labels-before-creation.cjs`; classify any `.github/scripts/validation/` reference as legacy and record the required migration to the root `scripts/validation/` directory ### Audit Scope Definition -- [ ] T015 [P] Document baseline state: current line counts for CLAUDE.md and AGENTS.md in audit log -- [ ] T016 [P] Document baseline state: count of duplicate sections, broken references, and identified conflicts -- [ ] T017 Extract all file path references from current CLAUDE.md into `audit-references-claude.txt` -- [ ] T018 Extract all file path references from current AGENTS.md into `audit-references-agents.txt` -- [ ] T019 [P] Extract all cross-file references from CLAUDE.md and AGENTS.md into `audit-cross-references.txt` +- [X] T015 [P] Document baseline state: current line counts for CLAUDE.md and AGENTS.md in audit log +- [X] T016 [P] Document baseline state: count of duplicate sections, broken references, and identified conflicts +- [X] T017 Extract all file path references from current CLAUDE.md into `audit-references-claude.txt` +- [X] T018 Extract all file path references from current AGENTS.md into `audit-references-agents.txt` +- [X] T019 [P] Extract all cross-file references from CLAUDE.md and AGENTS.md into `audit-cross-references.txt` ### Constitution Alignment Verification -- [ ] T020 [US1] Verify CLAUDE.md alignment with Constitution Principle I (Organisation-Wide Governance Authority) -- [ ] T021 [US1] Verify CLAUDE.md alignment with Constitution Principle II (Curated Assets with Locked Governance) -- [ ] T022 [US1] Verify CLAUDE.md alignment with Constitution Principle III (Clear Asset Boundaries, No Duplication) -- [ ] T023 [US1] Verify CLAUDE.md alignment with Constitution Principle IV (Technology-Agnostic Guidance) -- [ ] T024 [US1] Verify CLAUDE.md alignment with Constitution Principle V (Branch Naming Non-Negotiable) -- [ ] T025 [US1] Verify CLAUDE.md alignment with Constitution Principle VI (UK English, Accessibility, Security) -- [ ] T026 [US2] Verify AGENTS.md alignment with all 6 constitution principles +- [X] T020 [US1] Verify CLAUDE.md alignment with Constitution Principle I (Organisation-Wide Governance Authority) +- [X] T021 [US1] Verify CLAUDE.md alignment with Constitution Principle II (Curated Assets with Locked Governance) +- [X] T022 [US1] Verify CLAUDE.md alignment with Constitution Principle III (Clear Asset Boundaries, No Duplication) +- [X] T023 [US1] Verify CLAUDE.md alignment with Constitution Principle IV (Technology-Agnostic Guidance) +- [X] T024 [US1] Verify CLAUDE.md alignment with Constitution Principle V (Branch Naming Non-Negotiable) +- [X] T025 [US1] Verify CLAUDE.md alignment with Constitution Principle VI (UK English, Accessibility, Security) +- [X] T026 [US2] Verify AGENTS.md alignment with all 6 constitution principles **Checkpoint**: All verification tasks complete, reference validation done, constitution alignment confirmed @@ -81,27 +100,27 @@ ### US1 Audit Tasks -- [ ] T027 [P] [US1] Diff AGENTS.md lines 209-252 (Label Creation Governance v1) against lines 285-338 (v2); document findings -- [ ] T028 [US1] Create diff report showing exact differences between duplicate "Label Creation Governance" sections -- [ ] T029 [US1] Extract unique content from AGENTS.md lines 209-252 into working file -- [ ] T030 [US1] Extract unique content from AGENTS.md lines 285-338 into working file -- [ ] T031 [US1] Merge unique content and identify common elements; document consolidation approach -- [ ] T032 [P] [US1] Search CLAUDE.md for all section headings; create structured outline -- [ ] T033 [P] [US1] Search AGENTS.md for all section headings; create structured outline -- [ ] T034 [US1] Compare section outlines to identify overlap and relationship patterns -- [ ] T035 [P] [US1] Extract all "see also" and "related" references from CLAUDE.md -- [ ] T036 [P] [US1] Extract all "see also" and "related" references from AGENTS.md -- [ ] T037 [US1] Map all cross-references to verify target sections exist in both files -- [ ] T038 [P] [US1] Identify all internal links in CLAUDE.md using regex `\[.*\]\(\.?/?.*\)` -- [ ] T039 [P] [US1] Identify all internal links in AGENTS.md using regex `\[.*\]\(\.?/?.*\)` -- [ ] T040 [US1] Verify each internal link exists or is documented as migrated -- [ ] T041 [P] [US1] List all sections in AGENTS.md that appear to belong in CLAUDE.md instead -- [ ] T042 [P] [US1] List all sections in CLAUDE.md that appear to be duplicated or contradicted elsewhere -- [ ] T043 [US1] Create comprehensive audit report documenting all findings -- [ ] T044 [US1] Categorize findings by severity: CRITICAL, MAJOR, MEDIUM, LOW -- [ ] T045 [US1] Document decision rationale for each finding and proposed resolution - -**Checkpoint**: US1 Baseline audit complete with comprehensive report +- [X] T027 [P] [US1] Diff AGENTS.md lines 209-252 (Label Creation Governance v1) against lines 285-338 (v2); document findings +- [X] T028 [US1] Create diff report showing exact differences between duplicate "Label Creation Governance" sections +- [X] T029 [US1] Extract unique content from AGENTS.md lines 209-252 into working file +- [X] T030 [US1] Extract unique content from AGENTS.md lines 285-338 into working file +- [X] T031 [US1] Merge unique content and identify common elements; document consolidation approach +- [X] T032 [P] [US1] Search CLAUDE.md for all section headings; create structured outline +- [X] T033 [P] [US1] Search AGENTS.md for all section headings; create structured outline +- [X] T034 [US1] Compare section outlines to identify overlap and relationship patterns +- [X] T035 [P] [US1] Extract all "see also" and "related" references from CLAUDE.md +- [X] T036 [P] [US1] Extract all "see also" and "related" references from AGENTS.md +- [X] T037 [US1] Map all cross-references to verify target sections exist in both files +- [X] T038 [P] [US1] Identify all internal links in CLAUDE.md using regex `\[.*\]\(\.?/?.*\)` +- [X] T039 [P] [US1] Identify all internal links in AGENTS.md using regex `\[.*\]\(\.?/?.*\)` +- [X] T040 [US1] Verify each internal link exists or is documented as migrated +- [X] T041 [P] [US1] List all sections in AGENTS.md that appear to belong in CLAUDE.md instead +- [X] T042 [P] [US1] List all sections in CLAUDE.md that appear to be duplicated or contradicted elsewhere +- [X] T043 [US1] Create structured AUDIT_REPORT.md at `.github/specs/012-audit-governance-structure/AUDIT_REPORT.md` documenting all findings with: (1) Executive summary, (2) Finding categories (DUP-*, ORG-*, REF-*, CONST-*, VER-*), (3) Line-number references for each issue, (4) Remediation guidance per finding +- [X] T044 [US1] Categorize findings in AUDIT_REPORT.md by severity: CRITICAL (blocks automation), MAJOR (confuses readers), MEDIUM (technical debt), LOW (style) +- [X] T045 [US1] Document decision rationale for each finding in AUDIT_REPORT.md and proposed resolution approach + +**Checkpoint**: US1 Baseline audit complete; AUDIT_REPORT.md ready for @ashley review --- @@ -113,21 +132,21 @@ ### US2 Branch Naming Audit Tasks -- [ ] T046 [P] [US2] Extract all branch naming guidance from CLAUDE.md (lines 14-111) -- [ ] T047 [P] [US2] Extract all branch naming guidance from AGENTS.md (lines 104-145) -- [ ] T048 [P] [US2] Extract branch naming guidance from `.github/instructions/branch-naming.instructions.md` if it exists -- [ ] T049 [US2] Compare branch naming sections across all files; identify contradictions or inconsistencies -- [ ] T050 [US2] Document all 38 allowed branch types from CLAUDE.md with examples -- [ ] T051 [US2] Verify all forbidden prefixes are clearly documented with explanation: `claude/`, `copilot/`, `openai/` -- [ ] T052 [P] [US2] Create document showing forbidden prefixes with rationale for each -- [ ] T053 [P] [US2] List all examples in CLAUDE.md branch naming section; verify none use forbidden prefixes -- [ ] T054 [P] [US2] List all examples in AGENTS.md branch naming section; verify none use forbidden prefixes -- [ ] T055 [US2] Verify validation script `npm run validate:branch-name` exists and works correctly -- [ ] T056 [US2] Test validation script with 5 valid branches (feat/, fix/, audit/, etc.) to confirm acceptance -- [ ] T057 [US2] Test validation script with 3 forbidden branches (claude/, copilot/) to confirm rejection -- [ ] T058 [P] [US2] Document any branches in repository using forbidden prefixes -- [ ] T059 [US2] Create guidance document for consolidating/renaming forbidden-prefix branches -- [ ] T060 [US2] Verify CLAUDE.md section on branch naming is authoritative; AGENTS.md references it appropriately +- [X] T046 [P] [US2] Extract all branch naming guidance from CLAUDE.md (lines 14-111) +- [X] T047 [P] [US2] Extract all branch naming guidance from AGENTS.md (lines 104-145) +- [X] T048 [P] [US2] Extract branch naming guidance from `.github/instructions/branch-naming.instructions.md` if it exists +- [X] T049 [US2] Compare branch naming sections across all files; identify contradictions or inconsistencies +- [X] T050 [US2] Document all 38 allowed branch types from CLAUDE.md with examples +- [X] T051 [US2] Verify all forbidden prefixes are clearly documented with explanation: `claude/`, `copilot/`, `openai/` +- [X] T052 [P] [US2] Create document showing forbidden prefixes with rationale for each +- [X] T053 [P] [US2] List all examples in CLAUDE.md branch naming section; verify none use forbidden prefixes +- [X] T054 [P] [US2] List all examples in AGENTS.md branch naming section; verify none use forbidden prefixes +- [X] T055 [US2] Verify validation script `npm run validate:branch-name` exists and works correctly +- [X] T056 [US2] Test validation script with 5 valid branches (feat/, fix/, audit/, etc.) to confirm acceptance +- [X] T057 [US2] Test validation script with 3 forbidden branches (claude/, copilot/) to confirm rejection +- [X] T058 [P] [US2] Document any branches in repository using forbidden prefixes +- [X] T059 [US2] Create guidance document for consolidating/renaming forbidden-prefix branches +- [X] T060 [US2] Verify CLAUDE.md section on branch naming is authoritative; AGENTS.md references it appropriately **Checkpoint**: US2 Branch naming audit complete; all branch types documented; no conflicting guidance remains @@ -141,21 +160,21 @@ ### US3 Consolidation Tasks -- [ ] T061 [US3] Count occurrences of "Label Creation Governance" in AGENTS.md (should be 2 before consolidation) -- [ ] T062 [US3] Extract complete first occurrence of "Label Creation Governance" (lines 209-252) -- [ ] T063 [US3] Extract complete second occurrence of "Label Creation Governance" (lines 285-338) -- [ ] T064 [US3] Compare both versions line-by-line to identify unique and shared content -- [ ] T065 [US3] Document which unique examples/items appear only in first version -- [ ] T066 [US3] Document which unique examples/items appear only in second version -- [ ] T067 [P] [US3] Identify any differences in validation checklist between versions -- [ ] T068 [P] [US3] Identify any differences in referenced scripts between versions (e.g., validate-labels-before-creation.cjs) -- [ ] T069 [US3] Create consolidated "Label Creation Governance" section with all unique content -- [ ] T070 [US3] Verify consolidated section includes: all examples, all validation items, all script references, traceability notes -- [ ] T071 [US3] Update AGENTS.md to remove second occurrence of "Label Creation Governance" -- [ ] T072 [US3] Verify consolidated section appears exactly 1 time in AGENTS.md -- [ ] T073 [P] [US3] Search entire CLAUDE.md and AGENTS.md for other duplicate sections using similarity analysis -- [ ] T074 [US3] Document all other duplicates found (if any) beyond "Label Creation Governance" -- [ ] T075 [US3] Plan consolidation approach for any additional duplicates +- [X] T061 [US3] Count occurrences of "Label Creation Governance" in AGENTS.md (should be 2 before consolidation); per clarification Q1, sections with ≥70% text overlap must be consolidated +- [X] T062 [US3] Extract complete first occurrence of "Label Creation Governance" (lines 209-252) +- [X] T063 [US3] Extract complete second occurrence of "Label Creation Governance" (lines 285-338) +- [X] T064 [US3] Compare both versions line-by-line to identify unique and shared content; calculate text overlap percentage +- [X] T065 [US3] Document which unique examples/items appear only in first version +- [X] T066 [US3] Document which unique examples/items appear only in second version +- [X] T067 [P] [US3] Identify any differences in validation checklist between versions +- [X] T068 [P] [US3] Identify any differences in referenced scripts between versions (e.g., validate-labels-before-creation.cjs) +- [X] T069 [US3] Create consolidated "Label Creation Governance" section using union approach (per Q1 clarification) with all unique content from both versions +- [X] T070 [US3] Verify consolidated section includes: all examples, all validation items, all script references, traceability noting original locations (lines 209-252 and 285-338) +- [X] T071 [US3] Update AGENTS.md to remove second occurrence of "Label Creation Governance" +- [X] T072 [US3] Verify consolidated section appears exactly 1 time in AGENTS.md +- [X] T073 [P] [US3] Search entire CLAUDE.md and AGENTS.md for other duplicate sections using similarity analysis +- [X] T074 [US3] Document all other duplicates found (if any) beyond "Label Creation Governance" +- [X] T075 [US3] Plan consolidation approach for any additional duplicates **Checkpoint**: US3 Duplicate "Label Creation Governance" consolidated; zero duplicate sections remain @@ -169,20 +188,20 @@ ### US4 Structure & Organization Tasks -- [ ] T076 [P] [US4] Create table of contents structure for refactored CLAUDE.md with proposed section ordering -- [ ] T077 [P] [US4] Create table of contents structure for refactored AGENTS.md with proposed section ordering -- [ ] T078 [US4] Document current section order in CLAUDE.md and identify issues with grouping -- [ ] T079 [US4] Document current section order in AGENTS.md and identify issues with grouping -- [ ] T080 [P] [US4] Map all branch naming related content across both files; plan consolidation location -- [ ] T081 [P] [US4] Map all label governance related content across both files; plan consolidation location -- [ ] T082 [P] [US4] Map all AI client rules across both files; plan consolidation location -- [ ] T083 [US4] Create visual diagram showing information architecture and content flow for governance files -- [ ] T084 [US4] Document heading hierarchy and anchor naming convention for all sections -- [ ] T085 [US4] Verify section anchors are consistent and link-friendly across files -- [ ] T086 [P] [US4] Create navigation guide showing how to find topic X in both CLAUDE.md and AGENTS.md -- [ ] T087 [US4] Organize CLAUDE.md into logical sections: Purpose, Key Conventions, Branching, Workflow, Commands, Configuration, Related Files -- [ ] T088 [US4] Organize AGENTS.md into logical sections: Purpose, Governance Principles, Global Rules, Coding Standards, Configuration, Instruction Files -- [ ] T089 [US4] Add cross-references between files using consistent anchor format +- [X] T076 [P] [US4] Create table of contents structure for refactored CLAUDE.md with proposed section ordering +- [X] T077 [P] [US4] Create table of contents structure for refactored AGENTS.md with proposed section ordering +- [X] T078 [US4] Document current section order in CLAUDE.md and identify issues with grouping +- [X] T079 [US4] Document current section order in AGENTS.md and identify issues with grouping +- [X] T080 [P] [US4] Map all branch naming related content across both files; plan consolidation location +- [X] T081 [P] [US4] Map all label governance related content across both files; plan consolidation location +- [X] T082 [P] [US4] Map all AI client rules across both files; plan consolidation location +- [X] T083 [US4] Create visual diagram showing information architecture and content flow for governance files +- [X] T084 [US4] Document heading hierarchy and anchor naming convention for all sections +- [X] T085 [US4] Verify section anchors are consistent and link-friendly across files +- [X] T086 [P] [US4] Create navigation guide showing how to find topic X in both CLAUDE.md and AGENTS.md +- [X] T087 [US4] Organize CLAUDE.md into logical sections: Purpose, Key Conventions, Branching, Workflow, Commands, Configuration, Related Files +- [X] T088 [US4] Organize AGENTS.md into logical sections: Purpose, Governance Principles, Global Rules, Coding Standards, Configuration, Instruction Files +- [X] T089 [US4] Add cross-references between files using consistent anchor format **Checkpoint**: US4 Governance files reorganized; clear information architecture established @@ -196,23 +215,23 @@ ### US5 Workflow Guidance Tasks -- [ ] T090 [P] [US5] Document workflow Phase 0: Create feature branch with correct naming convention -- [ ] T091 [P] [US5] Document workflow Phase 1: Write specification in `specs/{###-feature-name}/spec.md` -- [ ] T092 [P] [US5] Document workflow Phase 2: Run `/speckit-plan` to create implementation plan -- [ ] T093 [P] [US5] Document workflow Phase 3: Run `/speckit-tasks` to decompose into concrete tasks -- [ ] T094 [P] [US5] Document workflow Phase 4: Implement tasks and commit changes to feature branch (do NOT create PR automatically) -- [ ] T095 [US5] Document workflow Phase 5: User manually creates draft PR when ready (not automatic) -- [ ] T096 [US5] Document workflow Phase 6: Review, respond to feedback, merge to develop when approved -- [ ] T097 [P] [US5] For each phase, define clear entry criteria (what must be done before this phase starts) -- [ ] T098 [P] [US5] For each phase, define clear exit criteria (what marks this phase as complete) -- [ ] T099 [P] [US5] For each phase, define measurable success criteria -- [ ] T100 [US5] Create example: "Implement a simple feature" showing all 6 workflow phases -- [ ] T101 [US5] Create example: "Audit and refactor" showing workflow applied to governance work -- [ ] T102 [US5] Document when to create specs vs. when specs are optional -- [ ] T103 [US5] Document when @ashley approval is required and how to obtain it -- [ ] T104 [US5] Add workflow guidance to CLAUDE.md under "Git Workflow" section -- [ ] T105 [US5] Add workflow reference to AGENTS.md with link to authoritative CLAUDE.md section -- [ ] T106 [US5] Verify workflow guidance aligns with constitution principle on Specification-First Process +- [X] T090 [P] [US5] Document workflow Phase 0: Create feature branch with correct naming convention +- [X] T091 [P] [US5] Document workflow Phase 1: Write specification in `specs/{###-feature-name}/spec.md` +- [X] T092 [P] [US5] Document workflow Phase 2: Run `/speckit-plan` to create implementation plan +- [X] T093 [P] [US5] Document workflow Phase 3: Run `/speckit-tasks` to decompose into concrete tasks +- [X] T094 [P] [US5] Document workflow Phase 4: Implement tasks and commit changes to feature branch (do NOT create PR automatically) +- [X] T095 [US5] Document workflow Phase 5: User manually creates draft PR when ready (not automatic) +- [X] T096 [US5] Document workflow Phase 6: Review, respond to feedback, merge to develop when approved +- [X] T097 [P] [US5] For each phase, define clear entry criteria (what must be done before this phase starts) +- [X] T098 [P] [US5] For each phase, define clear exit criteria (what marks this phase as complete) +- [X] T099 [P] [US5] For each phase, define measurable success criteria +- [X] T100 [US5] Create example: "Implement a simple feature" showing all 6 workflow phases +- [X] T101 [US5] Create example: "Audit and refactor" showing workflow applied to governance work +- [X] T102 [US5] Document when to create specs vs. when specs are optional +- [X] T103 [US5] Document when @ashley approval is required and how to obtain it +- [X] T104 [US5] Add workflow guidance to CLAUDE.md under "Git Workflow" section +- [X] T105 [US5] Add workflow reference to AGENTS.md with link to authoritative CLAUDE.md section +- [X] T106 [US5] Verify workflow guidance aligns with constitution principle on Specification-First Process **Checkpoint**: US5 Specification-first workflow clearly documented with all phases and criteria @@ -226,27 +245,48 @@ ### US6 Reference Validation Tasks -- [ ] T107 [P] [US6] Verify each reference from T017 (CLAUDE.md references) and document status -- [ ] T108 [P] [US6] Verify each reference from T018 (AGENTS.md references) and document status -- [ ] T109 [P] [US6] Update CLAUDE.md references to reflect actual file locations -- [ ] T110 [P] [US6] Update AGENTS.md references to reflect actual file locations -- [ ] T111 [US6] For each missing file, create entry in migration log documenting: original path, status, action taken -- [ ] T112 [US6] If `.github/prompts/prompts.md` exists, document its content and relationship to governance -- [ ] T113 [US6] If `.github/prompts/prompts.md` doesn't exist, update AGENTS.md line 18 reference appropriately -- [ ] T114 [US6] Verify all 5 consolidated instruction files exist and contain expected topics -- [ ] T115 [US6] If any consolidated instruction files are missing, document which topics were not consolidated -- [ ] T116 [US6] Verify GitHub projects in `.github/projects/active/` exist and update any archived project references -- [ ] T117 [US6] Migrate the legacy `.github/scripts/validation/validate-labels-before-creation.cjs` reference to `scripts/validation/validate-labels-before-creation.cjs` -- [ ] T118 [US6] Create reference validation report documenting: total references checked, valid, broken, migrated -- [ ] T119 [US6] Add validation check to governance files: "Last validated: [DATE]" +Per Q2 clarification, validate all 4 categories: (1) broken/missing files, (2) outdated paths, (3) unimplemented consolidation claims, (4) line-number mismatches + +- [X] T107 [P] [US6] Verify each reference from T017 (CLAUDE.md references) and document status against all 4 validation categories +- [X] T108 [P] [US6] Verify each reference from T018 (AGENTS.md references) and document status against all 4 validation categories +- [X] T109 [P] [US6] Update CLAUDE.md references to reflect actual file locations; for line-number references, use section anchors instead where possible +- [X] T110 [P] [US6] Update AGENTS.md references to reflect actual file locations; for line-number references, use section anchors instead where possible +- [X] T111 [US6] For each missing file, create entry in migration log documenting: original path, status (broken, migrated, consolidated), action taken +- [X] T112 [US6] If `.github/prompts/prompts.md` exists, document its content and relationship to governance (category 2: outdated path) +- [X] T113 [US6] If `.github/prompts/prompts.md` doesn't exist, update AGENTS.md line 18 reference appropriately (category 1: broken file) +- [X] T114 [US6] Verify all 5 consolidated instruction files exist and contain expected topics (category 3: unimplemented consolidation claims) +- [X] T115 [US6] If any consolidated instruction files are missing, document which topics were not consolidated (category 3) +- [X] T116 [US6] Verify GitHub projects in `.github/projects/active/` exist and update any archived project references (category 2: outdated paths) +- [X] T117 [US6] Migrate the legacy `.github/scripts/validation/validate-labels-before-creation.cjs` reference to `scripts/validation/validate-labels-before-creation.cjs` (category 2: outdated path) +- [X] T118 [US6] Create reference validation report documenting: total references checked, valid, broken (cat 1), outdated (cat 2), unimplemented (cat 3), line-mismatches (cat 4) +- [X] T119 [US6] Add validation check to governance files: "Last validated: [DATE]" with reference to AUDIT_REPORT.md validation section **Checkpoint**: US6 All references validated; no broken links remain; migration status documented --- +## 🔐 APPROVAL GATE: @ashley Review & Approval + +**After completing Phase 8 Checkpoint (T119), STOP and request review:** + +1. @ashley reviews AUDIT_REPORT.md for accuracy and completeness +2. @ashley reviews all audit findings and consolidation decisions +3. @ashley approves/flags any conflicts per Q5 (constitution vs. practice conflicts classified and decision options provided) +4. @ashley signals approval to proceed with Phase 9 (Refactoring) + +**Do NOT proceed with Phases 9–11 until @ashley has explicitly approved the audit findings.** + +This gate ensures all structural changes are reviewed and approved before implementation begins. + +--- + ## Phase 9: Refactoring Implementation (Multi-User Story) -**Purpose**: Apply all audit findings and consolidations to refactored governance files +**Purpose**: Apply all audit findings documented in AUDIT_REPORT.md and consolidations to refactored governance files + +**Prerequisites**: @ashley approval of AUDIT_REPORT.md findings (Approval Gate, above) + +**Reference**: All decisions and findings from AUDIT_REPORT.md guide the refactoring tasks below. Each task implements a specific finding or consolidation identified during audit phases. ### Refactoring Core Tasks (Applies to Multiple US) @@ -355,7 +395,7 @@ - [ ] T182 @ashley reviews audit findings and consolidation approach - [ ] T183 @ashley verifies all constitution principles respected - [ ] T184 @ashley approves changes and signs off -- [ ] T185 Update spec status to "Complete" in specs/012-audit-governance-structure/spec.md +- [ ] T185 Update spec status to "Complete" in .github/specs/012-audit-governance-structure/spec.md ### Integration Tasks diff --git a/.github/specs/013-spec-folder-refactor/contracts/MAINTENANCE.md.contract b/.github/specs/013-spec-folder-refactor/contracts/MAINTENANCE.md.contract index 0534640dd1..1a388c49e2 100644 --- a/.github/specs/013-spec-folder-refactor/contracts/MAINTENANCE.md.contract +++ b/.github/specs/013-spec-folder-refactor/contracts/MAINTENANCE.md.contract @@ -54,18 +54,18 @@ - NNN = 3-digit number (zero-padded: 001, 002, ..., 013) - {slug} = lowercase, hyphens, no spaces/special-chars -3. **Use SpecKit workflow** +1. **Use SpecKit workflow** - Run `/speckit-specify` with feature description - Complete `/speckit-clarify` to resolve ambiguities - Complete `/speckit-plan` to design technical approach - Complete `/speckit-tasks` to decompose into implementation tasks -4. **Update CATALOG.md** +2. **Update CATALOG.md** - Add row to index table with new number, title, purpose, status, date - Add detailed entry section below (see CATALOG.md contract) - Update date to creation date -5. **Approval gate** +3. **Approval gate** - New specification requires review by @ashley (governance authority) - Specification must pass all 8 quality dimensions (Constitution Principle VII) - Quality checklist in `checklists/requirements.md` must show all items passing diff --git a/.github/specs/014-agents-restructure-consolidate/data-model.md b/.github/specs/014-agents-restructure-consolidate/data-model.md index 3832f9fc59..29bcb7bf52 100644 --- a/.github/specs/014-agents-restructure-consolidate/data-model.md +++ b/.github/specs/014-agents-restructure-consolidate/data-model.md @@ -7,6 +7,7 @@ ### Agent **Core Attributes** + - `id` (string): Unique agent identifier, matches folder name (e.g., "prd-agent") - `name` (string): Human-readable name - `description` (string): Purpose and capabilities @@ -15,12 +16,14 @@ - `status` (enum): one of `active`, `deprecated`, `in-restructure`, `needs-remediation` **Metadata** + - `created_date` (ISO 8601): Creation date - `last_modified` (ISO 8601): Last update date - `restructure_priority` (enum): P1, P2, P3 (from spec) - `owner_team` (string): Responsible team **Folder Structure** (per Decision 1: Agent Folder Structure) + - `AGENT.md` - Agent definition file - `CHANGELOG.md` - Version history - `package.json` - Dependencies declaration @@ -30,11 +33,13 @@ - `config/` - Configuration files subfolder **Relationships** + - `skills` (array): Skill IDs used by this agent - `depends_on` (array): Agent IDs this depends on - `references_scripts` (array): Script paths referenced **Validation Rules** + - `id` must match folder name (e.g., agent in "agents/prd-agent" has id="prd-agent") - `version` must follow semantic versioning - `folder_path` must exist and be accessible @@ -42,6 +47,7 @@ - `dependencies` must reference existing agents (no dangling refs) **Lifecycle States** + ``` PENDING → IN_RESTRUCTURE (restructuring work begins) @@ -54,6 +60,7 @@ PENDING ### Skill **Core Attributes** + - `id` (string): Unique skill identifier (e.g., "broken-refs-finder") - `name` (string): Human-readable name - `version` (string): Semantic version @@ -64,27 +71,32 @@ PENDING - `status` (enum): `active`, `deprecated`, `in-development` **Naming Convention** (per Decision 2: Skills Naming) + - Pattern: `{category}/{scope}-{title}` - Examples: `validation/broken-refs-finder`, `audit/structure-checker` - Full path: `skills/{category}/{scope}-{title}/` **Compliance Attributes** + - `agentskills_compliant` (boolean): Passes agentskills.io validation - `compliance_violations` (array): List of missing/invalid fields - `last_validated_date` (ISO 8601): Last compliance check - `schema_version` (string): agentskills.io spec version **Deduplication Attributes** + - `content_hash` (string): SHA-256 hash of implementation - `semantic_similarity_score` (number): Similarity to other skills (0–1) - `duplicate_of` (string, optional): Source skill ID if duplicate **Relationships** + - `used_by` (array): Agent IDs that use this skill - `depends_on` (array): Skill IDs this depends on - `has_tests` (boolean): Whether tests exist **Validation Rules** + - `id` and `name` must be unique within location - `version` must follow semantic versioning - `type` must be valid agentskills.io skill type @@ -96,10 +108,12 @@ PENDING ### Agent Registry **File Locations** + - Consolidated: `agents/registry.json` (all agents) - Per-agent: `agents/{agent-id}/registry.json` (single agent) **Entry Fields** (per Decision 4: Registry Format) + - `id` (string): Unique agent identifier - `name` (string): Human-readable name - `version` (string): Semantic version @@ -110,6 +124,7 @@ PENDING - `references_scripts` (array): Script paths referenced **Generation & Maintenance** (per Decision 4) + - Auto-generated from filesystem state - Never manually maintained - Regenerated on-demand via CLI: `npm run audit:registry` @@ -120,10 +135,12 @@ PENDING ### Skill Registry **File Locations** + - Consolidated: `skills/registry.json` (all skills) - Per-category: `skills/{category}/registry.json` (skills in category) **Entry Fields** + - `id` (string): Unique skill identifier - `name` (string): Human-readable name - `version` (string): Semantic version @@ -136,6 +153,7 @@ PENDING - `used_by` (array): Agent IDs that use this skill **Generation & Maintenance** (per Decision 4) + - Auto-generated from filesystem scan of `skills/` and `agents/*/skills/` - Preserves categorical organization - Regenerated on-demand via CLI @@ -145,6 +163,7 @@ PENDING ## State Transitions ### Agent States + ``` PENDING → IN_RESTRUCTURE → COMPLETED ↓ @@ -152,17 +171,20 @@ PENDING → IN_RESTRUCTURE → COMPLETED ``` **Transition Rules**: + - PENDING → IN_RESTRUCTURE: Manual transition when restructuring work begins - IN_RESTRUCTURE → COMPLETED: Automatic when all 7 folder structure components verified - IN_RESTRUCTURE → NEEDS_REMEDIATION: Automatic when structure checks fail - NEEDS_REMEDIATION → IN_RESTRUCTURE: Manual transition after fixes applied ### Skill States + ``` IN_DEVELOPMENT → ACTIVE → DEPRECATED ``` **Transition Rules**: + - IN_DEVELOPMENT: New skills being created - ACTIVE: Publicly available and maintained - DEPRECATED: Marked for removal; has migration path @@ -172,11 +194,13 @@ IN_DEVELOPMENT → ACTIVE → DEPRECATED ## Validation & Constraints ### Referential Integrity + - All agent `depends_on` must reference existing agents (no dangling references) - All skill `used_by` agents must exist - All agent `references_scripts` must exist in repo ### Dependency Rules + - Circular dependencies detected and reported (no cycles allowed) - Missing skill dependencies block agent restructuring - Version-pinned skill copies allowed ONLY when versions differ diff --git a/.github/specs/014-agents-restructure-consolidate/quickstart.md b/.github/specs/014-agents-restructure-consolidate/quickstart.md index 68d565db7f..37ff542410 100644 --- a/.github/specs/014-agents-restructure-consolidate/quickstart.md +++ b/.github/specs/014-agents-restructure-consolidate/quickstart.md @@ -13,7 +13,7 @@ This guide documents 5 runnable validation scenarios that prove Phase 1 implemen **Prerequisites**: - Phase 1 Setup complete (audit scripts available) -- Agent files have been renamed/reorganized (per refactor/agents-resturcturing branch) +- Agent files have been renamed/reorganized (per refactor/agents-restructure-consolidate branch) **Run**: diff --git a/.github/specs/014-agents-restructure-consolidate/research.md b/.github/specs/014-agents-restructure-consolidate/research.md index 61572bd3a4..c2fdae8d65 100644 --- a/.github/specs/014-agents-restructure-consolidate/research.md +++ b/.github/specs/014-agents-restructure-consolidate/research.md @@ -9,6 +9,7 @@ ## Decision 1: Agent Folder Structure Template **Decision**: Every agent MUST contain 7 standardized components: + 1. `AGENT.md` - Agent definition file 2. `CHANGELOG.md` - Version history and changes 3. `package.json` - Node.js dependencies @@ -20,6 +21,7 @@ **Rationale**: Standardized structure enables automated tooling; each agent self-contained; package.json provides dependency declaration standard; reduces onboarding overhead. **Alternatives Considered**: + - Option A (Minimal, 5 items) - *Rejected*: Missing CHANGELOG.md and package.json - Option C (Comprehensive, 11 items) - *Rejected*: Excessive for MVP @@ -32,13 +34,15 @@ **Decision**: All skills follow `{category}/{scope}-{title}` where category is a categorical subfolder. **Examples**: -- `skills/validation/broken-refs-finder` + +- `skills/validation/broken-refs-finder` - `skills/audit/structure-checker` - `skills/reporting/audit-report-builder` **Rationale**: Mirrors branch naming for consistency; categorical organization groups related skills; enables hierarchical discovery; improves deduplication accuracy. **Alternatives Considered**: + - Flat structure - *Rejected*: 1000+ skills unnavigable - Alphabetical subfolders - *Rejected*: Doesn't reflect functional organization @@ -49,6 +53,7 @@ ## Decision 3: Testing Framework Selection (Context-Dependent) **Decision**: Framework chosen per agent type: + - **JavaScript agents/skills**: Jest with `__tests__/` convention - **Shell scripts**: Bats with `tests/` convention - **UI agents**: Playwright with `tests/e2e/` convention @@ -56,6 +61,7 @@ **Rationale**: Uses best tool per context; Jest standard for Node.js; Bats for shell; Playwright for browser automation. **Alternatives Considered**: + - Single framework for all - *Rejected*: Mismatched tooling fit **Implementation Impact**: Task T016 validates tests/ folder matches agent type; Phase 2 enforces 80% coverage. @@ -65,6 +71,7 @@ ## Decision 4: Skills Registry Format & Generation **Decision**: JSON registries auto-generated from filesystem: + - Per-agent: `agents/{agent}/registry.json` - Consolidated: `skills/registry.json` - Triggers: On-demand CLI; integrable with pre-commit hooks/CI @@ -72,6 +79,7 @@ **Rationale**: JSON machine-parseable for JavaScript; auto-generation prevents drift; on-demand allows validation. **Alternatives Considered**: + - YAML - *Rejected*: Less suitable for JavaScript parsing - Manual maintenance - *Rejected*: High drift risk @@ -92,6 +100,7 @@ ## Decision 6: Deferred Scope (Phase 2 Specifications) **Explicitly deferred**: + 1. Linting Phase - ESLint, PHPCS, Prettier gates 2. Test Creation & Validation Phase - 80% coverage enforcement 3. Comprehensive Documentation Phase - Extended docs diff --git a/.github/specs/014-agents-restructure-consolidate/spec.md b/.github/specs/014-agents-restructure-consolidate/spec.md index d6f8d09ac8..77314bf803 100644 --- a/.github/specs/014-agents-restructure-consolidate/spec.md +++ b/.github/specs/014-agents-restructure-consolidate/spec.md @@ -200,7 +200,7 @@ As a system maintainer, I need to plan the reconstruction of root-level scripts - Q: Should we extend the 30-day timeline to add dedicated Linting, Test Creation, and Documentation phases, or defer them to Phase 2? → A: Option C - Phased rollout: Phase 1 (this spec) delivers core restructuring in 30 days; Linting, Test Creation, and Documentation phases deferred to Phase 2 spec - Q: What files and folder structure should EVERY agent contain? → A: Option B - Recommended: AGENT.md, CHANGELOG.md, package.json, README.md, skills/, tests/, config/ -- Q: Which testing framework should agents mandate for test coverage? → A: Option D - Mixed (context-dependent): Jest for JavaScript agents (__tests__/ folders), Bats for shell scripts (tests/ folder), Playwright for UI agents (tests/e2e/ folder) +- Q: Which testing framework should agents mandate for test coverage? → A: Option D - Mixed (context-dependent): Jest for JavaScript agents (`__tests__/` folders), Bats for shell scripts (`tests/` folder), Playwright for UI agents (`tests/e2e/` folder) - Q: Should skills adopt a categorical naming convention {category}/{scope}-{title} with categorical subfolders? → A: Yes - Adopt pattern with example categories: skills/validation/, skills/audit/, skills/reporting/, skills/registry/ - Q: Should we add User Stories 8 (Plugins) & 9 (SpecKit Integration) to this spec, or defer to Phase 2? → A: Option A - Defer both to Phase 2 spec; Phase 1 focuses on core restructuring infrastructure (7 user stories) diff --git a/.github/specs/CATALOG.md b/.github/specs/CATALOG.md index 3166d0a4fb..22559011ea 100644 --- a/.github/specs/CATALOG.md +++ b/.github/specs/CATALOG.md @@ -38,7 +38,7 @@ All specification catalog entries MUST follow this exact column order and naming | 009 | audit-branch-cleanup | Audit and Refactor Branch Cleanup | Active | 2026-03-20 | [./009-audit-branch-cleanup/spec.md](./009-audit-branch-cleanup/spec.md) | | 010 | requirements-checklist | Requirements Quality Checklist | Active | 2026-04-01 | [./010-requirements-checklist/spec.md](./010-requirements-checklist/spec.md) | | 011 | workflow-consolidation-phase-2 | Workflow Consolidation Phase 2 | Active | 2026-04-10 | [./011-workflow-consolidation-phase-2/spec.md](./011-workflow-consolidation-phase-2/spec.md) | -| 012 | audit-governance-structure | Governance Files Audit & Refactor | Active | 2026-04-20 | [./012-audit-governance-structure/spec.md](./012-audit-governance-structure/spec.md) | +| 012 | audit-governance-structure | Governance Files Audit & Refactor | Active | 2026-10-07 | [./012-audit-governance-structure/spec.md](./012-audit-governance-structure/spec.md) | | 013 | spec-folder-refactor | SpecKit Folder Organization Refactoring | Active | 2026-09-16 | [./013-spec-folder-refactor/spec.md](./013-spec-folder-refactor/spec.md) | | 019 | qodo-pr-agent-integration | Qodo PR-Agent Installation & Agent/Skill Integration | Active | 2026-09-24 | [./019-qodo-pr-agent-integration/spec.md](./019-qodo-pr-agent-integration/spec.md) | @@ -204,9 +204,9 @@ Consolidate GitHub Actions workflows across the organization to reduce duplicati Audit governance files and refactor organizational structure for improved policy compliance and maintainability. - **Status**: Active -- **Phase**: Complete -- **Created**: 2026-04-20 -- **Updated**: 2026-04-20 +- **Phase**: InProgress +- **Created**: 2026-09-14 +- **Updated**: 2026-09-18 - **Link**: [./012-audit-governance-structure/spec.md](./012-audit-governance-structure/spec.md) --- diff --git a/CHANGELOG.md b/CHANGELOG.md index bd332f2344..cd400b85d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -255,6 +255,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Changelog Check Run Skips Forks** — Check-run publication now requires a same-repository pull request, so a fork PR touching a changelog no longer fails on a read-only token. ([PR #3376](https://github.com/lightspeedwp/.github/pull/3376)) - **Plugin Advisories and Register** — Added current scaffold tracking, safe asset versioning, a rate-limited newsletter example and project-controlled gateway approval. ([#1396](https://github.com/lightspeedwp/.github/issues/1396)) - **GitHub Label Audit** — Audited all 169 canonical labels: `type:decision` had no issue type and 12 protected labels were missing from the label list, so they were removed from it. Added evidence and the label consolidation plan. (#3362) +- Completed governance files audit identifying 8 findings: 1 critical duplicate, 5 major, 1 medium and 1 low issue. Audit report ready for review; Phase 2 refactoring pending. (#3368) - **SpecKit Folder Organization Refactoring & Quality Audit** — Added Spec 013 with `.github/specs/` audit, catalog, eight-dimension quality review, and maintenance procedures. ([PR #3348](https://github.com/lightspeedwp/.github/pull/3348)) - **Changelog pre-release validation tools** — Added automated validator script and release manager checklist for pre-release changelog quality audits. (#3350) - **Branch Cleanup Audit Added** — Added safe-cleanup guidance with keep, review and delete categories. (#3128) diff --git a/skills/claim-register-auditor/assets/evidence-needed-template.md b/skills/claim-register-auditor/assets/evidence-needed-template.md index 1c8bc61d39..f2b28e3f6e 100644 --- a/skills/claim-register-auditor/assets/evidence-needed-template.md +++ b/skills/claim-register-auditor/assets/evidence-needed-template.md @@ -29,5 +29,5 @@ |---|---|---|---|---|---| | CL-001 | | | | | | -_This page brought to you by the 🦄 Magic Automation Unicorns of LightSpeedWP._ +*This page brought to you by the 🦄 Magic Automation Unicorns of LightSpeedWP.* [Automation Docs](https://github.com/lightspeedwp/.github/tree/main/instructions) diff --git a/skills/faq-and-chatbot-source-curator/assets/chatbot-safe-faq-register-template.md b/skills/faq-and-chatbot-source-curator/assets/chatbot-safe-faq-register-template.md index 8e62a56912..6f9ae26ed8 100644 --- a/skills/faq-and-chatbot-source-curator/assets/chatbot-safe-faq-register-template.md +++ b/skills/faq-and-chatbot-source-curator/assets/chatbot-safe-faq-register-template.md @@ -32,5 +32,5 @@ *Maintained by the 🤖 LightSpeedWP Automation Team* -_Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team_ +*Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team* [Org Profile](https://github.com/lightspeedwp/.github/tree/main/profile) diff --git a/skills/launch-readiness-auditor/assets/page-qa-table-template.md b/skills/launch-readiness-auditor/assets/page-qa-table-template.md index aba1247e35..87bc8c9669 100644 --- a/skills/launch-readiness-auditor/assets/page-qa-table-template.md +++ b/skills/launch-readiness-auditor/assets/page-qa-table-template.md @@ -33,5 +33,5 @@ *Maintained by the 🤖 LightSpeedWP Automation Team* -_Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team_ +*Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team* [Org Profile](https://github.com/lightspeedwp/.github/tree/main/profile) diff --git a/skills/redirect-map-planner/assets/current-url-inventory-template.md b/skills/redirect-map-planner/assets/current-url-inventory-template.md index a10680f11a..708317b017 100644 --- a/skills/redirect-map-planner/assets/current-url-inventory-template.md +++ b/skills/redirect-map-planner/assets/current-url-inventory-template.md @@ -38,5 +38,5 @@ *Maintained by the 🤖 LightSpeedWP Automation Team* -_Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team_ +*Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team* [Org Profile](https://github.com/lightspeedwp/.github/tree/main/profile) diff --git a/skills/release-handoff-generator/assets/known-issues-register-template.md b/skills/release-handoff-generator/assets/known-issues-register-template.md index 74ad0fee14..fb705a1fb8 100644 --- a/skills/release-handoff-generator/assets/known-issues-register-template.md +++ b/skills/release-handoff-generator/assets/known-issues-register-template.md @@ -32,5 +32,5 @@ *Maintained by the 🤖 LightSpeedWP Automation Team* -_Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team_ +*Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team* [Org Profile](https://github.com/lightspeedwp/.github/tree/main/profile) diff --git a/skills/schema-and-ai-discoverability-planner/assets/faq-schema-map-template.md b/skills/schema-and-ai-discoverability-planner/assets/faq-schema-map-template.md index 25759c2b2e..e6c8be0ee3 100644 --- a/skills/schema-and-ai-discoverability-planner/assets/faq-schema-map-template.md +++ b/skills/schema-and-ai-discoverability-planner/assets/faq-schema-map-template.md @@ -32,5 +32,5 @@ *Maintained by the 🤖 LightSpeedWP Automation Team* -_Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team_ +*Maintained with ❤️ by the 🚀 LightSpeedWP Automation Team* [Org Profile](https://github.com/lightspeedwp/.github/tree/main/profile) diff --git a/skills/self-evolving-agent/CHANGELOG.md b/skills/self-evolving-agent/CHANGELOG.md index a820d314bd..4351df45d2 100644 --- a/skills/self-evolving-agent/CHANGELOG.md +++ b/skills/self-evolving-agent/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.4.0 - 2026-07-03 ### Added + - [reference] Added `references/mutation-proposal-schema.md` for machine-readable mutation proposal fields, review rules, and JSON examples. - [tooling] Added `scripts/validate_mutation_proposals.py` to validate JSON and JSONL proposal records before review or approved application. - [evaluation] Added proposal validation guidance to the evaluation pack. @@ -10,12 +11,14 @@ - [quality] Added proposal-record validation to the pre-package quality gate. ### Evaluation + - Ran Python syntax compilation for all scripts. - Smoke-tested the mutation proposal validator with valid and invalid JSONL records. - Smoke-tested existing observation, archive, and quality scripts. - Ran the local quality gate and standard skill packager. ### Safety and rollback + - Risk level: Low. - Approval level: Local package only. - Rollback: restore the previous 1.3.0 package or remove the mutation proposal schema, validator script, template additions, and `SKILL.md` helper-script references. @@ -23,6 +26,7 @@ ## 1.3.0 - 2026-07-03 ### Added + - [workflow] Added repeat-improvement guidance for continued mutation requests, including when to pause rather than keep adding speculative rules. - [reference] Added `references/improvement-backlog.md` for backlog statuses, prioritisation rules, saturation checks, and batch selection. - [reference] Added `references/quality-gates.md` for pre-package scope, structure, instruction, safety, evaluation, and packaging checks. @@ -30,11 +34,13 @@ - [output] Added improvement backlog and quality gate report templates. ### Evaluation + - Ran Python syntax compilation for all scripts. - Smoke-tested observation normalisation and archive validation. - Ran `scripts/check_skill_quality.py --skill-dir . --strict`; initial run caught generated `__pycache__` files, then passed after cleanup. ### Safety and rollback + - Risk level: Low to Medium. - Approval level: Local package only. - Rollback: restore the previous 1.2.0 package or remove the added references/script/templates and restore the prior `SKILL.md` reference list. @@ -42,6 +48,7 @@ ## 1.2.0 - 2026-07-03 ### Added + - [reference] Added archive and versioning guidance with version bump rules, decision record fields, and rollback examples. - [evaluation] Added a scenario-based evaluation pack for trigger, routing, safety, archive, and variant comparison checks. - [routing] Added concrete positive, negative, and edge-case scenarios for trigger and handoff testing. @@ -49,18 +56,20 @@ - [output] Added mutation decision record and variant comparison templates. ### Evaluation + - Smoke-tested the existing observation normaliser and new archive validator. - Repackaged the complete skill as `skill.zip`. ### Safety and rollback + - Risk level: Low to Medium. - Approval level: Local package only. - Rollback: restore the previous 1.1.0 package or remove the added references/script and restore the prior `SKILL.md` reference list. - ## 1.1.0 - 2026-07-03 ### Changed + - Added quick improvement audit mode for lightweight skill review requests. - Added explicit trigger and routing examples for common skill-evolution requests. - Added reusable evaluation examples for trigger accuracy, approved application, routing, safety gates, and archive quality. @@ -68,8 +77,10 @@ - Added approval-level distinctions for proposal, local package, connected edit, publication, and permission changes. ### Verified + - Confirmed `scripts/evolution_log.py` writes JSONL records correctly in a local smoke test. ### Safety and rollback + - Risk level: Low to Medium. - Rollback: restore the previous `SKILL.md`, `references/evolution-protocol.md`, `references/output-templates.md`, and `references/safety-and-governance.md` from the archived baseline.