Skip to content

feat(docs): add TELOS, Cursor rules generation, and nondominium-domain skill#104

Merged
Soushi888 merged 13 commits into
devfrom
feat/pai-enhancement
May 13, 2026
Merged

feat(docs): add TELOS, Cursor rules generation, and nondominium-domain skill#104
Soushi888 merged 13 commits into
devfrom
feat/pai-enhancement

Conversation

@Soushi888

@Soushi888 Soushi888 commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Intent

Extend the AI tooling infrastructure with three architectural improvements: declarative agent-skill management via Nix flake inputs, migration of all Claude Code source files into pai/claude/ (making .claude/ fully generated), and relocation of TELOS.md to documentation/. Also adds a new 10-domain-enums.md cursor rule and expands the conventions index.

Changes

1. nix/agent-skills.nix — declarative agent-skills hook (feat(nix))

New Nix package that maps {src, name} pairs to rsync targets across .claude/skills/, .cursor/skills/, and .agents/skills/. Replaces the previous manual if [ -d ... ]; then rsync shell blocks.

The holochain-agent-skill is now a flake input (github:Soushi888/holochain-agent-skill) instead of a git submodule under .claude/. Pinned via flake.lock; update with nix flake update holochain-agent-skill.

2. .claude/ is now fully generated — sources live in pai/claude/ (refactor(pai))

All files previously tracked under .claude/ have been moved to pai/claude/ and .claude/ added to .gitignore. On nix develop, the shellHook rsyncs pai/claude/.claude/ (alongside existing Cursor rules generation).

Moved from Now tracked at
.claude/hooks/LoadProjectDocs.hook.ts pai/claude/hooks/LoadProjectDocs.hook.ts
.claude/settings.json pai/claude/settings.json
.claude/skills/nondominium-domain/ pai/claude/skills/nondominium-domain/
.claude/skills/holochain-agent-skill (submodule) flake input holochain-agent-skill

.gitmodules entry for holochain-agent-skill removed.

3. TELOS.md moved to documentation/ (docs)

pai/TELOS.mddocumentation/TELOS.md. References updated in CLAUDE.md, AGENTS.md, README.md, CONTRIBUTING.md, and DOCUMENTATION_INDEX.md. TELOS belongs with the other living documentation rather than in the AI-config tree.

4. Expanded cursor rules and conventions (docs(pai))

  • New: pai/cursor-rules/10-domain-enums.md — canonical enum reference covering PropertyRegime, ResourceNature, LifecycleStage, OperationalState, VfAction, and RoleType
  • pai/conventions.md — source-map table added, pointing each convention area to its canonical documentation file
  • pai/cursor-rules/20-40-50-*.md — clarifications surfaced during recent review cycle

Cursor rules produced on nix develop

File Scope alwaysApply
00-telos.mdc true
10-conventions.mdc true
20-architecture.mdc true
25-domain-enums.mdc true
30-rust-zomes.mdc **/*.rs false
40-svelte-ui.mdc **/*.svelte false
50-tests.mdc dnas/**/tests/**/*.rs false

Decisions

  • Flake input vs git submodule for holochain-agent-skill: flake input gives deterministic pinning via flake.lock and avoids the submodule init requirement at nix develop time.
  • .claude/ gitignored and generated: removes the dual-tracking problem (source in .claude/, also in pai/claude/) and makes the generation boundary explicit. All AI tooling config is now authored in pai/ and materialized on nix develop.
  • TELOS.md to documentation/: TELOS is living documentation about the project, not AI harness config. Collocating it with requirements/ and specifications/ ensures it stays current alongside the spec docs and is loaded by LoadProjectDocs.hook.ts.

How to test

  • nix develop materializes .cursor/rules/ with correct .mdc files
  • nix develop materializes .claude/ from pai/claude/ (hooks, settings, skills)
  • diff CLAUDE.md AGENTS.md produces no output
  • Claude Code session loads TELOS content at startup (check system-reminder)
  • Cursor shows all rules in Settings → Rules → Project Rules
  • bun run build:zomes succeeds (no regression)
  • Tibi has confirmed Cursor rules apply correctly in his workflow
  • TELOS reviewed and approved by Tibi before merge (mark Ready for Review after)

Documentation

  • documentation/TELOS.md — new file (moved from pai/TELOS.md)
  • documentation/DOCUMENTATION_INDEX.md — updated to reference TELOS
  • CLAUDE.md, AGENTS.md, README.md, CONTRIBUTING.md — references updated to documentation/TELOS.md
  • pai/conventions.md — new source-map table
  • pai/cursor-rules/10-domain-enums.md — new canonical enum reference

Related

No open issues tracked for this PR.

Notes

  • .claude/ and .agents/ remain gitignored; both are generated-only
  • Phase 2 (additional skill packs), Phase 3 (MCP servers), Phase 4 (NixOS deployment) are out of scope for this PR

@Soushi888 Soushi888 marked this pull request as ready for review April 29, 2026 08:11

@devin-ai-integration devin-ai-integration Bot left a comment

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.

Devin Review found 4 potential issues.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment thread .claude/skills/nondominium-domain/ppr-system.md Outdated
Comment thread .claude/skills/nondominium-domain/ndo-three-layer-model.md Outdated
Comment thread .claude/skills/nondominium-domain/valueflows-alignment.md Outdated
Comment thread .claude/skills/nondominium-domain/SKILL.md Outdated
@Soushi888 Soushi888 marked this pull request as draft April 29, 2026 08:19
@Soushi888 Soushi888 requested a review from TiberiusB April 29, 2026 22:55
@Soushi888 Soushi888 force-pushed the feat/pai-enhancement branch from 9438be8 to 39f7519 Compare April 29, 2026 23:55
@Soushi888 Soushi888 marked this pull request as ready for review April 30, 2026 01:27
Soushi888 added 13 commits May 13, 2026 00:22
…n skill

- Add pai/TELOS.md: project purpose, philosophy, and AI operating principles
- Add pai/conventions.md: distilled coding/design conventions for both tools
- Add pai/cursor-rules/: 4 Cursor-specific source files (architecture, Rust,
  Svelte 5, Sweettest patterns)
- Add nix/cursor-pai.nix: Nix builder that generates .cursor/rules/*.mdc from
  pai/ sources with proper frontmatter (alwaysApply + glob scoping)
- Extend flake.nix: cursorPAI derivation + rsync shellHook to materialize rules
  on nix develop; adds rsync to devShell packages
- Add .claude/skills/nondominium-domain/: project-specific skill pack with 5 files
  covering NDO three-layer model, PPR system, capability slots, ValueFlows alignment
- Update LoadProjectDocs.hook.ts: add pai/TELOS.md as first loaded doc
- Update AGENTS.md and CLAUDE.md: add @pai/TELOS.md as first foundational reference
  (files remain byte-identical)
- Update README.md: add AI Tooling section explaining Cursor + Claude Code setup
- Update CONTRIBUTING.md: add AI Tooling Conventions section for pai/ editing workflow
…velop

- Extend shellHook to rsync both skills into .agents/skills/ after submodule init:
  - holochain-agent-skill → .agents/skills/holochain/ (name matches SKILL.md)
  - nondominium-domain → .agents/skills/nondominium-domain/
- Add /.agents to .gitignore (generated directory, never committed)
- Update README.md: expanded AI Tooling section with skills table + Cursor rules table
- Update CONTRIBUTING.md: table mapping source files to generated outputs

Skills now load in Cursor, VS Code Copilot, and any Open Agent Skill compatible
editor via .agents/skills/ (primary discovery path), with .claude/skills/ as
Claude Code fallback — same folders, no duplication.
…mpatibility

.agents/skills/ is the new editor-agnostic Open Agent Skill path, but
.cursor/skills/ is Cursor's own native path with longer-standing support.
Copy to both to guarantee Cursor picks them up regardless of which path
its current version checks first.
- ppr-system.md: PerformanceMetrics field names wrong; replace with
  actual fields from ppr.rs (timeliness, quality, reliability,
  communication, overall_satisfaction, notes)
- ndo-three-layer-model.md: ResourceNature missing Service and
  Information variants that already exist in zome_resource/src/lib.rs
- valueflows-alignment.md: VfAction count was 19, corrected to 16
- SKILL.md: VfAction count and ResourceNature quick ref both wrong;
  align both with actual enum values
… hook

Replace manual rsync shell blocks with a declarative agent-skills.nix
package that maps {src, name} pairs to rsync targets (.claude/skills/,
.cursor/skills/, .agents/skills/). The holochain-agent-skill is now
pinned as a flake input instead of a git submodule under .claude/.
.claude/ is now fully gitignored and generated by nix develop from
pai/claude/ sources. This removes the holochain-agent-skill git
submodule (now a flake input) and relocates LoadProjectDocs hook,
settings.json, and nondominium-domain skill into pai/claude/ so they
are managed under version control as PAI source files.
TELOS.md belongs alongside other documentation/ source files rather
than in the pai/ AI-config tree. Update CLAUDE.md, AGENTS.md,
CONTRIBUTING.md, README.md, and DOCUMENTATION_INDEX.md to point
to the new canonical location.
Add 10-domain-enums.md covering PropertyRegime, ResourceNature,
LifecycleStage, OperationalState, VfAction, and RoleType enums.
Expand architecture, Rust, Svelte, and test rules with clarifications
surfaced during recent review. Conventions.md gets a source-map table
pointing each convention area to its canonical documentation file.
cursor-pai.nix hardcoded all source files under paiDir (./pai).
TELOS.md was moved to documentation/ in this PR. This broke the Nix
build: cursor-pai-rules.drv could not find pai/TELOS.md.

Changes:
- Add docsDir parameter to cursor-pai.nix (separate from paiDir)
- Each rule now carries a dir field pointing to the correct source root
- TELOS rule uses docsDir; all other rules use paiDir (unchanged)
- Pass docsDir = ./documentation from flake.nix
- Add missing 25-domain-enums rule (sources cursor-rules/10-domain-enums.md)
…t path

- 20-architecture.md: removed dangling 'Full detail' link to
  .claude/skills/nondominium-domain/ndo-three-layer-model.md (deleted
  in d6cab72; authoritative source is ndo_prima_materia.md §4-5,
  already cited two lines above)
- 30-rust-zomes.md: removed .claude/skills/nondominium-domain/ppr-system.md
  from PPR Storage source annotation (file deleted in d6cab72;
  specifications.md §3.3.6 is sufficient)
- conventions.md: corrected pai/ editing workflow entry: .claude/ is
  now gitignored and generated on nix develop; source is
  pai/claude/skills/nondominium-domain/
…rsor rule

Both enums were referenced in the PR description and SKILL.md but absent
from 10-domain-enums.md. LifecycleStage (10 variants) is already in
zome_resource/src/lib.rs. OperationalState is planned (REQ-NDO-OS-06)
and documented here with a note that it is not yet in code.
- Row 4: source is pai/claude/skills/nondominium-domain/, not .claude/skills/
  (generated path, gitignored — edits there are overwritten on nix develop)
- Row 5: update is via nix flake update, not direct edit of .claude/skills/
- Remove misleading 'no rebuild needed' note
- fix(nix): omit globs field from cursor-pai.nix frontmatter when empty
  (lib.optionalString guard — cleaner .mdc output for alwaysApply rules)
@Soushi888 Soushi888 force-pushed the feat/pai-enhancement branch from 4187f76 to 4dc4220 Compare May 13, 2026 04:23
@Soushi888

Copy link
Copy Markdown
Collaborator Author

Re: Devin's findings on ppr-system.md, ndo-three-layer-model.md, and valueflows-alignment.md: These supplementary skill files were intentionally removed in this PR — the nondominium-domain skill is now routing-only and full docs are injected by LoadProjectDocs.hook.ts. After this PR merges, pai/claude/skills/nondominium-domain/ contains only SKILL.md; the incorrect field names / counts flagged there no longer exist in the generated output.

@Soushi888 Soushi888 merged commit 8c7a176 into dev May 13, 2026
1 check passed
@Soushi888 Soushi888 deleted the feat/pai-enhancement branch May 22, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant