Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
125 changes: 125 additions & 0 deletions .agents/skills/shadow-mate/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
```markdown
# shadow-mate Development Patterns

> Auto-generated skill from repository analysis

## Overview

This skill teaches the core development patterns, coding conventions, and collaborative workflows used in the `shadow-mate` JavaScript project. The repository focuses on backend logic, authentication, and security features, with a strong emphasis on documentation, testing, and process consistency. You'll learn how to contribute new features, fix bugs, and keep documentation aligned, following established conventions and step-by-step workflows.

## Coding Conventions

**File Naming**
- Use `camelCase` for JavaScript files.
- Example: `actionLock.js`, `learningState.js`

**Import Style**
- Use relative imports.
```js
import { doSomething } from './lib.js';
```

**Export Style**
- Use named exports.
```js
// In lib.js
export function doSomething() { ... }

// In another file
import { doSomething } from './lib.js';
```

**Commit Messages**
- Follow [Conventional Commits](https://www.conventionalcommits.org/) with prefixes:
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation update
- Keep commit messages concise (average ~42 characters).
- Example: `fix: handle token expiry in auth middleware`

## Workflows

### Feature Development with Auth and Database
**Trigger:** When adding a new authentication, security feature, or significant backend capability
**Command:** `/new-auth-feature`

1. Update or add backend logic in `src/` (e.g., `app.js`, `cloud.js`, `lib.js`, `action-lock.js`, `learning-state.js`).
```js
// src/actionLock.js
export function lockAction(userId) { ... }
```
2. Create or modify database migration files in `supabase/migrations/`.
```sql
-- supabase/migrations/20240401_add_user_tokens.sql
ALTER TABLE users ADD COLUMN token VARCHAR(255);
```
3. Update Supabase configuration in `supabase/config.toml`.
4. Add or update email templates in `supabase/templates/`.
```html
<!-- supabase/templates/welcome.html -->
<p>Welcome, {{username}}!</p>
```
5. Update or add tests in `tests/unit/`, `tests/e2e/`, or `supabase/tests/`.
```js
// tests/unit/actionLock.test.js
import { lockAction } from '../../src/actionLock.js';
test('locks action for user', () => { ... });
```
6. Update documentation in `docs/` (e.g., `architecture.md`, `auth-setup.md`, `security-baseline.md`, `user-guide.md`, `test-scope.md`).
7. Update project meta files (`CHANGELOG.md`, `ROADMAP.md`, `TODO.md`, `README.md`, `RELEASE_NOTES.md`).

---

### Documentation Alignment and Consistency
**Trigger:** When updating documentation for new features, process changes, or to enforce consistency
**Command:** `/docs-update`

1. Edit documentation files in `docs/` (e.g., `architecture.md`, `auth-setup.md`, `user-guide.md`, `security-baseline.md`, `test-scope.md`).
2. Update meta files (`CHANGELOG.md`, `ROADMAP.md`, `TODO.md`, `RELEASE_NOTES.md`).
3. Optionally update GitHub templates (e.g., `.github/PULL_REQUEST_TEMPLATE.md`).

---

### Bugfix with Tests and Documentation
**Trigger:** When fixing a bug and ensuring it is tested and documented
**Command:** `/bugfix`

1. Fix the bug in backend logic (`src/*.js`).
```js
// src/lib.js
export function sanitizeInput(input) {
return input.replace(/[<>]/g, '');
}
```
2. Update or add relevant tests in `tests/unit/` or `tests/e2e/`.
```js
// tests/unit/lib.test.js
import { sanitizeInput } from '../../src/lib.js';
test('removes angle brackets', () => { ... });
```
3. Update documentation and meta files (`CHANGELOG.md`, `ROADMAP.md`, `TODO.md`, `docs/architecture.md`, etc.).

---

## Testing Patterns

- **Framework:** [Jest](https://jestjs.io/)
- **Test Files:** Use the pattern `*.test.js` for unit tests and `*.spec.js` for end-to-end tests.
- **Structure:**
```js
// tests/unit/example.test.js
import { myFunction } from '../../src/myModule.js';

test('does something expected', () => {
expect(myFunction()).toBe(true);
});
```

## Commands

| Command | Purpose |
|--------------------|-------------------------------------------------------------------------|
| /new-auth-feature | Start a new authentication or backend feature with database integration |
| /docs-update | Align and update documentation and meta files |
| /bugfix | Fix a bug, update tests, and document the change |
```
6 changes: 6 additions & 0 deletions .agents/skills/shadow-mate/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface:
display_name: "Shadow Mate"
short_description: "Repo-specific patterns and workflows for shadow-mate"
default_prompt: "Use the shadow-mate repo skill to follow existing architecture, testing, and workflow conventions."
policy:
allow_implicit_invocation: true
40 changes: 40 additions & 0 deletions .claude/commands/bugfix-with-tests-and-documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: bugfix-with-tests-and-documentation
description: Workflow command scaffold for bugfix-with-tests-and-documentation in shadow-mate.
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
---

# /bugfix-with-tests-and-documentation

Use this workflow when working on **bugfix-with-tests-and-documentation** in `shadow-mate`.

## Goal

Fixes a bug in backend logic, updates tests to cover the fix, and updates documentation and meta files to reflect the change.

## Common Files

- `src/app.js`
- `src/cloud.js`
- `src/lib.js`
- `tests/unit/*.test.js`
- `tests/e2e/*.spec.js`
- `CHANGELOG.md`

## Suggested Sequence

1. Understand the current state and failure mode before editing.
2. Make the smallest coherent change that satisfies the workflow goal.
3. Run the most relevant verification for touched files.
4. Summarize what changed and what still needs review.

## Typical Commit Signals

- Fix bug in backend logic (src/*.js)
- Update or add relevant tests (tests/unit/, tests/e2e/)
- Update documentation and meta files (CHANGELOG.md, ROADMAP.md, TODO.md, docs/architecture.md, etc.)

## Notes

- Treat this as a scaffold, not a hard-coded script.
- Update the command if the workflow evolves materially.
40 changes: 40 additions & 0 deletions .claude/commands/documentation-alignment-and-consistency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: documentation-alignment-and-consistency
description: Workflow command scaffold for documentation-alignment-and-consistency in shadow-mate.
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
---

# /documentation-alignment-and-consistency

Use this workflow when working on **documentation-alignment-and-consistency** in `shadow-mate`.

## Goal

Updates and aligns multiple documentation files to reflect new features, processes, or guidance, often in conjunction with meta files like CHANGELOG and ROADMAP.

## Common Files

- `docs/architecture.md`
- `docs/auth-setup.md`
- `docs/user-guide.md`
- `docs/security-baseline.md`
- `docs/test-scope.md`
- `CONTRIBUTING.md`

## Suggested Sequence

1. Understand the current state and failure mode before editing.
2. Make the smallest coherent change that satisfies the workflow goal.
3. Run the most relevant verification for touched files.
4. Summarize what changed and what still needs review.

## Typical Commit Signals

- Edit multiple documentation files (docs/*.md, CONTRIBUTING.md, PRIVACY.md, etc.)
- Update meta files (CHANGELOG.md, ROADMAP.md, TODO.md, RELEASE_NOTES.md)
- Optionally update GitHub templates (.github/PULL_REQUEST_TEMPLATE.md)

## Notes

- Treat this as a scaffold, not a hard-coded script.
- Update the command if the workflow evolves materially.
42 changes: 42 additions & 0 deletions .claude/commands/feature-development-with-auth-and-database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: feature-development-with-auth-and-database
description: Workflow command scaffold for feature-development-with-auth-and-database in shadow-mate.
allowed_tools: ["Bash", "Read", "Write", "Grep", "Glob"]
---

# /feature-development-with-auth-and-database

Use this workflow when working on **feature-development-with-auth-and-database** in `shadow-mate`.

## Goal

Implements a new authentication or security-related feature, involving backend logic, database migrations, configuration, templates, tests, and documentation.

## Common Files

- `src/app.js`
- `src/cloud.js`
- `src/lib.js`
- `src/action-lock.js`
- `src/learning-state.js`
- `supabase/migrations/*.sql`

## Suggested Sequence

1. Understand the current state and failure mode before editing.
2. Make the smallest coherent change that satisfies the workflow goal.
3. Run the most relevant verification for touched files.
4. Summarize what changed and what still needs review.

## Typical Commit Signals

- Update or add backend logic in src/ (e.g., app.js, cloud.js, lib.js, action-lock.js, learning-state.js)
- Create or modify database migration files in supabase/migrations/
- Update Supabase configuration (supabase/config.toml)
- Add or update email templates (supabase/templates/)
- Update or add tests (tests/unit/, tests/e2e/, supabase/tests/)

## Notes

- Treat this as a scaffold, not a hard-coded script.
- Update the command if the workflow evolves materially.
Loading
Loading