Repository navigation
SAN-1274 PR 3 — Make fresh MDE coding sessions load the correct skills - #49
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| BestPractice | 11 medium |
🟢 Metrics 5 complexity · 0 duplication
Metric Results Complexity 5 Duplication 0
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
While this PR successfully implements the canonical skill alignment and the session-start integrity scan, it introduces significant portability issues. The Codacy analysis identifies the PR as not up to standards due to multiple new issues, including absolute path hardcoding and documentation redundancies.
Two critical gaps exist: first, the repository root path is hardcoded in several files, which will break the environment for any user other than the current author. Second, there are no automated tests provided for the logic in .claude/hooks/session-start.mjs. This script handles file system operations and git interactions that are vital for session initialization; without tests, this logic remains fragile. Several documentation findings also point to a lack of exception paths for absolute rules and duplicated instructions across markdown files.
About this PR
- The logic in '.claude/hooks/session-start.mjs' performs environment verification via file system and git commands but lacks automated unit tests to prevent regressions in the bootstrap process.
- The repository root path '/home/sk/mdeai' is hardcoded in 'session-start.mjs', 'AGENTS.md', and 'CLAUDE.md'. This prevents portability to other development environments or CI runners. Please ensure all paths are derived dynamically relative to the repository root.
Test suggestions
- Missing recommended test scenario: Verify session-start.mjs reports 'skill scan needs attention' when a required skill directory (e.g., 'tasks') is missing.
- Missing recommended test scenario: Verify session-start.mjs correctly identifies and lists broken symlinks in the skills directory.
- Missing recommended test scenario: Verify the git log output in the session preamble is restricted to the last 3 commits as specified in the updated code.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Missing recommended test scenario: Verify session-start.mjs reports 'skill scan needs attention' when a required skill directory (e.g., 'tasks') is missing.
2. Missing recommended test scenario: Verify session-start.mjs correctly identifies and lists broken symlinks in the skills directory.
3. Missing recommended test scenario: Verify the git log output in the session preamble is restricted to the last 3 commits as specified in the updated code.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| - CopilotKit stays on the v2 API surface; do not mix bare v1 imports with `/v2` imports. | ||
| - New Supabase tables require RLS and an explicit authorization policy. | ||
| - Never expose service-role secrets to client code. | ||
| - Google Places requests must use intentional field masks; Maps markers require the correct map configuration. |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Absolute rules without exception paths can cause operational blockers. Document a clear exception or escalation process for when dynamic field masks are required.
| - Google Places requests must use intentional field masks; Maps markers require the correct map configuration. | |
| - Google Places requests must use intentional field masks; Maps markers require the correct map configuration. Exceptions must be approved by the platform owner. |
| - Read the dated/numbered planning docs in the sibling planning repo (`/home/sk/mdeai/plan/`) for current direction; some `docs/` content may be superseded — cross-check the planning repo's audits. | ||
| - Use `mde-task-lifecycle` to plan/ship a task; floor before shipping: `/verify-floor`. | ||
| - Linear label taxonomy and deprecated prefixes are in `linear.md` §Labels. Do not use `SCREEN-*`, `EVP-*`, `IMP-*` as new issue prefixes. | ||
| Structural eval definitions are specifications only until they are actually executed. Never report an eval as passing merely because its JSON validates. |
There was a problem hiding this comment.
⚪ LOW RISK
Define what should occur if an eval cannot be executed but the specification requires updating. Include criteria for authorization of such overrides.
Try running the following prompt in your IDE agent:
Add a documented exception path for the absolute rule regarding structural eval definitions in CLAUDE.md line 80, specifying how to handle cases where behavior is not objectively testable.
| ## Legacy app freeze (2026-05-26) | ||
|
|
||
| See [`/home/sk/mde/FREEZE.md`](../mde/FREEZE.md). After **2026-05-26**, `/home/sk/mde/` accepts only P0 security fixes (data exposure, auth bypass, payment failure, Sentry P0). All non-P0 work belongs in `/home/sk/mdeai/mdeapp/`. The hook `.Codex/hooks/guard-sensitive-paths.mjs` already blocks `Edit/Write/MultiEdit` into the legacy tree — that protection stays on. The 5-min onboarding for the new app lives at [`mdeapp/docs/ARCHITECTURE.md`](mdeapp/docs/ARCHITECTURE.md). | ||
| Keep tool-specific settings separate from shared skill content. Claude Code uses `CLAUDE.md` and `.claude/`; Cursor/OpenCode may add their own thin config only when needed; Codex and compatible agents use this `AGENTS.md` as the portable bootstrap. |
There was a problem hiding this comment.
⚪ LOW RISK
Vague conditionals create ambiguity about when actions should occur. Specify the concrete thresholds or criteria that justify adding tool-specific config.
| Keep tool-specific settings separate from shared skill content. Claude Code uses `CLAUDE.md` and `.claude/`; Cursor/OpenCode may add their own thin config only when needed; Codex and compatible agents use this `AGENTS.md` as the portable bootstrap. | |
| Keep tool-specific settings separate from shared skill content. Claude Code uses `CLAUDE.md` and `.claude/`; Cursor/OpenCode may add their own thin config only when a tool-specific manifest (e.g., `.cursorrules`) is required for features not supported by AGENTS.md; Codex and compatible agents use this `AGENTS.md` as the portable bootstrap. |
| For simple work, use the directly relevant skill and do not add orchestration. | ||
|
|
||
| For substantial or ambiguous work: | ||
| 1. For substantial or ambiguous work, start with `tasks`; it owns dependency-safe execution and specialist selection. SAN-1273 will add the lightweight router later. |
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: The introductory phrase is redundant as it repeats the section header immediately above.
| 1. For substantial or ambiguous work, start with `tasks`; it owns dependency-safe execution and specialist selection. SAN-1273 will add the lightweight router later. | |
| 1. Start with `tasks`; it owns dependency-safe execution and specialist selection. SAN-1273 will add the lightweight router later.``` | |
| <!-- e34d5167-b092-49eb-b8c8-33859ab00079 --> |
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (4 files)
Previous Review Summary (commit 408095f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 408095f)Status: 2 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (4 files)
Reviewed by free · Input: 0 · Output: 0 · Cached: 0 |
|
Task 68 · PR #49 — Bootstrap Portability and Hook Tests Fixed and pushed at Verified fixes:
Validation on exact head:
Resolved the three review threads directly addressed by this commit: hardcoded root, Kilo template disable flag, and Kilo diff-check scope. Lower-value Codacy wording/style comments were intentionally left unchanged because they are not blockers and are outside this focused portability fix. |
There was a problem hiding this comment.
Pull Request Overview
The pull request successfully implements the logic for dynamic repository root resolution and skill scanning in the MDE bootstrap layer, meeting most functional acceptance criteria. However, the repository is currently not up to standards due to a high-severity security issue and several consistency gaps.
A significant security risk (ReDoS) was identified in the test suite's use of dynamic regular expressions. Furthermore, while the code now supports dynamic path resolution, the documentation (AGENTS.md and CLAUDE.md) still contains hardcoded absolute paths, which directly contradicts the portability goals of this change. There is also a discrepancy between the skills listed as 'required' in the session-start hook and the 'canonical' skills defined in the project documentation.
About this PR
- There is a systemic inconsistency where the logic for session-start has been made portable, but the supporting documentation continues to use hardcoded absolute paths (/home/sk/mdeai). This prevents the repository from being truly environment-agnostic as intended.
Test suggestions
- Verify dynamic repository root resolution correctly identifies the active worktree
- Verify skill scan reports 'OK' when all required canonical skills are present
- Verify skill scan reports 'missing' when a required SKILL.md file is absent
- Verify skill scan identifies 'broken' symlinks for required skills
- Verify the session preamble limits the git log output to the last 3 commits
- Verify test suite robustness by replacing dynamic RegExp with string inclusion checks
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify test suite robustness by replacing dynamic RegExp with string inclusion checks
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| For simple work, use the directly relevant skill and do not add orchestration. | ||
|
|
||
| For substantial or ambiguous work: | ||
| 1. For substantial or ambiguous work, start with `tasks`; it owns dependency-safe execution and specialist selection. SAN-1273 will add the lightweight router later. |
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: The phrase 'For substantial or ambiguous work' is redundant here as it repeats the section header condition.
4f92257 to
bc82707
Compare
066c69e to
11e68c5
Compare
Task 63 · SAN-1274 PR 3 — Make fresh MDE coding sessions load the correct skills
Current status
PR #49 is rebased onto merged
mainand now provides the portable bootstrap/discovery layer for MDE coding sessions.main @ 41d376025e54622237a2c46035673f61c533b6acc613bf9f779a6f45fa6615719481fce3193d3d29What this PR does
.claude/hooks/session-start.mjsresolve the actual checkout root dynamically.AGENTS.mdandCLAUDE.mdaround the canonical.claude/skills/workflow.using-mde-skillsrouter andmde-task-lifecycleretired until SAN-1273 adds the lightweight router.Current workflow
flowchart LR A[Fresh coding session] --> B[AGENTS.md / CLAUDE.md] B --> C[SessionStart hook] C --> D[Resolve actual checkout] D --> E[branch / HEAD / status / recent commits] D --> F[canonical skill scan] F --> G{Task type} G -->|Simple| H[direct specialist] G -->|Substantial| I[tasks] G -->|Unknown failure| J[systematic-debugging] G -->|PR review| K[code-review] G -->|Done claim| L[task-verifier]Verified fixes
/home/sk/mdeairootRegExpfrom the testdisable-model-invocation: truegit diff --checkverification is repo-wideCLAUDE.mduses repository-relative languageAGENTS.mdrewritten as a concise portable bootstrap documentAGENTS.mdAGENTS.mdExact-head focused verification
On the current branch after the bootstrap cleanup:
Live hook proof reports the active isolated worktree rather than another checkout.
Canonical workflow skills available from merged main
tasks,task-verifier,systematic-debugging,testing,tdd,research,code-review,writing-skills,wireframe, andmermaid-diagramsare present on the merged lower stack.Stack/domain skills referenced by the bootstrap were also checked against
.claude/skills/*/SKILL.md.Review status
Previously reproduced blockers are fixed. High-risk dynamic-RegExp and portability/skill-scan findings were corrected and resolved. AGENTS-specific obsolete comments became outdated after the portable rewrite and were resolved.
Remaining low/medium wording comments are not runtime correctness blockers unless they become current actionable findings on the exact head.
Merge gate
Merge only when:
main.After merge, retarget/rebase PR #50 onto the new
main, requirenpm audit --audit-level=critical= 0, run final Floor, update SAN-1274 evidence, then begin SAN-1273 from the clean workflow foundation.