Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
calcit.cirru -diff linguist-generated
yarn.lock -diff linguist-generated
Agents.md -diff linguist-generated
llms/*.md -diff linguist-generated
9 changes: 7 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: 24
cache: yarn

- name: Enable Corepack
run: |
corepack enable
corepack prepare yarn@4.12.0 --activate
yarn --version

- uses: calcit-lang/setup-cr@0.0.8

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ yarn-error.log
tmp/

draft/

.yarn/*.gz
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
726 changes: 5 additions & 721 deletions Agents.md

Large diffs are not rendered by default.

14,717 changes: 0 additions & 14,717 deletions calcit.cirru

This file was deleted.

203 changes: 126 additions & 77 deletions compact.cirru

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions deps.cirru
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{} (:calcit-version |0.10.6)
{} (:calcit-version |0.11.5)
:dependencies $ {} (|calcit-lang/calcit-test |0.0.6)
|calcit-lang/lilac |main
|calcit-lang/memof |0.0.17
|calcit-lang/memof |0.0.22
Comment thread
tiye marked this conversation as resolved.
Outdated
94 changes: 85 additions & 9 deletions docs/Respo-Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,48 @@ cr libs readme respo
caps
```

### 7. Code Analysis
### 7. Architectural Exploration (Structure & Patterns)

To quickly understand a project's architecture, combine **Top-Down call graphs** with **Pattern-based structure search**.

#### A. Top-Down: Call Graph Analysis

Use `call-graph` to visualize the component tree and data flow starting from an entry point.

```bash
# Visualize the app structure from the render entry point
cr analyze call-graph --root respo.app.core/render-app! --ns-prefix respo.app. --max-depth 3

# This reveals the component hierarchy:
# └── render-app!
# ├── comp-container
# │ ├── comp-todolist
# │ │ ├── comp-task
# │ │ └── comp-wrap
# └── dispatch! -> updater
```

#### B. Pattern-Based: Structure Search

Use `search-expr` to find functional patterns (like state management or event handling) across the whole project.

```bash
# Call graph analysis from init-fn (or custom root)
cr analyze call-graph
cr analyze call-graph --root app.main/main! --ns-prefix app. --include-core --max-depth 5 --format json
# How is state being navigated?
cr query search-expr '>> states' -l

# Call count statistics
cr analyze count-calls
cr analyze count-calls --root app.main/main! --ns-prefix app. --include-core --format json --sort count
# Where are local state changes dispatched?
cr query search-expr 'd! cursor' -l

# Find all component event handler signatures
cr query search-expr 'fn (e d!)' -l
```

**Strategy:**

1. Use `call-graph` to find **WHO** calls **WHOM**.
2. Use `search-expr` to find **HOW** certain features are implemented project-wide.
3. Use `query usages` to find **WHERE** a specific function is integrated.
Comment on lines +307 to +309
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.

🧹 Nitpick | 🔵 Trivial

Reduce repeated sentence starts for readability.

Lines 307–309 start with “Use”. Consider varying the phrasing to improve flow.

💡 Suggested wording
-1. Use `call-graph` to find **WHO** calls **WHOM**.
-2. Use `search-expr` to find **HOW** certain features are implemented project-wide.
-3. Use `query usages` to find **WHERE** a specific function is integrated.
+1. Start with `call-graph` to find **WHO** calls **WHOM**.
+2. Apply `search-expr` to see **HOW** features are implemented project-wide.
+3. Use `query usages` to locate **WHERE** a specific function is integrated.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Use `call-graph` to find **WHO** calls **WHOM**.
2. Use `search-expr` to find **HOW** certain features are implemented project-wide.
3. Use `query usages` to find **WHERE** a specific function is integrated.
1. Start with `call-graph` to find **WHO** calls **WHOM**.
2. Apply `search-expr` to see **HOW** features are implemented project-wide.
3. Use `query usages` to locate **WHERE** a specific function is integrated.
🧰 Tools
🪛 LanguageTool

[style] ~309-~309: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...atures are implemented project-wide. 3. Use query usages to find WHERE a spec...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🤖 Prompt for AI Agents
In `@docs/Respo-Agent.md` around lines 307 - 309, Rewrite the three consecutive
lines that all start with "Use" to vary sentence openings while preserving the
commands and their meanings: keep the command tokens `call-graph`,
`search-expr`, and `query usages` and their descriptions (WHO calls WHOM, HOW
features are implemented, WHERE a function is integrated) but change the
phrasing so each line begins differently (e.g., "Run `call-graph` to...",
"Employ `search-expr` to...", "Query `query usages` to...") to improve
readability and flow.


---

## Development Workflow for LLM Agents
Expand Down Expand Up @@ -449,6 +479,8 @@ list-> $ {}

### 5. Styling Pattern

**A. Dynamic Inline Styles (Style Maps)**

```cirru
; Define styles as maps
def style-container $ {}
Expand All @@ -469,6 +501,52 @@ let
extended
```

**B. Static CSS Styles with `defstyle` (Recommended for Performance)**

`defstyle` is a macro that generates CSS classes and injects them into `<style>` tags. Use it for static styles that don't need runtime computation.

```cirru
; Import from respo.css
ns my.namespace
:require (respo.css :refer $ defstyle)

; Basic usage: & refers to current element
defstyle style-button $ {}
|& $ {} (:padding "|8px 16px") (:border-radius "|4px")
:background-color $ hsl 200 80 50
:color "|white"

; Pseudo-classes: :hover, :focus, :active, etc.
defstyle style-link $ {}
|& $ {} (:color "|blue") (:text-decoration :none)
|&:hover $ {} (:text-decoration :underline)

; Pseudo-elements: ::before, ::after
defstyle style-text $ {}
|& $ {} (:font-size "|14px") (:line-height "|1.6")
|&::before $ {} (:content "|\"→ \"")

; Media queries using 'contained
defstyle style-responsive $ {}
|& $ {} (:font-family "|Avenir,Verdana")
|& $ {} ('contained "|@media only screen and (max-width: 600px)")
:background-color $ hsl 0 0 90

; Usage in component (returns className string)
div
{} $ :class-name style-button
<> "|Click Me"
```

**Key Points:**

- `|&` refers to the current element (required)
- Use string prefix `|` for CSS selectors like `|&:hover`, `|&::before`
- `'contained` for media queries and container queries
- `defstyle` generates unique class names automatically
- Styles are injected into `<head>` before render
- For SSR: read from `@*style-list-in-nodejs` to extract CSS

**Testing Style to String Conversion:**

```bash
Expand Down Expand Up @@ -808,12 +886,10 @@ cr query ns namespace-name # Check imports
### ⚠️ Critical Rules

1. **NEVER directly edit `calcit.cirru` or `compact.cirru`** with text editors

- Use `cr edit` commands instead
- These are serialized AST structures, not human-readable code

2. **ALWAYS use relative paths for documentation links**

- Use `../` and `../../` for navigation
- This allows easy file discovery for LLM tools

Expand Down
Loading
Loading