Skip to content

feat(skill): enhance /architect persona and scoring#832

Merged
carlos-alm merged 5 commits intomainfrom
docs/claude-code-architecture-analysis
Apr 4, 2026
Merged

feat(skill): enhance /architect persona and scoring#832
carlos-alm merged 5 commits intomainfrom
docs/claude-code-architecture-analysis

Conversation

@carlos-alm
Copy link
Copy Markdown
Contributor

Summary

  • Add uncompromising architect persona that holds enterprise-grade bar regardless of project stage, self-corrects mid-document
  • Add dual-lens scoring: Current State vs State of the Art side by side with gap analysis
  • Consolidate audit output to generated/architecture/ only (remove docs/architecture/ copy)

Test plan

  • Run /architect and verify persona tone and dual-lens scorecard format
  • Confirm audit writes only to generated/architecture/

Analyze Claude Code v2.1.88 architecture (all 17 episodes from
claude-reviews-claude) to extract 22 transferable patterns for codegraph.
Separate report identifies 11 concrete MCP integration hacks from source
analysis — alwaysLoad, searchHint, readOnlyHint annotations — to make
codegraph a first-class tool inside Claude Code.
- Add architect persona holding enterprise-grade bar
  regardless of project stage
- Add dual-lens scoring: Current State vs State of the Art
  side by side, with gap analysis
- Move audit output from docs/architecture/ to
  generated/architecture/ (single location)
- Remove old audit from docs/architecture/ (already in
  generated/)
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 4, 2026

Greptile Summary

This PR enhances the /architect skill with an opinionated "uncompromising architect" persona and a dual-lens scoring framework (Current State vs State of the Art), and consolidates audit output from two paths (docs/architecture/ + generated/architecture/) down to generated/architecture/ only. The previous review threads correctly identified that ADR lookup paths were mistakenly changed alongside the output-path consolidation; those were reverted in the fix commit and the three occurrences in SKILL.md (Phase 1 step 4, Phase 3-F, and the Audit Structure section) now correctly point to docs/architecture/decisions/. The deleted docs/architecture/ARCHITECTURE_AUDIT_v3.4.0_2026-03-26.md is preserved at generated/architecture/ which is tracked in git, so no audit history is lost.

Key changes:

  • New Persona section defines a self-correcting, ungraded-on-a-curve reviewer mindset with explicit permission to revise prior-section scores mid-document
  • Dual-Lens Scoring adds a structured | Dimension | Current State: X/10 | State of the Art: Y/10 | Gap | Justification | format that makes architectural debt quantifiable
  • Output consolidation: audit reports now write only to generated/architecture/; ADR lookups remain at docs/architecture/decisions/
  • Phase 8 branches the audit PR from local main — a minor improvement opportunity to use origin/main instead to guard against stale bases

Confidence Score: 5/5

Safe to merge — all P0/P1 ADR path issues are resolved; only a minor P2 style suggestion remains.

The previously flagged ADR path regressions (three occurrences) were fully fixed in cc97456. The generated/architecture/ consolidation for audit output is correct, and the audit history is preserved in git. The only remaining observation is a minor style improvement to branch from origin/main instead of local main in Phase 8, which does not block merge.

No files require special attention after the ADR path fix.

Important Files Changed

Filename Overview
.claude/skills/architect/SKILL.md Adds Persona and Dual-Lens Scoring sections, consolidates audit output to generated/architecture/ only, and (after the fix commit) correctly keeps ADR lookups at docs/architecture/decisions/. One minor issue remains: Phase 8 branches from local main rather than origin/main.
docs/architecture/ARCHITECTURE_AUDIT_v3.4.0_2026-03-26.md File deleted as part of output-path consolidation; equivalent content preserved at generated/architecture/ARCHITECTURE_AUDIT_v3.4.0_2026-03-26.md which is tracked in git.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    P0["Phase 0: /worktree isolation"] --> P1
    P1["Phase 1: Setup\npackage.json · date · SHA\nCheck generated/architecture/ for prev audits\nRead ADRs from docs/architecture/decisions/\ncodegraph build --no-incremental"] --> P2
    P2["Phase 2: Structural Census\nstats · structure · triage · dead · cycles · map · complexity"] --> P3
    P3["Phase 3: Layer-by-Layer Critique\nAbstraction · Coupling · SotA Comparison\nScalability · Correctness · ADR Compliance"] --> P4
    P4["Phase 4: Cross-Cutting Concerns\nType Safety · Errors · Tests · Dual Engine\nDeps · Security · API · Docs"] --> P5
    P5["Phase 5: Competitive Verification\nFetch READMEs · Cross-check source\nVerified comparison table"] --> P6
    P6["Phase 6: Strategic Verdict\nReason to exist · Flaws · Moat\nKill List · Build vs Buy · Roadmap"] --> P7
    P7["Phase 7: Write and Save\ngenerated/architecture/AUDIT_vVER_DATE.md\nAdd Changes Since Last Audit section"] --> P8
    P8["Phase 8: Commit and PR\ngit checkout -b audit-branch origin/main\ngit add generated/architecture/ ...\ngit commit and push and gh pr create"]
Loading

Reviews (2): Last reviewed commit: "fix(skill): restore ADR lookup path to d..." | Re-trigger Greptile

