@svayam-opensource/prj 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +123 -0
- package/agent/harness-manifest.yaml +225 -0
- package/agent/session-protocol.md +116 -0
- package/bin/prj +21 -0
- package/package.json +41 -0
- package/prj +2381 -0
- package/scripts/add-repo.sh +126 -0
- package/scripts/cancel.sh +157 -0
- package/scripts/close-knowledge.sh +250 -0
- package/scripts/close-project.sh +233 -0
- package/scripts/create-task.sh +226 -0
- package/scripts/install-deps.sh +292 -0
- package/scripts/join.sh +89 -0
- package/scripts/lib.sh +841 -0
- package/scripts/merge-task.sh +163 -0
- package/scripts/onboard-repo.sh +275 -0
- package/scripts/pause.sh +80 -0
- package/scripts/project-access.sh +34 -0
- package/scripts/propose-knowledge.sh +168 -0
- package/scripts/release-to-public.sh +185 -0
- package/scripts/render-harness.sh +151 -0
- package/scripts/resume.sh +103 -0
- package/scripts/seed.sh +774 -0
- package/scripts/sync-from-publish.sh +193 -0
- package/scripts/sync.sh +90 -0
- package/scripts/test-merge.sh +100 -0
- package/scripts/validate/check_knowledge.py +158 -0
- package/scripts/validate/check_privacy.py +211 -0
- package/scripts/validate/check_protocol.py +117 -0
- package/scripts/validate/check_secrets.py +175 -0
- package/scripts/validate/run.py +391 -0
- package/setup.sh +529 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Svayam Infoware Private Limited and contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Agentic Development Framework !!
|
|
2
|
+
|
|
3
|
+
A governance-first framework for organizing agentic software development inside an organization. It provides a directory structure, a policy template, a CLI, and a set of scripts that enforce the policy through every step of a project's lifecycle — so AI agents and human developers can work in parallel on multiple projects without losing track of who owns what, what's been decided, and what changed.
|
|
4
|
+
|
|
5
|
+
This repository is a **template**. Clone it, configure `org-config.yaml` with your organization's values, run `setup.sh`, and you have a workspace repo for your org's agentic development.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Why this exists
|
|
10
|
+
|
|
11
|
+
Agentic development gets messy fast: agents make decisions, modify multiple repos in parallel, propose policy updates, and accumulate institutional knowledge. Most teams handle this with ad-hoc convention; that breaks down past a handful of projects or a few agents.
|
|
12
|
+
|
|
13
|
+
This framework gives you:
|
|
14
|
+
|
|
15
|
+
- **Identifiable units of work** — every project gets a sequential, immutable ID (e.g., `ACME-001-invoice-api`); branches and folders derive from it.
|
|
16
|
+
- **Layered knowledge** — org-wide policy, project-specific learnings, repo-local conventions, and developer preferences, with explicit precedence rules.
|
|
17
|
+
- **Test-merge gate** — schema, registry, lifecycle, and cross-reference validators run locally before any merge to your default branch and again in CI on every PR. The default branch is hard to corrupt by accident.
|
|
18
|
+
- **Compliance levels** — three tiers (Non-Negotiable, Always Apply, Apply Intelligently) so policy can distinguish between hard rules and judgment calls.
|
|
19
|
+
- **One CLI** — `prj` wraps the whole lifecycle: seed, task, merge, pause, resume, sync, close, propose-knowledge.
|
|
20
|
+
- **Knowledge close** — completed projects produce reviewed proposals to update org knowledge, so learnings flow back upstream.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Quickstart
|
|
25
|
+
|
|
26
|
+
> This is a **template repository.** You don't fork it — you use it to scaffold *your own* private workspace repo, which you then own and commit to. The framework's `publish` upstream stays clean; your private overlay (real projects, accumulated knowledge, your `org-config.yaml` values) lives only in your repo.
|
|
27
|
+
|
|
28
|
+
**1. Create your repo from the template.** Open the framework's repo on GitHub:
|
|
29
|
+
|
|
30
|
+
> https://github.com/svayam-opensource/governed-agentic-dev-framework
|
|
31
|
+
|
|
32
|
+
Click the green **"Use this template"** button → **"Create a new repository"**. Pick a name (e.g. `000-acme-prj`) and visibility (typically Private). GitHub will create a new repository under your account or org.
|
|
33
|
+
|
|
34
|
+
**2. Clone *your* new repo and run the setup.**
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Clone YOUR new repository (not this template).
|
|
38
|
+
git clone https://github.com/<your-github-org>/<your-new-repo>.git
|
|
39
|
+
cd <your-new-repo>
|
|
40
|
+
|
|
41
|
+
# Verify the toolchain (git, gh, python3, pyyaml; yq optional).
|
|
42
|
+
# Hard gate — refuses to proceed if anything required is missing.
|
|
43
|
+
bash scripts/install-deps.sh
|
|
44
|
+
|
|
45
|
+
# Configure the framework for your org and verify GitHub access.
|
|
46
|
+
# Interactive: prompts for org name, slug, role identities, etc., with
|
|
47
|
+
# sensible defaults detected from gh and git config. Substitutes
|
|
48
|
+
# throughout, then checks gh user / org membership / scopes.
|
|
49
|
+
bash setup.sh
|
|
50
|
+
|
|
51
|
+
# (Optional) Customize the policy text for your org.
|
|
52
|
+
$EDITOR knowledge/policies/agentic-development-policy.md
|
|
53
|
+
|
|
54
|
+
# Commit and push to YOUR repository.
|
|
55
|
+
git add -A
|
|
56
|
+
git commit -m "configure framework for <your-org>"
|
|
57
|
+
git push origin main
|
|
58
|
+
|
|
59
|
+
# Start using it.
|
|
60
|
+
./prj
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The `prj` CLI is interactive: it lists current projects, walks you through seeding new ones, creating tasks, and closing them.
|
|
64
|
+
|
|
65
|
+
**Re-running `setup.sh` later** is safe — it remembers your existing values as defaults. Use `bash setup.sh --non-interactive` in CI or scripts to skip prompts entirely.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Concepts at a glance
|
|
70
|
+
|
|
71
|
+
- **Workspace repo** — this repository. Holds policy, project manifests, and accumulated knowledge. Not a code repo.
|
|
72
|
+
- **Project** — a unit of work with an ID, an assignee, a lifecycle (proposed → active → paused/completed/cancelled), and one or more code repos it touches.
|
|
73
|
+
- **Knowledge layers** (highest to lowest priority): org-wide → project → repo-local → developer preferences. Higher always wins.
|
|
74
|
+
- **Compliance levels** — C01 (Non-Negotiable, hard stop), C02 (Always Apply, exception PR required), C03 (Apply Intelligently, document deviation).
|
|
75
|
+
- **Test-merge gate** — local validators run before any push to the default branch; CI runs the same validators on every PR.
|
|
76
|
+
|
|
77
|
+
Full details in [docs/USER_GUIDE.md](docs/USER_GUIDE.md).
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
| Doc | For |
|
|
84
|
+
|---|---|
|
|
85
|
+
| [README](README.md) | First-time visitor — what this is, do you want it |
|
|
86
|
+
| [docs/USER_GUIDE.md](docs/USER_GUIDE.md) | Reference — concepts, roles, CLI surface |
|
|
87
|
+
| [docs/DEVELOPER_GUIDE.md](docs/DEVELOPER_GUIDE.md) | Day-in-the-life — step-by-step working on a project, prompting the agent |
|
|
88
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | Contributor — proposing changes to the framework itself |
|
|
89
|
+
| [SECURITY.md](SECURITY.md) | Security reporter |
|
|
90
|
+
| [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) | Community standards |
|
|
91
|
+
| [knowledge/policies/agentic-development-policy.md](knowledge/policies/agentic-development-policy.md) | The policy itself — read this once you've adopted |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Scripts and CLI
|
|
96
|
+
|
|
97
|
+
| Tool | Purpose |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `./prj` | Interactive CLI — wraps everything below |
|
|
100
|
+
| `scripts/seed.sh` | Seed a new project (sets ID, scaffolds folder, creates branches) |
|
|
101
|
+
| `scripts/create-task.sh` / `merge-task.sh` | Sub-branches for parallel agent work |
|
|
102
|
+
| `scripts/pause.sh` / `resume.sh` / `sync.sh` | Lifecycle transitions |
|
|
103
|
+
| `scripts/close-project.sh` / `close-knowledge.sh` | Close out and synthesize learnings |
|
|
104
|
+
| `scripts/cancel.sh` | Cancel without merge |
|
|
105
|
+
| `scripts/propose-knowledge.sh` | Standalone org knowledge proposals |
|
|
106
|
+
| `scripts/onboard-repo.sh` | Bring an existing code repo under the framework |
|
|
107
|
+
| `scripts/test-merge.sh` | Local pre-merge validator (used by lifecycle scripts) |
|
|
108
|
+
| `scripts/validate/run.py` | Schema/registry/lifecycle/cross-ref validators |
|
|
109
|
+
| `scripts/sync-from-publish.sh` | Pull universal updates from the framework's upstream branch |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Status
|
|
114
|
+
|
|
115
|
+
This framework is in active use at the upstream maintainer org and is offered as-is for other organizations to adopt. Issues and PRs are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT — see [LICENSE](LICENSE).
|
|
122
|
+
|
|
123
|
+
Copyright (c) 2026 Svayam Infoware Private Limited and contributors.
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Harness manifest — drives scripts/render-harness.sh
|
|
2
|
+
# Canonical protocol: agent/session-protocol.md + agent.md
|
|
3
|
+
# Spec: docs/design/agent-context-assembly-spec.md §3.3, Appendix C, Appendix D
|
|
4
|
+
#
|
|
5
|
+
# Do not hand-edit generated install paths listed under harnesses[].path when
|
|
6
|
+
# generated: true. Run ./scripts/render-harness.sh after editing session-protocol.
|
|
7
|
+
|
|
8
|
+
version: 1
|
|
9
|
+
|
|
10
|
+
canonical:
|
|
11
|
+
session_protocol: agent/session-protocol.md
|
|
12
|
+
org_entrypoint: framework/agent.md
|
|
13
|
+
adopter_marker: "<!-- ADOPTER_C03_EXTENSIONS -->"
|
|
14
|
+
|
|
15
|
+
# Delivery tiers (see spec Appendix D)
|
|
16
|
+
# import — file expand at launch (@import); Claude Code only today
|
|
17
|
+
# generate_auto — render-harness embeds protocol; tool auto-loads install path
|
|
18
|
+
# generate_manual— render-harness embeds protocol; developer must invoke (--read)
|
|
19
|
+
# fallback — no repo convention; paste ./prj context assemble output
|
|
20
|
+
|
|
21
|
+
tiers:
|
|
22
|
+
import:
|
|
23
|
+
description: Expand canonical files into startup context at tool launch
|
|
24
|
+
generate_auto:
|
|
25
|
+
description: Generated install path auto-loaded by the tool
|
|
26
|
+
generate_manual:
|
|
27
|
+
description: Generated file exists but developer must pass a flag or slash-command
|
|
28
|
+
fallback:
|
|
29
|
+
description: No install path; use kickoff prompt + transcript reads
|
|
30
|
+
|
|
31
|
+
generated_banner: "<!-- GENERATED FROM agent/session-protocol.md — do not edit; run ./scripts/render-harness.sh -->"
|
|
32
|
+
|
|
33
|
+
harnesses:
|
|
34
|
+
# ── Tier: import ──────────────────────────────────────────────────────────
|
|
35
|
+
- id: claude-code
|
|
36
|
+
tool: Claude Code
|
|
37
|
+
status: active
|
|
38
|
+
tier: import
|
|
39
|
+
path: framework/CLAUDE.md
|
|
40
|
+
generated: false
|
|
41
|
+
seed_copy: true
|
|
42
|
+
per_project_path: projects/{project_id}/CLAUDE.md
|
|
43
|
+
per_project_template: |
|
|
44
|
+
@../../agent/session-protocol.md
|
|
45
|
+
@agent.md
|
|
46
|
+
|
|
47
|
+
<!-- ADOPTER_C03_EXTENSIONS -->
|
|
48
|
+
verify: "Run /memory — must list CLAUDE.md and imported agent files"
|
|
49
|
+
notes: |
|
|
50
|
+
Claude does not read AGENTS.md unless @AGENTS.md is added.
|
|
51
|
+
First @import shows approval dialog once per project.
|
|
52
|
+
|
|
53
|
+
# ── Tier: generate_auto ───────────────────────────────────────────────────
|
|
54
|
+
- id: cursor
|
|
55
|
+
tool: Cursor
|
|
56
|
+
status: active
|
|
57
|
+
tier: generate_auto
|
|
58
|
+
path: framework/.cursor/rules/agent.mdc
|
|
59
|
+
generated: true
|
|
60
|
+
seed_copy: true
|
|
61
|
+
template: cursor-mdc
|
|
62
|
+
template_extra:
|
|
63
|
+
description: "Agentic Development Framework — session-start protocol (POL-113..117)"
|
|
64
|
+
globs: '["**/*"]'
|
|
65
|
+
alwaysApply: true
|
|
66
|
+
verify: "Cursor Settings → Rules — agent.mdc must show Always"
|
|
67
|
+
notes: |
|
|
68
|
+
Injected on every Chat/Agent/Composer turn when alwaysApply is true.
|
|
69
|
+
Inline Edit (Cmd+K) may not receive full rules.
|
|
70
|
+
|
|
71
|
+
- id: openai-codex
|
|
72
|
+
tool: OpenAI Codex
|
|
73
|
+
status: active
|
|
74
|
+
tier: generate_auto
|
|
75
|
+
path: framework/AGENTS.md
|
|
76
|
+
generated: true
|
|
77
|
+
seed_copy: true
|
|
78
|
+
template: markdown-plain
|
|
79
|
+
verify: "First message — ask agent to summarize session protocol"
|
|
80
|
+
notes: "Plain markdown; Codex CLI, Codex Web, ChatGPT coding mode."
|
|
81
|
+
|
|
82
|
+
- id: gemini-code-assist
|
|
83
|
+
tool: Gemini Code Assist
|
|
84
|
+
status: active
|
|
85
|
+
tier: generate_auto
|
|
86
|
+
path: framework/.gemini/styleguide.md
|
|
87
|
+
generated: true
|
|
88
|
+
seed_copy: true
|
|
89
|
+
template: markdown-plain
|
|
90
|
+
verify: "First message — ask what styleguide/rules were loaded"
|
|
91
|
+
notes: |
|
|
92
|
+
Convention name is styleguide; content is session protocol.
|
|
93
|
+
Re-check Google docs when extension updates.
|
|
94
|
+
|
|
95
|
+
- id: github-copilot
|
|
96
|
+
tool: GitHub Copilot
|
|
97
|
+
status: active
|
|
98
|
+
tier: generate_auto
|
|
99
|
+
path: framework/.github/copilot-instructions.md
|
|
100
|
+
generated: true
|
|
101
|
+
seed_copy: true
|
|
102
|
+
template: markdown-plain
|
|
103
|
+
verify: "Copilot assist on a repo file — ask it to state write restrictions"
|
|
104
|
+
notes: |
|
|
105
|
+
Edit-time assist, not a full agent session. Weaker C01 gate than Cursor/Claude.
|
|
106
|
+
Same folder holds GitHub Actions — do not mix CI config into instructions.
|
|
107
|
+
|
|
108
|
+
- id: windsurf
|
|
109
|
+
tool: Windsurf
|
|
110
|
+
status: active
|
|
111
|
+
tier: generate_auto
|
|
112
|
+
path: framework/.windsurf/rules/agent.md
|
|
113
|
+
generated: true
|
|
114
|
+
seed_copy: true
|
|
115
|
+
template: markdown-plain
|
|
116
|
+
verify: "First message — confirm rules loaded"
|
|
117
|
+
|
|
118
|
+
- id: cline
|
|
119
|
+
tool: Cline / Roo Code
|
|
120
|
+
status: active
|
|
121
|
+
tier: generate_auto
|
|
122
|
+
path: framework/.clinerules/agent.md
|
|
123
|
+
generated: true
|
|
124
|
+
seed_copy: true
|
|
125
|
+
template: markdown-plain
|
|
126
|
+
verify: "Open projects/{project_id}/ as workspace; confirm rules on startup"
|
|
127
|
+
notes: "Supports nested .clinerules/ per subdirectory."
|
|
128
|
+
|
|
129
|
+
- id: continue
|
|
130
|
+
tool: Continue.dev
|
|
131
|
+
status: active
|
|
132
|
+
tier: generate_auto
|
|
133
|
+
path: framework/.continue/rules.md
|
|
134
|
+
generated: true
|
|
135
|
+
seed_copy: true
|
|
136
|
+
template: markdown-plain
|
|
137
|
+
verify: "First message — confirm system rules loaded"
|
|
138
|
+
notes: "Complements .continue/config.yaml context providers."
|
|
139
|
+
|
|
140
|
+
# ── Tier: generate_manual ─────────────────────────────────────────────────
|
|
141
|
+
- id: aider
|
|
142
|
+
tool: Aider
|
|
143
|
+
status: active
|
|
144
|
+
tier: generate_manual
|
|
145
|
+
path: framework/CONVENTIONS.md
|
|
146
|
+
generated: true
|
|
147
|
+
seed_copy: true
|
|
148
|
+
template: markdown-plain
|
|
149
|
+
invoke: "aider --read CONVENTIONS.md …"
|
|
150
|
+
verify: "Confirm CONVENTIONS.md in aider context at session start"
|
|
151
|
+
|
|
152
|
+
# ── Tier: fallback (registered, not generated) ────────────────────────────
|
|
153
|
+
- id: chatgpt-web
|
|
154
|
+
tool: ChatGPT (web) / custom GPT
|
|
155
|
+
status: registered
|
|
156
|
+
tier: fallback
|
|
157
|
+
path: null
|
|
158
|
+
verify: "Paste kickoff prompt from DEVELOPER_GUIDE §3"
|
|
159
|
+
notes: "No repo-local auto-load."
|
|
160
|
+
|
|
161
|
+
- id: jetbrains-ai
|
|
162
|
+
tool: JetBrains AI Assistant
|
|
163
|
+
status: planned
|
|
164
|
+
tier: generate_auto
|
|
165
|
+
path: .junie/guidelines.md
|
|
166
|
+
generated: true
|
|
167
|
+
seed_copy: false
|
|
168
|
+
template: markdown-plain
|
|
169
|
+
notes: "Verify path against JetBrains docs before enabling."
|
|
170
|
+
|
|
171
|
+
- id: amazon-q
|
|
172
|
+
tool: Amazon Q Developer
|
|
173
|
+
status: planned
|
|
174
|
+
tier: generate_auto
|
|
175
|
+
path: .amazonq/rules.md
|
|
176
|
+
generated: true
|
|
177
|
+
seed_copy: false
|
|
178
|
+
template: markdown-plain
|
|
179
|
+
notes: "Path TBD — confirm with AWS docs before enabling."
|
|
180
|
+
|
|
181
|
+
- id: sourcegraph-cody
|
|
182
|
+
tool: Sourcegraph Cody
|
|
183
|
+
status: planned
|
|
184
|
+
tier: generate_auto
|
|
185
|
+
path: .sourcegraph/cody-rules.md
|
|
186
|
+
generated: true
|
|
187
|
+
seed_copy: false
|
|
188
|
+
template: markdown-plain
|
|
189
|
+
notes: "Path TBD."
|
|
190
|
+
|
|
191
|
+
# Templates (consumed by render-harness.sh)
|
|
192
|
+
templates:
|
|
193
|
+
cursor-mdc: |
|
|
194
|
+
---
|
|
195
|
+
description: {{template_extra.description}}
|
|
196
|
+
globs: {{template_extra.globs}}
|
|
197
|
+
alwaysApply: {{template_extra.alwaysApply}}
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
{{render.generated_banner}}
|
|
201
|
+
|
|
202
|
+
{{render.body}}
|
|
203
|
+
markdown-plain: |
|
|
204
|
+
{{render.generated_banner}}
|
|
205
|
+
|
|
206
|
+
{{render.body}}
|
|
207
|
+
claude-import-stub: |
|
|
208
|
+
@agent/session-protocol.md
|
|
209
|
+
@agent.md
|
|
210
|
+
|
|
211
|
+
<!-- ADOPTER_C03_EXTENSIONS -->
|
|
212
|
+
|
|
213
|
+
# Per-project composition (seed / render-harness --project)
|
|
214
|
+
per_project:
|
|
215
|
+
compose_body: |
|
|
216
|
+
{{render.session_protocol_body}}
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
# Project entrypoint
|
|
221
|
+
|
|
222
|
+
@agent.md
|
|
223
|
+
note: |
|
|
224
|
+
For Cursor/Aider/etc., render-harness concatenates session-protocol + projects/PID/agent.md
|
|
225
|
+
into the generated install path. For Claude, per_project_template uses separate @imports.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Agent Session-Start Protocol — <ORG_NAME>
|
|
2
|
+
|
|
3
|
+
This is the **canonical** session-start protocol for any AI coding agent working in this workspace. It is delivered to each tool at its conventional path (`CLAUDE.md`, `.cursor/rules/agent.mdc`, `AGENTS.md`, `CONVENTIONS.md`, …) by `scripts/render-harness.sh`, driven by `agent/harness-manifest.yaml`. **Edit the protocol here, then re-render — never hand-edit the generated copies** (they carry a "do not edit" banner).
|
|
4
|
+
|
|
5
|
+
## 0. New session — agent speaks first (Pattern 1)
|
|
6
|
+
|
|
7
|
+
**Applies to:** every new Cursor Agent/Chat session, every new `claude` invocation, and every new conversation after `/clear`.
|
|
8
|
+
|
|
9
|
+
When this protocol is loaded, your **first assistant message** in the session must run the C01 checklist (§1–§2 below) and post a **context manifest** — **before** planning work, proposing tasks, or editing files.
|
|
10
|
+
|
|
11
|
+
| Trigger | What you do |
|
|
12
|
+
|---|---|
|
|
13
|
+
| User's first message is a greeting, "start", "go", "ready", or session opener | Run §1–§2, post manifest, **stop and wait** |
|
|
14
|
+
| User's first message already contains a **specific work task** | Still run §1–§2 first; post a **short** manifest, then address the task |
|
|
15
|
+
| No active project (framework/contrib mode; no `active` entry in `registry.yaml`) | Post manifest stating no active project; load org layer + `agent.md` only; wait for direction |
|
|
16
|
+
|
|
17
|
+
**Do not** wait for the user to paste the kickoff prompt from `DEVELOPER_GUIDE.md` — that template is for humans; you execute the same steps proactively.
|
|
18
|
+
|
|
19
|
+
### Context manifest (required format)
|
|
20
|
+
|
|
21
|
+
Use this structure in your first reply:
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
## Context manifest
|
|
25
|
+
|
|
26
|
+
- **Project:** <PROJECT_ID or "none">
|
|
27
|
+
- **Branch:** <current git branch>
|
|
28
|
+
- **Status / assigned_to:** <from project.yaml, or n/a>
|
|
29
|
+
- **Repos:** <primary repos from project.yaml, or n/a>
|
|
30
|
+
- **Open todos:** <bullets from todo.md ## Open, or "none">
|
|
31
|
+
- **Layers loaded:** org ✓/✗ · project ✓/✗ · repo ✓/✗ · prefs ✓/✗
|
|
32
|
+
- **Awaiting:** your direction (no tasks proposed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
After the manifest, **stop**. Do not propose implementation work unless the user's first message already asked for something specific — and even then, complete the manifest first.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
Before you change any code, complete the steps below.
|
|
40
|
+
|
|
41
|
+
## 1. Read `org-config.yaml` first — every framework file references its values
|
|
42
|
+
|
|
43
|
+
Read `org-config.yaml` at the workspace repo root before anything else. The framework ships with no org-specific values baked in; instead, files refer to org values via angle-bracketed tokens that map to keys in `org-config.yaml`:
|
|
44
|
+
|
|
45
|
+
| Token | Key in `org-config.yaml` |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `<ORG_NAME>` | `org_name` |
|
|
48
|
+
| `<ORG_SHORT_NAME>` | `org_short_name` |
|
|
49
|
+
| `<ORG_SLUG>` | `org_slug` |
|
|
50
|
+
| `<org_slug>` (lowercase) | `org_slug_lower` |
|
|
51
|
+
| `<ORG_REPO_URL>` | `org_repo_url` |
|
|
52
|
+
| `<GITHUB_ORG>` | `github_org` |
|
|
53
|
+
| `<WORKSPACE_REPO>` | `workspace_repo` |
|
|
54
|
+
| `<DEFAULT_BRANCH>` | `default_branch` |
|
|
55
|
+
| `<DEFAULT_CODE_BRANCH>` | `default_code_branch` |
|
|
56
|
+
| `<AGENT_WORK_ROOT>` | `agent_work_root` |
|
|
57
|
+
| `<POLICY_OWNER_EMAIL>` | `policy_owner_email` |
|
|
58
|
+
| `<POLICY_OWNER_GITHUB>` | `policy_owner_github` |
|
|
59
|
+
| `<LEGAL_OWNER_GITHUB>` etc. | `legal_owner_github`, `infra_owner_github`, `system_arch_owner_github`, `data_arch_owner_github` |
|
|
60
|
+
| `<POLICY_EFFECTIVE_DATE>` | `policy_effective_date` |
|
|
61
|
+
|
|
62
|
+
Tokens like `<PROJECT_ID>`, `<repo-name>`, `<your-gh-login>` are per-session values you'll discover from the current branch, `registry.yaml`, and `gh api user`.
|
|
63
|
+
|
|
64
|
+
If `org-config.yaml` has empty values (`org_name: ""`), the workspace is still in TEMPLATE state. Hard-stop and tell the human to run `./setup.sh`.
|
|
65
|
+
|
|
66
|
+
## 2. Load four knowledge layers — fresh every session
|
|
67
|
+
|
|
68
|
+
Read these in priority order (highest first). Never use cached layers from a prior session:
|
|
69
|
+
|
|
70
|
+
1. **Org-wide knowledge** — `knowledge/` in this repo, from the `<DEFAULT_BRANCH>` branch.
|
|
71
|
+
2. **Active project** — `projects/<PROJECT_ID>/knowledge/` plus the project's own entrypoint at `projects/<PROJECT_ID>/agent.md`. To determine the active `PROJECT_ID`: check `registry.yaml` for entries with `status: active`, and check the current git branch (project branches are named `brnch-NNN-<slug>`).
|
|
72
|
+
3. **Repo-local** — `<repo>/knowledge/` for each linked code repo at `$AGENT_WORK_ROOT/<PROJECT_ID>/<repo-name>/`.
|
|
73
|
+
4. **Your developer preferences** — `$AGENT_WORK_ROOT/preferences/<your-gh-login>.md`. Run `gh api user --jq .login` to determine your handle; load **only** your file. Other files in that directory belong to other developers — do not read them.
|
|
74
|
+
|
|
75
|
+
Higher layers always win. Developer preferences cannot override repo-local or org-wide knowledge.
|
|
76
|
+
|
|
77
|
+
## 3. Verify project state (C01 — hard stops)
|
|
78
|
+
|
|
79
|
+
If a project is active:
|
|
80
|
+
|
|
81
|
+
- Confirm you are authorized: you have **write access to the project's linked GitHub Project** (the authorization source of truth — an owner grants it via `./prj manage assign`). `assigned_to` in `project.yaml` is a display/audit cache, **not** the gate. When on a task sub-branch (`brnch-NNN-<slug>/<task-slug>`), confirm that sub-branch's assignee is you.
|
|
82
|
+
- `project.yaml`'s `status` must be `active`.
|
|
83
|
+
- Read `projects/<PROJECT_ID>/knowledge/todo.md` and surface its `## Open` items to the developer before planning new work.
|
|
84
|
+
|
|
85
|
+
If any of these can't be verified, hard-stop and surface to the human. Do not commit anything.
|
|
86
|
+
|
|
87
|
+
## 4. What's writable, what's not
|
|
88
|
+
|
|
89
|
+
During an active project:
|
|
90
|
+
|
|
91
|
+
- ✅ Writable: `projects/<PROJECT_ID>/` (workspace repo) and code on the project branch in cloned repos under `$AGENT_WORK_ROOT/<PROJECT_ID>/`.
|
|
92
|
+
- ❌ Read-only: `<WORKSPACE_REPO>/knowledge/` — never edit during an active project.
|
|
93
|
+
- ❌ Never hand-manage task state — tasks are GitHub Issues on the board (open = active, closed = done); create with `./prj task`, land with `./prj merge`.
|
|
94
|
+
- ❌ Don't create GitHub Issues unilaterally — those represent business intent that humans add to the GitHub Project board.
|
|
95
|
+
|
|
96
|
+
## 5. Where work happens
|
|
97
|
+
|
|
98
|
+
- Code repos are cloned at `$AGENT_WORK_ROOT/<PROJECT_ID>/<repo-name>/`, each on the project branch.
|
|
99
|
+
- Code changes go in those cloned repos — **NOT** in the workspace repo's tree.
|
|
100
|
+
- Project metadata (knowledge, decisions, to-dos) goes in `projects/<PROJECT_ID>/` in the workspace repo.
|
|
101
|
+
|
|
102
|
+
## 6. During work
|
|
103
|
+
|
|
104
|
+
- Capture decisions, exceptions, and policy notes in `projects/<PROJECT_ID>/knowledge/` as you make them — not at session end.
|
|
105
|
+
- **Draw, don't just describe.** When the knowledge you're capturing has a flow, architecture, sequence, state machine, or relationship, author it as a **Mermaid diagram (text, never an image — POL-414)** instead of prose. One artifact serves both readers: it renders as a picture for humans and stays ~tens of diffable, RAG-indexable lines for agents and PR review. Default to a diagram for anything structural; reach for `flowchart`/`sequenceDiagram`/`stateDiagram`/`erDiagram`/`C4Context` as fits.
|
|
106
|
+
- Capture intermediate to-dos in `projects/<PROJECT_ID>/knowledge/todo.md` under `## Open` as they arise.
|
|
107
|
+
- When an item from `todo.md` is resolved, move it to `## Done` with a short note (commit SHA, PR link, or one-line outcome).
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
For the canonical, full version of this protocol and the policy that governs it:
|
|
112
|
+
|
|
113
|
+
- **`docs/DEVELOPER_GUIDE.md`** — step-by-step session walkthrough with example prompts.
|
|
114
|
+
- **`knowledge/policies/agentic-development-policy.md`** — full policy text. POL-113 through POL-171 govern session protocol.
|
|
115
|
+
|
|
116
|
+
Per-project specifics (the actual `<PROJECT_ID>`, paths, GitHub Project URL, etc.) are filled in at `projects/<PROJECT_ID>/agent.md` once the project is seeded — that file is your project-specific entrypoint.
|
package/bin/prj
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# @svayam/prj — npm bin wrapper for the bash CLI.
|
|
3
|
+
# Resolves the workspace (the governance repo) and execs the bundled `prj`.
|
|
4
|
+
# The CLI code ships in this package; org data lives in the workspace.
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
+
PKG="$(cd "$HERE/.." && pwd)" # package root: <...>/node_modules/@svayam/prj
|
|
8
|
+
# Discover the workspace: explicit env, else nearest ancestor with org-config.yaml.
|
|
9
|
+
if [[ -z "${ADF_WORKSPACE:-}" ]]; then
|
|
10
|
+
d="$PWD"
|
|
11
|
+
while [[ "$d" != "/" ]]; do
|
|
12
|
+
if [[ -f "$d/org-config.yaml" ]]; then ADF_WORKSPACE="$d"; break; fi
|
|
13
|
+
d="$(dirname "$d")"
|
|
14
|
+
done
|
|
15
|
+
fi
|
|
16
|
+
if [[ -z "${ADF_WORKSPACE:-}" || ! -f "${ADF_WORKSPACE:-}/org-config.yaml" ]]; then
|
|
17
|
+
echo "prj: no workspace found here. cd into your governance repo, or set ADF_WORKSPACE." >&2
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
export ADF_WORKSPACE
|
|
21
|
+
exec "$PKG/prj" "$@"
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@svayam-opensource/prj",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Governed Agentic Development Framework CLI (prj). A bash CLI wrapped for npm; operates on a governance workspace resolved via $ADF_WORKSPACE or the nearest org-config.yaml. Runtime prerequisites (not npm deps): bash, git, gh, yq, python3 (use Git Bash on Windows).",
|
|
5
|
+
"bin": {
|
|
6
|
+
"prj": "bin/prj"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"prj",
|
|
10
|
+
"bin/",
|
|
11
|
+
"setup.sh",
|
|
12
|
+
"agent/",
|
|
13
|
+
"scripts/*.sh",
|
|
14
|
+
"scripts/validate/*.py"
|
|
15
|
+
],
|
|
16
|
+
"os": [
|
|
17
|
+
"darwin",
|
|
18
|
+
"linux",
|
|
19
|
+
"win32"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=14"
|
|
23
|
+
},
|
|
24
|
+
"preferGlobal": true,
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"registry": "https://registry.npmjs.org/",
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"cli",
|
|
31
|
+
"agentic",
|
|
32
|
+
"governance",
|
|
33
|
+
"framework",
|
|
34
|
+
"prj"
|
|
35
|
+
],
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/svayam-opensource/governed-agentic-dev-framework.git"
|
|
40
|
+
}
|
|
41
|
+
}
|