trackfw 2.16.0 → 3.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.
Files changed (53) hide show
  1. package/README.md +18 -2
  2. package/package.json +1 -1
  3. package/src/commands/discover.js +18 -0
  4. package/src/commands/index.js +2 -0
  5. package/src/commands/init.js +50 -4
  6. package/src/commands/integrations.js +75 -4
  7. package/src/commands/log.js +2 -1
  8. package/src/commands/note.js +24 -0
  9. package/src/commands/req.js +7 -1
  10. package/src/commands/roadmap.js +4 -3
  11. package/src/commands/ship.js +49 -0
  12. package/src/config/index.js +5 -2
  13. package/src/forge/adapter.js +189 -0
  14. package/src/forge/resolve.js +191 -0
  15. package/src/generators/adr.js +13 -4
  16. package/src/generators/date.js +23 -0
  17. package/src/generators/init.js +133 -8
  18. package/src/generators/note.js +154 -0
  19. package/src/generators/req.js +88 -5
  20. package/src/generators/roadmap.js +96 -20
  21. package/src/i18n/locales/en-US.json +2 -1
  22. package/src/i18n/locales/es-ES.json +2 -1
  23. package/src/i18n/locales/pt-BR.json +2 -1
  24. package/src/identity/preset.js +22 -0
  25. package/src/integrations/assets/agents/architect.md +32 -0
  26. package/src/integrations/assets/agents/backend.md +32 -0
  27. package/src/integrations/assets/agents/code-quality.md +29 -0
  28. package/src/integrations/assets/agents/data.md +32 -0
  29. package/src/integrations/assets/agents/dba.md +32 -0
  30. package/src/integrations/assets/agents/frontend.md +32 -0
  31. package/src/integrations/assets/agents/iac.md +46 -0
  32. package/src/integrations/assets/agents/infra.md +34 -0
  33. package/src/integrations/assets/agents/qa.md +32 -0
  34. package/src/integrations/assets/agents/security.md +29 -0
  35. package/src/integrations/assets/agents/tooling.md +47 -0
  36. package/src/integrations/assets/agents/ux.md +29 -0
  37. package/src/integrations/assets/catalog.json +16 -2
  38. package/src/integrations/assets/skills/architecture.md +66 -0
  39. package/src/integrations/assets/skills/backend.md +67 -0
  40. package/src/integrations/assets/skills/code-quality.md +78 -0
  41. package/src/integrations/assets/skills/data.md +75 -0
  42. package/src/integrations/assets/skills/dba.md +77 -0
  43. package/src/integrations/assets/skills/frontend.md +70 -0
  44. package/src/integrations/assets/skills/iac.md +90 -0
  45. package/src/integrations/assets/skills/infra.md +62 -0
  46. package/src/integrations/assets/skills/qa.md +63 -0
  47. package/src/integrations/assets/skills/security.md +74 -0
  48. package/src/integrations/assets/skills/tooling.md +80 -0
  49. package/src/integrations/assets/skills/ux.md +70 -0
  50. package/src/integrations/render.js +57 -6
  51. package/src/ship/runner.js +454 -0
  52. package/src/validator/index.js +321 -111
  53. package/src/validator/traceid.js +1 -1
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: trackfw-tooling-skill
3
+ description: AI agent design, skill composition, MCP configuration and context economy.
4
+ ---
5
+
6
+ ## Agent Design Principles
7
+
8
+ An agent is effective when its scope, tools and constraints are explicit. Vague instructions
9
+ produce vague behaviour:
10
+ - **Lock the role**: every agent declares its role at the top of its system prompt and does
11
+ not switch roles mid-session without an explicit handoff.
12
+ - **Declare tools explicitly**: list only the tools the agent needs for its role; an agent
13
+ with write access that only needs to read is a liability.
14
+ - **Explicit memory scope**: use project-scoped memory for context that belongs to the
15
+ repository; use global memory only for cross-project preferences.
16
+ - **Restrict scope**: an agent must know what it is forbidden to do (create branches, open PRs,
17
+ modify configuration outside its domain). Prohibitions are as important as permissions.
18
+
19
+ ## Skill Design
20
+
21
+ Skills extend agents with domain expertise loaded on demand:
22
+ - **Single responsibility**: one skill per role or domain. A skill that covers both backend
23
+ and frontend is too broad to be useful without loading the entire file.
24
+ - **Stack-agnostic content**: skills contain principles, patterns and vocabulary that define
25
+ the role. Stack-specific choices (library names, project configuration) belong in the
26
+ project's CLAUDE.md, not in a shared skill.
27
+ - **Right size**: 40–90 lines is the target. A 5-line skill teaches nothing; a 300-line
28
+ skill inflates context on every invocation. Prefer principles over tool lists.
29
+ - **Load on demand**: skills are not always loaded. Design them as self-contained documents
30
+ that provide value when read in isolation, without assuming other skills are present.
31
+
32
+ ## MCP (Model Context Protocol)
33
+
34
+ MCP enables agents to interact with external tools and services through a standardised protocol:
35
+ - Define tool schemas precisely: name, description, input schema, output schema.
36
+ - Group related tools in a tool set to reduce context size when only a subset is needed.
37
+ - Prefer tool sets over individual tool registrations when the agent needs more than five tools.
38
+ - Validate MCP server responses before acting on them; a malformed response must not
39
+ silently corrupt state.
40
+ - Document which MCP servers a configuration depends on; an agent that fails silently because
41
+ a server is unavailable is hard to debug.
42
+
43
+ ## Prompt Engineering
44
+
45
+ - **Specificity over length**: a short, specific prompt outperforms a long, vague one.
46
+ Remove filler instructions that repeat the model's defaults.
47
+ - **Reusable prompt files**: extract repeated prompt patterns into versioned, reviewable files.
48
+ Treat prompts as code: they have bugs, they drift, they need tests.
49
+ - **Context economy**: every token in context is a cost. Load only the context that is
50
+ relevant to the current task. Unload when done.
51
+ - **Structured output**: when the downstream consumer is code (not a human), request JSON
52
+ or a defined schema. Freeform prose is hard to parse reliably.
53
+
54
+ ## Validating Recommendations
55
+
56
+ Before recommending a tool, configuration option, or API:
57
+ 1. Check the official documentation for the current version.
58
+ 2. Verify that the feature or flag exists in the version the project is using.
59
+ 3. Test in a minimal example before including in a recommendation.
60
+
61
+ A memory that says "feature X exists" is not the same as "feature X exists now." Models have
62
+ knowledge cutoffs; documentation does not. When in doubt, read the source.
63
+
64
+ ## Human-in-the-Loop
65
+
66
+ Define checkpoints where human review is mandatory:
67
+ - Irreversible operations (production deploys, data deletions, secret rotation).
68
+ - Operations with significant blast radius (schema migrations, dependency upgrades).
69
+ - Decisions that bifurcate the architecture (new service boundary, new data model).
70
+
71
+ Agents that can proceed without human input should declare that capability explicitly in their
72
+ design. Agents that are uncertain must ask, not guess.
73
+
74
+ ## Observability for AI Systems
75
+
76
+ - Log prompts, tool calls, token counts and latency for every agent interaction in production.
77
+ - Monitor for response quality drift: a pipeline that produces correct output today may not
78
+ produce correct output after a model update.
79
+ - Evaluation datasets: maintain a set of representative inputs with expected outputs; run
80
+ them on every model or prompt change.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: trackfw-ux-skill
3
+ description: User-centred design, design systems, accessibility and usability validation.
4
+ ---
5
+
6
+ ## User-Centred Design
7
+
8
+ Design starts with understanding users, not with wireframes. Before sketching, establish:
9
+ - **Who** are the users? (personas, JTBD — Jobs to Be Done)
10
+ - **What** are they trying to accomplish? (user journey, task analysis)
11
+ - **Where** does the current experience fail? (pain points, drop-off analysis)
12
+
13
+ Design Thinking cycle: Empathize → Define → Ideate → Prototype → Test. The cycle is
14
+ iterative; return to earlier phases when testing invalidates assumptions.
15
+
16
+ ## Prototyping
17
+
18
+ Prototypes are for learning, not for pride. Build the cheapest prototype that can answer the
19
+ design question:
20
+ - **Low-fidelity** (sketch, wireframe): validates information architecture and flow.
21
+ - **High-fidelity** (interactive prototype): validates micro-interactions and visual language.
22
+ - **Discardable prototypes**: isolated from production code; exist to prove a concept, not
23
+ to ship. Remove them before the production implementation goes to review.
24
+
25
+ ## Accessibility (WCAG 2.2 AA Minimum)
26
+
27
+ Accessibility is a legal requirement in many jurisdictions and a quality attribute in all:
28
+ - Color contrast ≥ 4.5:1 for body text; ≥ 3:1 for large text and UI components.
29
+ - All interactive elements are keyboard-operable with a visible focus indicator.
30
+ - ARIA landmarks structure the page for assistive technology; do not use ARIA to override
31
+ broken semantics — fix the semantics first.
32
+ - `prefers-reduced-motion`: disable or reduce animations for users who opt out.
33
+ - Every form field has a programmatically associated label.
34
+ - Test with a real screen reader; automated tools (axe-core) catch ~30–40% of issues.
35
+
36
+ ## Usability Heuristics
37
+
38
+ Apply Nielsen's 10 heuristics as a review lens, not a checklist:
39
+ - **Visibility of system status**: users always know what is happening.
40
+ - **Match with the real world**: language and concepts match the user's mental model.
41
+ - **User control and freedom**: support undo and clear exit paths.
42
+ - **Consistency**: same words, same icons, same placement across the product.
43
+ - **Error prevention**: design to make errors impossible before handling them gracefully.
44
+
45
+ ## Design Systems
46
+
47
+ A design system is a product that serves the product team:
48
+ - **Design tokens** (W3C DTCG format): spacing, colour, typography as named variables.
49
+ Tokens are the contract between design and code.
50
+ - **Atomic Design**: atoms (button, input) → molecules (form field) → organisms (card) →
51
+ templates → pages. Each level composes from the level below.
52
+ - Document components in isolation with rendered examples, props API and accessibility notes.
53
+ - A component that cannot be demonstrated without application context is too tightly coupled.
54
+
55
+ ## Validation and Metrics
56
+
57
+ A design is a hypothesis until tested with users:
58
+ - **A/B testing**: one variable, measurable success criterion, sufficient sample size.
59
+ Do not run experiments without a pre-registered hypothesis.
60
+ - **Usability testing**: five users reveal the majority of critical usability problems.
61
+ Recruit from the actual target audience, not convenience.
62
+ - **Quantitative signals**: task completion rate, time on task, error rate, NPS/CSAT.
63
+ - **Qualitative signals**: think-aloud sessions, session replays, support ticket themes.
64
+
65
+ ## Responsive and Adaptive Design
66
+
67
+ - Mobile-first: design and test the constrained layout first; expand to wider viewports.
68
+ - Touch targets ≥ 48 dp (CSS equivalent) for all interactive elements on touch surfaces.
69
+ - Fluid typography with `clamp()` to eliminate breakpoint-driven font size jumps.
70
+ - Content-driven breakpoints, not device-driven; break where the layout breaks.
@@ -80,8 +80,8 @@ function toolsFor(itemId) {
80
80
  // identidade configurada. Sem apelido configurado, apenas o display name do
81
81
  // agente é mencionado. Espelha internal/integrations/render.go:greetingLine.
82
82
  function greetingLine(displayName, nickname) {
83
- if (!nickname) return `Você é ${displayName}.`
84
- return `Você é ${displayName}. Trate o usuário como ${nickname}.`
83
+ if (!nickname) return `You are ${displayName}.`
84
+ return `You are ${displayName}. Address the user as ${nickname}.`
85
85
  }
86
86
 
87
87
  // insertBodyPrefix insere prefix como a nova primeira linha da seção de
@@ -103,6 +103,54 @@ function insertBodyPrefix(source, prefix) {
103
103
  return `${head}\n\n${prefix}\n\n${rest}`
104
104
  }
105
105
 
106
+ // rewriteSignatureLine reescreve a última linha da seção de corpo de um
107
+ // markdown cru (frontmatter + corpo) que casa com o padrão de assinatura
108
+ // `^— <nome>, <título>$` (travessão em-dash U+2014, espaço, nome, vírgula,
109
+ // espaço, título). Apenas o grupo de nome (primeiro) é substituído por
110
+ // displayName; o título (segundo grupo) é preservado byte a byte.
111
+ //
112
+ // Escopo: a função opera somente no corpo (após o fechamento do frontmatter).
113
+ // Uma linha de assinatura dentro do frontmatter nunca é tocada — a detecção
114
+ // de fronteira espelha rewriteFrontmatterFields exatamente.
115
+ //
116
+ // Se nenhuma linha do corpo casar com o padrão, source é retornado inalterado.
117
+ // Se displayName for vazio, source é retornado inalterado. A função nunca
118
+ // inventa uma assinatura que não estava presente.
119
+ //
120
+ // Espelha internal/integrations/render.go:rewriteSignatureLine.
121
+ function rewriteSignatureLine(source, displayName) {
122
+ if (!displayName) return source
123
+ const trimmed = String(source).trim()
124
+
125
+ // Localiza o início do corpo — espelha a detecção de fronteira de
126
+ // rewriteFrontmatterFields para que o escopo de ambas as funções coincida.
127
+ let bodyStart = 0
128
+ if (trimmed.startsWith('---\n')) {
129
+ const end = trimmed.indexOf('\n---', 4)
130
+ if (end >= 0) {
131
+ bodyStart = end + 4 // aponta para o char imediatamente após "\n---"
132
+ }
133
+ }
134
+ const head = trimmed.slice(0, bodyStart)
135
+ const bodySection = trimmed.slice(bodyStart)
136
+
137
+ const lines = bodySection.split('\n')
138
+ // Percorre de trás para frente para encontrar a ÚLTIMA linha candidata.
139
+ for (let i = lines.length - 1; i >= 0; i--) {
140
+ const line = lines[i]
141
+ if (!line.startsWith('— ')) continue
142
+ const rest = line.slice('— '.length) // pula "— "
143
+ const commaIdx = rest.indexOf(', ')
144
+ if (commaIdx < 0) continue
145
+ const title = rest.slice(commaIdx + 2)
146
+ if (!title) continue
147
+ lines[i] = `— ${displayName}, ${title}`
148
+ return head + lines.join('\n')
149
+ }
150
+ // Nenhuma linha de assinatura encontrada — retorna source inalterado.
151
+ return source
152
+ }
153
+
106
154
  // rewriteFrontmatterFields substitui as linhas "name:" e "description:" do
107
155
  // frontmatter de um markdown cru por name e description, preservando toda
108
156
  // outra linha do frontmatter byte a byte (ordem, espaçamento, estilo de
@@ -176,8 +224,10 @@ function frontmatterName(content) {
176
224
  // gemini, cursor, copilot, kiro-ide, windsurf), retorna o source cru
177
225
  // normalizado com o frontmatter ainda anexado. Quando há identidade
178
226
  // configurada, suas linhas "name:"/"description:" são reescritas no
179
- // lugar (ver rewriteFrontmatterFields) — necessário porque a seleção de
180
- // subagent do Claude Code lê apenas o frontmatter, nunca o corpo.
227
+ // lugar (ver rewriteFrontmatterFields) e a última linha de assinatura do
228
+ // corpo com padrão `^— <nome>, <título>$` é reescrita com o display name
229
+ // da identidade (ver rewriteSignatureLine) — necessário porque a seleção
230
+ // de subagent do Claude Code lê apenas o frontmatter, nunca o corpo.
181
231
  //
182
232
  // Ambas as rotas devem receber a injeção de identidade. Quando não há
183
233
  // identidade configurada para item.id, name/description/body ficam
@@ -231,7 +281,8 @@ function render({ kind, content, capability, item, identity: cfg }) {
231
281
  if (!id) return normalize(content)
232
282
  const withBody = insertBodyPrefix(content, greeting)
233
283
  const withFrontmatter = rewriteFrontmatterFields(withBody, name, description)
234
- return normalize(withFrontmatter)
284
+ const withSignature = rewriteSignatureLine(withFrontmatter, id.display_name)
285
+ return normalize(withSignature)
235
286
  }
236
287
 
237
- module.exports = { render, markdownParts, frontmatterName, greetingLine, insertBodyPrefix, rewriteFrontmatterFields }
288
+ module.exports = { render, markdownParts, frontmatterName, greetingLine, insertBodyPrefix, rewriteFrontmatterFields, rewriteSignatureLine }