Skip to content

docs(agents): accurate guidance, guardrail map, and check:guidance-refs - #8557

Merged
waleedlatif1 merged 18 commits into
stagingfrom
improvement/agent-guidance
Oct 2, 2026
Merged

waleedlatif1 merged 18 commits into
stagingfrom
improvement/agent-guidance

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • New check:guidance-refs audit: scans CLAUDE.md, every AGENTS.md/CLAUDE.md, .claude/rules, and .agents/skills and fails when guidance names a repo path, script, skill, or @//@sim/ import that doesn't exist, or when a rule's paths: glob matches no file (which silently stops it loading). Fixed every stale reference it found
  • check:application-graph guarded the route wrapper against lib/copilot/, a directory that no longer exists; it now guards lib/mothership/
  • Guidance accuracy and consolidation: ~60 stale facts corrected against the code, contradictions resolved in favor of what the checks enforce, one source of truth per topic (text scale, 'use client' boundary, testing principles), change-history narration rewritten as current-state rules
  • CLAUDE.md gets "How your work is checked": the exact local gate (lint, type-check, check:audits, root test, plus check:migrations for migrations), the shrink-only baseline rule, and a table mapping written rules to the check that enforces them (including the new unused-exports, explicit-any, file-names, comment-hygiene, and unused-binding rules)
  • Comment guidance tightened: no narrating, restating names/types, or change history in comments

Type of Change

  • Documentation + audit tooling

Testing

  • bun run check:guidance-refs (76 documents), check:skills, bun run lint, bunx turbo run type-check, bun run check:audits (58), bun run test:scripts
  • New check proven able to fail on injected fake path/script/skill/import references

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner October 2, 2026 03:01
@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 2, 2026 8:49am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Updates agent guidance docs and adds a validation script.

The PR appears safe to merge; no new actionable issue or outstanding previous finding was identified.

Summary

The PR updates agent guidance, adds an audit for stale guidance references, and retargets the application-graph guard to the Mothership directory. The changes since the previous review add a repository-containment check for path references and extend fenced-code scanning to require.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Guidance documents] --> B[Extract paths, scripts, skills, imports, and rule globs]
  B --> C[Resolve against repository files and workspace manifests]
  C --> D{Unresolved reference?}
  D -- Yes --> E[Fail guidance audit]
  D -- No --> F[Pass guidance audit]
Loading

Reviews (8) · Last reviewed commit: "fix(audits): check require() specifiers ..."

Comment thread scripts/check-guidance-refs.ts Outdated
Comment thread scripts/check-guidance-refs.ts Outdated
Comment thread .agents/skills/add-connector/SKILL.md

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 72 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread .agents/skills/you-might-not-need-url-state/SKILL.md Outdated
Comment thread .agents/skills/make-interfaces-feel-better/animations.md
Comment thread .cursor/rules/sim-architecture.mdc Outdated
Comment thread .claude/rules/sim-api-contracts.md Outdated
Comment thread .agents/skills/validate-integration/SKILL.md Outdated
Comment thread .cursor/rules/sim-integrations.mdc Outdated
Comment thread .claude/rules/sim-integrations.md Outdated
Comment thread .agents/skills/memory-load-check/SKILL.md Outdated
Comment thread .agents/skills/validate-permission-group-item/SKILL.md Outdated
Comment thread .agents/skills/add-permission-group-item/SKILL.md Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread CLAUDE.md
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread scripts/check-guidance-refs.ts
Comment thread scripts/check-guidance-refs.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 73 files

Requires human review: Auto-approval blocked because this review re-detected 2 unresolved issues already reported by Cubic.
Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread .agents/skills/design-taste-frontend/SKILL.md Outdated
Comment thread .agents/skills/v2-api-conventions/SKILL.md Outdated
Comment thread .agents/skills/design-taste-frontend/SKILL.md Outdated
Comment thread scripts/check-application-graph.ts Outdated
Comment thread .agents/skills/add-connector/SKILL.md Outdated
Comment thread .agents/skills/add-integration/SKILL.md
Comment thread .agents/skills/memory-load-check/SKILL.md Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 73 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread .agents/skills/add-permission-group-item/SKILL.md Outdated
Comment thread .claude/rules/sim-architecture.md Outdated
Comment thread scripts/check-guidance-refs.ts Outdated
Comment thread .agents/skills/babysit/SKILL.md Outdated
Comment thread .agents/skills/add-connector/SKILL.md Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 73 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread scripts/check-guidance-refs.ts Outdated
Comment thread scripts/check-guidance-refs.ts
…removed lib/copilot

The Copilot modules moved to lib/mothership in the v1.0.0 rename, so the
route-wrapper graph guard was banning a directory that no longer exists.
…nces it found

Agent guidance (CLAUDE.md, every AGENTS.md, .claude/rules, .agents/skills)
names paths, scripts, skills, and import specifiers that agents follow
literally. The new audit resolves each one and fails on any that no longer
exists. Fixes the references it found: lib/copilot -> lib/mothership,
stores/workflows/store -> stores/workflows/workflow/store, a relative landing
path, deleted selector-provider and legacy landing mentions, and illustrative
example imports rewritten as placeholders.
A paths glob that matches nothing silently stops the rule from loading.
sim-api-contracts still targeted the removed apps/sim/hooks/selectors; drop
it, and name check:api-validation:strict as the gate the rule describes.
- CLAUDE.md: "How your work is checked" (the local gate and a rule-to-check
  map), sharper comment rules (no narration, restated names, or change
  history), drop filler, fix the type-check command description.
- Rules: one source for the text scale (sim-styling), use-client boundary
  (sim-queries), testing principles (CLAUDE.md); fix an in-place sort in a
  list-ordering example and an ESLint directive the repo does not use; drop
  change-history narration and rotting line-number references.
Restore the connector byte-cap rule's skip list, list every CI gate step,
name the real baseline flags and generated-artifact checks, make
api-validation strict-only guidance explicit, pass a base ref to
check-block-registry, and teach check:guidance-refs about bun run --cwd.
Name the enforcing check on the rule's own bullet instead, and tighten the
Comments bullet.
…graph guards

check:guidance-refs reuses sync-skills' parseRule, reads workspace manifests
once from the root workspaces globs, and matches rule globs against one git
listing instead of a filesystem scan per glob (~2.5s to ~0.2s). Markdown
links now go through the shared path check. check:application-graph fails
when a forbidden prefix matches nothing under apps/sim.
…d files and test-only guards

check:guidance-refs now requires a bare @sim/<pkg> import to have a '.' export, checks that a wildcard export match maps to an existing file, and drops index entries missing from the working tree before matching rule path globs. check:application-graph no longer counts a leftover test file as keeping a non-directory forbidden prefix alive.
Scope SSRF, client-boundary, forcedToolUse, canonicalParamId, integration metadata, and HEAD claims to what the code does; fix the ship migration pathspec, the babysit conflict path, enrichment folder placeholders, framer-motion samples, and stale connector and column-type references.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
waleedlatif1 force-pushed the improvement/agent-guidance branch from 2973989 to 5c0d278 Compare October 2, 2026 08:20
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 73 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 73 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

Comment thread scripts/check-guidance-refs.ts Outdated
Comment thread scripts/check-guidance-refs.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

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.

All reported issues were addressed across 73 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Fix all with cubic | Re-trigger cubic

Comment thread scripts/check-guidance-refs.ts
@waleedlatif1
waleedlatif1 merged commit 94b879d into staging Oct 2, 2026
41 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/agent-guidance branch October 2, 2026 16:48

This branch was successfully deployed

1 active deployment
Preview — ffccca6a Deployed Oct 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant