Skip to content

feat: use CLAUDE.md imports syntax for rule references#4

Merged
mattzcarey merged 2 commits intoStackOneHQ:mainfrom
ryoppippi:use-prompt-import
Aug 12, 2025
Merged

feat: use CLAUDE.md imports syntax for rule references#4
mattzcarey merged 2 commits intoStackOneHQ:mainfrom
ryoppippi:use-prompt-import

Conversation

@ryoppippi
Copy link
Copy Markdown
Contributor

@ryoppippi ryoppippi commented Aug 12, 2025

Summary

Changes

  • Changed markdown links to @ syntax in src/index.ts
  • Affects both full rule inclusions and reference-only rule links

Benefits

  • Claude Code will automatically import referenced rules when reading the generated CLAUDE.md file
  • Improves the integration with Claude Code memory management features

Summary by cubic

Updated CLAUDE.md rule references to use the @ imports syntax instead of markdown links, so Claude Code can automatically import referenced rules.

  • Integration
  • Switched all rule file links to @ syntax for both full inclusions and reference-only links.

Replace markdown link syntax with @ syntax for file references to enable CLAUDE.md imports feature

This allows Claude Code to automatically import referenced rules when reading the generated CLAUDE.md file
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

cubic analysis

1 issue found across 1 file • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

}

rulesContent += `Read the full rule [here](${rulesDir}/${rule.filename}.md)\n\n`;
rulesContent += `Read the full rule @${rulesDir}/${rule.filename}.md\n\n`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude import syntax requires the path to appear at the beginning of the line; the explanatory prefix will stop Claude from importing the file.

Prompt for AI agents
Address the following comment on src/index.ts at line 148:

<comment>Claude import syntax requires the path to appear at the beginning of the line; the explanatory prefix will stop Claude from importing the file.</comment>

<file context>
@@ -145,7 +145,7 @@ ${DIVIDERS.GENERATED_BY}
         rulesContent += `This refers to: ${rule.globs}\n\n`;
       }
 
-      rulesContent += `Read the full rule [here](${rulesDir}/${rule.filename}.md)\n\n`;
+      rulesContent += `Read the full rule @${rulesDir}/${rule.filename}.md\n\n`;
     }
   }
</file context>
Suggested change
rulesContent += `Read the full rule @${rulesDir}/${rule.filename}.md\n\n`;
rulesContent += `Read the full rule\n@${rulesDir}/${rule.filename}.md\n\n`;

- Apply biome formatting to package.json

- Update test expectations to match new @ syntax for file references
@mattzcarey mattzcarey merged commit 6469165 into StackOneHQ:main Aug 12, 2025
2 checks passed
@ryoppippi ryoppippi deleted the use-prompt-import branch September 2, 2025 15:46
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.

2 participants