project-governance-init 0.1.0

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/README.md ADDED
@@ -0,0 +1,159 @@
1
+ # project-governance-init
2
+
3
+ `project-governance-init` is a small, zero-dependency CLI for starting work in an unfamiliar codebase with clear project context and repeatable review habits.
4
+
5
+ It is for people who use AI coding tools to build apps, APIs, mobile products, libraries, scripts, and prototypes. It is especially useful when the person describing the product, the person writing code, and the person reviewing the result are different people—or when one person is doing all three with an AI assistant.
6
+
7
+ ## Why this repository exists
8
+
9
+ AI coding tools are good at producing code quickly. They cannot know a project's real purpose, users, release constraints, data obligations, or definition of “done” unless someone records those things. Starting with a blank folder also makes it easy to skip tests, security review, accessibility checks, or a release plan.
10
+
11
+ Teams often solve this by repeating the same setup conversation in every repository. The questions vary in wording and the resulting instructions live in different places. Important details get lost when the project changes tools or when a new contributor joins.
12
+
13
+ This CLI turns that setup into a repeatable repository artifact: an `AGENTS.md` containing project context, commands, guardrails, review stages, known gaps, and portable capability recommendations. The file is plain Markdown, so it remains useful when the team changes AI providers or works without an AI tool.
14
+
15
+ ## Who should use it
16
+
17
+ Use it when:
18
+
19
+ - You are starting an application in an empty directory and want to establish scope before writing features.
20
+ - You are joining an existing repository and need a quick picture of its stack, commands, risks, and missing safeguards.
21
+ - You use more than one AI coding tool and want one source of project instructions instead of separate vendor-specific copies.
22
+ - You are building a sensitive product involving personal data, payments, health information, credentials, authentication, or tenant isolation.
23
+ - You want an AI-assisted project to have a written definition of success and a review path that survives the original author.
24
+
25
+ It is not a project-management system, an automatic security certification, or a replacement for a human who understands the product. It creates a useful starting point and makes gaps visible.
26
+
27
+ ## How the workflow works
28
+
29
+ Run the CLI from the folder you want to initialize:
30
+
31
+ ```bash
32
+ npx project-governance-init
33
+ ```
34
+
35
+ The CLI first looks for signs of a real project. It checks package and build manifests, source files, common source directories, Docker and Terraform files, README content, CI workflows, dependency files, and package scripts. A Git directory or IDE settings alone do not count as a project.
36
+
37
+ ### Empty folder
38
+
39
+ An empty folder starts an interview. The questions cover the information tools cannot safely infer:
40
+
41
+ - What the project does and who uses it.
42
+ - What outcome proves that it is working.
43
+ - Whether it handles sensitive data or needs tenant isolation.
44
+ - Where it runs and who owns releases.
45
+ - Which user flow must not break.
46
+ - Which external systems it trusts.
47
+ - What cannot be compromised, such as privacy, compatibility, a deadline, or performance.
48
+ - The largest known risk or unfinished area.
49
+
50
+ Answers are written into the generated project context. Blank answers become visible placeholders rather than invented facts.
51
+
52
+ ### Existing project
53
+
54
+ An existing project is reviewed before anything is written. The report includes detected languages, package manager, project type, scripts, CI and scanning configuration, dependency signals, and checklist gaps. It also recommends portable capabilities that match the evidence.
55
+
56
+ The first run is read-only until the user confirms. If `AGENTS.md` already exists, the CLI asks how to handle it:
57
+
58
+ - Cancel and keep the file unchanged.
59
+ - Append a marked generated section below the existing content.
60
+ - Replace the entire file.
61
+
62
+ Generated files contain `project-governance-init` start and end markers. Future updates replace only the marked section, so manually maintained instructions outside that section remain intact.
63
+
64
+ Use `--review` when you want the analysis and recommendations without any confirmation prompt or file changes.
65
+
66
+ ## What gets generated
67
+
68
+ The normal run can create:
69
+
70
+ - `AGENTS.md`, the single source of project instructions.
71
+ - `CLAUDE.md`, a thin pointer to `AGENTS.md`.
72
+ - `GEMINI.md`, a thin pointer to `AGENTS.md`.
73
+
74
+ The generated `AGENTS.md` contains:
75
+
76
+ - Project overview and success context.
77
+ - Definitions of ready and done for each change.
78
+ - Detected technology and native build/test commands.
79
+ - Project-type guardrails for web, API, mobile, CLI, library, or general projects.
80
+ - Integration signals for UI, authentication, databases, and payments.
81
+ - A staged workflow: plan, delegate, correctness review, UI/accessibility review, security review, verification, and sign-off.
82
+ - Known gaps such as missing CI, dependency scanning, or secret scanning.
83
+ - Portable capability recommendations with manual fallbacks.
84
+ - Sections for coding conventions and unfinished work that the team can complete later.
85
+
86
+ ## Portable skills, agents, and plugins
87
+
88
+ The generated recommendations never require a named AI provider. They use capability labels such as:
89
+
90
+ ```md
91
+ ### security-review
92
+ When: Authentication, databases, payments, sensitive data, or tenant isolation are involved.
93
+ Use: the installed security reviewer, agent, or plugin for trust-boundary and OWASP analysis.
94
+ Fallback: Apply the OWASP checklist in this file and verify every authorization check server-side.
95
+ ```
96
+
97
+ For web and mobile work, the interview also records visual direction (for example glass, flat, editorial, dense, or minimal) and content voice. It recommends `design-preferences` for the UI intake, `authentic-writing` for direct user-facing copy, and `seo-review` for public web discoverability. Each label can map to a local Claude, Codex, Gemini, or other tool skill; the generated fallback remains usable without one.
98
+
99
+ An AI tool can map `security-review` to its own installed skill, agent, or plugin. A tool that has no matching extension can follow the fallback instructions. This repository also ships fallback skills in [`skills/`](skills/): `design-preferences`, `authentic-writing`, `seo-review`, `secure-server`, and `aeo-geo-seo-website-optimizer`. They are plain Markdown and can be read by any coding tool.
100
+
101
+ ## Commands
102
+
103
+ ```bash
104
+ node bin/init.mjs # analyze, then interview or ask for update approval
105
+ node bin/init.mjs --review # analyze and recommend; never write files
106
+ node bin/init.mjs --dry-run # show planned output; never write files
107
+ node bin/init.mjs --force # allow pointer files and full replacement when selected
108
+ npm test # run the native Node test suite
109
+ ```
110
+
111
+ The CLI has no runtime dependencies. It uses Node's standard library for file inspection, prompts, and writing.
112
+
113
+ ## Detection coverage
114
+
115
+ The detector recognizes JavaScript and TypeScript package managers (`npm`, `pnpm`, `yarn`, and `bun`), Python (`uv` and Poetry), Go, Rust, Maven, Gradle, and Swift Package Manager. It recognizes Python API frameworks (FastAPI, Flask, Django), native iOS markers, Android markers, and common project types from dependencies and metadata.
116
+
117
+ When a project has no package scripts, generated instructions use native test commands where there is a safe convention, such as `go test ./...`, `cargo test`, `uv run pytest`, `mvn test`, or `gradle test`. Unknown commands are left for the project owner to fill in.
118
+
119
+ Detection is intentionally conservative. A dependency name or folder is a signal for a recommendation, not proof that a feature is configured correctly. Review the report and correct any false positives before accepting generated instructions.
120
+
121
+ ## Safety and privacy boundaries
122
+
123
+ The CLI reads local filenames and selected text files to build recommendations. It does not send repository contents to a service and it has no network dependency at runtime. It does not infer or store secrets. The generated file can contain whatever answers the user provides, so do not enter credentials, private keys, or raw personal records into the interview.
124
+
125
+ The tool reports security and privacy work that still needs to happen. Passing its tests or generating an `AGENTS.md` does not prove that an application is secure, compliant, accessible, or ready to ship.
126
+
127
+ ## Development
128
+
129
+ Clone the repository, then run:
130
+
131
+ ```bash
132
+ npm test
133
+ node --check bin/init.mjs
134
+ ```
135
+
136
+ The implementation is intentionally kept in one CLI file. Tests in `test/` use Node's built-in test runner and temporary directories; no test framework or dependency installation is required.
137
+
138
+ Before publishing, inspect the package contents:
139
+
140
+ ```bash
141
+ npm pack --dry-run
142
+ ```
143
+
144
+ The package allowlist publishes only the CLI, README, and package metadata. GitHub Actions runs the test suite on pushes and pull requests.
145
+
146
+ ## Extending the project
147
+
148
+ Small changes usually belong in `bin/init.mjs`:
149
+
150
+ - Add a detector when a new manifest or lockfile gives reliable evidence.
151
+ - Add a capability when a recurring review responsibility has a clear trigger and manual fallback.
152
+ - Add a project-type guardrail when a platform has rules that differ from the general workflow.
153
+ - Add a fixture test before changing detection or generated output.
154
+
155
+ Keep recommendations evidence-based. If the tool cannot determine something from the repository, ask the user or mark it as unknown instead of guessing.
156
+
157
+ ## Feedback
158
+
159
+ Have feedback, found a bug, or have an idea? [Open an issue](https://github.com/yogi-dad/project-governance-init/issues) and share your thoughts. For bugs, include the command you ran, expected behavior, actual behavior, and your Node.js version when relevant.