Skip to content

feat: compact skills#7

Draft
0xisk wants to merge 2 commits into
mainfrom
feat/compact-skills
Draft

feat: compact skills#7
0xisk wants to merge 2 commits into
mainfrom
feat/compact-skills

Conversation

@0xisk
Copy link
Copy Markdown
Member

@0xisk 0xisk commented Mar 6, 2026

No description provided.

@0xisk 0xisk self-assigned this Mar 6, 2026
@0xisk 0xisk added the enhancement New feature or request label Mar 6, 2026
@0xisk 0xisk moved this from Backlog to Ready for Dev in OZ Development for Midnight Mar 6, 2026
@0xisk 0xisk moved this from Ready for Dev to Needs Review in OZ Development for Midnight Mar 6, 2026
| `@midnight-ntwrk/zswap` | Zero-knowledge token swap library |
| `@midnight-ntwrk/ledger-*` | Ledger integration (version suffix changes across releases, check `package.json` for the current one) |

## Testing
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should have a troubleshooting section that provides context for common errors and pain points. I like how it's presented here.

Copy link
Copy Markdown
Member

@ericglau ericglau left a comment

Choose a reason for hiding this comment

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

It would be good to add some tests in https://github.com/OpenZeppelin/openzeppelin-skills/blob/main/dev/TESTING.md. You can point Claude Code to that file and tell it to run the testcases, which it will do using subagents to simulate responses.

Comment on lines +155 to +182
### Compact Directory Structure

Compact contracts use a flat module structure:

| Category | Modules | Path |
|----------|---------|------|
| Access Control | `Ownable`, `AccessControl`, `ZOwnablePK` | `src/access/` |
| Security | `Pausable`, `Initializable` | `src/security/` |
| Tokens | `FungibleToken`, `NonFungibleToken`, `MultiToken` | `src/token/` |
| Utilities | `Utils` | `src/utils/` |

Compact supports named imports (similar to TypeScript/ES modules) and an optional `prefix` keyword:

```typescript
// Named imports (import specific identifiers)
import { initialize, assertOnlyOwner } from "./path/to/Ownable";

// Named imports with prefix (namespaces to avoid collisions)
import { initialize, assertOnlyOwner } from "./path/to/Ownable" prefix Ownable_;

// Wildcard import with prefix
import "./path/to/Ownable" prefix Ownable_;

// Wildcard import without prefix
import "./path/to/Ownable";
```

When using a prefix, internal (underscore-prefixed) circuits like `_mint` become double-underscored: `FungibleToken__mint(...)`.
Copy link
Copy Markdown
Member

@ericglau ericglau Mar 6, 2026

Choose a reason for hiding this comment

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

These are very specific to Compact and probably belong in a reference file instead. Otherwise they would be irrelevant in the context when working with other languages. (Although the directory structure chart above is also a bit cluttered for the various languages - feel free to propose an alternative if you'd prefer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

3 participants