3. Check `docs/architecture/` for previous audit files
4. **Read all ADRs in `docs/architecture/decisions/`.** These are the project's settled architectural decisions. Read every file — they document rationale, trade-offs, alternatives considered, and trajectory. The audit must evaluate the codebase *against* these decisions: are they being followed? Are the stated trade-offs still accurate? Has anything changed that invalidates the rationale?
3. Check `generated/architecture/` for previous audit files
4. **Read all ADRs in `generated/architecture/decisions/`.** These are the project's settled architectural decisions. Read every file — they document rationale, trade-offs, alternatives considered, and trajectory. The audit must evaluate the codebase *against* these decisions: are they being followed? Are the stated trade-offs still accurate? Has anything changed that invalidates the rationale?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 ADR path points to empty directory

The path was changed from docs/architecture/decisions/ to generated/architecture/decisions/, but no ADRs exist under generated/architecture/decisions/. The only ADR in the repo is at docs/architecture/decisions/001-dual-engine-architecture.md. Running git ls-files generated/architecture/decisions/ returns empty.

As a result, every future /architect run will silently skip ADR reading in Phase 1, and the ADR compliance review in Phase 3 will find nothing to evaluate.

The previous audits were correctly consolidated to generated/architecture/ (those are generated artefacts), but ADRs are design-decision records that belong in docs/ and are committed to git — they are not generated output. Updating this path breaks the audit's ability to validate ADR compliance.

Suggested change
4. **Read all ADRs in `generated/architecture/decisions/`.** These are the project's settled architectural decisions. Read every file — they document rationale, trade-offs, alternatives considered, and trajectory. The audit must evaluate the codebase *against* these decisions: are they being followed? Are the stated trade-offs still accurate? Has anything changed that invalidates the rationale?
4. **Read all ADRs in `docs/architecture/decisions/`.** These are

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Reverted all three ADR lookup paths back to docs/architecture/decisions/ in commit cc97456. The consolidation to generated/architecture/ was correct for audit output, but ADRs are committed design-decision records that belong in docs/. Verified that docs/architecture/decisions/001-dual-engine-architecture.md exists and generated/architecture/decisions/ does not.

Comment on lines 105 to 107
- Does the implementation match the decisions documented in `generated/architecture/decisions/`?
- Are the trade-offs described in ADRs still accurate given the current code?
- Has the codebase drifted from any stated trajectory? If so, is that drift justified or accidental?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 ADR compliance section references wrong path

Phase 3-F repeats the incorrect generated/architecture/decisions/ path. This is a second occurrence of the same mismatch — both must be corrected together to avoid the skill skipping ADR compliance checks.

Suggested change
- Does the implementation match the decisions documented in `generated/architecture/decisions/`?
- Are the trade-offs described in ADRs still accurate given the current code?
- Has the codebase drifted from any stated trajectory? If so, is that drift justified or accidental?
- Does the implementation match the decisions documented in `docs/architecture/decisions/`?
- Are the trade-offs described in ADRs still accurate given the current code?
- Has the codebase drifted from any stated trajectory? If so, is that drift justified or accidental?
- Are there architectural decisions that *should* have an ADR but don't?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the same commit (cc97456). This second occurrence at Phase 3-F is now reverted to docs/architecture/decisions/.

- Executive summary (1 paragraph, brutally honest)
- Scorecard (each dimension rated 1-10 with justification)
- **ADR compliance review** — for each ADR in `docs/architecture/decisions/`, assess whether the codebase follows the decision, whether the stated trade-offs are still valid, and whether any drift has occurred. Flag missing ADRs for decisions that exist in code but aren't documented
- **ADR compliance review** — for each ADR in `generated/architecture/decisions/`, assess whether the codebase follows the decision, whether the stated trade-offs are still valid, and whether any drift has occurred. Flag missing ADRs for decisions that exist in code but aren't documented
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Audit Structure section has the same wrong ADR path

The deliverable spec also references generated/architecture/decisions/ for the ADR compliance review. This is the third occurrence — it should be docs/architecture/decisions/ to match where ADRs actually live.

Suggested change
- **ADR compliance review** — for each ADR in `generated/architecture/decisions/`, assess whether the codebase follows the decision, whether the stated trade-offs are still valid, and whether any drift has occurred. Flag missing ADRs for decisions that exist in code but aren't documented
- **ADR compliance review** — for each ADR in `docs/architecture/decisions/`, assess whether the codebase follows the decision, whether the stated trade-offs are still valid, and whether any drift has occurred. Flag missing ADRs for decisions that exist in code but aren't documented

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the same commit (cc97456). Third occurrence in the Audit Structure section is now reverted to docs/architecture/decisions/.

@@ -40,8 +59,8 @@ Run `/worktree` to get an isolated copy of the repo. `CLAUDE.md` mandates this f
### Phase 1 — Setup
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Previous-audit lookup path is correct

Step 3 now checks generated/architecture/ for previous audits — this is correct and consistent with the consolidation goal. Just confirming this step is fine on its own; the issue is in step 4 immediately below it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged. Step 3 (generated/architecture/ for previous audits) is correct as-is — those are generated output. The fix only targets step 4 and the other two ADR references.

The output consolidation to generated/architecture/ was correctly
applied to audit output paths, but incorrectly also changed ADR
lookup references. ADRs are committed design-decision records that
live in docs/architecture/decisions/, not generated output.
@carlos-alm
Copy link
Copy Markdown
Contributor Author

@greptileai

@carlos-alm carlos-alm force-pushed the docs/claude-code-architecture-analysis branch from cc97456 to e5fd2fb Compare April 4, 2026 21:03
@carlos-alm carlos-alm merged commit 61e186a into main Apr 4, 2026
12 checks passed
@carlos-alm carlos-alm deleted the docs/claude-code-architecture-analysis branch April 4, 2026 22:01
@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant