Skip to content

feat: add project docs (DOC#) for non-repo knowledge#8

Merged
gf5901 merged 1 commit into
mainfrom
feat/project-docs
Mar 22, 2026
Merged

feat: add project docs (DOC#) for non-repo knowledge#8
gf5901 merged 1 commit into
mainfrom
feat/project-docs

Conversation

@gf5901
Copy link
Copy Markdown
Owner

@gf5901 gf5901 commented Mar 22, 2026

Summary

  • Adds a DOC#<slug> DynamoDB record type under PROJECT#<id> for storing non-repo knowledge (credentials inventory, infra references, business context) that agents need but shouldn't live in the target repo
  • Full CRUD across all layers: Python helpers, ./ctx docs CLI, Hono Lambda API routes, and a Docs tab on ProjectDetail in the frontend UI
  • Slug validated with ^[a-z0-9][a-z0-9_-]{0,62}$ on both server and client; content capped at 50KB per doc

Changes

Python (src/projects_dynamo.py)

  • list_docs, get_doc, put_doc, delete_doc with slug validation

CLI (src/context_cli.py)

  • ./ctx docs — list all docs with slug, title, preview
  • ./ctx docs <slug> — print full doc content

Hono API (infra/packages/api/)

  • GET /projects/:id/docs — list all
  • GET /projects/:id/docs/:slug — get one
  • PUT /projects/:id/docs/:slug — create or update (idempotent)
  • DELETE /projects/:id/docs/:slug — remove

Frontend (frontend/src/pages/ProjectDetail.tsx)

  • New "Docs" tab with create form (slug + title + markdown content), inline editing, delete with confirmation, markdown rendering

Docs

  • docs/dynamo-schema.md — DOC# record type
  • AGENTS.md and project conventions updated

Test plan

  • Create a project, navigate to the Docs tab
  • Create a new doc with slug aws-setup, verify it appears in the list
  • Edit the doc content, verify the update persists after reload
  • Delete the doc, verify it's removed
  • Verify ./ctx docs and ./ctx docs aws-setup work from an agent temp dir
  • Verify deleting a project also cleans up its docs (existing deleteProject queries all items under the pk)
  • Verify slug validation rejects invalid slugs (leading hyphens, special chars, > 63 chars)

Made with Cursor

Add a DOC#<slug> record type under PROJECT# for storing non-repo
knowledge like credentials inventory, infra references, and business
context. Agents access docs via `./ctx docs [slug]`.

- Python: CRUD helpers in projects_dynamo.py with slug validation
- CLI: `./ctx docs` (list) and `./ctx docs <slug>` (get) in context_cli.py
- API: GET/PUT/DELETE /projects/:id/docs/:slug in Hono Lambda
- UI: Docs tab on ProjectDetail with create, edit, delete, markdown preview
- Schema: DOC# record type documented in dynamo-schema.md

Made-with: Cursor
@gf5901 gf5901 merged commit 4f88958 into main Mar 22, 2026
4 checks passed
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