project-kit-cli 0.1.0__py3-none-any.whl

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.
Files changed (49) hide show
  1. project_kit/__init__.py +8 -0
  2. project_kit/__main__.py +5 -0
  3. project_kit/agents.py +81 -0
  4. project_kit/ai_attribution.py +69 -0
  5. project_kit/approval.py +36 -0
  6. project_kit/assets/hooks/commit-msg +14 -0
  7. project_kit/assets/project/workflow.yml +63 -0
  8. project_kit/assets/skills/pk-decide/SKILL.md +63 -0
  9. project_kit/assets/skills/pk-discover/SKILL.md +57 -0
  10. project_kit/assets/skills/pk-handoff/SKILL.md +43 -0
  11. project_kit/assets/skills/pk-plan/SKILL.md +55 -0
  12. project_kit/assets/skills/pk-provision/SKILL.md +45 -0
  13. project_kit/assets/skills/pk-start/SKILL.md +47 -0
  14. project_kit/assets/skills/pk-workflow/SKILL.md +51 -0
  15. project_kit/assets/templates/adr.md +32 -0
  16. project_kit/assets/templates/backlog.example.json +59 -0
  17. project_kit/assets/templates/brief.md +77 -0
  18. project_kit/assets/templates/constitution-input.md +78 -0
  19. project_kit/assets/templates/development-workflow.md +51 -0
  20. project_kit/assets/templates/github/ISSUE_TEMPLATE/adr.yml +21 -0
  21. project_kit/assets/templates/github/ISSUE_TEMPLATE/bug.yml +25 -0
  22. project_kit/assets/templates/github/ISSUE_TEMPLATE/config.yml +1 -0
  23. project_kit/assets/templates/github/ISSUE_TEMPLATE/epic.yml +15 -0
  24. project_kit/assets/templates/github/ISSUE_TEMPLATE/feature.yml +22 -0
  25. project_kit/assets/templates/github/pull_request_template.md +21 -0
  26. project_kit/assets/templates/interview.md +68 -0
  27. project_kit/backlog.py +312 -0
  28. project_kit/cli.py +286 -0
  29. project_kit/config.py +139 -0
  30. project_kit/doctor.py +187 -0
  31. project_kit/fsutil.py +27 -0
  32. project_kit/gh.py +152 -0
  33. project_kit/handoff.py +360 -0
  34. project_kit/help.py +152 -0
  35. project_kit/installer.py +100 -0
  36. project_kit/labels.py +17 -0
  37. project_kit/project_choice.py +127 -0
  38. project_kit/providers/__init__.py +1 -0
  39. project_kit/providers/github.py +329 -0
  40. project_kit/provision.py +260 -0
  41. project_kit/provision_issues.py +360 -0
  42. project_kit/state.py +115 -0
  43. project_kit/templating.py +23 -0
  44. project_kit/workflow.py +168 -0
  45. project_kit_cli-0.1.0.dist-info/METADATA +97 -0
  46. project_kit_cli-0.1.0.dist-info/RECORD +49 -0
  47. project_kit_cli-0.1.0.dist-info/WHEEL +4 -0
  48. project_kit_cli-0.1.0.dist-info/entry_points.txt +3 -0
  49. project_kit_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,32 @@
1
+ # ADR-NNNN: <decision title>
2
+
3
+ <!-- One decision per file, named docs/adr/NNNN-short-title.md. Written by /pk-decide, or fill
4
+ it in by hand. Status: Proposed, Accepted, Deprecated or Superseded by ADR-NNNN. -->
5
+
6
+ - **Status**: Proposed
7
+ - **Date**: YYYY-MM-DD
8
+
9
+ ## Context
10
+
11
+ <!-- The problem or constraint that forces a decision, with links to the brief. -->
12
+
13
+ ## Decision drivers
14
+
15
+ <!-- What matters for choosing: team skills, cost, time, scale, compliance, lock-in... -->
16
+
17
+ -
18
+
19
+ ## Options considered
20
+
21
+ | Option | Pros | Cons |
22
+ |--------|------|------|
23
+ | A | | |
24
+ | B | | |
25
+
26
+ ## Decision
27
+
28
+ <!-- The option chosen, in one sentence, and the main reason. -->
29
+
30
+ ## Consequences
31
+
32
+ <!-- What gets easier, what gets harder, what must be done as a result, when to revisit. -->
@@ -0,0 +1,59 @@
1
+ {
2
+ "version": 1,
3
+ "phases": [
4
+ {"id": "mvp", "title": "v0.1 MVP", "description": "First usable version"},
5
+ {"id": "growth", "title": "v0.2", "description": "Improvements after the first feedback"}
6
+ ],
7
+ "labels": [
8
+ {"name": "area:backend", "color": "0E8A16", "description": "Server side"},
9
+ {"name": "area:frontend", "color": "1D76DB", "description": "User interface"}
10
+ ],
11
+ "issues": [
12
+ {
13
+ "id": "epic-accounts",
14
+ "type": "epic",
15
+ "phase": "mvp",
16
+ "title": "User accounts",
17
+ "priority": "P1",
18
+ "size": "L",
19
+ "body": "Users can sign up, sign in and manage their profile."
20
+ },
21
+ {
22
+ "id": "adr-auth",
23
+ "type": "adr",
24
+ "phase": "mvp",
25
+ "title": "Decide the authentication approach",
26
+ "priority": "P1",
27
+ "size": "S",
28
+ "parent": "epic-accounts",
29
+ "body": "Compare hosted identity providers with in-house authentication."
30
+ },
31
+ {
32
+ "id": "sign-up",
33
+ "type": "feature",
34
+ "phase": "mvp",
35
+ "title": "Sign up with email and password",
36
+ "priority": "P1",
37
+ "size": "M",
38
+ "parent": "epic-accounts",
39
+ "labels": ["area:backend", "area:frontend"],
40
+ "body": "A visitor can create an account.",
41
+ "acceptance": [
42
+ "The form validates the email and the password strength",
43
+ "A confirmation email is sent",
44
+ "Duplicate emails are rejected with a clear message"
45
+ ]
46
+ },
47
+ {
48
+ "id": "profile-page",
49
+ "type": "feature",
50
+ "phase": "growth",
51
+ "title": "Profile page",
52
+ "priority": "P3",
53
+ "size": "S",
54
+ "parent": "epic-accounts",
55
+ "labels": ["area:frontend"],
56
+ "acceptance": ["A signed-in user can see and edit their display name"]
57
+ }
58
+ ]
59
+ }
@@ -0,0 +1,77 @@
1
+ # Project brief: {{project_name}}
2
+
3
+ <!-- Written by /pk-discover, or fill it in by hand. Describe WHAT and WHY, not HOW:
4
+ technology and architecture are decided in the next phase. -->
5
+
6
+ - **Status**: Draft
7
+ - **Created**: YYYY-MM-DD
8
+
9
+ ## Summary
10
+
11
+ <!-- Two or three sentences: what it is, for whom, and why it is worth building. -->
12
+
13
+ ## Problem
14
+
15
+ <!-- Who hurts, what hurts, and what happens today without this project. -->
16
+
17
+ ## Users and stakeholders
18
+
19
+ <!-- Users experience the problem; stakeholders decide, pay or are affected. -->
20
+
21
+ - **Users**:
22
+ - **Stakeholders**:
23
+
24
+ ## Goals
25
+
26
+ -
27
+
28
+ ## Scope
29
+
30
+ <!-- The capabilities the project must offer, at product level and grouped by theme. -->
31
+
32
+ ### In scope
33
+
34
+ -
35
+
36
+ ### Out of scope (non-goals)
37
+
38
+ -
39
+
40
+ ## Success criteria
41
+
42
+ <!-- How will you know it worked? Measurable and independent of technology where possible. -->
43
+
44
+ -
45
+
46
+ ## Constraints
47
+
48
+ <!-- Legal and compliance, budget, deadline, team size and skills, existing systems, hosting
49
+ or data-residency requirements. -->
50
+
51
+ -
52
+
53
+ ## Data and integrations
54
+
55
+ <!-- What information the project handles and which external services it must talk to. -->
56
+
57
+ -
58
+
59
+ ## Technical preferences already stated
60
+
61
+ <!-- Anything the user already decided or wants to avoid (languages, tools, hosting). It is
62
+ not decided here: /pk-decide takes it as input and turns it into ADRs. -->
63
+
64
+ -
65
+
66
+ ## Risks and assumptions
67
+
68
+ -
69
+
70
+ ## Open questions
71
+
72
+ <!-- [NEEDS CLARIFICATION: ...] -->
73
+
74
+ ## Clarifications
75
+
76
+ <!-- ### Session YYYY-MM-DD
77
+ - Q: ... -> A: ... -->
@@ -0,0 +1,78 @@
1
+ <!-- project-kit:managed -->
2
+ # {{project_name}} constitution input
3
+
4
+ Governance principles for {{project_name}}, generated by project-kit from the project's
5
+ decisions. They are meant to be passed to `/speckit-constitution`. Governance content only:
6
+ nothing in this document asks for features to be built.
7
+
8
+ ## Core principles
9
+
10
+ ### I. Spec-driven development (NON-NEGOTIABLE)
11
+ Every feature follows specify, clarify, plan, tasks, implement. There is no product code
12
+ without an approved spec. Each spec lives in its own branch `NNN-name`, created from
13
+ `{{branches.develop}}`, and in `specs/NNN-name/`. Trivial changes (typos, dependency bumps,
14
+ configuration) may go as `chore/*` without a spec.
15
+
16
+ ### II. Test-first and verifiable quality
17
+ Domain logic is written test-first (red, green, refactor). Integration tests cover the
18
+ boundaries between components, and contract tests cover every API or schema change. Nothing
19
+ is merged without a green CI. A fixed bug includes the test that reproduces it.
20
+
21
+ ### III. Security and secrets
22
+ Authorisation is enforced on the server side. Secrets live only in a secrets manager or in
23
+ the hosting platform's secrets, never in the repository (a `.env.example` without values is
24
+ versioned instead). Personal data is handled according to the applicable regulation and that
25
+ handling is documented in the spec that touches it.
26
+
27
+ ### IV. Automation and reproducibility
28
+ Infrastructure and processes are versioned configuration. There are no manual changes that
29
+ are not reflected in the repository, and critical tasks are idempotent and retryable.
30
+
31
+ ### V. Simplicity
32
+ Choose the simplest solution that validates the product. Any extra complexity is justified in
33
+ writing, in the plan's complexity tracking or in an ADR.
34
+
35
+ ### VI. Decisions in writing
36
+ Every cross-cutting decision (stack, authentication, data, deployment) is recorded as an ADR
37
+ in `docs/adr/`.
38
+
39
+ ## Additional constraints
40
+
41
+ - Technology stack: {{stack}}
42
+ - Language: documents and specs are written in `{{language}}`; code, commits and branch
43
+ names are in lowercase English.
44
+ {{references}}
45
+
46
+ ## Development workflow and quality gates
47
+
48
+ - Permanent branches: `{{branches.main}}` (released product), `{{branches.release}}`
49
+ (testing and acceptance) and `{{branches.develop}}` (development).
50
+ - Working branches start from `{{branches.develop}}`: `NNN-name` (one per spec), `chore/*`,
51
+ `docs/*` and `fix/*`. `hotfix/*` starts from `{{branches.main}}`.
52
+ - Promotion flows `{{branches.develop}}` to `{{branches.release}}` to `{{branches.main}}`. A
53
+ hotfix goes to `{{branches.main}}` and `{{branches.release}}` and is then propagated back
54
+ to `{{branches.develop}}`.
55
+ - Squash merge into `{{branches.develop}}`; merge commit into `{{branches.release}}` and
56
+ `{{branches.main}}`. Releases are tagged `vX.Y.Z` (SemVer) on `{{branches.main}}`.
57
+ - Commits follow Conventional Commits (`feat:`, `fix:`, `docs:`, `chore:`, `test:`,
58
+ `refactor:`, `ci:`).
59
+ - Everything goes through a pull request. There is no direct push to a permanent branch.
60
+ - Branch protection is not configured by project-kit. Where the hosting plan does not offer
61
+ it (for example a private repository on a free GitHub plan) these rules are followed by
62
+ discipline; where it is available it should be enabled.
63
+ - The project board is the source of truth for planning. A card becomes Ready only when it
64
+ has acceptance criteria. Work in progress is limited to one spec In progress and one In
65
+ review.
66
+ - Definition of Done: acceptance criteria met, tests green in CI, documentation and ADRs
67
+ updated, the pull request references its issue (`Closes #N`) and the working branch is
68
+ deleted.
69
+
70
+ ## Decisions on record
71
+
72
+ {{decisions}}
73
+ {{extra}}
74
+ ## Governance
75
+
76
+ This constitution prevails over other practices. Amendments are proposed by pull request
77
+ against `{{branches.develop}}` with a justification and are versioned with SemVer. Every plan
78
+ includes a check against this constitution, and any deviation is justified in writing.
@@ -0,0 +1,51 @@
1
+ # Development workflow: {{project_name}}
2
+
3
+ <!-- Written by /pk-workflow, or fill it in by hand. It records how the team works; the
4
+ handoff phase turns it into the Spec Kit constitution. -->
5
+
6
+ - **Status**: Draft
7
+
8
+ ## Team and ways of working
9
+
10
+ <!-- Who works on the project, how many people, and how they review each other's work. -->
11
+
12
+ ## Branches
13
+
14
+ <!-- Permanent branches and the types of working branch, where each one starts and where it
15
+ goes. Default: main / release / develop, with one branch per spec. -->
16
+
17
+ | Branch | Purpose | Starts from | Merges into |
18
+ |--------|---------|-------------|-------------|
19
+ | `main` | Released product | | |
20
+ | `release` | Testing and acceptance | | |
21
+ | `develop` | Integration | | |
22
+
23
+ ## Pull requests and reviews
24
+
25
+ <!-- Who approves, how many approvals, merge strategy per branch. -->
26
+
27
+ ## Commits and versions
28
+
29
+ <!-- Commit convention, versioning scheme, tags and releases. -->
30
+
31
+ ## Repository and tooling
32
+
33
+ <!-- Single repository or monorepo; package manager and workspace tool; formatters, linters
34
+ and hooks. These follow from the ADRs: link them instead of repeating them. -->
35
+
36
+ ## Quality gates
37
+
38
+ <!-- What must be green before merging: tests, lint, type checks, security scans, coverage. -->
39
+
40
+ ## Definition of Done
41
+
42
+ -
43
+
44
+ ## Open questions
45
+
46
+ <!-- [NEEDS CLARIFICATION: ...] -->
47
+
48
+ ## Clarifications
49
+
50
+ <!-- ### Session YYYY-MM-DD
51
+ - Q: ... -> A: ... -->
@@ -0,0 +1,21 @@
1
+ name: Decision (ADR)
2
+ description: Pending architecture or process decision
3
+ labels: ["type:adr"]
4
+ body:
5
+ - type: textarea
6
+ id: context
7
+ attributes:
8
+ label: Context
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ id: options
13
+ attributes:
14
+ label: Options
15
+ description: Alternatives with pros and cons
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ id: recommendation
20
+ attributes:
21
+ label: Recommendation
@@ -0,0 +1,25 @@
1
+ name: Bug
2
+ description: Something does not work as it should
3
+ labels: ["bug"]
4
+ body:
5
+ - type: textarea
6
+ id: description
7
+ attributes:
8
+ label: Description
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ id: steps
13
+ attributes:
14
+ label: Steps to reproduce
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: expected
19
+ attributes:
20
+ label: Expected and observed behaviour
21
+ - type: input
22
+ id: environment
23
+ attributes:
24
+ label: Environment
25
+ description: OS, tool versions
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,15 @@
1
+ name: Epic
2
+ description: Groups several issues of the same delivery
3
+ labels: ["type:epic"]
4
+ body:
5
+ - type: textarea
6
+ id: goal
7
+ attributes:
8
+ label: Goal
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ id: children
13
+ attributes:
14
+ label: Child issues
15
+ placeholder: "- [ ] #123"
@@ -0,0 +1,22 @@
1
+ name: Feature
2
+ description: New functionality or improvement
3
+ labels: ["type:feature"]
4
+ body:
5
+ - type: textarea
6
+ id: context
7
+ attributes:
8
+ label: Context
9
+ description: What problem it solves and why
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: acceptance
14
+ attributes:
15
+ label: Acceptance criteria
16
+ placeholder: "- [ ] ..."
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: notes
21
+ attributes:
22
+ label: Notes
@@ -0,0 +1,21 @@
1
+ ## What changes
2
+
3
+ <!-- Short summary of the change and why -->
4
+
5
+ ## Related issue
6
+
7
+ Closes #
8
+
9
+ ## Type
10
+
11
+ - [ ] Feature
12
+ - [ ] Fix
13
+ - [ ] Documentation
14
+ - [ ] Decision (ADR)
15
+ - [ ] Chore
16
+
17
+ ## Checklist
18
+
19
+ - [ ] The PR targets the right branch (`{{branches.develop}}`; `{{branches.release}}` and `{{branches.main}}` only by promotion)
20
+ - [ ] Affected documentation is updated
21
+ - [ ] Tests pass (if applicable)
@@ -0,0 +1,68 @@
1
+ <!-- Shared by pk-discover, pk-decide and pk-workflow. Same technique as Spec Kit's clarify. -->
2
+ # How project-kit interviews
3
+
4
+ Every guided phase follows these rules. Edit this file to change the style of the questions
5
+ for the whole project.
6
+
7
+ ## Before asking anything
8
+
9
+ 1. Read `.project-kit/config.yml`: write everything in its `language`.
10
+ 2. Read the document the phase produces if it already exists. The user may have filled it in
11
+ by hand or in an earlier session. Only ask about what is **Missing** or **Partial**; never
12
+ ask again what the document already answers.
13
+ 3. Read the documents of the earlier phases: they are the context, not something to ask again.
14
+ 4. Build, internally, a list of the topics of the phase marked Clear / Partial / Missing. Do
15
+ not show it unless there is nothing left to ask.
16
+ 5. Keep the questions that change what gets built or decided, ordered by impact times
17
+ uncertainty. Drop trivia and anything that belongs to a later phase.
18
+
19
+ ## Asking
20
+
21
+ - **One question at a time.** Never reveal the questions that are still queued.
22
+ - Start the line with `**Question:**` and make it a full question that ends in `?` and makes
23
+ sense on its own (no topic labels as questions). Follow it with one plain sentence,
24
+ `Why it matters:`, saying what depends on the answer.
25
+ - When there are discrete options (2 to 5, mutually exclusive), say which one you recommend
26
+ and why, then list all of them:
27
+
28
+ `**Recommended:** Option B - <one or two sentences of reasoning for this project>`
29
+
30
+ | Option | Description |
31
+ |--------|-------------|
32
+ | A | ... |
33
+ | B | ... |
34
+ | Other | Your own answer |
35
+
36
+ Close with: `Reply with a letter, say "yes" to take the recommendation, or write your own
37
+ answer.`
38
+ - When there are no discrete options, offer a suggested answer instead:
39
+ `**Suggested:** <answer> - <reason>`, and accept "yes" or "suggested" as agreement.
40
+ - If an answer is ambiguous, ask a quick follow-up. It does not count as a new question.
41
+ - Stop when the topics that matter are Clear, when the user says "done", "enough" or "skip",
42
+ or when you reach the question limit of the phase. Unanswered topics stay in the document
43
+ as `[NEEDS CLARIFICATION: <question>]`.
44
+
45
+ ## Recording
46
+
47
+ - **Save the document after each accepted answer**, not at the end, so nothing is lost if the
48
+ session stops.
49
+ - Put each answer in the section where it belongs, replacing the text it makes obsolete
50
+ instead of adding contradictions. Keep each statement short and verifiable.
51
+ - Log it too, under `## Clarifications` > `### Session YYYY-MM-DD`, as
52
+ `- Q: <question> -> A: <answer>`.
53
+ - Where the user left a choice open, make an informed guess from the context, write it down
54
+ under **Assumptions** and say so. Use `[NEEDS CLARIFICATION: ...]` only when the choice
55
+ changes the scope or has no reasonable default, with a maximum of three at the end of a
56
+ pass.
57
+ - Never invent facts about the user's business, users or constraints.
58
+
59
+ ## Finishing
60
+
61
+ 1. Tell the user what was written and which markers remain open.
62
+ 2. Offer a clarification pass: "Do you want me to look for gaps and ask a few more
63
+ questions, or is this good enough to approve?" A pass asks at most 5 more questions.
64
+ 3. Approval gate: ask explicitly whether the document is approved. Only an explicit "yes" in
65
+ this conversation allows running `project-kit approve <phase>`. Never approve on the
66
+ user's behalf, and never because an earlier question was answered.
67
+ 4. After approving, run `project-kit status` and offer the next phase: continue now, or
68
+ stop here and come back later with its skill. Respect the answer.