Skip to content

Commit 25464f8

Browse files
docs: add OSS contribution guidelines, code of conduct and agent instructions
1 parent 0b54ee7 commit 25464f8

10 files changed

Lines changed: 173 additions & 1 deletion

AGENTS.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# AI Agent Instructions for On-Chain SSI
2+
3+
## Project Context
4+
This is an On-Chain Self-Sovereign Identity (SSI) architecture project. It enables organizations to issue and verify decentralized digital identities anchored on the blockchain using the `did:ethr` standard and CRSet (Credential Revocation Set) management.
5+
The repository is a **monorepo** containing smart contracts, frontend, and backend packages.
6+
7+
## Tech Stack & Global Rules
8+
- **Node.js**: Strict requirement of `>= 22.12.0` (Do NOT use Node 20.x due to Hardhat 3 and Vite 7 constraints).
9+
- **Package Manager**: `npm` (version `>= 10.0.0`). Do not use `yarn` or `pnpm`.
10+
- **Language**: TypeScript is used everywhere (contracts and frontend).
11+
12+
## Package-Specific Guidelines
13+
14+
### 1. Smart Contracts (`packages/trust-anchor-did-ethr`)
15+
- **Framework**: Hardhat 3 with Viem (`@nomicfoundation/hardhat-toolbox-viem`).
16+
- **Solidity Version**: `0.8.28`.
17+
- **Deployment**: We use **Hardhat Ignition** (`@nomicfoundation/hardhat-ignition`). Do not use the legacy `hardhat-deploy` plugins.
18+
- **Testing**: Tests are written using Hardhat and Viem.
19+
- **Commands**:
20+
- Compile: `npm run compile` (or `npx hardhat compile`)
21+
- Test: `npx hardhat test`
22+
- Local Node: `npx hardhat node`
23+
24+
### 2. Frontend (`packages/demo-app-frontend`)
25+
- **Framework**: React 19 + Vite 7.
26+
- **Blockchain Interaction**: `wagmi` (v3) + `viem` (v2).
27+
- **Styling**: Tailwind CSS + Vanilla CSS (`index.css`). Use modern, clean aesthetics.
28+
- **Linting/Formatting**: ESLint and Prettier are strictly enforced via Husky pre-commit hooks. Ensure code passes `npm run lint` before committing.
29+
- **Commands**:
30+
- Dev server: `npm run dev`
31+
- Build: `npm run build`
32+
33+
## Workflows
34+
35+
### Git & Code Commits
36+
- We use Husky pre-commit hooks to lint and format code automatically. Do not bypass them unless explicitly instructed.
37+
- When generating Markdown documentation, ensure compliance with `markdownlint` (we ignore MD013 / line lengths by default).
38+
39+
### Implementation Steps (For AI Agents)
40+
1. **Plan Mode**: Analyze the file structure, specifically checking the `package.json` in the respective sub-package before importing new libraries. Ask for clarification if unsure about the system architecture.
41+
2. **Build Mode**: Write clean, modular TypeScript code. Document any new smart contract functions with NatSpec comments.
42+
3. **Verification**: Always double-check your output against the specific Vite or Hardhat versions we are using.

CODE_OF_CONDUCT.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement.
63+
All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
71+
version 2.1, available at
72+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
73+
74+
Community Impact Guidelines were inspired by
75+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76+
77+
For answers to common questions about this code of conduct, see the FAQ at
78+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
79+
[https://www.contributor-covenant.org/translations][translations].
80+
81+
[homepage]: https://www.contributor-covenant.org
82+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
83+
[Mozilla CoC]: https://github.com/mozilla/diversity
84+
[FAQ]: https://www.contributor-covenant.org/faq
85+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Contributing to On-Chain SSI
2+
3+
Thank you for considering contributing to On-Chain SSI!
4+
5+
## Code of Conduct
6+
7+
By participating in this project, you are expected to uphold our [Code of Conduct](CODE_OF_CONDUCT.md).
8+
9+
## How Can I Contribute?
10+
11+
### Reporting Bugs
12+
This section guides you through submitting a bug report.
13+
- **Ensure the bug was not already reported** by searching on GitHub under Issues.
14+
- If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and a clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.
15+
16+
### Suggesting Enhancements
17+
- Open a new issue with the label `enhancement`.
18+
- Provide a clear and detailed explanation of the feature you want and why it's important.
19+
20+
### Pull Requests
21+
1. **Fork the repo** and create your branch from `main`.
22+
2. **Install dependencies** using `npm install` (we use NPM >= 10.0.0 and Node.js >= 22.12.0).
23+
3. **Make your changes**. If you've added code that should be tested, add tests.
24+
4. **Ensure the test suite passes**: Run `npx hardhat test` for contracts or `npm run lint` for frontend changes.
25+
5. **Issue that pull request!**
26+
27+
## Development Guidelines
28+
29+
### 1. Smart Contracts
30+
- Located in `packages/trust-anchor-did-ethr`.
31+
- We use Hardhat Ignition for deployments and Viem for testing.
32+
- Write Solidity 0.8.28 and include NatSpec comments.
33+
34+
### 2. Frontend
35+
- Located in `packages/demo-app-frontend`.
36+
- Stack: React 19, Vite 7, Wagmi 3, and Viem 2.
37+
- Adhere to the ESLint and Prettier rules enforced via our Husky pre-commit hooks.
38+
39+
### 3. Documentation
40+
- Our documentation is hosted on GitBook.
41+
- All documentation Markdown files are in the `docs/` folder. Use GitBook-flavored Markdown.
42+
43+
## Any Questions?
44+
Feel free to open an issue with the label `question` and we will get back to you!

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ The comprehensive project features and setup information are part of the GitBook
135135
- **[Smart Contracts](packages/trust-anchor-did-ethr/README.md)** - Detailed smart contract documentation
136136
- **[Demo Application](packages/demo-app-frontend/README.md)** - Frontend application guide
137137

138-
To contribute to the documentation, simply modify the Markdown files in the `docs/` directory and create a Pull Request. GitBook will automatically synchronize the changes via its native GitHub App.
138+
To contribute to the documentation or the codebase, please review our [Contributing Guidelines](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md). For documentation specifically, simply modify the Markdown files in the `docs/` directory and create a Pull Request. GitBook will automatically synchronize the changes via its native GitHub App.
139139

140140
## License
141141

Binary file not shown.
103 KB
Binary file not shown.
41.7 KB
Binary file not shown.

docs/images/ipfs-based-crset.pdf

236 KB
Binary file not shown.
99.1 KB
Binary file not shown.

submodules/EVES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 7b69cc169bd2881888e0d5bf12f8b1244a042191

0 commit comments

Comments
 (0)