Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 15:45 UTC
docs: update CLAUDE.md for default-on Twoslash
Updated documentation to reflect that Twoslash type checking is now the default for all TypeScript blocks (explicitTrigger: false). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Jan 12, 2026 at 15:08 UTC
840435fc8e401654ac35aed92b7f657b2e4eccd7
1 file changed
+30
-18
fumadocs/CLAUDE.md
+30
-18
@@ -42,40 +42,52 @@ CI auto-generates on changes to `ts/packages/core/src/**` or `python/composio/**
42
43
## Twoslash - TypeScript Code Block Type Checking
44
45
-TypeScript code blocks can be type-checked at build time using Twoslash.
45
+**ALL TypeScript code blocks are type-checked at build time.** This ensures documentation stays in sync with the SDK.
46
47
-> **Note**: This only validates TypeScript (`ts`, `typescript`) code blocks. Python code blocks are NOT type-checked. A separate Python validation pipeline (using `mypy` or `pyright`) could be added in the future.
47
+> **Note**: This only validates TypeScript (`ts`, `typescript`, `tsx`) code blocks. Python code blocks are NOT type-checked.
48
49
-### How to use
50
-Add `twoslash` to the code fence to enable type checking:
49
+### Key features
50
+- **Default on**: All TypeScript blocks are validated. No annotation needed.
51
+- **Build-time validation**: Type errors fail the build.
52
+- **CI enforcement**: `.github/workflows/docs-typescript-check.yml` runs on PRs to fumadocs/
53
+
54
+### Common patterns
55
56
+**Basic snippet with setup code (hidden from output):**
57
````md
53
-```ts twoslash
54
-import { Composio } from "@composio/core";
55
-const composio = new Composio({ apiKey: "test" });
56
-// ^? - hover shows type info in rendered docs
58
+```typescript twoslash
59
+import { Composio } from '@composio/core';
60
+const composio = new Composio({ apiKey: 'key' });
61
+const userId = 'user_123';
62
+// ---cut---
63
+// Only code below this line is shown in docs
64
+const tools = await composio.tools.get(userId, { toolkits: ['GITHUB'] });
65
```
66
````
67
60
-### Key features
61
-- **Build-time validation**: Code blocks are compiled during build. Type errors fail the build.
62
-- **Opt-in**: Only blocks with `twoslash` annotation are checked. Regular code blocks are unaffected.
63
-- **CI enforcement**: `.github/workflows/fumadocs-build.yml` runs on PRs to fumadocs/
68
+**Skip type checking (for external deps or pseudocode):**
69
+````md
70
+```typescript
71
+// @noErrors
72
+import { SomeExternalThing } from 'not-installed-package';
73
+```
74
+````
75
76
### Annotations
66
-- `// ^?` - Show type on hover at that position
67
-- `// @errors: 2322` - Expect specific error (won't fail build)
77
+- `// ---cut---` - Hide code above from output (but include for compilation)
78
- `// @noErrors` - Skip all type checking for this block
69
-- `// ---cut---` - Hide code above this line from output (but include for compilation)
79
+- `// @errors: 2322` - Expect specific error code (won't fail build)
80
+- `// ^?` - Show type on hover at that position
81
82
### Configuration
72
-- **Config**: `source.config.ts` - `transformerTwoslash({ explicitTrigger: true })`
83
+- **Config**: `source.config.ts` - `transformerTwoslash({ explicitTrigger: false })`
84
- **SDK packages**: Installed as devDependencies for import resolution
85
86
### Troubleshooting
87
- If imports fail, ensure the package is in `devDependencies`
77
-- Use `// @noErrors` for pseudocode or partial examples
78
-- Check CI logs for specific error codes (e.g., 2322 = type mismatch)
88
+- Use `// @noErrors` for examples with external dependencies not in package.json
89
+- Use `// ---cut---` to add setup code (imports, variable declarations) that compiles but isn't shown
90
+- Check CI logs for specific error codes (e.g., 2304 = cannot find name, 2322 = type mismatch)
91
92
## Deployment
93
- Vercel project: `composio/fumadocs`